diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index e168bac7..ce2aebf3 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -273,7 +273,7 @@ export default { return this.$store.state.navItems; }, helpUrl() { - return this.$store.state.helpUrl; + return window.$gz.api.helpUrl(); }, titleDisplay() { if (this.appBar.title == null || this.appBar.title == "") { diff --git a/ayanova/src/api/gzapi.js b/ayanova/src/api/gzapi.js index 775f667b..ca578286 100644 --- a/ayanova/src/api/gzapi.js +++ b/ayanova/src/api/gzapi.js @@ -269,36 +269,23 @@ export default { }; }, APIUrl(apiPath) { - if ("" == window.$gz.store.state.apiUrl) { - //construct the api url and store it - //development location? - if ( - (window.location.hostname == "localhost" || - window.location.hostname == "192.168.1.56") && - window.location.port == "8080" - ) { - window.$gz.store.commit("setAPIURL", "http://localhost:7575/api/v8.0/"); - window.$gz.store.commit("setHelpURL", "http://localhost:7575/docs/"); - } else { - //production location //:/ - window.$gz.store.commit( - "setHelpURL", - window.location.protocol + "//" + window.location.host + "/docs/" - ); - window.$gz.store.commit( - "setAPIURL", - window.location.protocol + "//" + window.location.host + "/api/v8.0/" - ); - } - } - return window.$gz.store.state.apiUrl + apiPath; + return ( + window.location.protocol + + "//" + + window.location.host + + "/api/v8.0/" + + apiPath + ); + }, + helpUrl() { + return window.location.protocol + "//" + window.location.host + "/docs/"; }, ///////////////////////////// // Just the server itself // used by profiler etc // ServerBaseUrl() { - return window.$gz.store.state.helpUrl.replace("/docs/", "/"); + return this.helpUrl().replace("/docs/", "/"); }, ///////////////////////////// // generic routed download URL diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index cc8ab0df..2abb5563 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -314,7 +314,7 @@ export default { if (!item.disabled && item.owner == "app") { switch (item.key) { case "help": - window.open(vm.$store.state.helpUrl + item.data, "_blank"); + window.open(window.$gz.api.helpUrl() + item.data, "_blank"); break; case "search": vm.$router.push({ diff --git a/ayanova/src/components/extension-delete-control.vue b/ayanova/src/components/extension-delete-control.vue index 2517d1ba..57183360 100644 --- a/ayanova/src/components/extension-delete-control.vue +++ b/ayanova/src/components/extension-delete-control.vue @@ -46,7 +46,7 @@ export default { }, methods: { goHelp() { - window.open(this.$store.state.helpUrl + "ay-ex-delete", "_blank"); + window.open(window.$gz.api.helpUrl() + "ay-ex-delete", "_blank"); }, canDoAction() { return true; diff --git a/ayanova/src/components/extension-export-control.vue b/ayanova/src/components/extension-export-control.vue index 0edab67e..fb3f7be9 100644 --- a/ayanova/src/components/extension-export-control.vue +++ b/ayanova/src/components/extension-export-control.vue @@ -35,7 +35,7 @@ export default { ); }, goHelp() { - window.open(this.$store.state.helpUrl + "ay-ex-export", "_blank"); + window.open(window.$gz.api.helpUrl() + "ay-ex-export", "_blank"); }, async doAction() { diff --git a/ayanova/src/components/extension-tags-control.vue b/ayanova/src/components/extension-tags-control.vue index 21ce7507..0ab3baeb 100644 --- a/ayanova/src/components/extension-tags-control.vue +++ b/ayanova/src/components/extension-tags-control.vue @@ -66,7 +66,7 @@ export default { }, methods: { goHelp() { - window.open(this.$store.state.helpUrl + "ay-ex-tags", "_blank"); + window.open(window.$gz.api.helpUrl() + "ay-ex-tags", "_blank"); }, canDoAction() { const vm = this; diff --git a/ayanova/src/components/report-control.vue b/ayanova/src/components/report-control.vue index 563c63ad..c482b79d 100644 --- a/ayanova/src/components/report-control.vue +++ b/ayanova/src/components/report-control.vue @@ -196,7 +196,7 @@ export default { ), null, "error", - `${this.$store.state.helpUrl}/ay-report-timeout` + `${window.$gz.api.helpUrl()}/ay-report-timeout` ); //we're done here return this.reject(this.$ay.t("JobFailed")); diff --git a/ayanova/src/components/wiki-control.vue b/ayanova/src/components/wiki-control.vue index e7573777..945b61e0 100644 --- a/ayanova/src/components/wiki-control.vue +++ b/ayanova/src/components/wiki-control.vue @@ -414,7 +414,7 @@ export default { }, methods: { goHelp() { - window.open(this.$store.state.helpUrl + "ay-start-form-wiki", "_blank"); + window.open(window.$gz.api.helpUrl() + "ay-start-form-wiki", "_blank"); }, compiledOutput() { if (!this.localVal) { diff --git a/ayanova/src/store.js b/ayanova/src/store.js index 9b3fc3fc..8d5a6caf 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -21,8 +21,6 @@ export default new Vuex.Store({ state: { lastClientVersion: "", authenticated: false, - apiUrl: "", - helpUrl: "", apiToken: "-", downloadToken: "-", l: false, //license lockout flag @@ -128,7 +126,6 @@ export default new Vuex.Store({ state.translationText = {}; state.enums = {}; state.formCustomTemplate = {}; - state.apiUrl = ""; state.userOptions.languageOverride = "en-US"; state.userOptions.timeZoneOverride = null; state.userOptions.currencyName = "USD"; @@ -168,12 +165,6 @@ export default new Vuex.Store({ setEnum(state, data) { state.enums[data.enumKey] = data.items; }, - setAPIURL(state, data) { - state.apiUrl = data; - }, - setHelpURL(state, data) { - state.helpUrl = data; - }, logItem(state, msg) { msg = new Date().toLocaleString("sv-SE") + "|" + msg; state.logArray.push(msg); diff --git a/ayanova/src/views/adm-license.vue b/ayanova/src/views/adm-license.vue index c32c3f4a..6190a3be 100644 --- a/ayanova/src/views/adm-license.vue +++ b/ayanova/src/views/adm-license.vue @@ -288,7 +288,7 @@ export default { "UserCountExceeded", null, "error", - this.$store.state.helpUrl + "adm-license#user-count-exceeded" + window.$gz.api.helpUrl() + "adm-license#user-count-exceeded" ); // } diff --git a/ayanova/src/views/adm-user.vue b/ayanova/src/views/adm-user.vue index afaecfbd..b6e9fbaa 100644 --- a/ayanova/src/views/adm-user.vue +++ b/ayanova/src/views/adm-user.vue @@ -560,10 +560,7 @@ export default { }, methods: { goHelp() { - window.open( - this.$store.state.helpUrl + "ay-start-localization", - "_blank" - ); + window.open(window.$gz.api.helpUrl() + "ay-start-localization", "_blank"); }, canSave: function() { return this.formState.valid && this.formState.dirty; diff --git a/ayanova/src/views/ay-about.vue b/ayanova/src/views/ay-about.vue index 441e7612..e10ce4ae 100644 --- a/ayanova/src/views/ay-about.vue +++ b/ayanova/src/views/ay-about.vue @@ -62,7 +62,7 @@ {{ $ay.t("Server") }}
{{ $ay.t("ServerAddress") }}: - {{ $store.state.apiUrl }} + {{ apiUrl }}
{{ $ay.t("Version") }}: @@ -158,6 +158,11 @@ export default { } }; }, + computed: { + apiUrl() { + return window.$gz.api.APIUrl(""); + } + }, async created() { const vm = this; try { diff --git a/ayanova/src/views/cust-user.vue b/ayanova/src/views/cust-user.vue index eb60b73a..5265abab 100644 --- a/ayanova/src/views/cust-user.vue +++ b/ayanova/src/views/cust-user.vue @@ -561,10 +561,7 @@ export default { }, methods: { goHelp() { - window.open( - this.$store.state.helpUrl + "ay-start-localization", - "_blank" - ); + window.open(window.$gz.api.helpUrl() + "ay-start-localization", "_blank"); }, canSave: function() { return this.formState.valid && this.formState.dirty; diff --git a/ayanova/src/views/home-user-settings.vue b/ayanova/src/views/home-user-settings.vue index 880700fe..e297f851 100644 --- a/ayanova/src/views/home-user-settings.vue +++ b/ayanova/src/views/home-user-settings.vue @@ -292,10 +292,7 @@ export default { }, methods: { goHelp() { - window.open( - this.$store.state.helpUrl + "ay-start-localization", - "_blank" - ); + window.open(window.$gz.api.helpUrl() + "ay-start-localization", "_blank"); }, translation() { return window.$gz.translation;