Ver Fonte

修改首页数据库ip展示

lry há 7 meses atrás
pai
commit
cbdb6c547f

+ 20 - 2
industry-admin/src/views/dashboard/index.vue

@@ -94,7 +94,15 @@
         <span style="font-size:20px">业务数据信息</span>
       </el-divider>
       <el-row :gutter="40" class="panel-group">
-        <el-col :xs="12" :sm="12" :lg="12" class="card-panel-col">
+        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col">
+          <div class="card-panel">
+            <div class="card-panel-description">
+              <div class="card-panel-text">IP</div>
+              <div class="info-label">{{ systemInfo.ip }}</div>
+            </div>
+          </div>
+        </el-col>
+        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col">
           <div class="card-panel">
             <div class="card-panel-description">
               <div class="card-panel-text">业务数据磁盘</div>
@@ -131,7 +139,15 @@
         <span style="font-size:20px">实时数据信息</span>
       </el-divider>
       <el-row :gutter="40" class="panel-group">
-        <el-col :xs="12" :sm="12" :lg="12" class="card-panel-col">
+        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col">
+          <div class="card-panel">
+            <div class="card-panel-description">
+              <div class="card-panel-text">IP</div>
+              <div class="info-label">{{ inFluxDbInfo.ip }}</div>
+            </div>
+          </div>
+        </el-col>
+        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col">
           <div class="card-panel">
             <div class="card-panel-description">
               <div class="card-panel-text">实时数据磁盘</div>
@@ -212,6 +228,7 @@ export default {
         totalSpace: 0,
         usableSpace: 0,
         tray: '',
+        ip:'',
         path: ''
       },
       inFluxDbInfo: {
@@ -219,6 +236,7 @@ export default {
         totalSpace: 0,
         usableSpace: 0,
         tray: '',
+        ip:'',
         path: ''
       },
       onlineUsersTable: []

+ 5 - 3
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/SystemServiceImpl.java

@@ -60,6 +60,7 @@ public class SystemServiceImpl implements SystemService {
         //赋值默认值
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("tray","");
+        jsonObject.put("ip","");
         jsonObject.put("usableSpace",0);
         jsonObject.put("databaseSpace",0);
 
@@ -104,9 +105,10 @@ public class SystemServiceImpl implements SystemService {
                 if(influxdbIp.equals(localIp)){
                     jsonObject.put("tray",engine_path);
                 }else{
-                    String spath = influxdbIp + "," + engine_path;//engine_path.substring(2,engine_path.length());
+                    String spath = engine_path;//engine_path.substring(2,engine_path.length());
                     jsonObject.put("tray",spath);
                 }
+                jsonObject.put("ip",influxdbIp);
                 //获得磁盘可用空间和总空间
                 File[] files = File.listRoots();
                 for (File file : files) {
@@ -156,13 +158,13 @@ public class SystemServiceImpl implements SystemService {
             //InetAddress inetAddress = InetAddress.getLocalHost();
             //String localIp = inetAddress.getHostAddress();
 
-
+            jsonObject.put("ip", mysql_ip);
             while ((resultSet1.next())) {
                 String value = resultSet1.getString("value");
                 jsonObject.put("path", value);
                 //path = value.split("\\\\")[0];
                 diskpath = value.split("\\\\")[0];
-                path = mysql_ip + ","+ value;
+                path =  value;
                 jsonObject.put("tray", path);
                 break;
             }