+
+ Apache:
+ Нужен перезапуск
+ Перезапуск
+
+
+ Обновить
+
+
+ Перезапустить
+
+
+
+
+
diff --git a/src/store/index.js b/src/store/index.js
index b7dee6a..e970f2f 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,9 +1,11 @@
import { createStore } from "vuex";
import infobases from "@/store/modules/infobases.js";
+import apache_restart from "@/store/modules/apache_restart.js";
export default createStore({
modules: {
infobases,
+ apache_restart,
},
});
diff --git a/src/store/modules/apache_restart.js b/src/store/modules/apache_restart.js
index 2c4f7ea..70a8317 100644
--- a/src/store/modules/apache_restart.js
+++ b/src/store/modules/apache_restart.js
@@ -4,19 +4,24 @@ import config from "@/config.js";
const api_base = config.api;
+const pass = (some) => some
+
export default {
state: {
apache_need_restart: false,
restart_flag: false,
+ flag_sent: false,
},
mutations: {
setApacheNeedRestart(state) {
state.apache_need_restart = true;
- console.log("restart need");
},
setApacheRestartFlag(state, flag) {
state.restart_flag = flag;
},
+ setApacheRestartFlagSent(state, flag) {
+ state.flag_sent = flag;
+ },
},
actions: {
async fetchApacheRestartFlag(ctx) {
@@ -25,6 +30,10 @@ export default {
ctx.commit("setApacheRestartFlag", true);
} catch (err) {
ctx.commit("setApacheRestartFlag", false);
+ if (ctx.getters.isApacheRestartFlagSent) {
+ ctx.commit("setApacheNeedRestart", false);
+ ctx.commit("setApacheRestartFlagSent", false);
+ }
}
},
async updateApacheRestartFlag(ctx) {
@@ -37,8 +46,9 @@ export default {
try {
await axios.put(`${api_base}/apache-restart`);
ctx.commit("setApacheRestartFlag", true);
- } catch (err) {
- ctx.commit("setApacheRestartFlag", false);
+ ctx.commit("setApacheRestartFlagSent", true);
+ } catch(err) {
+ pass()
}
},
},
@@ -49,5 +59,8 @@ export default {
isApacheRestartPending(state) {
return state.restart_flag;
},
+ isApacheRestartFlagSent(state) {
+ return state.flag_sent;
+ },
},
};
diff --git a/src/store/modules/infobases.js b/src/store/modules/infobases.js
index 8abd31c..8d6c13f 100644
--- a/src/store/modules/infobases.js
+++ b/src/store/modules/infobases.js
@@ -63,7 +63,7 @@ export default {
state.infobases.splice(idx, 1);
setInfobaseLock(state, { name, lock: false });
} else {
- infobase.publicated = true;
+ //infobase.publicated = true; // debug
state.infobases[idx] = infobase;
}
}
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 293e4b2..599c283 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -1,6 +1,7 @@