This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user