From b30c5831406c85369835eb0e9b48c60a8b65cf72 Mon Sep 17 00:00:00 2001
From: sd <shidong@jhsoft.cc>
Date: 星期四, 07 八月 2025 17:10:42 +0800
Subject: [PATCH] 数据推送-增加推送方式标签,UDP有单独的ip输入框和推送字段

---
 src/Pool/PollData.ts |   43 ++++++++++---------------------------------
 1 files changed, 10 insertions(+), 33 deletions(-)

diff --git a/src/Pool/PollData.ts b/src/Pool/PollData.ts
index bf47626..3ecfc8d 100644
--- a/src/Pool/PollData.ts
+++ b/src/Pool/PollData.ts
@@ -58,7 +58,6 @@
   public DiskUsePercent: number = 0;
   public barCharts: Array<any> = [];
   public Thresholds: Array<object> = [];
-  public serverUrl: string = "";
 
   //绠楀姏閰嶇疆涓粦鍧楁暟鎹�
   public sliderList: Array<any> = [];
@@ -68,7 +67,6 @@
     this.fetchPollList();
     this.sysThresholds();
     this.statisticTaskInfo();
-    this.fetchCameraInfo();
   }
 
   public async fetchPollConfig() {
@@ -80,31 +78,11 @@
       }
     }
   }
-  public async fetchCameraInfo() {
-    console.info("response:")
-      const response = await fetch("/config.json");
-      console.info("response:"+response)
-      if (!response.ok) throw new Error(`璇锋眰澶辫触: ${response.status}`);
-      const responseData = await response.json();
-      this.serverUrl = responseData.serverUrl;
-      console.info("chatUrl:"+this.serverUrl);
-    }
-  public async fetchPollList() {
-    console.info("鎼滅储:"+this.serverUrl)
-    this.CameraList = []
-    // let rsp: any = await getCamerasByServer({ cameraName: this.SearchName });
-    const response = await fetch("/api-v1/v1/videoCamera/list", {//http://192.168.1.235:8088
-      method: "GET",
-      headers: {
-        "Content-Type": "application/json",
-      },
-    })
-    if (!response.ok) {
-      throw new Error(`璇锋眰澶辫触: ${response.status}`);
-    }
-    let rsp: any = await response.json();
 
-    if (rsp && rsp.status == 200) {
+  public async fetchPollList() {
+    this.CameraList = []
+    let rsp: any = await getCamerasByServer({ cameraName: this.SearchName });
+    if (rsp && rsp.success) {
       if (rsp.data) {
         this.CameraList = rsp.data.sort(function (obj1: any, obj2: any) {
           var val1 = obj1.run_type;
@@ -118,13 +96,12 @@
     const ipReg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
     this.CameraList.forEach((cam: any) => {
       // 鍥芥爣鎽勫儚鏈轰笉鏄剧ずip
-      if (cam.type && cam.type === 1) {
+      if (cam.type === 1) {
         cam.ip = "-"
         return
       }
       let ip = ipReg.exec(cam.rtsp)
-      console.info("ip:"+ip)
-      if (ip && ip.length > 0) {
+      if (ip.length > 0) {
         cam.ip = ip[0]
       }
     })
@@ -197,7 +174,7 @@
         }
         this.GpuUsedPercent = Number((gpuLoad / gpuTotal * 100).toFixed(2))
       }
-      this.barCharts = [this.DiskUsePercent, this.CpuUsedPercent, this.GpuUsedPercent, this.MemUsedPercent]
+      this.barCharts = [this.DiskUsePercent,this.CpuUsedPercent,this.GpuUsedPercent,this.MemUsedPercent]
     }
   }
 
@@ -233,17 +210,17 @@
       let totalCount = res.data.channelTotal
       let realCount = res.data.realValidCount
       let pollCount = res.data.pollChannelCount
-      this.sliderList = [0, realCount, realCount + pollCount]
+      this.sliderList = [0,realCount,realCount + pollCount]
       // if(realCount + pollCount == totalCount){
       //   this.sliderList = [0,realCount,realCount + pollCount]
       // }else{
       //   this.sliderList = [0,realCount,realCount + pollCount,totalCount]
       // }
-
+      
     }
   }
 
-  public async updateChannelCount(fileChannelCount, pollChannelCount) {
+  public async updateChannelCount(fileChannelCount,pollChannelCount){
     let res: any = await updateChannelCount({
       videoChannelCount: fileChannelCount,
       pollChannelCount: pollChannelCount

--
Gitblit v1.8.0