Procházet zdrojové kódy

feat: 更新规则引擎前端,调试规则引擎通过配置调用服务地址

yanglzh před 11 měsíci
rodič
revize
fe0f9f665a

+ 9 - 0
public/config.json

@@ -0,0 +1,9 @@
+{
+  "topo": "/base-api/api/v1",
+  "screen": "/base-api/api/v1",
+  "rule": {
+    "server": "http://127.0.0.1:9090",
+    "iotServer": "/api/v1"
+  },
+  "media": "http://127.0.0.1:9090"
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
public/plugin/rule/assets/index.64d25905.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
public/plugin/rule/assets/index.fcb91b3d.css


+ 6 - 0
public/plugin/rule/config.json

@@ -0,0 +1,6 @@
+{
+  "rule": {
+    "server": "http://127.0.0.1:9090",
+    "iotServer": "/api/v1"
+  }
+}

+ 19 - 13
public/plugin/rule/index.html

@@ -1,15 +1,21 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
-    <meta charset="UTF-8" />
-    <link rel="icon" href="/plugin/rule/favicon.ico" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Sagoo Rule Editor</title>
-    <script type="module" crossorigin src="/plugin/rule/assets/index.1986eaa5.js"></script>
-    <link rel="stylesheet" href="/plugin/rule/assets/index.8f2f0176.css">
-  </head>
-  <body>
-    <div id="app"></div>
-
-  </body>
-</html>
+<head>
+  <meta charset="UTF-8" />
+  <link rel="icon" href="/plugin/rule/favicon.ico" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <title>Sagoo Rule Editor</title>
+  <script>
+    // 获取配置文件中的 服务地址,定义为全局变量
+    fetch('/config.json').then(function (res) { return res.json() }).then(function (config) {
+      window.env = config.rule
+    })
+  </script>
+  <script type="module" crossorigin src="/plugin/rule/assets/index.64d25905.js"></script>
+  <link rel="stylesheet" href="/plugin/rule/assets/index.fcb91b3d.css">
+</head>
+<body>
+  <div id="app"></div>
+  
+</body>
+</html>

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů