-
-
-
- {{ item.alarmInfo }}
- {{ item.alarmStartDate }}
-
-
-
-
-
+
+
+
+
+ -
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ average value:{{ cpuData.avg }}%
+
+
+ minimum value:{{ cpuData.min }}%
+
+
+ Maximum value:{{ cpuData.max }}%
+
+
+
+
+
-
-
-
-
-
-
-
- -
-
- {{ item.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- average value:{{ cpuData.avg }}%
-
-
- minimum value:{{ cpuData.min }}%
-
-
- Maximum value:{{ cpuData.max }}%
-
-
-
-
-
+
-
-
+
@@ -417,6 +413,7 @@ export default {
},
data() {
return {
+ spinning: false,
types,
dataSource: [],
loading: false,
@@ -496,120 +493,12 @@ export default {
// })
},
methods: {
- // Echarts (时间线)
- // EchartsTimeline() {
- // const params = {
- // itemId: '37550',
- // itemType: 0,
- // start: '2023-09-21 00:00:00',
- // end: '2023-09-21 18:54:00',
- // }
- // getAction('/systemMonitor/queryItemHistoryData', params).then((res) => {
- // let data = res.result
- // const percentage = 100 / data.length
- // let indexArr = [[0, 0]]
- // for (let i = 1; i < data.length; i++) {
- // const num = i + 1
- // if (i === data.length - 1) {
- // indexArr[0][1] = data.length
- // }
- // if (data[i - 1].value != data[i].value) {
- // indexArr[0][1] = i
- // indexArr.unshift([i, num])
- // }
- // }
- // let objArr = [],
- // echartData = []
- // indexArr.map((item) => {
- // objArr.push(data.slice(item[0], item[1]))
- // })
- // const statusConversion = (val) => {
- // if (val == 1) {
- // return '正常'
- // } else if (val == 2) {
- // return '警告'
- // } else {
- // return '离线'
- // }
- // }
- // objArr.map((item, index) => {
- // let obj = null
- // if (index === 0) {
- // const arr = objArr[index + 1]
- // let timeInterval
- // if (arr) {
- // timeInterval = [item[0].date, arr[arr.length - 1].date]
- // } else {
- // timeInterval = [item[0].date, item[item.length - 1].date]
- // }
- // obj = {
- // type: 'Cpu',
- // value: statusConversion(item[0].value),
- // valueInterval: [0, item.length * percentage],
- // timeInterval: timeInterval, // 时间区间
- // }
- // } else if (index === objArr.length - 1) {
- // const arr = echartData[echartData.length - 1]
- // obj = {
- // type: 'Cpu',
- // value: statusConversion(item[0].value),
- // valueInterval: [arr.valueInterval[1], 100],
- // timeInterval: [arr.timeInterval[1], item[0].date], // 时间区间
- // }
- // } else {
- // const arr = echartData[echartData.length - 1],
- // arr1 = objArr[index + 1],
- // num = arr.valueInterval[1],
- // length = item.length * percentage
- // obj = {
- // type: 'Cpu',
- // value: statusConversion(item[0].value),
- // valueInterval: [num, length + num],
- // timeInterval: [arr.timeInterval[1], arr1[arr1.length - 1].date], // 时间区间
- // }
- // }
- // echartData.push(obj)
- // })
- // if (this.barPlot) {
- // this.barPlot.changeData(echartData)
- // return
- // }
- // const timeDateHours = (val) => {
- // return moment(val).format('HH:mm')
- // }
- // this.barPlot = new Bar('timeL', {
- // data: echartData.reverse(),
- // xField: 'valueInterval',
- // yField: 'type',
- // isRange: true,
- // seriesField: 'value',
- // padding: 20,
- // yAxis: {
- // label: null,
- // },
- // xAxis: {
- // label: {
- // formatter: (params) => {
- // const percentage = params / 100,
- // index = parseInt((data.length - 1) * percentage)
-
- // return timeDateHours(data[index].date)
- // },
- // },
- // },
- // legend: {
- // position: "top-left'",
- // },
- // tooltip: false,
- // })
- // this.barPlot.render()
- // })
- // },
moment,
// Basic lnformation
getBasiclnfo(sourceId) {
let params = { hostId: sourceId }
getAction('/sysServer/detailsBasicInfo', params).then((res) => {
+ this.spinning = false
if (res.success) {
this.detailInfo = res.result
this.drawGuageCpu()
@@ -630,6 +519,7 @@ export default {
end: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
}
getAction('/systemMonitor/queryItemHistoryData', params).then((res) => {
+ this.spinning = false
const arr = res.result.map((x) => x.value)
this.cpuData.max = Math.max(...arr).toFixed(2)
this.cpuData.min = Math.min(...arr).toFixed(2)
@@ -654,6 +544,7 @@ export default {
end: `${dateFormat(new Date(), 'yyyy-MM-dd')} 23:59:59`,
}
getAction('/systemMonitor/queryItemHistoryData', params).then((res) => {
+ this.spinning = false
let data = res.result
startTime = data[0].clock * 1000
let indexArr = [[0, 0]]
@@ -727,6 +618,7 @@ export default {
}
},
handleBasicItem(i, item) {
+ this.spinning = true
this.currIndex = i
this.currItemId = item.cpuUsedItemId
this.currSourceId = item.sourceId
diff --git a/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue b/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue
index f78a800..c384d95 100644
--- a/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue
+++ b/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue
@@ -49,22 +49,24 @@