Add update all button

This commit is contained in:
Dominika Jadowska 2025-02-08 15:32:50 +01:00
parent d451e06e84
commit ada2a3ca8b
3 changed files with 21 additions and 3 deletions

View file

@ -187,7 +187,7 @@ export class DockerSocketHandler extends AgentSocketHandler {
await stack.update(socket); await stack.update(socket);
callbackResult({ callbackResult({
ok: true, ok: true,
msg: "Updated", msg: `Updated ${stackName}`,
msgi18n: true, msgi18n: true,
}, callback); }, callback);
server.sendStackList(); server.sendStackList();

View file

@ -19,6 +19,12 @@
<input v-model="searchText" class="form-control search-input" autocomplete="off" /> <input v-model="searchText" class="form-control search-input" autocomplete="off" />
</form> </form>
</div> </div>
<div class="update-all-wrapper">
<button class="btn btn-primary" :disabled="processing || Object.keys(sortedStackList).length === 0" @click="updateAll">
<font-awesome-icon icon="fa-cloud-arrow-down me-1" />
{{ $t("updateAll") }}
</button>
</div>
</div> </div>
<!-- TODO --> <!-- TODO -->
@ -346,6 +352,17 @@ export default {
this.cancelSelectMode(); this.cancelSelectMode();
}, },
updateAll() {
console.log("updateAll");
console.log(this.sortedStackList);
for (let stack of this.sortedStackList) {
console.log(stack);
this.$root.emitAgent(stack.endpoint, "updateStack", stack.name, (res) => {
this.processing = false;
this.$root.toastRes(res);
});
}
},
}, },
}; };
</script> </script>
@ -417,7 +434,7 @@ export default {
} }
.search-input { .search-input {
max-width: 15em; max-width: 10em;
} }
.stack-item { .stack-item {

View file

@ -128,5 +128,6 @@
"New Container Name...": "New Container Name...", "New Container Name...": "New Container Name...",
"Network name...": "Network name...", "Network name...": "Network name...",
"Select a network...": "Select a network...", "Select a network...": "Select a network...",
"NoNetworksAvailable": "No networks available. You need to add internal networks or enable external networks in the right side first." "NoNetworksAvailable": "No networks available. You need to add internal networks or enable external networks in the right side first.",
"updateAll": "Update All"
} }