This commit is contained in:
2022-02-15 19:48:26 +00:00
parent b29ab8eceb
commit 27efdd9644
14 changed files with 28 additions and 54 deletions

View File

@@ -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 == "") {

View File

@@ -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 <protocol>//<hostname>:<port>/
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

View File

@@ -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({

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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"));

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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"
);
//
}

View File

@@ -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;

View File

@@ -62,7 +62,7 @@
<v-subheader>{{ $ay.t("Server") }}</v-subheader>
<div>
<span class="ml-6 text-body-1">{{ $ay.t("ServerAddress") }}: </span>
<span class="text-body-2">{{ $store.state.apiUrl }}</span>
<span class="text-body-2">{{ apiUrl }}</span>
</div>
<div>
<span class="ml-6 text-body-1">{{ $ay.t("Version") }}: </span>
@@ -158,6 +158,11 @@ export default {
}
};
},
computed: {
apiUrl() {
return window.$gz.api.APIUrl("");
}
},
async created() {
const vm = this;
try {

View File

@@ -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;

View File

@@ -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;