Rebuilt the shutdown/reboot dialog in Svelte

This commit is contained in:
David Carley
2022-08-16 03:02:05 +00:00
parent 5900632b28
commit 2554f0ea75
5 changed files with 67 additions and 25 deletions

View File

@@ -106,8 +106,7 @@ module.exports = new Vue({
firmwareUpgrading: false,
checkedUpgrade: false,
firmwareName: "",
latestVersion: "",
confirmShutdown: false,
latestVersion: ""
};
},
@@ -283,10 +282,17 @@ module.exports = new Vue({
},
show_upgrade: function () {
if (!this.latestVersion) return false;
if (!this.latestVersion) {
return false;
}
return is_newer_version(this.config.version, this.latestVersion);
},
showShutdownDialog: function () {
SvelteComponents.showDialog("Shutdown");
},
update: async function () {
const config = await api.get("config/load");
@@ -303,16 +309,6 @@ module.exports = new Vue({
SvelteComponents.handleConfigUpdate(this.config);
},
shutdown: function () {
this.confirmShutdown = false;
api.put("shutdown");
},
reboot: function () {
this.confirmShutdown = false;
api.put("reboot");
},
connect: function () {
this.sock = new Sock(`//${location.host}/sockjs`);