From 1046cd9d4dbdee67582d5e92fa0d6df8c635d05e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 14 Jun 2020 11:10:21 +0000 Subject: [PATCH] alert when refresh needed on frontend. remove unnecessary logout page --- quasar.conf.js | 5 ---- src/router/routes.js | 10 +------- src/store/index.js | 28 +++++++++++++++++++++ src/views/Dashboard.vue | 47 +++++++++++++++++++++--------------- src/views/Login.vue | 2 +- src/views/Logout.vue | 14 ----------- src/views/SessionExpired.vue | 10 +------- 7 files changed, 58 insertions(+), 58 deletions(-) delete mode 100644 src/views/Logout.vue diff --git a/quasar.conf.js b/quasar.conf.js index f6c0e09..28db7f0 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -88,15 +88,10 @@ module.exports = function () { plugins: [ 'Dialog', 'Loading', - 'LoadingBar', 'Meta', 'Notify' ], config: { - loadingBar: { - color: "red", - size: "4px" - }, notify: { position: "top", timeout: 2000, diff --git a/src/router/routes.js b/src/router/routes.js index 9b0f70b..9dcb4ba 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -39,18 +39,10 @@ const routes = [ requiresVisitor: true } }, - { - path: "/logout", - name: "Logout", - component: () => import("@/views/Logout") - }, { path: "/expired", name: "SessionExpired", - component: () => import("@/views/SessionExpired"), - meta: { - requireAuth: true - } + component: () => import("@/views/SessionExpired") }, { path: "*", component: () => import("@/views/NotFound") } ] diff --git a/src/store/index.js b/src/store/index.js index 0c92168..2290120 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -31,6 +31,7 @@ export default function () { installedSoftware: [], scripts: [], toggleScriptManager: false, + needrefresh: false, }, getters: { loggedIn(state) { @@ -70,6 +71,9 @@ export default function () { scripts(state) { return state.scripts; }, + needRefresh(state) { + return state.needrefresh; + } }, mutations: { TOGGLE_SCRIPT_MANAGER(state, action) { @@ -121,6 +125,9 @@ export default function () { SET_SCRIPTS(state, scripts) { state.scripts = scripts; }, + SET_REFRESH_NEEDED(state, action) { + state.needrefresh = action; + } }, actions: { loadAutomatedTasks(context, pk) { @@ -228,6 +235,27 @@ export default function () { //commit("destroySubTable"); }); }, + checkVer(context) { + axios.get("/core/version/").then(r => { + const version = r.data; + + if (localStorage.getItem("rmmver")) { + if (localStorage.getItem("rmmver") === version) { + return; + } else { + localStorage.setItem("rmmver", "0.0.1"); + context.commit("SET_REFRESH_NEEDED", true); + } + } else { + localStorage.setItem("rmmver", version); + return; + } + }) + }, + reload() { + localStorage.removeItem("rmmver"); + location.reload(); + }, retrieveToken(context, credentials) { return new Promise((resolve, reject) => { axios diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index fd2c6ed..28aab4b 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -1,6 +1,10 @@