feat: add full update function to update manager
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
1 parent
c6d4e0630f
commit
c81311bc61
3 files changed
+38
-4
No files matched your search
@@ -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' })
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-if="'system' in version_info">
|
||||
<template v-if="'system' in version_info">
|
||||
<v-divider class="my-0 border-top-2" ></v-divider>
|
||||
<v-row class="pt-2">
|
||||
<v-col class="col-auto pl-6 text-no-wrap">
|
||||
@@ -157,7 +157,18 @@
|
||||
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? $t('Machine.UpdatePanel.Upgrade') : $t('Machine.UpdatePanel.UpToDate') }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="showUpdateAll">
|
||||
<v-divider class="my-0 border-top-2" ></v-divider>
|
||||
<v-row class="pt-3">
|
||||
<v-col class="text-center">
|
||||
<v-btn color="primary" outlined small @click="updateAll" :disabled="['printing', 'paused'].includes(this.printer_state)">
|
||||
<v-icon left>mdi-progress-upload</v-icon>
|
||||
{{ $t('Machine.UpdatePanel.UpdateAll') }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
@@ -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 })
|
||||
|
||||
+2
-1
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user