|
@@ -2758,15 +2758,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
@@ -2758,15 +2758,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
2758
|
}
|
2758
|
}
|
2759
|
});
|
2759
|
});
|
2760
|
if ($('.layui-show').find(".detail-left-panel").length == 0) {
|
2760
|
if ($('.layui-show').find(".detail-left-panel").length == 0) {
|
2761
|
- var leftUrl = common.domainName + '/api-web/detail/findRelationGroupByResId'
|
|
|
2762
|
- $.ajax({
|
2761
|
+ var leftUrl = common.domainName + '/api-web/detail/findRelationGroupByResId';
|
|
|
2762
|
+ admin.req({
|
2763
|
url: leftUrl,
|
2763
|
url: leftUrl,
|
2764
|
- type: 'get',
|
|
|
2765
|
- headers: {
|
|
|
2766
|
- "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
|
|
|
2767
|
- },
|
|
|
2768
|
data: {resId: resId},
|
2764
|
data: {resId: resId},
|
2769
|
- success: function (res) {
|
2765
|
+ success(res) {
|
2770
|
if (!res || !res.success) {
|
2766
|
if (!res || !res.success) {
|
2771
|
layer.msg('获取关联信息失败!', {icon: 0});
|
2767
|
layer.msg('获取关联信息失败!', {icon: 0});
|
2772
|
res.map = {};
|
2768
|
res.map = {};
|
|
@@ -2857,8 +2853,111 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
@@ -2857,8 +2853,111 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
2857
|
obj.openDetail(resId, resType, title, false, null, null, 'newTabPage');
|
2853
|
obj.openDetail(resId, resType, title, false, null, null, 'newTabPage');
|
2858
|
});
|
2854
|
});
|
2859
|
}, 0)
|
2855
|
}, 0)
|
|
|
2856
|
+ },
|
|
|
2857
|
+ error() {
|
|
|
2858
|
+
|
2860
|
}
|
2859
|
}
|
2861
|
- })
|
2860
|
+ });
|
|
|
2861
|
+ // $.ajax({
|
|
|
2862
|
+ // url: leftUrl,
|
|
|
2863
|
+ // type: 'get',
|
|
|
2864
|
+ // headers: {
|
|
|
2865
|
+ // "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
|
|
|
2866
|
+ // },
|
|
|
2867
|
+ // data: {resId: resId},
|
|
|
2868
|
+ // success: function (res) {
|
|
|
2869
|
+ // if (!res || !res.success) {
|
|
|
2870
|
+ // layer.msg('获取关联信息失败!', {icon: 0});
|
|
|
2871
|
+ // res.map = {};
|
|
|
2872
|
+ // }
|
|
|
2873
|
+ // setTimeout(function () {
|
|
|
2874
|
+ // // var height = $("#" + tableId).parent().parent().parent().parent().parent().height() - 10;
|
|
|
2875
|
+ // var height = $('.layui-layer-page').find('.layui-layer-content').height();
|
|
|
2876
|
+ // if (!height || height === 0) {
|
|
|
2877
|
+ // height = window.innerHeight
|
|
|
2878
|
+ // }
|
|
|
2879
|
+ // if ($('.layui-layer-page').find('.layui-tab-title').length > 0) {
|
|
|
2880
|
+ // height = height - 70;
|
|
|
2881
|
+ // } else {
|
|
|
2882
|
+ // height = height - 15;
|
|
|
2883
|
+ // }
|
|
|
2884
|
+ // $("#" + tableId).parent().parent().parent().parent().before(laytpl($("#detailPageLeftPanel").html()).render(res))
|
|
|
2885
|
+ // $(".detail-left-panel").css({height: height + "px"})
|
|
|
2886
|
+ // $(".detail-left-panel").find(".detail-left-panel-btn").unbind("click").on("click", function () {
|
|
|
2887
|
+ // var $that = $(this);
|
|
|
2888
|
+ // if ($(".detail-left-panel").width() == 0) {
|
|
|
2889
|
+ // $that.find("i.layui-icon").removeClass("layui-icon-next").addClass("layui-icon-prev")
|
|
|
2890
|
+ // $(".detail-left-panel").animate({width: 270, marginLeft: 0}, 300);
|
|
|
2891
|
+ // $(".detail-left-panel").find(".detail-left-panel-node").show();
|
|
|
2892
|
+ // } else {
|
|
|
2893
|
+ // $that.find("i.layui-icon").removeClass("layui-icon-prev").addClass("layui-icon-next")
|
|
|
2894
|
+ // $(".detail-left-panel").animate({width: 0, marginLeft: 10}, 300);
|
|
|
2895
|
+ // $(".detail-left-panel").find(".detail-left-panel-node").hide();
|
|
|
2896
|
+ // }
|
|
|
2897
|
+ // });
|
|
|
2898
|
+ // $('div.info-box').unbind('click').bind('click', function () {
|
|
|
2899
|
+ // var name = $(this).text();
|
|
|
2900
|
+ // var resId = $(this).data("resid");
|
|
|
2901
|
+ // var resType = '';
|
|
|
2902
|
+ // var ip = $(this).data("ip");
|
|
|
2903
|
+ // var resTypeName = $(this).data("restypename");
|
|
|
2904
|
+ // var admin = $(this).data("admin");
|
|
|
2905
|
+ // var adminName = '';
|
|
|
2906
|
+ // var manageIp = '';
|
|
|
2907
|
+ // var collProtocol = '';
|
|
|
2908
|
+ // $.ajax({
|
|
|
2909
|
+ // url: common.domainName + "/api-web/home/resource/findById?resId=" + resId,
|
|
|
2910
|
+ // async: false,
|
|
|
2911
|
+ // type: 'get',
|
|
|
2912
|
+ // headers: {
|
|
|
2913
|
+ // "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
|
|
|
2914
|
+ // },
|
|
|
2915
|
+ // error: function () {
|
|
|
2916
|
+ // layer.closeAll('loading');
|
|
|
2917
|
+ // },
|
|
|
2918
|
+ // success: function (res) {
|
|
|
2919
|
+ // var data = res.object;
|
|
|
2920
|
+ // resType = data.resType;
|
|
|
2921
|
+ // adminName = data.adminName;
|
|
|
2922
|
+ // manageIp = data.manageIp;
|
|
|
2923
|
+ // collProtocol = data.collProtocol;
|
|
|
2924
|
+ // }
|
|
|
2925
|
+ // })
|
|
|
2926
|
+ // var title = name;
|
|
|
2927
|
+ // if (title && title !== '') {
|
|
|
2928
|
+ // title += '|';
|
|
|
2929
|
+ // }
|
|
|
2930
|
+ // if (resTypeName && resType !== 'HOST_X86SERVER') {
|
|
|
2931
|
+ // title += resTypeName + '|';
|
|
|
2932
|
+ // }
|
|
|
2933
|
+ // if (ip) {
|
|
|
2934
|
+ // if (resType === 'HOST_X86SERVER') {
|
|
|
2935
|
+ // if (collProtocol && (collProtocol.split(",").length > 1 || collProtocol === 'SSH')) {
|
|
|
2936
|
+ // title += '应用IP-' + ip + '|';
|
|
|
2937
|
+ // }
|
|
|
2938
|
+ // } else {
|
|
|
2939
|
+ // title += ip + '|';
|
|
|
2940
|
+ // }
|
|
|
2941
|
+ // }
|
|
|
2942
|
+ // if (resType === 'HOST_X86SERVER' && collProtocol && collProtocol.indexOf('SNMP') !== -1) {
|
|
|
2943
|
+ // if (manageIp) {
|
|
|
2944
|
+ // title += '管理IP-' + manageIp + '|';
|
|
|
2945
|
+ // }
|
|
|
2946
|
+ // }
|
|
|
2947
|
+ // if (adminName) {
|
|
|
2948
|
+ // title += adminName + '|';
|
|
|
2949
|
+ // }
|
|
|
2950
|
+ // if (title.length > 0) {
|
|
|
2951
|
+ // title = title.substr(0, title.length - 1);
|
|
|
2952
|
+ // }
|
|
|
2953
|
+ // layer.closeAll('page');
|
|
|
2954
|
+ // //资源关联关系时弹窗在新的标签页
|
|
|
2955
|
+ // // obj.openDetail(resId, resType, name, false,null,null,'newTabPage');
|
|
|
2956
|
+ // obj.openDetail(resId, resType, title, false, null, null, 'newTabPage');
|
|
|
2957
|
+ // });
|
|
|
2958
|
+ // }, 0)
|
|
|
2959
|
+ // }
|
|
|
2960
|
+ // })
|
2862
|
|
2961
|
|
2863
|
}
|
2962
|
}
|
2864
|
},
|
2963
|
},
|
|
@@ -2996,7 +3095,6 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
@@ -2996,7 +3095,6 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
2996
|
});
|
3095
|
});
|
2997
|
cols.push({field: 'resRemark', title: '备注', align: 'center', sort: false});
|
3096
|
cols.push({field: 'resRemark', title: '备注', align: 'center', sort: false});
|
2998
|
|
3097
|
|
2999
|
- console.log(JSON.stringify(cols))
|
|
|
3000
|
var vhostTable = table.render(Object.assign({
|
3098
|
var vhostTable = table.render(Object.assign({
|
3001
|
elem: '#' + tableId
|
3099
|
elem: '#' + tableId
|
3002
|
, url: common.domainName + '/api-web/home/res-list/' + resType + '?parentId=' + resId
|
3100
|
, url: common.domainName + '/api-web/home/res-list/' + resType + '?parentId=' + resId
|
|
@@ -3376,176 +3474,341 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
|
@@ -3376,176 +3474,341 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele |
3376
|
"provider": res.provider,
|
3474
|
"provider": res.provider,
|
3377
|
"model": res.model
|
3475
|
"model": res.model
|
3378
|
};
|
3476
|
};
|
3379
|
- $.ajax({
|
3477
|
+ admin.req({
|
3380
|
url: common.domainName + "/api-web/favorites/checkResIsExist",
|
3478
|
url: common.domainName + "/api-web/favorites/checkResIsExist",
|
3381
|
async: false,
|
3479
|
async: false,
|
3382
|
data: {
|
3480
|
data: {
|
3383
|
resId: resId,
|
3481
|
resId: resId,
|
3384
|
access_token: layui.sessions.getToken()['access_token']
|
3482
|
access_token: layui.sessions.getToken()['access_token']
|
3385
|
},
|
3483
|
},
|
3386
|
- success: function (response) {
|
|
|
3387
|
- layer.closeAll('loading');
|
|
|
3388
|
- //拼接提示信息
|
|
|
3389
|
- var li = '';
|
|
|
3390
|
- var html = '';
|
|
|
3391
|
- admin.req({
|
|
|
3392
|
- url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
|
|
|
3393
|
- , async: false
|
|
|
3394
|
- , done: function (res) {
|
|
|
3395
|
- if (res.success) {
|
|
|
3396
|
- if (res.map) {
|
|
|
3397
|
- if (res.map.ip) {
|
|
|
3398
|
- li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
|
|
|
3399
|
- '<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3400
|
- + res.map.ip + '</span></li>'
|
|
|
3401
|
- }
|
|
|
3402
|
- if (res.map.resTypeName) {
|
|
|
3403
|
- li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
|
|
|
3404
|
- '<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3405
|
- + res.map.resTypeName + '</span></li>'
|
|
|
3406
|
- }
|
|
|
3407
|
- if (res.map.businessName) {
|
|
|
3408
|
- li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
|
|
|
3409
|
- '<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3410
|
- + res.map.businessName + '</span></li>'
|
|
|
3411
|
- }
|
|
|
3412
|
- if (res.map.taskName) {
|
|
|
3413
|
- li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
|
|
|
3414
|
- '<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3415
|
- + res.map.taskName + '</span></li>'
|
|
|
3416
|
- }
|
|
|
3417
|
- if (res.map.collectorName) {
|
|
|
3418
|
- li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
|
|
|
3419
|
- '<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3420
|
- + res.map.collectorName + '</span></li>'
|
|
|
3421
|
- }
|
|
|
3422
|
- if (res.map.domainName) {
|
|
|
3423
|
- li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
|
|
|
3424
|
- '<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3425
|
- + res.map.domainName + '</span></li>'
|
|
|
3426
|
- }
|
|
|
3427
|
- if (res.map.extendCol3) {
|
|
|
3428
|
- li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
|
|
|
3429
|
- '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3430
|
- + res.map.extendCol3 + '</span></li>'
|
|
|
3431
|
- }
|
|
|
3432
|
- if (res.map.colonyName) {
|
|
|
3433
|
- li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
|
|
|
3434
|
- '<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3435
|
- + res.map.colonyName + '</span></li>'
|
|
|
3436
|
- }
|
|
|
3437
|
- if (res.map.resNameHost) {
|
|
|
3438
|
- li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
|
|
|
3439
|
- '<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3440
|
- + res.map.resNameHost + '</span></li>'
|
|
|
3441
|
- }
|
|
|
3442
|
- if (res.map.os) {
|
|
|
3443
|
- li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
|
|
|
3444
|
- '<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3445
|
- + res.map.os + '</span></li>'
|
|
|
3446
|
- }
|
|
|
3447
|
- if (res.map.provider) {
|
|
|
3448
|
- li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
|
|
|
3449
|
- '<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3450
|
- + res.map.provider + '</span></li>'
|
|
|
3451
|
- }
|
|
|
3452
|
- if (res.map.model) {
|
|
|
3453
|
- li += ' <li><span style="text-align:left;width:40%">型号</span>' +
|
|
|
3454
|
- '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3455
|
- + res.map.model + '</span></li>'
|
|
|
3456
|
- }
|
|
|
3457
|
- if (res.map.resPositon) {
|
|
|
3458
|
- li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
|
|
|
3459
|
- '<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3460
|
- + res.map.resPositon + '</span></li>'
|
|
|
3461
|
- }
|
|
|
3462
|
- if (resId) {
|
|
|
3463
|
- li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
|
|
|
3464
|
- '<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3465
|
- + resId + '</span></li>'
|
|
|
3466
|
- }
|
3484
|
+ }).done(function (response) {
|
|
|
3485
|
+ layer.closeAll('loading');
|
|
|
3486
|
+ //拼接提示信息
|
|
|
3487
|
+ var li = '';
|
|
|
3488
|
+ var html = '';
|
|
|
3489
|
+ admin.req({
|
|
|
3490
|
+ url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
|
|
|
3491
|
+ , async: false
|
|
|
3492
|
+ , done: function (res) {
|
|
|
3493
|
+ if (res.success) {
|
|
|
3494
|
+ if (res.map) {
|
|
|
3495
|
+ if (res.map.ip) {
|
|
|
3496
|
+ li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
|
|
|
3497
|
+ '<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3498
|
+ + res.map.ip + '</span></li>'
|
|
|
3499
|
+ }
|
|
|
3500
|
+ if (res.map.resTypeName) {
|
|
|
3501
|
+ li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
|
|
|
3502
|
+ '<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3503
|
+ + res.map.resTypeName + '</span></li>'
|
|
|
3504
|
+ }
|
|
|
3505
|
+ if (res.map.businessName) {
|
|
|
3506
|
+ li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
|
|
|
3507
|
+ '<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3508
|
+ + res.map.businessName + '</span></li>'
|
|
|
3509
|
+ }
|
|
|
3510
|
+ if (res.map.taskName) {
|
|
|
3511
|
+ li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
|
|
|
3512
|
+ '<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3513
|
+ + res.map.taskName + '</span></li>'
|
|
|
3514
|
+ }
|
|
|
3515
|
+ if (res.map.collectorName) {
|
|
|
3516
|
+ li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
|
|
|
3517
|
+ '<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3518
|
+ + res.map.collectorName + '</span></li>'
|
|
|
3519
|
+ }
|
|
|
3520
|
+ if (res.map.domainName) {
|
|
|
3521
|
+ li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
|
|
|
3522
|
+ '<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3523
|
+ + res.map.domainName + '</span></li>'
|
|
|
3524
|
+ }
|
|
|
3525
|
+ if (res.map.extendCol3) {
|
|
|
3526
|
+ li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
|
|
|
3527
|
+ '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3528
|
+ + res.map.extendCol3 + '</span></li>'
|
|
|
3529
|
+ }
|
|
|
3530
|
+ if (res.map.colonyName) {
|
|
|
3531
|
+ li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
|
|
|
3532
|
+ '<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3533
|
+ + res.map.colonyName + '</span></li>'
|
|
|
3534
|
+ }
|
|
|
3535
|
+ if (res.map.resNameHost) {
|
|
|
3536
|
+ li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
|
|
|
3537
|
+ '<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3538
|
+ + res.map.resNameHost + '</span></li>'
|
|
|
3539
|
+ }
|
|
|
3540
|
+ if (res.map.os) {
|
|
|
3541
|
+ li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
|
|
|
3542
|
+ '<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3543
|
+ + res.map.os + '</span></li>'
|
|
|
3544
|
+ }
|
|
|
3545
|
+ if (res.map.provider) {
|
|
|
3546
|
+ li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
|
|
|
3547
|
+ '<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3548
|
+ + res.map.provider + '</span></li>'
|
|
|
3549
|
+ }
|
|
|
3550
|
+ if (res.map.model) {
|
|
|
3551
|
+ li += ' <li><span style="text-align:left;width:40%">型号</span>' +
|
|
|
3552
|
+ '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3553
|
+ + res.map.model + '</span></li>'
|
|
|
3554
|
+ }
|
|
|
3555
|
+ if (res.map.resPositon) {
|
|
|
3556
|
+ li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
|
|
|
3557
|
+ '<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3558
|
+ + res.map.resPositon + '</span></li>'
|
|
|
3559
|
+ }
|
|
|
3560
|
+ if (resId) {
|
|
|
3561
|
+ li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
|
|
|
3562
|
+ '<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3563
|
+ + resId + '</span></li>'
|
3467
|
}
|
3564
|
}
|
3468
|
}
|
3565
|
}
|
3469
|
}
|
3566
|
}
|
3470
|
- });
|
|
|
3471
|
- var uuid = generateUUID();
|
|
|
3472
|
- //start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
|
|
|
3473
|
- var resName = res.resName;
|
|
|
3474
|
- var resTypeName = res.resTypeName;
|
|
|
3475
|
- var adminName = res.adminName;
|
|
|
3476
|
- //end lsq 2022-04-25
|
|
|
3477
|
-
|
|
|
3478
|
- if (li != '') {
|
|
|
3479
|
- html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
|
|
|
3480
|
- }
|
|
|
3481
|
- if (html != '') {
|
|
|
3482
|
- title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >${html}</i>`
|
|
|
3483
|
- }
|
|
|
3484
|
- title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
3485
|
- title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
3486
|
- if (response && response.success && response.count > 0) {
|
|
|
3487
|
- var favIds = response.map.favIds;
|
|
|
3488
|
- title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
|
|
|
3489
|
- } else {
|
|
|
3490
|
- title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
3491
|
- }
|
|
|
3492
|
- title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
3493
|
- title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
3494
|
- //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
3495
|
- 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>`;
|
|
|
3496
|
- if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
3497
|
- /*
|
|
|
3498
|
- 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>`;
|
|
|
3499
|
- */
|
|
|
3500
|
- }
|
|
|
3501
|
- if (res.state == 'new' && hardwareFlag.endsWith("N")) {
|
|
|
3502
|
- layer.alert('资源未监控!', {icon: 0});
|
|
|
3503
|
- return;
|
|
|
3504
|
- }
|
|
|
3505
|
- if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
|
|
|
3506
|
- layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
|
|
|
3507
|
- return;
|
|
|
3508
|
}
|
3567
|
}
|
3509
|
- //lsq 停机计划跑马灯 2022-08-19
|
|
|
3510
|
- 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>`
|
|
|
3511
|
- 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>`;
|
|
|
3512
|
- 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>`;
|
|
|
3513
|
-
|
|
|
3514
|
- obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
|
|
|
3515
|
- },
|
|
|
3516
|
- error: function () {
|
|
|
3517
|
- layer.closeAll('loading');
|
|
|
3518
|
- title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息"></i>'
|
|
|
3519
|
- title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
3520
|
- title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
3568
|
+ });
|
|
|
3569
|
+ var uuid = generateUUID();
|
|
|
3570
|
+ //start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
|
|
|
3571
|
+ var resName = res.resName;
|
|
|
3572
|
+ var resTypeName = res.resTypeName;
|
|
|
3573
|
+ var adminName = res.adminName;
|
|
|
3574
|
+ //end lsq 2022-04-25
|
|
|
3575
|
+
|
|
|
3576
|
+ if (li != '') {
|
|
|
3577
|
+ html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
|
|
|
3578
|
+ }
|
|
|
3579
|
+ if (html != '') {
|
|
|
3580
|
+ title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >${html}</i>`
|
|
|
3581
|
+ }
|
|
|
3582
|
+ title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
3583
|
+ title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
3584
|
+ if (response && response.success && response.count > 0) {
|
|
|
3585
|
+ var favIds = response.map.favIds;
|
|
|
3586
|
+ title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
|
|
|
3587
|
+ } else {
|
3521
|
title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
3588
|
title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
3522
|
- title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
3523
|
- title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
3524
|
- //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
3525
|
- 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>`;
|
|
|
3526
|
- 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>`;
|
|
|
3527
|
- 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>`;
|
|
|
3528
|
- if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
3529
|
- /*
|
|
|
3530
|
- 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>`;
|
|
|
3531
|
- */
|
|
|
3532
|
- }
|
|
|
3533
|
- obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
|
|
|
3534
|
}
|
3589
|
}
|
|
|
3590
|
+ title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
3591
|
+ title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
3592
|
+ //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
3593
|
+ 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>`;
|
|
|
3594
|
+ if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
3595
|
+ /*
|
|
|
3596
|
+ 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>`;
|
|
|
3597
|
+ */
|
|
|
3598
|
+ }
|
|
|
3599
|
+ if (res.state == 'new' && hardwareFlag.endsWith("N")) {
|
|
|
3600
|
+ layer.alert('资源未监控!', {icon: 0});
|
|
|
3601
|
+ return;
|
|
|
3602
|
+ }
|
|
|
3603
|
+ if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
|
|
|
3604
|
+ layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
|
|
|
3605
|
+ return;
|
|
|
3606
|
+ }
|
|
|
3607
|
+ //lsq 停机计划跑马灯 2022-08-19
|
|
|
3608
|
+ 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>`
|
|
|
3609
|
+ 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>`;
|
|
|
3610
|
+ 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>`;
|
|
|
3611
|
+ obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
|
|
|
3612
|
+ }).error(function () {
|
|
|
3613
|
+ layer.closeAll('loading');
|
|
|
3614
|
+ title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息"></i>'
|
|
|
3615
|
+ title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
3616
|
+ title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
3617
|
+ title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
3618
|
+ title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
3619
|
+ title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
3620
|
+ //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
3621
|
+ 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>`;
|
|
|
3622
|
+ 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>`;
|
|
|
3623
|
+ 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>`;
|
|
|
3624
|
+ if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
3625
|
+ /*
|
|
|
3626
|
+ 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>`;
|
|
|
3627
|
+ */
|
|
|
3628
|
+ }
|
|
|
3629
|
+ obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
|
3535
|
});
|
3630
|
});
|
|
|
3631
|
+ // $.ajax({
|
|
|
3632
|
+ // url: common.domainName + "/api-web/favorites/checkResIsExist",
|
|
|
3633
|
+ // async: false,
|
|
|
3634
|
+ // data: {
|
|
|
3635
|
+ // resId: resId,
|
|
|
3636
|
+ // access_token: layui.sessions.getToken()['access_token']
|
|
|
3637
|
+ // },
|
|
|
3638
|
+ // success: function (response) {
|
|
|
3639
|
+ // layer.closeAll('loading');
|
|
|
3640
|
+ // //拼接提示信息
|
|
|
3641
|
+ // var li = '';
|
|
|
3642
|
+ // var html = '';
|
|
|
3643
|
+ // admin.req({
|
|
|
3644
|
+ // url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
|
|
|
3645
|
+ // , async: false
|
|
|
3646
|
+ // , done: function (res) {
|
|
|
3647
|
+ // if (res.success) {
|
|
|
3648
|
+ // if (res.map) {
|
|
|
3649
|
+ // if (res.map.ip) {
|
|
|
3650
|
+ // li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
|
|
|
3651
|
+ // '<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3652
|
+ // + res.map.ip + '</span></li>'
|
|
|
3653
|
+ // }
|
|
|
3654
|
+ // if (res.map.resTypeName) {
|
|
|
3655
|
+ // li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
|
|
|
3656
|
+ // '<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3657
|
+ // + res.map.resTypeName + '</span></li>'
|
|
|
3658
|
+ // }
|
|
|
3659
|
+ // if (res.map.businessName) {
|
|
|
3660
|
+ // li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
|
|
|
3661
|
+ // '<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3662
|
+ // + res.map.businessName + '</span></li>'
|
|
|
3663
|
+ // }
|
|
|
3664
|
+ // if (res.map.taskName) {
|
|
|
3665
|
+ // li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
|
|
|
3666
|
+ // '<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3667
|
+ // + res.map.taskName + '</span></li>'
|
|
|
3668
|
+ // }
|
|
|
3669
|
+ // if (res.map.collectorName) {
|
|
|
3670
|
+ // li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
|
|
|
3671
|
+ // '<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3672
|
+ // + res.map.collectorName + '</span></li>'
|
|
|
3673
|
+ // }
|
|
|
3674
|
+ // if (res.map.domainName) {
|
|
|
3675
|
+ // li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
|
|
|
3676
|
+ // '<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3677
|
+ // + res.map.domainName + '</span></li>'
|
|
|
3678
|
+ // }
|
|
|
3679
|
+ // if (res.map.extendCol3) {
|
|
|
3680
|
+ // li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
|
|
|
3681
|
+ // '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3682
|
+ // + res.map.extendCol3 + '</span></li>'
|
|
|
3683
|
+ // }
|
|
|
3684
|
+ // if (res.map.colonyName) {
|
|
|
3685
|
+ // li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
|
|
|
3686
|
+ // '<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3687
|
+ // + res.map.colonyName + '</span></li>'
|
|
|
3688
|
+ // }
|
|
|
3689
|
+ // if (res.map.resNameHost) {
|
|
|
3690
|
+ // li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
|
|
|
3691
|
+ // '<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3692
|
+ // + res.map.resNameHost + '</span></li>'
|
|
|
3693
|
+ // }
|
|
|
3694
|
+ // if (res.map.os) {
|
|
|
3695
|
+ // li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
|
|
|
3696
|
+ // '<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3697
|
+ // + res.map.os + '</span></li>'
|
|
|
3698
|
+ // }
|
|
|
3699
|
+ // if (res.map.provider) {
|
|
|
3700
|
+ // li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
|
|
|
3701
|
+ // '<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3702
|
+ // + res.map.provider + '</span></li>'
|
|
|
3703
|
+ // }
|
|
|
3704
|
+ // if (res.map.model) {
|
|
|
3705
|
+ // li += ' <li><span style="text-align:left;width:40%">型号</span>' +
|
|
|
3706
|
+ // '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3707
|
+ // + res.map.model + '</span></li>'
|
|
|
3708
|
+ // }
|
|
|
3709
|
+ // if (res.map.resPositon) {
|
|
|
3710
|
+ // li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
|
|
|
3711
|
+ // '<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3712
|
+ // + res.map.resPositon + '</span></li>'
|
|
|
3713
|
+ // }
|
|
|
3714
|
+ // if (resId) {
|
|
|
3715
|
+ // li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
|
|
|
3716
|
+ // '<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
|
|
|
3717
|
+ // + resId + '</span></li>'
|
|
|
3718
|
+ // }
|
|
|
3719
|
+ // }
|
|
|
3720
|
+ // }
|
|
|
3721
|
+ // }
|
|
|
3722
|
+ // });
|
|
|
3723
|
+ // var uuid = generateUUID();
|
|
|
3724
|
+ // //start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
|
|
|
3725
|
+ // var resName = res.resName;
|
|
|
3726
|
+ // var resTypeName = res.resTypeName;
|
|
|
3727
|
+ // var adminName = res.adminName;
|
|
|
3728
|
+ // //end lsq 2022-04-25
|
|
|
3729
|
+ //
|
|
|
3730
|
+ // if (li != '') {
|
|
|
3731
|
+ // html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
|
|
|
3732
|
+ // }
|
|
|
3733
|
+ // if (html != '') {
|
|
|
3734
|
+ // title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >${html}</i>`
|
|
|
3735
|
+ // }
|
|
|
3736
|
+ // title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
3737
|
+ // title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
3738
|
+ // if (response && response.success && response.count > 0) {
|
|
|
3739
|
+ // var favIds = response.map.favIds;
|
|
|
3740
|
+ // title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
|
|
|
3741
|
+ // } else {
|
|
|
3742
|
+ // title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
3743
|
+ // }
|
|
|
3744
|
+ // title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
3745
|
+ // title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
3746
|
+ // //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
3747
|
+ // 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>`;
|
|
|
3748
|
+ // if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
3749
|
+ // /*
|
|
|
3750
|
+ // 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>`;
|
|
|
3751
|
+ // */
|
|
|
3752
|
+ // }
|
|
|
3753
|
+ // if (res.state == 'new' && hardwareFlag.endsWith("N")) {
|
|
|
3754
|
+ // layer.alert('资源未监控!', {icon: 0});
|
|
|
3755
|
+ // return;
|
|
|
3756
|
+ // }
|
|
|
3757
|
+ // if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
|
|
|
3758
|
+ // layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
|
|
|
3759
|
+ // return;
|
|
|
3760
|
+ // }
|
|
|
3761
|
+ // //lsq 停机计划跑马灯 2022-08-19
|
|
|
3762
|
+ // 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>`
|
|
|
3763
|
+ // 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>`;
|
|
|
3764
|
+ // 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>`;
|
|
|
3765
|
+ //
|
|
|
3766
|
+ // obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
|
|
|
3767
|
+ // },
|
|
|
3768
|
+ // error: function () {
|
|
|
3769
|
+ // layer.closeAll('loading');
|
|
|
3770
|
+ // title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息"></i>'
|
|
|
3771
|
+ // title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
|
|
|
3772
|
+ // title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
|
|
|
3773
|
+ // title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
|
|
|
3774
|
+ // title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`;
|
|
|
3775
|
+ // title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
|
|
|
3776
|
+ // //lsq 2022-04-25 增加ping详情提交按钮
|
|
|
3777
|
+ // 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>`;
|
|
|
3778
|
+ // 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>`;
|
|
|
3779
|
+ // 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>`;
|
|
|
3780
|
+ // if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
|
|
|
3781
|
+ // /*
|
|
|
3782
|
+ // 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>`;
|
|
|
3783
|
+ // */
|
|
|
3784
|
+ // }
|
|
|
3785
|
+ // obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
|
|
|
3786
|
+ // }
|
|
|
3787
|
+ // });
|
3536
|
});
|
3788
|
});
|
3537
|
},
|
3789
|
},
|
3538
|
alarmData: new Object(),
|
3790
|
alarmData: new Object(),
|
3539
|
loadResAlarm: function (resId) {
|
3791
|
loadResAlarm: function (resId) {
|
3540
|
- $.ajax({
|
|
|
3541
|
- type: 'get',
|
3792
|
+ admin.req({
|
3542
|
url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId,
|
3793
|
url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId,
|
3543
|
- contentType: "application/json; charset=utf-8",
|
|
|
3544
|
async: false,
|
3794
|
async: false,
|
3545
|
- success: function (res) {
|
3795
|
+ data: {},
|
|
|
3796
|
+ success(res) {
|
3546
|
obj.alarmData = res.data;
|
3797
|
obj.alarmData = res.data;
|
|
|
3798
|
+ },
|
|
|
3799
|
+ error() {
|
|
|
3800
|
+ //layer.closeAll('loading');
|
3547
|
}
|
3801
|
}
|
3548
|
});
|
3802
|
});
|
|
|
3803
|
+ // $.ajax({
|
|
|
3804
|
+ // type: 'get',
|
|
|
3805
|
+ // url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId,
|
|
|
3806
|
+ // contentType: "application/json; charset=utf-8",
|
|
|
3807
|
+ // async: false,
|
|
|
3808
|
+ // success: function (res) {
|
|
|
3809
|
+ // obj.alarmData = res.data;
|
|
|
3810
|
+ // }
|
|
|
3811
|
+ // });
|
3549
|
},
|
3812
|
},
|
3550
|
alarmEleMatchStyle: function (flag, kpiId) {
|
3813
|
alarmEleMatchStyle: function (flag, kpiId) {
|
3551
|
var tempAlarms = obj.alarmData;
|
3814
|
var tempAlarms = obj.alarmData;
|