Showing
5 changed files
with
145 additions
and
1 deletions
@@ -189,6 +189,13 @@ | @@ -189,6 +189,13 @@ | ||
189 | </select> | 189 | </select> |
190 | </div> | 190 | </div> |
191 | </div> | 191 | </div> |
192 | + <div class="layui-inline hide"> | ||
193 | + <div class="layui-input-inline"> | ||
194 | + <select name="tenantId" id="tenant" lay-filter="tenant"> | ||
195 | + <option value="">=腾讯云租户=</option> | ||
196 | + </select> | ||
197 | + </div> | ||
198 | + </div> | ||
192 | </div> | 199 | </div> |
193 | </form> | 200 | </form> |
194 | </div> | 201 | </div> |
@@ -680,6 +680,10 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' | @@ -680,6 +680,10 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' | ||
680 | form.on('select(res_minicomputer)', function (data) { | 680 | form.on('select(res_minicomputer)', function (data) { |
681 | reloadTable(); | 681 | reloadTable(); |
682 | }); | 682 | }); |
683 | + // 腾讯云租户 | ||
684 | + form.on('select(tenant)', function (data) { | ||
685 | + reloadTable(); | ||
686 | + }); | ||
683 | //资源池选择事件 | 687 | //资源池选择事件 |
684 | form.on('select(sub_restype)', function (data) { | 688 | form.on('select(sub_restype)', function (data) { |
685 | if(data.value){ | 689 | if(data.value){ |
@@ -1298,6 +1302,26 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' | @@ -1298,6 +1302,26 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' | ||
1298 | } else { | 1302 | } else { |
1299 | $("#res_vendor").parent().parent().addClass("hide"); | 1303 | $("#res_vendor").parent().parent().addClass("hide"); |
1300 | } | 1304 | } |
1305 | + if (resType == 'TENCENT_CLOUD_PLAT_VIRTUALHOST' || resType.includes('TENCENT_CLOUD_PLAT_RES_')){ | ||
1306 | + $("#tenant").parent().parent().removeClass("hide"); | ||
1307 | + var providerStr = ''; | ||
1308 | + $.ajax({ | ||
1309 | + url: `${common.domainName}/api-web/bResource/tencentTenant?access_token=${accessToken}`, | ||
1310 | + method: 'get', | ||
1311 | + success: function (res) { | ||
1312 | + if (res && res.data) { | ||
1313 | + var ddiclist = res.data; | ||
1314 | + $.each(ddiclist, function (i, v) { | ||
1315 | + providerStr += '<option value="' + v.resId + '">' + v.resName + '</option>'; | ||
1316 | + }); | ||
1317 | + $("#tenant").append(providerStr) | ||
1318 | + form.render("select"); | ||
1319 | + } | ||
1320 | + } | ||
1321 | + }) | ||
1322 | + }else { | ||
1323 | + $("#tenant").parent().parent().addClass("hide"); | ||
1324 | + } | ||
1301 | if(/HUAWEI_CLOUD_VIRTUALHOST/.test(resType) || /ALI_CLOUD_ECS/.test(resType) || /VIRTUALIZATION_VMWARE_VHOST/.test(resType)){ | 1325 | if(/HUAWEI_CLOUD_VIRTUALHOST/.test(resType) || /ALI_CLOUD_ECS/.test(resType) || /VIRTUALIZATION_VMWARE_VHOST/.test(resType)){ |
1302 | //绑定采集协议 | 1326 | //绑定采集协议 |
1303 | admin.req({ | 1327 | admin.req({ |
@@ -1496,6 +1520,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' | @@ -1496,6 +1520,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' | ||
1496 | resCategory: 'resources', | 1520 | resCategory: 'resources', |
1497 | collProtocols:collProtocols, | 1521 | collProtocols:collProtocols, |
1498 | platform: $("#aliyun_plantform").val(), | 1522 | platform: $("#aliyun_plantform").val(), |
1523 | + tenantId: $("#tenant").val(), | ||
1499 | } | 1524 | } |
1500 | }) | 1525 | }) |
1501 | } | 1526 | } |
@@ -313,6 +313,7 @@ | @@ -313,6 +313,7 @@ | ||
313 | margin-right: 50px; | 313 | margin-right: 50px; |
314 | font-weight: 500; | 314 | font-weight: 500; |
315 | text-align: right; | 315 | text-align: right; |
316 | + cursor: pointer; | ||
316 | } | 317 | } |
317 | .tencent-tenant-alarmCount div:nth-of-type(1){ | 318 | .tencent-tenant-alarmCount div:nth-of-type(1){ |
318 | margin-bottom: 14px; | 319 | margin-bottom: 14px; |
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | <div>正常量</div> | 17 | <div>正常量</div> |
18 | <div>{{item.normalCount}}</div> | 18 | <div>{{item.normalCount}}</div> |
19 | </div> | 19 | </div> |
20 | - <div class="tencent-tenant-alarmCount"> | 20 | + <div class="tencent-tenant-alarmCount" @click="handleErrList(item)"> |
21 | <div>异常量</div> | 21 | <div>异常量</div> |
22 | <div>{{item.alarmCount}}</div> | 22 | <div>{{item.alarmCount}}</div> |
23 | </div> | 23 | </div> |
@@ -26,5 +26,27 @@ | @@ -26,5 +26,27 @@ | ||
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
29 | + | ||
30 | + <el-dialog | ||
31 | + v-model="dialogVisible" | ||
32 | + title="腾讯云租户" | ||
33 | + :modal="false" | ||
34 | + append-to-body | ||
35 | + width="80%"> | ||
36 | + <cm-table-page :columns="tableData.columns" :dataList="tableData.dataList" | ||
37 | + :height="height - 163" | ||
38 | + :loading="false" | ||
39 | + :pageSize="queryParams.pageSize" | ||
40 | + :showBorder="false" | ||
41 | + :showIndex="false" | ||
42 | + :showPage="true" | ||
43 | + :showSelection="false" | ||
44 | + :showTools="false" | ||
45 | + :total="count"> | ||
46 | + <template #default="{row,prop,column}"> | ||
47 | + | ||
48 | + </template> | ||
49 | + </cm-table-page> | ||
50 | + </el-dialog> | ||
29 | </div> | 51 | </div> |
30 | </div> | 52 | </div> |
@@ -21,8 +21,97 @@ export default { | @@ -21,8 +21,97 @@ export default { | ||
21 | } | 21 | } |
22 | getList(); | 22 | getList(); |
23 | 23 | ||
24 | + let dialogVisible=Vue.ref(false); | ||
25 | + const handleErrList = (value)=>{ | ||
26 | + dialogVisible.value = true; | ||
27 | + queryParams.value.tenantId = resId; | ||
28 | + queryParams.value.resTypes = value.resTypeCode; | ||
29 | + getTenantList(); | ||
30 | + /*window.parent.postMessage({ | ||
31 | + type:'openTCTenantErrors', | ||
32 | + message:{ | ||
33 | + params:{ | ||
34 | + title:"腾讯云租户", | ||
35 | + resId:props.resId, | ||
36 | + type:value.resTypeCode, | ||
37 | + } | ||
38 | + } | ||
39 | + },'*')*/ | ||
40 | + } | ||
41 | + | ||
42 | + let queryParams = Vue.ref({ | ||
43 | + tenantId:'', | ||
44 | + resTypes:'', | ||
45 | + pageNum:1, | ||
46 | + pageSize:20, | ||
47 | + }); | ||
48 | + | ||
49 | + let count = Vue.ref(0); | ||
50 | + let tableData = Vue.ref({ | ||
51 | + dataList: [], | ||
52 | + columns:[ | ||
53 | + { | ||
54 | + prop: 'alarmLevelName', | ||
55 | + label: '告警级别', | ||
56 | + align: 'center', | ||
57 | + }, { | ||
58 | + prop: 'alarmNo', | ||
59 | + label: '告警编号', | ||
60 | + align: 'center', | ||
61 | + },{ | ||
62 | + prop: 'resType', | ||
63 | + label: '资源类型', | ||
64 | + align: 'center', | ||
65 | + },{ | ||
66 | + prop: 'objType', | ||
67 | + label: '对象类型', | ||
68 | + align: 'center', | ||
69 | + },{ | ||
70 | + prop: 'resName', | ||
71 | + label: '对象名称', | ||
72 | + align: 'center', | ||
73 | + },{ | ||
74 | + prop: 'kpiName', | ||
75 | + label: '指标', | ||
76 | + align: 'center', | ||
77 | + },{ | ||
78 | + prop: 'alarmContent', | ||
79 | + label: '告警内容', | ||
80 | + align: 'center', | ||
81 | + },{ | ||
82 | + prop: 'alarmTime', | ||
83 | + label: '首次告警时间', | ||
84 | + align: 'center', | ||
85 | + },{ | ||
86 | + prop: 'updateTime', | ||
87 | + label: '最新告警时间', | ||
88 | + align: 'center', | ||
89 | + },{ | ||
90 | + prop: 'alarmRepeatCnt', | ||
91 | + label: '告警次数', | ||
92 | + align: 'center', | ||
93 | + } | ||
94 | + ] | ||
95 | + }) | ||
96 | + | ||
97 | + /** | ||
98 | + * 加载列表 | ||
99 | + */ | ||
100 | + const getTenantList = ()=>{ | ||
101 | + proxy.$http.get('/api-web/home/alarm/alarmListPage',queryParams.value,(res)=>{ | ||
102 | + count.value = res.data.count; | ||
103 | + tableData.value.dataList = res.data.rows; | ||
104 | + }) | ||
105 | + } | ||
106 | + | ||
24 | return { | 107 | return { |
25 | tenantList, | 108 | tenantList, |
109 | + handleErrList, | ||
110 | + dialogVisible, | ||
111 | + queryParams, | ||
112 | + tableData, | ||
113 | + count, | ||
114 | + height, | ||
26 | } | 115 | } |
27 | } | 116 | } |
28 | } | 117 | } |
-
Please register or login to post a comment