index.js
4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import api from "../index";
import baseUrl from "../baseUrl";
export default {
getDev(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs`);
},
getSubdev(pid, params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${pid}/fx_devs`, params);
},
getGlobalWs(uid, clientid) {
return api.get(`${baseUrl}/api/v1/devconf_fx/ws_url?src_type=user&user_unid=${uid}&client_unid=${clientid}`);
},
getConfParam(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/conf_param/types`, params); //获取类型
},
getDevtree(devuid, devname, params) {
let url = "";
switch (devname) {
case "外部设备":
url = "/device_catalogs";
break;
case "内部设备":
url = "/vchan_struct?vchan_type=camera";
break;
case "短视频":
url = "/vchans?vchan_type=vfile";
break;
case "视频云设备":
url = "/video_cloud?vchan_type=cloud";
break;
}
if (window.config.bigtree) {
if(devname == "外部设备") {
return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
} else if (devname == "视频云设备") {
return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
} else {
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`;
}
} else {
if(devname == "外部设备") {
return api.get(`${baseUrl}/api/v1/devconf_fx/${url}`, params);
} else if (devname == "视频云设备") {
return `${baseUrl}/api/v1/devconf_fx${url}`; //ztree版本
} else {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`);
}
}
},
getDevtreeLike(devuid, devname, params){
let url = "";
switch (devname) {
case "外部设备":
url = "/vchan_struct?vchan_type=extern";
break;
case "内部设备":
url = "/vchan_struct?vchan_type=camera";
break;
case "短视频":
url = "/vchans?vchan_type=vfile";
break;
}
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`, params)
},
getFxStream(devuid, refid) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}/vchans/${refid}`); //获取分析流
},
sipSet(devid, userid) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devid}/${userid}/sip_server`);
},
getStore(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params);
},
getFreelist(dev_unid, params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${dev_unid}/fx_devs/free`, params);
},
getDevStatus(dev_unid, params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${dev_unid}/status`, params);
},
getSubTaskStatus() {
return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/subtasks/status`);
},
algos: (devid,params) => {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devid}/algos`,params) // 设备算法
},
savealgocombs: (params) =>{
return api.post(`${baseUrl}/api/v1/devconf_fx/algo_combs`,params) // 保存模板
},
combs:(params) =>{
return api.get(`${baseUrl}/api/v1/devconf_fx/algo_combs`,params)
},
containeslist:(params) => {
return api.get(`${baseUrl}/api/v1/gpu/resource/containers`,params)
},
gpuresource:(params)=> {
return api.get(`${baseUrl}/api/v1/gpu/resource`,params)
},
getcatadev:(params)=> {
return api.get(`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params)
},
postcatadev:(params)=> {
return api.post(`${baseUrl}/api/v1/devconf_fx/device_catalogs`,params)
},
getNvs3000:(params)=>{
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/nvs3000`,params)
},
getConfig:(conf,params) => {
return api.get(`${baseUrl}/api/v1/devconf_fx/content?name=${conf}`,params)
},
saveConfig:(id,params) => {
return api.post(`${baseUrl}/api/v1/devconf_fx/content/${id}`,params)
},
refreshCloudDev: (params) => {
return api.get(`${baseUrl}/api/v1/devconf_fx/video_cloud/refresh`,params)
},
getCloudDev: (params) => {
return api.get(`${baseUrl}/api/v1/devconf_fx/video_cloud`,params)
},
};