...
|
...
|
@@ -2758,15 +2758,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
|
}
|
|
|
});
|
|
|
if ($('.layui-show').find(".detail-left-panel").length == 0) {
|
|
|
var leftUrl = common.domainName + '/api-web/detail/findRelationGroupByResId'
|
|
|
$.ajax({
|
|
|
var leftUrl = common.domainName + '/api-web/detail/findRelationGroupByResId';
|
|
|
admin.req({
|
|
|
url: leftUrl,
|
|
|
type: 'get',
|
|
|
headers: {
|
|
|
"Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
|
|
|
},
|
|
|
data: {resId: resId},
|
|
|
success: function (res) {
|
|
|
success(res) {
|
|
|
if (!res || !res.success) {
|
|
|
layer.msg('获取关联信息失败!', {icon: 0});
|
|
|
res.map = {};
|
...
|
...
|
@@ -2857,8 +2853,111 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
|
obj.openDetail(resId, resType, title, false, null, null, 'newTabPage');
|
|
|
});
|
|
|
}, 0)
|
|
|
},
|
|
|
error() {
|
|
|
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
// $.ajax({
|
|
|
// url: leftUrl,
|
|
|
// type: 'get',
|
|
|
// headers: {
|
|
|
// "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
|
|
|
// },
|
|
|
// data: {resId: resId},
|
|
|
// success: function (res) {
|
|
|
// if (!res || !res.success) {
|
|
|
// layer.msg('获取关联信息失败!', {icon: 0});
|
|
|
// res.map = {};
|
|
|
// }
|
|
|
// setTimeout(function () {
|
|
|
// // var height = $("#" + tableId).parent().parent().parent().parent().parent().height() - 10;
|
|
|
// var height = $('.layui-layer-page').find('.layui-layer-content').height();
|
|
|
// if (!height || height === 0) {
|
|
|
// height = window.innerHeight
|
|
|
// }
|
|
|
// if ($('.layui-layer-page').find('.layui-tab-title').length > 0) {
|
|
|
// height = height - 70;
|
|
|
// } else {
|
|
|
// height = height - 15;
|
|
|
// }
|
|
|
// $("#" + tableId).parent().parent().parent().parent().before(laytpl($("#detailPageLeftPanel").html()).render(res))
|
|
|
// $(".detail-left-panel").css({height: height + "px"})
|
|
|
// $(".detail-left-panel").find(".detail-left-panel-btn").unbind("click").on("click", function () {
|
|
|
// var $that = $(this);
|
|
|
// if ($(".detail-left-panel").width() == 0) {
|
|
|
// $that.find("i.layui-icon").removeClass("layui-icon-next").addClass("layui-icon-prev")
|
|
|
// $(".detail-left-panel").animate({width: 270, marginLeft: 0}, 300);
|
|
|
// $(".detail-left-panel").find(".detail-left-panel-node").show();
|
|
|
// } else {
|
|
|
// $that.find("i.layui-icon").removeClass("layui-icon-prev").addClass("layui-icon-next")
|
|
|
// $(".detail-left-panel").animate({width: 0, marginLeft: 10}, 300);
|
|
|
// $(".detail-left-panel").find(".detail-left-panel-node").hide();
|
|
|
// }
|
|
|
// });
|
|
|
// $('div.info-box').unbind('click').bind('click', function () {
|
|
|
// var name = $(this).text();
|
|
|
// var resId = $(this).data("resid");
|
|
|
// var resType = '';
|
|
|
// var ip = $(this).data("ip");
|
|
|
// var resTypeName = $(this).data("restypename");
|
|
|
// var admin = $(this).data("admin");
|
|
|
// var adminName = '';
|
|
|
// var manageIp = '';
|
|
|
// var collProtocol = '';
|
|
|
// $.ajax({
|
|
|
// url: common.domainName + "/api-web/home/resource/findById?resId=" + resId,
|
|
|
// async: false,
|
|
|
// type: 'get',
|
|
|
// headers: {
|
|
|
// "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
|
|
|
// },
|
|
|
// error: function () {
|
|
|
// layer.closeAll('loading');
|
|
|
// },
|
|
|
// success: function (res) {
|
|
|
// var data = res.object;
|
|
|
// resType = data.resType;
|
|
|
// adminName = data.adminName;
|
|
|
// manageIp = data.manageIp;
|
|
|
// collProtocol = data.collProtocol;
|
|
|
// }
|
|
|
// })
|
|
|
// var title = name;
|
|
|
// if (title && title !== '') {
|
|
|
// title += '|';
|
|
|
// }
|
|
|
// if (resTypeName && resType !== 'HOST_X86SERVER') {
|
|
|
// title += resTypeName + '|';
|
|
|
// }
|
|
|
// if (ip) {
|
|
|
// if (resType === 'HOST_X86SERVER') {
|
|
|
// if (collProtocol && (collProtocol.split(",").length > 1 || collProtocol === 'SSH')) {
|
|
|
// title += '应用IP-' + ip + '|';
|
|
|
// }
|
|
|
// } else {
|
|
|
// title += ip + '|';
|
|
|
// }
|
|
|
// }
|
|
|
// if (resType === 'HOST_X86SERVER' && collProtocol && collProtocol.indexOf('SNMP') !== -1) {
|
|
|
// if (manageIp) {
|
|
|
// title += '管理IP-' + manageIp + '|';
|
|
|
// }
|
|
|
// }
|
|
|
// if (adminName) {
|
|
|
// title += adminName + '|';
|
|
|
// }
|
|
|
// if (title.length > 0) {
|
|
|
// title = title.substr(0, title.length - 1);
|
|
|
// }
|
|
|
// layer.closeAll('page');
|
|
|
// //资源关联关系时弹窗在新的标签页
|
|
|
// // obj.openDetail(resId, resType, name, false,null,null,'newTabPage');
|
|
|
// obj.openDetail(resId, resType, title, false, null, null, 'newTabPage');
|
|
|
// });
|
|
|
// }, 0)
|
|
|
// }
|
|
|
// })
|
|
|
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -2996,7 +3095,6 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
|
});
|
|
|
cols.push({field: 'resRemark', title: '备注', align: 'center', sort: false});
|
|
|
|
|
|
console.log(JSON.stringify(cols))
|
|
|
var vhostTable = table.render(Object.assign({
|
|
|
elem: '#' + tableId
|
|
|
, url: common.domainName + '/api-web/home/res-list/' + resType + '?parentId=' + resId
|
...
|
...
|
@@ -3376,176 +3474,341 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
|
"provider": res.provider,
|
|
|
"model": res.model
|
|
|
};
|
|
|
$.ajax({
|
|
|
admin.req({
|
|
|
url: common.domainName + "/api-web/favorites/checkResIsExist",
|
|
|
async: false,
|
|
|
data: {
|
|
|
resId: resId,
|
|
|
access_token: layui.sessions.getToken()['access_token']
|
|
|
},
|
|
|
success: function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
//拼接提示信息
|
|
|
var li = '';
|
|
|
var html = '';
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
|
|
|
, async: false
|
|
|
, done: function (res) {
|
|
|
if (res.success) {
|
|
|
if (res.map) {
|
|
|
if (res.map.ip) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
|
|
|
'<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.ip + '</span></li>'
|
|
|
}
|
|
|
if (res.map.resTypeName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
|
|
|
'<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.resTypeName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.businessName) {
|
|
|
li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
|
|
|
'<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.businessName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.taskName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
|
|
|
'<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.taskName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.collectorName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
|
|
|
'<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.collectorName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.domainName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
|
|
|
'<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.domainName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.extendCol3) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
|
|
|
'<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.extendCol3 + '</span></li>'
|
|
|
}
|
|
|
if (res.map.colonyName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
|
|
|
'<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.colonyName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.resNameHost) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
|
|
|
'<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.resNameHost + '</span></li>'
|
|
|
}
|
|
|
if (res.map.os) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
|
|
|
'<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.os + '</span></li>'
|
|
|
}
|
|
|
if (res.map.provider) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
|
|
|
'<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.provider + '</span></li>'
|
|
|
}
|
|
|
if (res.map.model) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">型号</span>' +
|
|
|
'<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.model + '</span></li>'
|
|
|
}
|
|
|
if (res.map.resPositon) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
|
|
|
'<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.resPositon + '</span></li>'
|
|
|
}
|
|
|
if (resId) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
|
|
|
'<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ resId + '</span></li>'
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
//拼接提示信息
|
|
|
var li = '';
|
|
|
var html = '';
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
|
|
|
, async: false
|
|
|
, done: function (res) {
|
|
|
if (res.success) {
|
|
|
if (res.map) {
|
|
|
if (res.map.ip) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
|
|
|
'<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.ip + '</span></li>'
|
|
|
}
|
|
|
if (res.map.resTypeName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
|
|
|
'<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.resTypeName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.businessName) {
|
|
|
li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
|
|
|
'<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.businessName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.taskName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
|
|
|
'<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.taskName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.collectorName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
|
|
|
'<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.collectorName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.domainName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
|
|
|
'<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.domainName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.extendCol3) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
|
|
|
'<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.extendCol3 + '</span></li>'
|
|
|
}
|
|
|
if (res.map.colonyName) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
|
|
|
'<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.colonyName + '</span></li>'
|
|
|
}
|
|
|
if (res.map.resNameHost) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
|
|
|
'<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.resNameHost + '</span></li>'
|
|
|
}
|
|
|
if (res.map.os) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
|
|
|
'<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.os + '</span></li>'
|
|
|
}
|
|
|
if (res.map.provider) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
|
|
|
'<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.provider + '</span></li>'
|
|
|
}
|
|
|
if (res.map.model) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">型号</span>' +
|
|
|
'<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.model + '</span></li>'
|
|
|
}
|
|
|
if (res.map.resPositon) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
|
|
|
'<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ res.map.resPositon + '</span></li>'
|
|
|
}
|
|
|
if (resId) {
|
|
|
li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
|
|
|
'<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
+ resId + '</span></li>'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
var uuid = generateUUID();
|
|
|
//start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
|
|
|
var resName = res.resName;
|
|
|
var resTypeName = res.resTypeName;
|
|
|
var adminName = res.adminName;
|
|
|
//end lsq 2022-04-25
|
|
|
|
|
|
if (li != '') {
|
|
|
html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
|
|
|
}
|
|
|
if (html != '') {
|
|
|
title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >${html}</i>`
|
|
|
}
|
|
|
title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
if (response && response.success && response.count > 0) {
|
|
|
var favIds = response.map.favIds;
|
|
|
title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
|
|
|
} else {
|
|
|
title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
}
|
|
|
title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
//lsq 2022-04-25 增加ping详情提交按钮
|
|
|
title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${resName} data-ip=${ip} data-restypename=${resTypeName} data-adminname=${adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;
|
|
|
if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
/*
|
|
|
title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont"></i></a>`;
|
|
|
*/
|
|
|
}
|
|
|
if (res.state == 'new' && hardwareFlag.endsWith("N")) {
|
|
|
layer.alert('资源未监控!', {icon: 0});
|
|
|
return;
|
|
|
}
|
|
|
if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
|
|
|
layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
|
|
|
return;
|
|
|
}
|
|
|
//lsq 停机计划跑马灯 2022-08-19
|
|
|
title +=`<span id="title-shutdown" data-id=${resId} style="flex:1;padding:0 5px;margin-left:10px;background:url('/src/style/img/shutdown.png'); background-repeat: round;"></span>`
|
|
|
title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin:0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;
|
|
|
title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;
|
|
|
|
|
|
obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.closeAll('loading');
|
|
|
title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息"></i>'
|
|
|
title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
});
|
|
|
var uuid = generateUUID();
|
|
|
//start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
|
|
|
var resName = res.resName;
|
|
|
var resTypeName = res.resTypeName;
|
|
|
var adminName = res.adminName;
|
|
|
//end lsq 2022-04-25
|
|
|
|
|
|
if (li != '') {
|
|
|
html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
|
|
|
}
|
|
|
if (html != '') {
|
|
|
title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >${html}</i>`
|
|
|
}
|
|
|
title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
if (response && response.success && response.count > 0) {
|
|
|
var favIds = response.map.favIds;
|
|
|
title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
|
|
|
} else {
|
|
|
title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
//lsq 2022-04-25 增加ping详情提交按钮
|
|
|
title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;
|
|
|
title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin: 0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;
|
|
|
title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;
|
|
|
if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
/*
|
|
|
title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont"></i></a>`;
|
|
|
*/
|
|
|
}
|
|
|
obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
|
|
|
}
|
|
|
title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
//lsq 2022-04-25 增加ping详情提交按钮
|
|
|
title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${resName} data-ip=${ip} data-restypename=${resTypeName} data-adminname=${adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/monitor-web/src/style/img/ping.png" ></a>`;
|
|
|
if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
/*
|
|
|
title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont"></i></a>`;
|
|
|
*/
|
|
|
}
|
|
|
if (res.state == 'new' && hardwareFlag.endsWith("N")) {
|
|
|
layer.alert('资源未监控!', {icon: 0});
|
|
|
return;
|
|
|
}
|
|
|
if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
|
|
|
layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
|
|
|
return;
|
|
|
}
|
|
|
//lsq 停机计划跑马灯 2022-08-19
|
|
|
title +=`<span id="title-shutdown" data-id=${resId} style="flex:1;padding:0 5px;margin-left:10px;background:url('/monitor-web/src/style/img/shutdown.png'); background-repeat: round;"></span>`
|
|
|
title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin:0 10px"> <img width="20" src="/monitor-web/src/style/img/snapshotadd.png" ></a>`;
|
|
|
title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/monitor-web/src/style/img/snapshothistory.png" ></a></div>`;
|
|
|
obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息"></i>'
|
|
|
title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
//lsq 2022-04-25 增加ping详情提交按钮
|
|
|
title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/monitor-web/src/style/img/ping.png" ></a>`;
|
|
|
title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin: 0 10px"> <img width="20" src="/monitor-web/src/style/img/snapshotadd.png" ></a>`;
|
|
|
title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/monitor-web/src/style/img/snapshothistory.png" ></a></div>`;
|
|
|
if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
/*
|
|
|
title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont"></i></a>`;
|
|
|
*/
|
|
|
}
|
|
|
obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
|
|
|
});
|
|
|
// $.ajax({
|
|
|
// url: common.domainName + "/api-web/favorites/checkResIsExist",
|
|
|
// async: false,
|
|
|
// data: {
|
|
|
// resId: resId,
|
|
|
// access_token: layui.sessions.getToken()['access_token']
|
|
|
// },
|
|
|
// success: function (response) {
|
|
|
// layer.closeAll('loading');
|
|
|
// //拼接提示信息
|
|
|
// var li = '';
|
|
|
// var html = '';
|
|
|
// admin.req({
|
|
|
// url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
|
|
|
// , async: false
|
|
|
// , done: function (res) {
|
|
|
// if (res.success) {
|
|
|
// if (res.map) {
|
|
|
// if (res.map.ip) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
|
|
|
// '<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.ip + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.resTypeName) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
|
|
|
// '<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.resTypeName + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.businessName) {
|
|
|
// li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
|
|
|
// '<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.businessName + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.taskName) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
|
|
|
// '<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.taskName + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.collectorName) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
|
|
|
// '<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.collectorName + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.domainName) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
|
|
|
// '<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.domainName + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.extendCol3) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
|
|
|
// '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.extendCol3 + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.colonyName) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
|
|
|
// '<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.colonyName + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.resNameHost) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
|
|
|
// '<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.resNameHost + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.os) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
|
|
|
// '<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.os + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.provider) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
|
|
|
// '<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.provider + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.model) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">型号</span>' +
|
|
|
// '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.model + '</span></li>'
|
|
|
// }
|
|
|
// if (res.map.resPositon) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
|
|
|
// '<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + res.map.resPositon + '</span></li>'
|
|
|
// }
|
|
|
// if (resId) {
|
|
|
// li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
|
|
|
// '<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
// + resId + '</span></li>'
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// });
|
|
|
// var uuid = generateUUID();
|
|
|
// //start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
|
|
|
// var resName = res.resName;
|
|
|
// var resTypeName = res.resTypeName;
|
|
|
// var adminName = res.adminName;
|
|
|
// //end lsq 2022-04-25
|
|
|
//
|
|
|
// if (li != '') {
|
|
|
// html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
|
|
|
// }
|
|
|
// if (html != '') {
|
|
|
// title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >${html}</i>`
|
|
|
// }
|
|
|
// title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
// title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
// if (response && response.success && response.count > 0) {
|
|
|
// var favIds = response.map.favIds;
|
|
|
// title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
|
|
|
// } else {
|
|
|
// title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
// }
|
|
|
// title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
// title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
// //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
// title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${resName} data-ip=${ip} data-restypename=${resTypeName} data-adminname=${adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;
|
|
|
// if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
// /*
|
|
|
// title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont"></i></a>`;
|
|
|
// */
|
|
|
// }
|
|
|
// if (res.state == 'new' && hardwareFlag.endsWith("N")) {
|
|
|
// layer.alert('资源未监控!', {icon: 0});
|
|
|
// return;
|
|
|
// }
|
|
|
// if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
|
|
|
// layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
|
|
|
// return;
|
|
|
// }
|
|
|
// //lsq 停机计划跑马灯 2022-08-19
|
|
|
// title +=`<span id="title-shutdown" data-id=${resId} style="flex:1;padding:0 5px;margin-left:10px;background:url('/src/style/img/shutdown.png'); background-repeat: round;"></span>`
|
|
|
// title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin:0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;
|
|
|
// title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;
|
|
|
//
|
|
|
// obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
|
|
|
// },
|
|
|
// error: function () {
|
|
|
// layer.closeAll('loading');
|
|
|
// title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息"></i>'
|
|
|
// title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
// title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
// title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
// title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
// title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
// //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
// title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;
|
|
|
// title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin: 0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;
|
|
|
// title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;
|
|
|
// if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
// /*
|
|
|
// title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont"></i></a>`;
|
|
|
// */
|
|
|
// }
|
|
|
// obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
|
|
|
// }
|
|
|
// });
|
|
|
});
|
|
|
},
|
|
|
alarmData: new Object(),
|
|
|
loadResAlarm: function (resId) {
|
|
|
$.ajax({
|
|
|
type: 'get',
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId,
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
async: false,
|
|
|
success: function (res) {
|
|
|
data: {},
|
|
|
success(res) {
|
|
|
obj.alarmData = res.data;
|
|
|
},
|
|
|
error() {
|
|
|
//layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
// $.ajax({
|
|
|
// type: 'get',
|
|
|
// url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId,
|
|
|
// contentType: "application/json; charset=utf-8",
|
|
|
// async: false,
|
|
|
// success: function (res) {
|
|
|
// obj.alarmData = res.data;
|
|
|
// }
|
|
|
// });
|
|
|
},
|
|
|
alarmEleMatchStyle: function (flag, kpiId) {
|
|
|
var tempAlarms = obj.alarmData;
|
...
|
...
|
|