| | |
| | | public DiskUsePercent: number = 0; |
| | | public barCharts: Array<any> = []; |
| | | public Thresholds: Array<object> = []; |
| | | public serverUrl: string = ""; |
| | | |
| | | //算力配置中滑块数据 |
| | | public sliderList: Array<any> = []; |
| | |
| | | this.fetchPollList(); |
| | | this.sysThresholds(); |
| | | this.statisticTaskInfo(); |
| | | this.fetchCameraInfo(); |
| | | } |
| | | |
| | | public async fetchPollConfig() { |
| | |
| | | } |
| | | } |
| | | } |
| | | 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; |
| | |
| | | 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] |
| | | } |
| | | }) |