From 07c15876280f1c012478b1b16097ebbf0cc6e45e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 15 Feb 2022 20:04:41 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 1 + ayanova/src/api/gzapi.js | 16 ++++++++++++++++ ayanova/src/main.js | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index ec66361f..157d0502 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -817,3 +817,4 @@ BUILD 8.0.0-beta.0.15 CHANGES OF NOTE - Upgraded dompurify.js used with markdown generator used by ayWIKi helper to security sanitize generated html to prevent malicious page script hacks (tested ok, no need for changes to stock reports) - added warning in server log during boot if AYANOVA_JWT_SECRET configuration setting not set that users will need to re-login if they were logged in before the reboot - PO: strip all *viz fields from object before sending over the wire from client to server on save (no need to send *viz fields, most times doesn't matter too little to be significant but PO had a *LOT* of them. Note wo already does this) +- API and HELP URL, changed to dynamically determine this rather than store it once initially determined as it would mess up users if server URL was changed after they have been using AyaNova, also fixed issue with developer mode forcing 7575 if port 8080 and localhost \ No newline at end of file diff --git a/ayanova/src/api/gzapi.js b/ayanova/src/api/gzapi.js index ca578286..de6d36c3 100644 --- a/ayanova/src/api/gzapi.js +++ b/ayanova/src/api/gzapi.js @@ -269,6 +269,14 @@ export default { }; }, APIUrl(apiPath) { + if ( + window.$gz.dev && + window.location.hostname == "localhost" && + window.location.port == "8080" + ) { + return "http://localhost:7575/api/v8.0/" + apiPath; + } + return ( window.location.protocol + "//" + @@ -278,6 +286,13 @@ export default { ); }, helpUrl() { + if ( + window.$gz.dev && + window.location.hostname == "localhost" && + window.location.port == "8080" + ) { + return "http://localhost:7575/docs/"; + } return window.location.protocol + "//" + window.location.host + "/docs/"; }, ///////////////////////////// @@ -394,6 +409,7 @@ export default { async get(route) { try { const that = this; + let r = await fetch(that.APIUrl(route), that.fetchGetOptions()); that.statusEx(r); r = await that.extractBodyEx(r); diff --git a/ayanova/src/main.js b/ayanova/src/main.js index 9c912a90..395d6347 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -66,7 +66,7 @@ import chartBarHorizontalControl from "./components/chart-bar-horizontal-control //DEVELOPMENT MODE //THIS SHOULD BE FALSE IN RELEASE //************************************************************ -const DEV_MODE = false; +const DEV_MODE = true; //************************************************************ //************************************************************** //**************************************************************