...
|
...
|
@@ -121,8 +121,15 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' |
|
|
|
|
|
//加载业务信息
|
|
|
function loadBizInfo() {
|
|
|
var filter = $("#select-content-ul-bus li.listActive").attr('data-val');
|
|
|
if(!filter){
|
|
|
// 过滤无资源的业务
|
|
|
filter = '2';
|
|
|
}
|
|
|
var url = `${common.domainName}/api-web/home/business/getBusHealthResultByAlarm?filter=${filter}&layout=${sessionStorage.getItem("userLayout")}`
|
|
|
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/home/business/getBusHealthResultByAlarm?layout=' + sessionStorage.getItem("userLayout")
|
|
|
url: url
|
|
|
, type: "get"
|
|
|
, async: false
|
|
|
, done: function (data) {
|
...
|
...
|
@@ -299,41 +306,10 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' |
|
|
});
|
|
|
}
|
|
|
|
|
|
//加载资源类型信息
|
|
|
function loadResTypeInfo() {
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/home/restype/getResTypeHealthResult'
|
|
|
, type: "get"
|
|
|
, done: function (data) {
|
|
|
layer.close(loadIdx);
|
|
|
if (data.code === 0) {
|
|
|
var resTypelist = data.data
|
|
|
if(resTypelist != null && resTypelist.length > 0){
|
|
|
$(".index-line").show();
|
|
|
layui.use('laytpl', function () {
|
|
|
var laytpl = layui.laytpl;
|
|
|
//加载资源类型导航
|
|
|
var getResTypeTpl = document.getElementById("indexResTypeTabTpl").innerHTML;
|
|
|
laytpl(getResTypeTpl).render(data, function (html) {
|
|
|
$('.index-banner-res-group').remove();
|
|
|
$('.index-banner-biz-div').append(html);
|
|
|
|
|
|
//点击告警数字,跳转至告警页面
|
|
|
$("#indexbizhealth [data-index-banner-item='resType'] .gj-detail-info li[data-level]").unbind('click').on("click", function () {
|
|
|
var level = $(this).data("level");
|
|
|
var _resType = $(this).data("restype");
|
|
|
var alarmTotal = $(this).find("b").text();
|
|
|
if (alarmTotal === '0') {
|
|
|
layer.msg('暂无告警', {icon: 0});
|
|
|
return false;
|
|
|
}
|
|
|
//不以资源类型不包括父节点的资源类型 包括阿里云、华为云
|
|
|
if("ALI_CLOUD_PLAT"== _resType || "HUAWEI_CLOUD_PLAT" == _resType){
|
|
|
_resType =_resType.substring(0,_resType.lastIndexOf("_"));
|
|
|
}
|
|
|
$(this).attr("lay-href", "/alarm/activewarning/restype=" + _resType + "/level=" + level);
|
|
|
// $(this).trigger();
|
|
|
});
|
|
|
/**
|
|
|
* 首页右下角两个功能的时间
|
|
|
*/
|
|
|
function bottomEvent(){
|
|
|
// Start 告警级别默认为严重告警,点击左下角选择告警级别,页面的小红点切换不同告警的数量,item根据告警数量进行排序 LSQ 2021/12/29 19:37
|
|
|
$(".select-total").hide();
|
|
|
$(".select-important").hide();
|
...
|
...
|
@@ -345,10 +321,11 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' |
|
|
}
|
|
|
$(item).css('order',$(item).data('serious'))
|
|
|
})
|
|
|
|
|
|
$("#select-content-ul li").unbind("click").on("click",function (){
|
|
|
var dataVal=$(this).data('val');
|
|
|
var dataValLabel=$(this).text();
|
|
|
$('.select-val span').text(dataValLabel);
|
|
|
$('.alarm-text-view span').text(dataValLabel);
|
|
|
$(this).addClass('listActive').siblings().removeClass("listActive");
|
|
|
if(dataVal=='4'){
|
|
|
$(".select-total").show();
|
...
|
...
|
@@ -398,6 +375,62 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' |
|
|
|
|
|
})
|
|
|
//End LSQ 2021/12/29 19:38
|
|
|
// Start Wang 2022/3/7 16:33 业务资源过滤
|
|
|
$("#select-content-ul-bus li").unbind("click").on("click",function (){
|
|
|
debugger
|
|
|
var that = $(this);
|
|
|
// 设置标题
|
|
|
that.parent().parent().find('#bus-text-view').text(that.text());
|
|
|
|
|
|
// 删除所有li标签的样式:listActive
|
|
|
$("#select-content-ul-bus li.listActive").removeClass('listActive')
|
|
|
|
|
|
that.addClass('listActive');
|
|
|
|
|
|
// 调用接口获取数据
|
|
|
loadBizInfo()
|
|
|
})
|
|
|
// End Wang 2022/3/7 16:33
|
|
|
}
|
|
|
|
|
|
//加载资源类型信息
|
|
|
function loadResTypeInfo() {
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/home/restype/getResTypeHealthResult'
|
|
|
, type: "get"
|
|
|
, done: function (data) {
|
|
|
layer.close(loadIdx);
|
|
|
if (data.code === 0) {
|
|
|
var resTypelist = data.data
|
|
|
if(resTypelist != null && resTypelist.length > 0){
|
|
|
$(".index-line").show();
|
|
|
layui.use('laytpl', function () {
|
|
|
var laytpl = layui.laytpl;
|
|
|
//加载资源类型导航
|
|
|
var getResTypeTpl = document.getElementById("indexResTypeTabTpl").innerHTML;
|
|
|
laytpl(getResTypeTpl).render(data, function (html) {
|
|
|
$('.index-banner-res-group').remove();
|
|
|
$('.index-banner-biz-div').append(html);
|
|
|
|
|
|
//点击告警数字,跳转至告警页面
|
|
|
$("#indexbizhealth [data-index-banner-item='resType'] .gj-detail-info li[data-level]").unbind('click').on("click", function () {
|
|
|
var level = $(this).data("level");
|
|
|
var _resType = $(this).data("restype");
|
|
|
var alarmTotal = $(this).find("b").text();
|
|
|
if (alarmTotal === '0') {
|
|
|
layer.msg('暂无告警', {icon: 0});
|
|
|
return false;
|
|
|
}
|
|
|
//不以资源类型不包括父节点的资源类型 包括阿里云、华为云
|
|
|
if("ALI_CLOUD_PLAT"== _resType || "HUAWEI_CLOUD_PLAT" == _resType){
|
|
|
_resType =_resType.substring(0,_resType.lastIndexOf("_"));
|
|
|
}
|
|
|
$(this).attr("lay-href", "/alarm/activewarning/restype=" + _resType + "/level=" + level);
|
|
|
// $(this).trigger();
|
|
|
});
|
|
|
|
|
|
|
|
|
bottomEvent();
|
|
|
|
|
|
// 点击资源数量
|
|
|
$("#indexbizhealth [data-index-banner-item='resType'] .gj-detail-info li:not([data-level])").unbind('click').on("click", function () {
|
...
|
...
|
@@ -458,6 +491,8 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' |
|
|
//绑定卡片上的事件
|
|
|
function bindCardEvent() {
|
|
|
|
|
|
bottomEvent();
|
|
|
|
|
|
//点击空白处隐藏子菜单
|
|
|
$(document).click(function (event) {
|
|
|
// var _con = $('[data-index-banner-item]');// 设置目标区域
|
...
|
...
|
@@ -1006,8 +1041,14 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' |
|
|
|
|
|
//刷新业务健康状态
|
|
|
function refreshBizHealth() {
|
|
|
var filter = $("#select-content-ul-bus li.listActive").attr('data-val');
|
|
|
if(!filter){
|
|
|
// 过滤无资源的业务
|
|
|
filter = '2';
|
|
|
}
|
|
|
var url = `${common.domainName}/api-web/home/business/getBusHealthResultByAlarm?filter=${filter}&layout=${sessionStorage.getItem("userLayout")}`
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/home/business/getBusHealthResultByAlarm?layout=' + sessionStorage.getItem("userLayout")
|
|
|
url: url
|
|
|
, type: "get"
|
|
|
, done: function (data) {
|
|
|
if (data.code === 0) {
|
...
|
...
|
|