sd
2025-08-07 b30c5831406c85369835eb0e9b48c60a8b65cf72
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