From 498c9097cf5d447b9a39921b3106069f415e6729 Mon Sep 17 00:00:00 2001 From: Tero Marttila Date: Mon, 6 Jan 2025 23:08:32 +0200 Subject: [PATCH] web: restart on config apply --- web/src/components/ConfigView.vue | 6 +++++- web/src/components/SystemView.vue | 1 + web/src/store.js | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/components/ConfigView.vue b/web/src/components/ConfigView.vue index 7e733ca6..bdfd1aab 100644 --- a/web/src/components/ConfigView.vue +++ b/web/src/components/ConfigView.vue @@ -61,8 +61,8 @@

Apply

- Applying... + Applying...

Backup

@@ -154,6 +154,8 @@ export default { try { await this.$store.dispatch('postConfig', formdata); + await this.$store.dispatch('restartSystem'); + await this.$store.dispatch('loadConfig'); } catch (error) { // XXX: UI? alert(error.name + ": " + error.message); @@ -170,6 +172,8 @@ export default { try { await this.$store.dispatch('uploadConfig', file); + await this.$store.dispatch('restartSystem'); + await this.$store.dispatch('loadConfig'); } catch (error) { input.setCustomValidity(error.name + ": " + error.message); } finally { diff --git a/web/src/components/SystemView.vue b/web/src/components/SystemView.vue index 0b3e0367..4b1f32db 100644 --- a/web/src/components/SystemView.vue +++ b/web/src/components/SystemView.vue @@ -286,6 +286,7 @@ export default { try { await this.$store.dispatch('restartSystem'); + await this.$store.dispatch('loadSystem'); } catch (error) { } finally { diff --git a/web/src/store.js b/web/src/store.js index d5076d99..4d5f62a3 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -86,12 +86,9 @@ export default new Vuex.Store({ }, async postConfig({ state, dispatch }, formdata) { await configService.post(state.config, formdata); - - await dispatch('loadConfig'); }, async uploadConfig({ dispatch }, file) { await configService.upload(file); - await dispatch('loadConfig'); }, /* system */ @@ -107,8 +104,6 @@ export default new Vuex.Store({ }, async restartSystem({ dispatch }) { await systemService.restart(); - - await dispatch('loadSystem'); }, /* wifi */