Переглянути джерело

HPCC-23289 EclWatch option to override debug server

Signed-off-by: Gordon Smith <gordonjsmith@gmail.com>
Gordon Smith 5 роки тому
батько
коміт
e93161d906
4 змінених файлів з 25 додано та 35 видалено
  1. 0 1
      .gitignore
  2. 1 0
      esp/src/.gitignore
  3. 19 30
      esp/src/eclwatch/dojoConfig.js
  4. 5 4
      esp/src/lws.config.js

+ 0 - 1
.gitignore

@@ -7,7 +7,6 @@ node_modules
 esp/src/lib
 esp/src/build
 esp/src/hpcc-js
-esp/src/gjs.md
 .vscode/
 .eclcc/
 eclcc.log

+ 1 - 0
esp/src/.gitignore

@@ -0,0 +1 @@
+/lws.target.txt

+ 19 - 30
esp/src/eclwatch/dojoConfig.js

@@ -1,12 +1,7 @@
-var dojoConfig;
-var debugHPCC_JS = false; //  Should never be TRUE in a PR  ---
-
 function getConfig(env) {
     // dojoRoot is defined if we're running in node (i.e. building)
     var dojoRoot = env.dojoRoot;
     var baseUrl = dojoRoot ? "." : "/esp/files";
-    var hpccBaseUrl = baseUrl + "/node_modules/@hpcc-js";
-    var hpccMin = debugHPCC_JS ? "" : ".min";
 
     return {
         baseUrl: baseUrl,
@@ -25,24 +20,24 @@ function getConfig(env) {
             "templates": baseUrl + "/eclwatch/templates",
             "ecl": baseUrl + "/eclwatch/ecl",
             "css": baseUrl + "/loader/css",
-            "@hpcc-js/api": baseUrl + "/node_modules/@hpcc-js/api/dist/index" + hpccMin,
-            "@hpcc-js/chart": baseUrl + "/node_modules/@hpcc-js/chart/dist/index" + hpccMin,
-            "@hpcc-js/common": baseUrl + "/node_modules/@hpcc-js/common/dist/index" + hpccMin,
-            "@hpcc-js/comms": baseUrl + "/node_modules/@hpcc-js/comms/dist/index" + hpccMin,
-            "@hpcc-js/composite": baseUrl + "/node_modules/@hpcc-js/composite/dist/index" + hpccMin,
-            "@hpcc-js/dgrid": baseUrl + "/node_modules/@hpcc-js/dgrid/dist/index" + hpccMin,
-            "@hpcc-js/dgrid-shim": baseUrl + "/node_modules/@hpcc-js/dgrid-shim/dist/index" + hpccMin,
-            "@hpcc-js/eclwatch": baseUrl + "/node_modules/@hpcc-js/eclwatch/dist/index" + hpccMin,
-            "@hpcc-js/form": baseUrl + "/node_modules/@hpcc-js/form/dist/index" + hpccMin,
-            "@hpcc-js/graph": baseUrl + "/node_modules/@hpcc-js/graph/dist/index" + hpccMin,
-            "@hpcc-js/layout": baseUrl + "/node_modules/@hpcc-js/layout/dist/index" + hpccMin,
-            "@hpcc-js/html": baseUrl + "/node_modules/@hpcc-js/html/dist/index" + hpccMin,
-            "@hpcc-js/map": baseUrl + "/node_modules/@hpcc-js/map/dist/index" + hpccMin,
-            "@hpcc-js/other": baseUrl + "/node_modules/@hpcc-js/other/dist/index" + hpccMin,
-            "@hpcc-js/react": baseUrl + "/node_modules/@hpcc-js/react/dist/index" + hpccMin,
-            "@hpcc-js/timeline": baseUrl + "/node_modules/@hpcc-js/timeline/dist/index" + hpccMin,
-            "@hpcc-js/tree": baseUrl + "/node_modules/@hpcc-js/tree/dist/index" + hpccMin,
-            "@hpcc-js/util": baseUrl + "/node_modules/@hpcc-js/util/dist/index" + hpccMin,
+            "@hpcc-js/api": baseUrl + "/node_modules/@hpcc-js/api/dist/index",
+            "@hpcc-js/chart": baseUrl + "/node_modules/@hpcc-js/chart/dist/index",
+            "@hpcc-js/common": baseUrl + "/node_modules/@hpcc-js/common/dist/index",
+            "@hpcc-js/comms": baseUrl + "/node_modules/@hpcc-js/comms/dist/index",
+            "@hpcc-js/composite": baseUrl + "/node_modules/@hpcc-js/composite/dist/index",
+            "@hpcc-js/dgrid": baseUrl + "/node_modules/@hpcc-js/dgrid/dist/index",
+            "@hpcc-js/dgrid-shim": baseUrl + "/node_modules/@hpcc-js/dgrid-shim/dist/index",
+            "@hpcc-js/eclwatch": baseUrl + "/node_modules/@hpcc-js/eclwatch/dist/index",
+            "@hpcc-js/form": baseUrl + "/node_modules/@hpcc-js/form/dist/index",
+            "@hpcc-js/graph": baseUrl + "/node_modules/@hpcc-js/graph/dist/index",
+            "@hpcc-js/layout": baseUrl + "/node_modules/@hpcc-js/layout/dist/index",
+            "@hpcc-js/html": baseUrl + "/node_modules/@hpcc-js/html/dist/index",
+            "@hpcc-js/map": baseUrl + "/node_modules/@hpcc-js/map/dist/index",
+            "@hpcc-js/other": baseUrl + "/node_modules/@hpcc-js/other/dist/index",
+            "@hpcc-js/react": baseUrl + "/node_modules/@hpcc-js/react/dist/index",
+            "@hpcc-js/timeline": baseUrl + "/node_modules/@hpcc-js/timeline/dist/index",
+            "@hpcc-js/tree": baseUrl + "/node_modules/@hpcc-js/tree/dist/index",
+            "@hpcc-js/util": baseUrl + "/node_modules/@hpcc-js/util/dist/index",
             "@hpcc-js/TopoJSON": dojoRoot ? "/esp/files/dist/TopoJSON" : baseUrl + "/node_modules/@hpcc-js/map/TopoJSON",
             "clipboard": baseUrl + "/node_modules/clipboard/dist/clipboard",
             "codemirror": baseUrl + "/node_modules/codemirror",
@@ -90,10 +85,4 @@ function getConfig(env) {
     };
 }
 
-// For Webpack, export the config.  This is needed both at build time and on the client at runtime
-// for the packed application.
-if (typeof module !== 'undefined' && module) {
-    module.exports = getConfig;
-} else {
-    dojoConfig = getConfig({});
-}
+module.exports = getConfig;

+ 5 - 4
esp/src/lws.config.js

@@ -1,8 +1,9 @@
 const fs = require("fs");
 
-const CLUSTER_MV = "192.168.99.103";
-const CLUSTER_GJS = "localhost";
-const debugServerIP = fs.existsSync("./gjs.md") ? CLUSTER_GJS : CLUSTER_MV;
+let debugServerIP = "192.168.99.103";
+if (fs.existsSync("./lws.target.txt")) {
+    debugServerIP = fs.readFileSync("./lws.target.txt").toString().replace("\r\n", "\n").split("\n")[0];
+}
 
 let rewrite = [
     { from: "/esp/files/Login.html", to: "http://" + debugServerIP + ":8010/esp/files/Login.html" },
@@ -19,7 +20,7 @@ let rewrite = [
     { from: "/esp/files/esp/logout", to: "http://" + debugServerIP + ":8010/esp/logout" },
     { from: "/ws_elk/(.*)", to: "http://" + debugServerIP + ":8010/ws_elk/$1" },
     { from: "/esp/files/esp/reset_session_timeout", to: "http://" + debugServerIP + ":8010/esp/reset_session_timeout" },
-    { from: "/esp/files/node_modules/@hpcc-js/(.*)/dist/index.min.js", to: debugServerIP !== CLUSTER_GJS ? "/node_modules/@hpcc-js/$1/dist/index.js" : "/hpcc-js/$1/dist/index.js" },
+    { from: "/esp/files/node_modules/@hpcc-js/(.*)/dist/index.min.js", to: "/node_modules/@hpcc-js/$1/dist/index.js" },
     { from: "/esp/files/dist/(.*)", to: "/build/dist/$1" },
     { from: "/esp/files/(.*)", to: "/$1" },
     { from: "/ws_elk/(.*)", to: "http://" + debugServerIP + ":8010/ws_elk/$1" },