Authored by 张凯

Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into joke

... ... @@ -337,30 +337,31 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
{field: 'cpuSetRate', title: 'CPU分配率', align: 'center', minWidth: 120, templet: '#cpuSetRateTpl'},
{field: 'memorySetRate', title: '内存分配率', align: 'center', minWidth: 120, templet: '#memorySetRateTpl'},
{field: 'storageSetRate', title: '存储分配率', align: 'center', minWidth: 120, templet: '#storageSetRateTpl'},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'resTypeName', title: '资源类型', minWidth: 101, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: 120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: 120, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: 120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: 120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'hostState', title: '主机状态', align: 'center', minWidth: x_110, templet: '#hostStateTpl', sort: true},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true}
{field: 'clusterState', title: '资源池状态', align: 'center', minWidth: x_120,templet:'#clusterStateTpl'},
//{field: 'hostState', title: '主机状态', align: 'center', minWidth: x_110, templet: '#hostStateTpl', sort: true},
{field: 'lastColTime', title: '最近采集时间', minWidth: 160, align: 'center', sort: true}
],
"HUAWEI_CLOUD_CLUSTER": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'cpuSetRate', title: 'CPU分配率', align: 'center', minWidth: 120, templet: '#cpuSetRateTpl'},
{field: 'memorySetRate', title: '内存分配率', align: 'center', minWidth: 120, templet: '#memorySetRateTpl'},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
{field: 'cpuSetRate', title: 'CPU分配率', align: 'center', minWidth: x_120, templet: '#cpuSetRateTpl'},
{field: 'memorySetRate', title: '内存分配率', align: 'center', minWidth: x_120, templet: '#memorySetRateTpl'},
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_120, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: 160, align: 'center', sort: true}
// {field: 'linkState', title: '连接状态', align: 'center', minWidth: x_120, templet: '#linkStateTpl', sort: true}
],
"HUAWEI_CLOUD_PHYSICSHOST": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
... ... @@ -400,58 +401,58 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
"HUAWEI_CLOUD_STORAGE": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true},
{field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_120, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
{field: 'runState', title: '运行状态', minWidth: x_120, align: 'center', sort: true,templet: '#runStateTpl'}
],
"HUAWEI_CLOUD_SWITCHBOARD": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{field: 'ip', title: 'IP地址', minWidth: x_110, align: 'center', sort: true},
// {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true},
// {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_120, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWdth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
// {field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
],
"HUAWEI_CLOUD_FIREWALL": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{field: 'ip', title: 'IP地址', minWidth: x_120, align: 'center', sort: true},
// {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true},
// {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_130, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true}
//{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
],
"ALI_CLOUD_ECS": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
... ... @@ -459,60 +460,61 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
{field: 'memorySize', title: '内存大小', align: 'center', minWidth: x_120, sort: true, templet: '<div>{{d.memorySize}} GB</div>'},
{field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
{field: 'ptName', title: '所属平台', minWidth: x_130, align: 'center', sort: true},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_130, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', minWidth: x_120, templet: '#linkStateTpl', sort: true}
],
"ALI_CLOUD_RDS": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{field: 'ip', title: 'IP地址', minWidth: x_130, align: 'center', sort: true},
{field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true},
{field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_130, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
// {field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
],
"ALI_CLOUD_SLB": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
{field: 'ip', title: 'IP地址', minWidth: x_130, align: 'center', sort: true},
{field: 'resTypeName', title: '资源类型', minWidth: x_120, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_130, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
{field: 'runState', title: '运行状态', minWidth: x_120, align: 'center', sort: true,templet: '#runStateTpl'}
//{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
],
"ALI_CLOUD_OSS": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName'
},
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
// {field: 'ip', title: 'IP地址', minWidth: x_130, align: 'center', sort: true},
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_130, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_120, align: 'center', sort: true},
// {field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true}
],
"ALI_ARMS": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
... ... @@ -2620,9 +2622,9 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
return false;
}
// 阿里云,华为云不能点击
if(resType == 'ALI_CLOUD_PLAT' || resType == 'HUAWEI_CLOUD_PLAT'){
return false;
}
// if(resType == 'ALI_CLOUD_PLAT' || resType == 'HUAWEI_CLOUD_PLAT'){
// return false;
// }
return true;
},
... ...
... ... @@ -3298,8 +3298,13 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
admin.req({
url: common.domainName + url
}).done(function (res) {
var data = res.data;
var li = "";
if(res.data && res.data.length > 0){
var data = res.data;
var li = "";
}else{
var li ='<div style="text-align:center;">'
+ '<i style="line-height: 150px; padding:20px;font-style:normal;">'+"暂无数据"+'</i>' + '</div>'
}
$.each(data, function (i, v) {
var valueStr = '';
if (v.value != 'null'){
... ...
/**
* @desc 华为云集群
* @author joke
* @date 2020/4/12 23:35
**/
layui.define(['commonDetail','common'], function (exports) {
var commonDetail = layui.commonDetail;
var common = layui.common;
//对外暴露的接口
exports('huawei_cloud_plat', function (data) {
var resId = '';
var showFlag = common.getUrlParam("show");
if(showFlag && showFlag == '0'){
resId = common.getUrlParam("resId");
}else{
resId = data.resId;
}
commonDetail.bindTips();
//基本信息
var jbxxKpi = "KPIE13DD9A3,KPI9E5E1B3E,KPIF74D9D2B,KPI1584BE1C,KPI5B7998C9";
reload()
//渲染页面
function reload() {
//资源状态
commonDetail.renderResHealth("huawei_cloud_plat_state",resId);
//基本信息
commonDetail.renderText("huawei_cloud_plat_baseinfo",resId,jbxxKpi);
//存储空间使用率走势(12小时)
commonDetail.renderLineCharat("huawei_cloud_plat_storage_linechart",resId,"KPI5E148DBE","存储空间使用率","storage");
// CPU使用率走势(12小时)
commonDetail.renderLineCharat("huawei_cloud_plat_cpu_linechart",resId,"KPI7054BC34","CPU使用率","cpu");
// 内存使用率走势(12小时)
commonDetail.renderLineCharat("huawei_cloud_plat_memeryuse_linechart",resId,"KPI31CB8D97","内存使用率","mem");
// 存储分配率走势(12小时)
commonDetail.renderLineCharat("huawei_cloud_plat_allot_linechart",resId,"KPI46BAA9BE","存储分配率","");
// CPU分配率走势(12小时)
commonDetail.renderLineCharat("huawei_cloud_plat_cpuset_linechart",resId,"KPIBFA3F5CD","CPU分配率","");
// 内存分配率走势(12小时)
commonDetail.renderLineCharat("huawei_cloud_plat_memeryset_linechart",resId,"KPIC40A80AC","内存分配率","");
//活动告警
commonDetail.renderActiveAlarms("huawei_cloud_plat_alarms",resId);
}
//定时任务
var timer = setInterval(function () {
reload()
},commonDetail.timerTime);
commonDetail.detailTimer.push(timer);
});
});
\ No newline at end of file
... ...
... ... @@ -1031,14 +1031,14 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
noClick($(this));
});
//华为云,阿里云不让点击,并且提示暂无监控信息
var $hds = $('span[data-restype="HUAWEI_CLOUD_PLAT"]');
$.each($hds, function (i, v) {
noClick($(this));
});
var $hds = $('span[data-restype="ALI_CLOUD_PLAT"]');
$.each($hds, function (i, v) {
noClick($(this));
});
// var $hds = $('span[data-restype="HUAWEI_CLOUD_PLAT"]');
// $.each($hds, function (i, v) {
// noClick($(this));
// });
// var $hds = $('span[data-restype="ALI_CLOUD_PLAT"]');
// $.each($hds, function (i, v) {
// noClick($(this));
// });
soulTable.render(this)
... ...
<!--华为云集群-->
<article class="page-container template">
<div class="page-panel">
<div class="main">
<div class="layui-card template_detail_content">
<div class="layui-card-body">
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">资源状态</h5>
<div class="res-state" id="huawei_cloud_plat_state"></div>
</div>
<div class="lay-row-item lay-row-item--auto-width">
<h5 class="lay-row-title">基本信息<i data-id="huawei_cloud_plat_baseinfo" class="iconfont detail_base_info">&#xe61e;</i></h5>
<ul class="info-table" id="huawei_cloud_plat_baseinfo"></ul>
</div>
<div class="lay-row-item lay-row-item--auto-width">
<div class="lay-row-item">
<h5 class="lay-row-title">存储使用率走势(12小时)</h5>
<div id="huawei_cloud_plat_storage_linechart" class="detail_line_chart"></div>
</div>
</div>
<div class="lay-row-item lay-row-item--auto-width">
<h5 class="lay-row-title">存储分配率走势(12小时)</h5>
<div id="huawei_cloud_plat_allot_linechart" class="detail_line_chart"></div>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">CPU使用率走势(12小时)</h5>
<div id="huawei_cloud_plat_cpu_linechart" class="detail_line_chart"></div>
</div>
<div class="lay-row-item">
<h5 class="lay-row-title">内存使用率走势(12小时)</h5>
<div id="huawei_cloud_plat_memeryuse_linechart" class="detail_line_chart"></div>
</div>
<div class="lay-row-item">
<h5 class="lay-row-title">CPU分配率走势(12小时)</h5>
<div id="huawei_cloud_plat_cpuset_linechart" class="detail_line_chart"></div>
</div>
<div class="lay-row-item">
<h5 class="lay-row-title">内存分配率走势(12小时)</h5>
<div id="huawei_cloud_plat_memeryset_linechart" class="detail_line_chart"></div>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">实时告警动态</h5>
<div id="huawei_cloud_plat_alarms"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</article>
<textarea id="huawei_cloud_plat_param_id" style="display: none;">{{d}}</textarea>
<script>
layui.use('huawei_cloud_plat', function (fn) {
var $ = layui.$;
var parm = $("#huawei_cloud_plat_param_id").val();
if(parm.indexOf('{{d') != -1){
fn();
}else{
fn(JSON.parse(parm));
}
});
</script>
\ No newline at end of file
... ...
... ... @@ -11,7 +11,7 @@
</div>
<div class="lay-row-item lay-row-item--small">
<h5 class="lay-row-title">维保信息</h5>
<ul class="info-table" id="huawei_cloud_storage_wbinfo"></ul>
<div class="info-table" id="huawei_cloud_storage_wbinfo"></div>
</div>
</div>
<div class="lay-row">
... ...
... ... @@ -55,4 +55,7 @@ custom-class="config-dialog"
}
.select-all .el-button{
height:42px;
}
.button-more{
position: absolute;right: 0;top: 33px;z-index: 1;background: #f5f7fa;width: 80px; padding: 10px;
}
\ No newline at end of file
... ...
... ... @@ -92,8 +92,43 @@
<!--列表-->
<div v-if="activeBtn == 'list'">
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="false" :showSelection="false"
:showPage="false" :height="height - 54"></cm-table-page>
:showBorder="false" :showSelection="false" :showTools="isEditName"
:showPage="false" :height="height - 54">
<template #default="{row,prop,column}">
<div class="fileName-div" style="display: flex; align-items: center;" v-if="isEditName && prop == 'fileName'" @click="getFile(row)">
<i :class="['iconfont', iconclass[row.type] == undefined ? 'icon-wenjian' : iconclass[row.type]]" style="font-size: 22px;margin-right: 10px;"></i>
<div>
<span @click.stop="editFileName(row,index)" v-if="isInput!=row.id">{{row.fileName}}</span>
</div>
<el-input @click.stop="" @blur="reNameFile(row,true)" v-if="isInput==row.id" type="text" v-model="row.fileName"></el-input>
</div>
</template>
<template #tools="{scope}" >
<div >
<el-button type="text" size="small" @click.prevent="getFile(scope.row)">
<i class="el-icon-view"/>查看 <i @mouseenter="moreShow=scope.row.id" :class="{'el-icon-arrow-down':moreShow!=scope.row.id,'el-icon-arrow-up':moreShow==scope.row.id}"></i>
</el-button>
<div class="button-more" v-if="moreShow==scope.row.id" @mouseleave="moreShow=''">
<ul>
<li>
<el-button type="text" size="small" @click.prevent="handleDownloadFile(scope.row,scope.$index)">
<i class="el-icon-download"/>下载
</el-button>
</li>
<li>
<el-button type="text" size="small" @click.prevent="handleDelete(scope.row,scope.$index)">
<i class="el-icon-delete"/>删除
</el-button>
</li>
</ul>
</div>
</div>
</template>
</cm-table-page>
</div>
<div v-if="activeBtn == 'view'" style="background-color: white" :style="{'height':(height -50) +'px','max-height':(height -50) + 'px','overflow':'auto'}">
<div style="text-align: left;margin: 6px;border-bottom: solid 1px #F2F6FC;padding-bottom: 5px;">
... ...
... ... @@ -46,6 +46,11 @@ export default {
isSelect:{
type:Boolean,
default:false
},
//是否编辑文件名称
isEditName:{
type:Boolean,
default:false
}
},
data() {
... ... @@ -67,6 +72,8 @@ export default {
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
//是否编辑文档名称
const isInput=Vue.ref();
let height = Vue.ref(window.innerHeight - 20);
let iconclass = {
'folder': 'icon-wenjianjia',
... ... @@ -173,7 +180,8 @@ export default {
// return `<i class="iconfont ${cls}" style="font-size: 22px;margin-right: 10px;"></i><input value="${inputFileName}"></input>`
return `<i class="iconfont ${cls}" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
}, {
},
{
prop: 'createUser',
label: '提交人',
sortable: true,
... ... @@ -184,8 +192,8 @@ export default {
sortable: true,
width: '180px'
}
/* ,{
prop: '',
/*,{
prop: 'handle',
label: '操作',
sortable: false,
width: '180px',
... ... @@ -330,6 +338,31 @@ export default {
}
}
/*
* 单个删除文档
* lu
* */
let handleDelete =(row,index)=>{
dataList.value.filter((v)=>{
if(v.id==row.id){
v.checked = true
}
})
deleteDocument(row.id,row.type)
}
/*
* 下载单个文档
* lu
* */
let handleDownloadFile=(row,index)=>{
dataList.value.filter((v)=>{
if(v.id==row.id){
v.checked = true
}
})
downloadFile();
}
const moreShow=Vue.ref();//更多按钮是否显示
/**
* 将文档放入回收站
... ... @@ -702,17 +735,55 @@ export default {
proxy.$global.showMsg(msg, 'warning');
}
}
isInput.value='';
})
reNameFileFlg.value[item.id] = false;
}
}
/*表格列表添加文件大小列
*lu
* */
let addColumns=()=>{
let newColumns= {
prop: 'fileSize',
label:'文件大小',
width:'120px',
render:function (row){
let fileSizeB=0;
if(row.fileSize){
fileSizeB=row.fileSize;
}
let fileSize=filterType(fileSizeB)
return `<span>${fileSize}</span>`
}
}
if(props.isEditName){
columns.value.splice(1,0,newColumns)
}
}
/*文件大小单位转换
* lu
* */
let filterType=(val)=>{
if (val==0) return "0 B";
let k=1024;
let sizes=["B","KB","GB","TB","PB","EB","ZB","YB"];
let i=Math.floor(Math.log(val) / Math.log(k));
return (val/Math.pow(k,i)).toPrecision(3) + " "+sizes[i];
}
/**
* 挂载完
*/
Vue.onMounted(() => {
//表格列表添加文件大小列
addColumns();
getUserList();
// 预览模式 不展示左侧树
if (!props.isView) {
... ... @@ -782,8 +853,15 @@ export default {
},function (){},false)
}
//点击文件名称编辑
const editFileName=(item)=>{
isInput.value=item.id;
}
return {
/* viewEdit,*/
editFileName,
isInput,
iconclass,
layout,
height,
... ... @@ -832,7 +910,12 @@ export default {
editType,
selectAll,
isAllSelect,
selectText
selectText,
handleDelete,
handleDownloadFile,
moreShow,
addColumns,
filterType
}
}
... ...
... ... @@ -941,6 +941,27 @@
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="查看资源拓扑"><i class="iconfont">&#XE515;</i></a>
</div>
</script>
<!--资源池状态-->
<script type="text/html" id="clusterStateTpl">
{{# if(d.clusterState === '正常'){ }}
<button type="button" class="layui-btn layui-btn-danger layui-bg-green layui-btn-radius layui-btn-xs p-0-15">正常
</button>
{{# }else{ }}
<button type="button" class="layui-btn layui-btn-radius layui-bg-red layui-btn-xs p-0-15">异常</button>
{{# } }}
</script>
<!--运行状态-->
<script type="text/html" id="runStateTpl">
{{# if(d.runState === '正常'){ }}
<button type="button" class="layui-btn layui-btn-danger layui-bg-green layui-btn-radius layui-btn-xs p-0-15">正常
</button>
{{# }else{ if(d.runState === '运行中'){ }}
<button type="button" class="layui-btn layui-btn-danger layui-bg-green layui-btn-radius layui-btn-xs p-0-15">运行中</button>
{{# }else{ }}
<button type="button" class="layui-btn layui-btn-radius layui-bg-red layui-btn-xs p-0-15">异常</button>
{{# } }}
{{# } }}
</script>
<script type="text/html" id="weblogicIpTpl">
<div>{{d.ip?d.ip:""}}</div>
</script>
... ...
... ... @@ -24,7 +24,7 @@ body
padding-top: 30px;
border: 2px solid #0a93be;
width: 900px;
height: 600px;
min-height: 666px;
margin: 0 auto;
font-size: 16px;
border-radius: 5px;
... ...
<div v-if="!isDetailShow" class="outlinediv" style="height: 666px">
<div v-if="!isDetailShow" class="outlinediv" >
<!-- <span>湖州灾备一机房平面图</span>-->
<div class="huzhouone-topcabinet">
<table>
... ...
<div class="container">
<cm-document :isSelect="true"></cm-document>
<cm-document :isSelect="true" :isEditName="true"></cm-document>
</div>
... ...