Authored by 王涛

Merge branch 'master-V32-XuHaoJie' into 'master'

杭州-业务视图-华为云虚拟机列宽优化



See merge request !193
@@ -366,37 +366,37 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', @@ -366,37 +366,37 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
366 "HUAWEI_CLOUD_PHYSICSHOST": [ 366 "HUAWEI_CLOUD_PHYSICSHOST": [
367 //{type: 'numbers', title: '序号', align: 'center', fixed: 'left'}, 367 //{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
368 { 368 {
369 - field: 'resName', title: '资源名称', minWidth: 250, sort: true, 369 + field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
370 templet: '#resindex_resName' 370 templet: '#resindex_resName'
371 }, 371 },
372 - {field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true}, 372 + {field: 'ip', title: 'IP地址', minWidth: x_130, align: 'center', sort: true},
373 {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true}, 373 {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true},
374 {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true}, 374 {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
375 - {field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},  
376 - {field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},  
377 - {field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},  
378 - {field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},  
379 - {field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},  
380 - {field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true}, 375 + {field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
  376 + {field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
  377 + {field: 'adminPhone', title: '负责人电话', minWidth: x_120, align: 'center', sort: true},
  378 + {field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
  379 + {field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
  380 + {field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
381 // 2021-11-22 徐毫杰 连接状态无数据改成展示主机状态 381 // 2021-11-22 徐毫杰 连接状态无数据改成展示主机状态
382 {field: 'hostState', title: '主机状态', align: 'center', minWidth: x_110, templet: '#hostStateTpl', sort: true} 382 {field: 'hostState', title: '主机状态', align: 'center', minWidth: x_110, templet: '#hostStateTpl', sort: true}
383 ], 383 ],
384 "HUAWEI_CLOUD_VIRTUALHOST": [ 384 "HUAWEI_CLOUD_VIRTUALHOST": [
385 //{type: 'numbers', title: '序号', align: 'center', fixed: 'left'}, 385 //{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
386 { 386 {
387 - field: 'resName', title: '资源名称', minWidth: 250, sort: true, 387 + field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
388 templet: '#resindex_resName' 388 templet: '#resindex_resName'
389 }, 389 },
390 - {field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true}, 390 + {field: 'ip', title: 'IP地址', minWidth: x_130, align: 'center', sort: true},
391 {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true}, 391 {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true},
392 {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true}, 392 {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
393 - {field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},  
394 - {field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},  
395 - {field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},  
396 - {field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},  
397 - {field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},  
398 - {field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},  
399 - {field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true} 393 + {field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
  394 + {field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
  395 + {field: 'adminPhone', title: '负责人电话', minWidth: x_130, align: 'center', sort: true},
  396 + {field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
  397 + {field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
  398 + {field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
  399 + {field: 'linkState', title: '连接状态', align: 'center', minWidth: x_120, templet: '#linkStateTpl', sort: true}
400 ], 400 ],
401 "HUAWEI_CLOUD_STORAGE": [ 401 "HUAWEI_CLOUD_STORAGE": [
402 //{type: 'numbers', title: '序号', align: 'center', fixed: 'left'}, 402 //{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
@@ -724,7 +724,7 @@ @@ -724,7 +724,7 @@
724 {{# 724 {{#
725 var linkStateHtml = ''; 725 var linkStateHtml = '';
726 var linkStateTips = '无连接信息'; 726 var linkStateTips = '无连接信息';
727 - if(d.linkStateList && d.linkStateList.length) { 727 + if(d.linkStateList && d.linkStateList.length >=0 ) {
728 linkStateTips = ''; 728 linkStateTips = '';
729 if(d.linkStateList.length == 1) { 729 if(d.linkStateList.length == 1) {
730 var linkState = d.linkStateList[0]; 730 var linkState = d.linkStateList[0];
@@ -737,11 +737,31 @@ @@ -737,11 +737,31 @@
737 data-message="${d.message}" 737 data-message="${d.message}"
738 data-state="${d.state}" 738 data-state="${d.state}"
739 data-id="${d.resId}_bizdanger" 739 data-id="${d.resId}_bizdanger"
740 - class="layui-btn showTip layui-btn-danger layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click"> 740 + class="layui-btn layui-btn-danger layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click">
741 失败 741 失败
742 </button>`; 742 </button>`;
743 } 743 }
744 } else { 744 } else {
  745 + if(d.linkStateList.length == 0){
  746 + if(d.hostState == 'active' || d.hostState == 'connected' || d.hostState == '正常' ){
  747 + linkStateHtml = '<button type="button" class="layui-btn layui-btn-radius layui-bg-green layui-btn-xs p-0-15 cant-click">成功</button>';
  748 + linkStateTips += `<li class='li-link-state-tips-red'>自动发现: 连接成功</li>`;
  749 + }else{
  750 + linkStateHtml = `<button type="button"
  751 + id="${d.resId}_bizdanger"
  752 + data-message="${d.message}"
  753 + data-state="${d.state}"
  754 + data-id="${d.resId}_bizdanger"
  755 + class="layui-btn layui-btn-danger layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click">
  756 + 失败
  757 + </button>`;
  758 + if(d.hostState!=''){
  759 + linkStateTips += `<li class='li-link-state-tips-red'>自动发现: 连接失败</li>`;
  760 + }else{
  761 + linkStateTips += `<li class='li-link-state-tips-red'>ssh: 连接失败</li>`;
  762 + }
  763 + }
  764 + }else{
745 linkStateTips += `<ul class='ul-link-state-tips'>`; 765 linkStateTips += `<ul class='ul-link-state-tips'>`;
746 layui.each(d.linkStateList, function(index, value) { 766 layui.each(d.linkStateList, function(index, value) {
747 if(value.state.indexOf('成功') !== -1) { 767 if(value.state.indexOf('成功') !== -1) {
@@ -755,6 +775,7 @@ @@ -755,6 +775,7 @@
755 linkStateTips += '</ul>'; 775 linkStateTips += '</ul>';
756 } 776 }
757 } 777 }
  778 + }
758 }} 779 }}
759 <div class="div-link-state-list" lay-tips="{{linkStateTips}}"> 780 <div class="div-link-state-list" lay-tips="{{linkStateTips}}">
760 {{linkStateHtml}} 781 {{linkStateHtml}}