diff --git a/src/components/table/index.vue b/src/components/table/index.vue
index 2aaa32b..728395f 100644
--- a/src/components/table/index.vue
+++ b/src/components/table/index.vue
@@ -115,7 +115,7 @@
-
删除 ' + this.reserveForm.configName + ' 配置后,相应的服务器/交换机集合的总流量的相关数据都将删除
'; this.$modal.confirm(content).then(() => { delMonitorConfig(this.reserveForm.id).then(res => { + this.reserveForm = {}; + this.lineDataParams = {}; this.fnConfigName(this.groupData); }); }).catch(() => {}); @@ -419,7 +422,9 @@ }, fnDialogResult(res){ this.open = false; - this.groupListData(); + if (res && res.type === 'submit') { + this.groupListData(); + } // this.fnConfigName(this.groupData); // this.fnChartView(); }, diff --git a/src/views/resource/serverRegister/details.vue b/src/views/resource/serverRegister/details.vue index 05efeaf..73298c2 100644 --- a/src/views/resource/serverRegister/details.vue +++ b/src/views/resource/serverRegister/details.vue @@ -1,5 +1,5 @@ -升级警告
` + `未找到最新版本${model.maxAgentVersion}的下载地址,请到【AGENT更新】中添加一条版本${model.maxAgentVersion}的更新策略,才可自动进行升级更新`; @@ -499,9 +518,23 @@ this.$set(this.mapDataList, keyName, [{tableList: newList, queryParams: {total: 0}}]); } }); + // diskAllNames({clientId: this.paramsData.clientId}).then(res => { + // if (res && res.data.length > 0) { + // let tabNameList = {}; + // res && res.data.forEach(async(item,index) => { + // let oneData = JSON.parse(JSON.stringify(this.linuxSystem['disk'])); + // oneData.title = item && item.name; + // oneData.toTitle = '硬盘设备'; + // oneData.clientId = this.paramsData.clientId; + // tabNameList[item.name] = oneData; + // }); + // this.$set(this.mapDataList, keyName, tabNameList); + // } + // }); }, // 回调 fnTimeChangeData(val) { + this.eventKeyName = {}; if (this.activeName && this.activeName === '网卡流量监控' && this.mapDataList[this.activeName]) { this.fnNetChartList('网卡流量监控', val.currTimeList, val.interCardName, val.onlyInterCard); } else if (this.activeName && this.activeName === '挂载文件系统监控' && this.mapDataList[this.activeName]) { @@ -525,40 +558,53 @@ } } } else { - Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + for (const keyName of Object.keys(this.mapDataList[keyVal])) { if (keyName === '网卡信息') { - // this.mapDataList[keyVal][keyName].echartList = []; if (await this.getNetEcharts(time, keyVal, keyName, interCardName)) { if (await this.getNetPingDropCharts(time, keyVal, keyName, interCardName)) { if (this.interCartList[interCardName].businessFlag) { if (await this.getNetIPv4Echarts(time, keyVal, keyName, interCardName)) { - this.getNetIPv6Echarts(time, keyVal, keyName, interCardName) + await this.getNetIPv6Echarts(time, keyVal, keyName, interCardName) } } } } } else if (keyName === 'CPU使用率') { - this.getCpuLoadData(time, keyVal, keyName) + await this.getCpuLoadData(time, keyVal, keyName) } else if (keyName === '内存使用率') { - this.getMemoryUtilizationData(time, keyVal, keyName) + await this.getMemoryUtilizationData(time, keyVal, keyName) } else if (keyName === 'HDD磁盘空间') { - this.fnUsedSpaceCharts(time, keyVal, keyName); + await this.fnUsedSpaceCharts(time, keyVal, keyName); } else if (keyName === 'CPU温度') { this.fnCpuTemperatureCharts(time, keyVal, keyName); } - }); + } + // Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + // }); } }, // 挂载文件系统监控 fnMountCharList(keyVal, time){ - Object.keys(this.mapDataList[keyVal]).forEach(async keyName => { - this.getSpaceRate(time, keyVal, keyName); + Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + if (Object.keys(this.mapDataList[keyVal]).length > 3) { + if (index <= 2) { + this.getSpaceRate(time, keyVal, keyName); + } + } else { + this.getSpaceRate(time, keyVal, keyName); + } }); }, // 硬盘设备 fnDiskCharList(keyVal, time){ - Object.keys(this.mapDataList[keyVal]).forEach(async keyName => { - this.getSpaceRate(time, keyVal, keyName); + Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + if (Object.keys(this.mapDataList[keyVal]).length > 3) { + if (index <= 2) { + this.getSpeedEcharts(time, keyVal, keyName); + } + } else { + this.getSpeedEcharts(time, keyVal, keyName); + } }); }, // 网卡 流量 @@ -723,6 +769,7 @@ }, // 挂载文件 空间利用率 getSpaceRate(times, keyVal, titleName) { + this.eventKeyName[titleName] = true; let mountCollect = JSON.parse(JSON.stringify(this.mapDataList[keyVal][titleName])); mountCollect['titleTo'] = titleName; let mountEcharts = JSON.parse(JSON.stringify(this.echartData)); @@ -737,6 +784,9 @@ name: content.echartFors[0].oneName, data: res.data && res.data.yData['vfsUtilData'] || [] }; + if (res.data && res.data.yData && res.data.yData['usedData'] && res.data.yData['usedData'].length > 0) { + mountEcharts.dataVal.otherModel = {name: '存储使用大小', value: res.data && res.data.yData['usedData'] || []}; + } } mountCollect['echartList'][0] = mountEcharts; this.$set(this.mapDataList[keyVal], titleName, mountCollect); @@ -747,6 +797,7 @@ }, // 硬盘设备 读写速率 getSpeedEcharts(times, keyVal, titleName) { + this.eventKeyName[titleName] = true; let mountCollect = JSON.parse(JSON.stringify(this.mapDataList[keyVal][titleName])); mountCollect['titleTo'] = titleName; let netEcharts = JSON.parse(JSON.stringify(this.echartData)); @@ -871,6 +922,20 @@ } }, + // 滚动监听事件 + fnLazyLoad(val) { + if (val) { + if (this.mapDataList[this.activeName]) { + if (this.mapDataList[this.activeName][val.key] && !(this.mapDataList[this.activeName][val.key].echartList[0] && this.mapDataList[this.activeName][val.key].echartList[0].title)) { + if (this.activeName === '挂载文件系统监控' && !this.eventKeyName[val.key]) { + this.getSpaceRate(val.currTimeList, this.activeName, val.key); + } else if (this.activeName === '硬盘设备监控' && !this.eventKeyName[val.key]) { + this.getSpeedEcharts(val.currTimeList, this.activeName, val.key); + } + } + } + } + }, // 监听事件 callback(result, dataVal, formVal) { diff --git a/src/views/resource/serverRegister/flowForm.vue b/src/views/resource/serverRegister/flowForm.vue index 9720e64..b2df1e3 100644 --- a/src/views/resource/serverRegister/flowForm.vue +++ b/src/views/resource/serverRegister/flowForm.vue @@ -56,13 +56,13 @@ readonly: true, paramsData: {}, ruleForm: { - detectFlag: '1', - frequency: '每天', + // detectFlag: '1', + // frequency: '每天', detectTimes: [] }, formModel: { - detectFlag: '1', - frequency: '每天', + // detectFlag: '1', + // frequency: '每天', detectTimes: [] }, inputVisible: false, @@ -154,7 +154,7 @@ if (!this.readonly) { this.formSumbit(); } else { - this.ruleForm = Object.assign({}, this.ruleForm, {typeName: 111}); + this.ruleForm = Object.assign({}, this.ruleForm, {frequency: '每天'}); this.readonly = !this.readonly; this.fnFormList(this.readonly); } diff --git a/src/views/resource/serverRegister/tabsChart.vue b/src/views/resource/serverRegister/tabsChart.vue index ee0f08b..fb4c66b 100644 --- a/src/views/resource/serverRegister/tabsChart.vue +++ b/src/views/resource/serverRegister/tabsChart.vue @@ -44,20 +44,20 @@