Authored by zhangtianqi

腾讯云租户查询告警信息并增加租户的查询条件

... ... @@ -189,6 +189,13 @@
</select>
</div>
</div>
<div class="layui-inline hide">
<div class="layui-input-inline">
<select name="tenantId" id="tenant" lay-filter="tenant">
<option value="">=腾讯云租户=</option>
</select>
</div>
</div>
</div>
</form>
</div>
... ...
... ... @@ -680,6 +680,10 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
form.on('select(res_minicomputer)', function (data) {
reloadTable();
});
// 腾讯云租户
form.on('select(tenant)', function (data) {
reloadTable();
});
//资源池选择事件
form.on('select(sub_restype)', function (data) {
if(data.value){
... ... @@ -1298,6 +1302,26 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
} else {
$("#res_vendor").parent().parent().addClass("hide");
}
if (resType == 'TENCENT_CLOUD_PLAT_VIRTUALHOST' || resType.includes('TENCENT_CLOUD_PLAT_RES_')){
$("#tenant").parent().parent().removeClass("hide");
var providerStr = '';
$.ajax({
url: `${common.domainName}/api-web/bResource/tencentTenant?access_token=${accessToken}`,
method: 'get',
success: function (res) {
if (res && res.data) {
var ddiclist = res.data;
$.each(ddiclist, function (i, v) {
providerStr += '<option value="' + v.resId + '">' + v.resName + '</option>';
});
$("#tenant").append(providerStr)
form.render("select");
}
}
})
}else {
$("#tenant").parent().parent().addClass("hide");
}
if(/HUAWEI_CLOUD_VIRTUALHOST/.test(resType) || /ALI_CLOUD_ECS/.test(resType) || /VIRTUALIZATION_VMWARE_VHOST/.test(resType)){
//绑定采集协议
admin.req({
... ... @@ -1496,6 +1520,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
resCategory: 'resources',
collProtocols:collProtocols,
platform: $("#aliyun_plantform").val(),
tenantId: $("#tenant").val(),
}
})
}
... ...
... ... @@ -313,6 +313,7 @@
margin-right: 50px;
font-weight: 500;
text-align: right;
cursor: pointer;
}
.tencent-tenant-alarmCount div:nth-of-type(1){
margin-bottom: 14px;
... ...
... ... @@ -17,7 +17,7 @@
<div>正常量</div>
<div>{{item.normalCount}}</div>
</div>
<div class="tencent-tenant-alarmCount">
<div class="tencent-tenant-alarmCount" @click="handleErrList(item)">
<div>异常量</div>
<div>{{item.alarmCount}}</div>
</div>
... ... @@ -26,5 +26,27 @@
</div>
</div>
</div>
<el-dialog
v-model="dialogVisible"
title="腾讯云租户"
:modal="false"
append-to-body
width="80%">
<cm-table-page :columns="tableData.columns" :dataList="tableData.dataList"
:height="height - 163"
:loading="false"
:pageSize="queryParams.pageSize"
:showBorder="false"
:showIndex="false"
:showPage="true"
:showSelection="false"
:showTools="false"
:total="count">
<template #default="{row,prop,column}">
</template>
</cm-table-page>
</el-dialog>
</div>
</div>
... ...
... ... @@ -21,8 +21,97 @@ export default {
}
getList();
let dialogVisible=Vue.ref(false);
const handleErrList = (value)=>{
dialogVisible.value = true;
queryParams.value.tenantId = resId;
queryParams.value.resTypes = value.resTypeCode;
getTenantList();
/*window.parent.postMessage({
type:'openTCTenantErrors',
message:{
params:{
title:"腾讯云租户",
resId:props.resId,
type:value.resTypeCode,
}
}
},'*')*/
}
let queryParams = Vue.ref({
tenantId:'',
resTypes:'',
pageNum:1,
pageSize:20,
});
let count = Vue.ref(0);
let tableData = Vue.ref({
dataList: [],
columns:[
{
prop: 'alarmLevelName',
label: '告警级别',
align: 'center',
}, {
prop: 'alarmNo',
label: '告警编号',
align: 'center',
},{
prop: 'resType',
label: '资源类型',
align: 'center',
},{
prop: 'objType',
label: '对象类型',
align: 'center',
},{
prop: 'resName',
label: '对象名称',
align: 'center',
},{
prop: 'kpiName',
label: '指标',
align: 'center',
},{
prop: 'alarmContent',
label: '告警内容',
align: 'center',
},{
prop: 'alarmTime',
label: '首次告警时间',
align: 'center',
},{
prop: 'updateTime',
label: '最新告警时间',
align: 'center',
},{
prop: 'alarmRepeatCnt',
label: '告警次数',
align: 'center',
}
]
})
/**
* 加载列表
*/
const getTenantList = ()=>{
proxy.$http.get('/api-web/home/alarm/alarmListPage',queryParams.value,(res)=>{
count.value = res.data.count;
tableData.value.dataList = res.data.rows;
})
}
return {
tenantList,
handleErrList,
dialogVisible,
queryParams,
tableData,
count,
height,
}
}
}
\ No newline at end of file
... ...