Removed the old downtime prioritization logic

This commit is contained in:
Marshu 2025-04-13 18:09:32 +08:00
parent 4fdeba8cb0
commit fee7666c0f

View File

@ -775,24 +775,10 @@ export default {
const { heartbeatList, uptimeList } = res.data;
this.$root.heartbeatList = heartbeatList;
this.$root.uptimeList = uptimeList;
if (!this.enableEditMode) {
this.$root.publicGroupList.forEach((group) => {
const downs = [];
const others = [];
// Traverse all monitors in the current group
for (const monitor of group.monitorList) {
const hbArr = heartbeatList[monitor.id];
// Check if the last heartbeat status is Down (status === 0)
if (hbArr && hbArr.length > 0 && hbArr.at(-1).status === 0) {
downs.push(monitor);
} else {
others.push(monitor);
}
}
// Place Down monitors at the front, keep the original order for others
group.monitorList = downs.concat(others);
});
}
// ""
// PublicGroupList
const heartbeatIds = Object.keys(heartbeatList);
const downMonitors = heartbeatIds.reduce((downMonitorsAmount, currentId) => {
const monitorHeartbeats = heartbeatList[currentId];