diff --git a/src/components/TheUpdateDialog.vue b/src/components/TheUpdateDialog.vue index d892a69f..b181ac72 100644 --- a/src/components/TheUpdateDialog.vue +++ b/src/components/TheUpdateDialog.vue @@ -155,7 +155,7 @@ export default class TheUpdateDialog extends Mixins(BaseMixin) { } close() { - if (this.application !== null && this.complete && ['client', 'mainsail'].includes(this.application.toLowerCase())) window.location.reload(true) + if (this.application !== null && this.complete && ['client', 'mainsail', 'full'].includes(this.application.toLowerCase())) window.location.reload(true) else { this.$store.commit('server/updateManager/resetUpdateResponse') this.$socket.emit('machine.update.status', { refresh: false }, { action: 'server/updateManager/getStatus' }) diff --git a/src/components/panels/Machine/UpdatePanel.vue b/src/components/panels/Machine/UpdatePanel.vue index 029f4f59..f6a83fe0 100644 --- a/src/components/panels/Machine/UpdatePanel.vue +++ b/src/components/panels/Machine/UpdatePanel.vue @@ -132,7 +132,7 @@ -
+ + @@ -262,6 +273,24 @@ export default class UpdatePanel extends Mixins(BaseMixin) { return this.$store.getters['server/updateManager/getUpdateableSoftwares'] } + get showUpdateAll() { + let updateableModuls = 0 + + Object.keys(this.updateableSoftwares).forEach((modulename) => { + const module = this.updateableSoftwares[modulename] + if ( + 'version' in module && + 'remote_version' in module && + semver.valid(module.remote_version) && + semver.valid(module.version) && + semver.gt(module.remote_version, module.version) + ) updateableModuls++ + }) + + if (this.version_info?.system?.package_count > 0) updateableModuls++ + return (updateableModuls > 1) + } + btnSync() { this.$socket.emit('machine.update.status', { refresh: true }, { action: 'server/updateManager/getStatus', loading: 'loadingBtnSyncUpdateManager' }) } @@ -418,6 +447,10 @@ export default class UpdatePanel extends Mixins(BaseMixin) { return false } + updateAll() { + this.$socket.emit('machine.update.full', { }) + } + updateModule(key: string) { if (['klipper', 'moonraker'].includes(key)) this.$socket.emit('machine.update.'+key, { }) else this.$socket.emit('machine.update.client', { name: key }) diff --git a/src/locales/en.json b/src/locales/en.json index d9a7b9e4..15cb827f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -488,7 +488,8 @@ "CommittedHoursAgo": "committed {hours} hours ago", "CommittedYesterday": "committed yesterday", "CommittedDaysAgo": "committed {days} days ago", - "CommittedOnDate": "committed on {date}" + "CommittedOnDate": "committed on {date}", + "UpdateAll": "Update all components" }, "SystemPanel": { "SystemLoad": "System Loads",