From 0fae24e7c46b11d99ebf89e1cc36f5b7e9a6c3ec Mon Sep 17 00:00:00 2001 From: Vincent Rose Date: Sat, 6 Jun 2020 11:16:58 -0700 Subject: [PATCH 1/5] rename profile to application to resolve any ambiguity with listener profiles (#32) --- .eslintrc.js | 1 + src/App.vue | 6 +++--- src/api/axios-instance.js | 3 +-- src/components/Login.vue | 6 +++--- src/router/index.js | 4 ++-- src/store/{ProfileModule.js => ApplicationModule.js} | 0 src/store/index.js | 11 +++++------ src/views/Settings.vue | 8 ++++---- src/views/Users.vue | 2 +- 9 files changed, 20 insertions(+), 21 deletions(-) rename src/store/{ProfileModule.js => ApplicationModule.js} (100%) diff --git a/.eslintrc.js b/.eslintrc.js index 3bfe878..4f33edb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,7 @@ module.exports = { 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-plusplus': 'off', + 'import/no-cycle': 'off', }, parserOptions: { parser: 'babel-eslint', diff --git a/src/App.vue b/src/App.vue index b69630d..5aaa7eb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -47,11 +47,11 @@ export default { }, computed: { ...mapGetters({ - isLoggedIn: 'profile/isLoggedIn', - isDarkMode: 'profile/isDarkMode', + isLoggedIn: 'application/isLoggedIn', + isDarkMode: 'application/isDarkMode', }), ...mapState({ - empireVersion: state => state.profile.empireVersion, + empireVersion: state => state.application.empireVersion, }), isLoginPage() { return this.$route.name === 'home'; diff --git a/src/api/axios-instance.js b/src/api/axios-instance.js index 16e95cb..44bd506 100644 --- a/src/api/axios-instance.js +++ b/src/api/axios-instance.js @@ -3,7 +3,6 @@ import axios from 'axios'; // todo: I don't like this cyclic dependency, but struggling to find a better way atm. -// eslint-disable-next-line import/no-cycle import store from '@/store/index'; // eslint-disable-next-line import/no-mutable-exports @@ -23,7 +22,7 @@ export function setInstance(url, token) { response => response, (err) => { if (err.response.status === 401) { - store.dispatch('profile/logout'); + store.dispatch('application/logout'); } }, ); diff --git a/src/components/Login.vue b/src/components/Login.vue index 908349a..9a2d81c 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -61,10 +61,10 @@ export default { }, computed: { ...mapGetters({ - isLoggedIn: 'profile/isLoggedIn', + isLoggedIn: 'application/isLoggedIn', }), ...mapState({ - loginError: state => state.profile.loginError, + loginError: state => state.application.loginError, }), }, watch: { @@ -93,7 +93,7 @@ export default { electronStore.delete('username'); } - this.$store.dispatch('profile/login', this.form); + this.$store.dispatch('application/login', this.form); }, }, }; diff --git a/src/router/index.js b/src/router/index.js index 85dd7ff..aaccc20 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -101,11 +101,11 @@ const router = new VueRouter({ }); function isAuthenticated() { - return store.getters['profile/token'].length > 0; + return store.getters['application/token'].length > 0; } function isAdmin() { - return store.getters['profile/isAdmin'] === true; + return store.getters['application/isAdmin'] === true; } // Auth diff --git a/src/store/ProfileModule.js b/src/store/ApplicationModule.js similarity index 100% rename from src/store/ProfileModule.js rename to src/store/ApplicationModule.js diff --git a/src/store/index.js b/src/store/index.js index 645c380..fb1c5a2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,4 +1,3 @@ -/* eslint-disable import/no-cycle */ import Vue from 'vue'; import Vuex from 'vuex'; @@ -11,7 +10,7 @@ import StagerModule from './StagerModule'; import AgentModule from './AgentModule'; import ModuleModule from './ModuleModule'; import CredentialModule from './CredentialModule'; -import ProfileModule from './ProfileModule'; +import ApplicationModule from './ApplicationModule'; Vue.use(Vuex); @@ -30,13 +29,13 @@ export default new Vuex.Store({ agent: AgentModule, module: ModuleModule, credential: CredentialModule, - profile: ProfileModule, + application: ApplicationModule, }, plugins: [createPersistedState({ - paths: ['profile'], + paths: ['application'], rehydrated: ({ state }) => { // todo handle code duplication here? - setInstance(state.profile.url, state.profile.token); - initNamespacedStore(state.profile.url); + setInstance(state.application.url, state.application.token); + initNamespacedStore(state.application.url); }, })], }); diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 65286a3..abc43df 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -112,8 +112,8 @@ export default { }, computed: { ...mapState({ - user: state => state.profile.user, - darkMode: state => state.profile.darkMode, + user: state => state.application.user, + darkMode: state => state.application.darkMode, }), apiToken() { return this.user.api_token; @@ -123,7 +123,7 @@ export default { }, darkModeSwitch: { set(val) { - this.$store.dispatch('profile/darkMode', val); + this.$store.dispatch('application/darkMode', val); }, get() { return this.darkMode; @@ -137,7 +137,7 @@ export default { }, async logout() { if (await this.$root.$confirm('', 'Are you sure you want to logout?', { color: 'green' })) { - this.$store.dispatch('profile/logout'); + this.$store.dispatch('application/logout'); } }, submit() { diff --git a/src/views/Users.vue b/src/views/Users.vue index 2ec06ce..0b2e9f4 100644 --- a/src/views/Users.vue +++ b/src/views/Users.vue @@ -85,7 +85,7 @@ export default { users: state => state.user.users, }), ...mapGetters({ - isAdmin: 'profile/isAdmin', + isAdmin: 'application/isAdmin', }), }, mounted() { From de245c4de47e9204c7e14de2443c909a335f3844 Mon Sep 17 00:00:00 2001 From: Vincent Rose Date: Sat, 4 Jul 2020 20:23:44 -0400 Subject: [PATCH 2/5] 1.2.4 small fixes (#36) * handle host with and without http prefix * move mdi/fonts and roboto font to local * move fontawesome to package manager * upgrade dependencies * remove todo * seems to function fine in dev mode. Need to test builds * install roboto from npm --- package.json | 3 + public/index.html | 3 - src/App.vue | 3 + src/api/axios-instance.js | 2 +- src/components/Login.vue | 9 +- src/components/SideNav.vue | 2 +- src/plugins/vuetify.js | 3 +- src/store/ApplicationModule.js | 8 +- yarn.lock | 2553 ++++++++++++++++---------------- 9 files changed, 1325 insertions(+), 1261 deletions(-) diff --git a/package.json b/package.json index a3df5d5..13ec2a4 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ }, "main": "background.js", "dependencies": { + "@fortawesome/fontawesome-free": "^5.13.1", + "@mdi/font": "^5.3.45", "axios": "0.18.1", "chai-as-promised": "^7.1.1", "core-js": "^3.4.4", @@ -26,6 +28,7 @@ "lodash.debounce": "^4.0.8", "moment": "^2.24.0", "semver": "^7.1.3", + "typeface-roboto": "^0.0.75", "vue": "^2.6.10", "vue-router": "^3.1.3", "vue-splitpane": "^1.0.6", diff --git a/public/index.html b/public/index.html index 29f604e..24b8126 100644 --- a/public/index.html +++ b/public/index.html @@ -5,9 +5,6 @@ - - - starkiller diff --git a/src/App.vue b/src/App.vue index 5aaa7eb..638f737 100644 --- a/src/App.vue +++ b/src/App.vue @@ -106,6 +106,9 @@ export default {