Skip to content

Commit

Permalink
Add update all button
Browse files Browse the repository at this point in the history
  • Loading branch information
DomiiBunn committed Feb 8, 2025
1 parent d451e06 commit ada2a3c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/agent-socket-handlers/docker-socket-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class DockerSocketHandler extends AgentSocketHandler {
await stack.update(socket);
callbackResult({
ok: true,
msg: "Updated",
msg: `Updated ${stackName}`,
msgi18n: true,
}, callback);
server.sendStackList();
Expand Down
19 changes: 18 additions & 1 deletion frontend/src/components/StackList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
<input v-model="searchText" class="form-control search-input" autocomplete="off" />
</form>
</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>

<!-- TODO -->
Expand Down Expand Up @@ -346,6 +352,17 @@ export default {
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>
Expand Down Expand Up @@ -417,7 +434,7 @@ export default {
}
.search-input {
max-width: 15em;
max-width: 10em;
}
.stack-item {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,6 @@
"New Container Name...": "New Container Name...",
"Network name...": "Network name...",
"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"
}

0 comments on commit ada2a3c

Please # to comment.