|
|
@ -220,12 +220,18 @@ import ImageCropUpload from "vue-image-crop-upload";
|
|
|
|
import { STATUS_PAGE_ALL_DOWN, STATUS_PAGE_ALL_UP, STATUS_PAGE_PARTIAL_DOWN, UP } from "../util.ts";
|
|
|
|
import { STATUS_PAGE_ALL_DOWN, STATUS_PAGE_ALL_UP, STATUS_PAGE_PARTIAL_DOWN, UP } from "../util.ts";
|
|
|
|
import { useToast } from "vue-toastification";
|
|
|
|
import { useToast } from "vue-toastification";
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
|
|
|
import Favico from "favico.js";
|
|
|
|
|
|
|
|
|
|
|
|
const toast = useToast();
|
|
|
|
const toast = useToast();
|
|
|
|
|
|
|
|
|
|
|
|
const leavePageMsg = "Do you really want to leave? you have unsaved changes!";
|
|
|
|
const leavePageMsg = "Do you really want to leave? you have unsaved changes!";
|
|
|
|
|
|
|
|
|
|
|
|
let feedInterval;
|
|
|
|
let feedInterval;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const favicon = new Favico({
|
|
|
|
|
|
|
|
animation: "none"
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
PublicGroupList,
|
|
|
|
PublicGroupList,
|
|
|
@ -304,7 +310,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
tagsVisible() {
|
|
|
|
tagsVisible() {
|
|
|
|
return this.config.statusPageTags
|
|
|
|
return this.config.statusPageTags;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
logoClass() {
|
|
|
|
logoClass() {
|
|
|
@ -439,8 +445,25 @@ export default {
|
|
|
|
// If editMode, it will use the data from websocket.
|
|
|
|
// If editMode, it will use the data from websocket.
|
|
|
|
if (! this.editMode) {
|
|
|
|
if (! this.editMode) {
|
|
|
|
axios.get("/api/status-page/heartbeat").then((res) => {
|
|
|
|
axios.get("/api/status-page/heartbeat").then((res) => {
|
|
|
|
this.$root.heartbeatList = res.data.heartbeatList;
|
|
|
|
const { heartbeatList, uptimeList } = res.data;
|
|
|
|
this.$root.uptimeList = res.data.uptimeList;
|
|
|
|
|
|
|
|
|
|
|
|
this.$root.heartbeatList = heartbeatList;
|
|
|
|
|
|
|
|
this.$root.uptimeList = uptimeList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const heartbeatIds = Object.keys(heartbeatList);
|
|
|
|
|
|
|
|
const downMonitors = heartbeatIds.reduce((downMonitorsAmount, currentId) => {
|
|
|
|
|
|
|
|
const monitorHeartbeats = heartbeatList[currentId];
|
|
|
|
|
|
|
|
const lastHeartbeat = monitorHeartbeats.at(-1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lastHeartbeat) {
|
|
|
|
|
|
|
|
return lastHeartbeat.status === 0 ? downMonitorsAmount + 1 : downMonitorsAmount;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return downMonitorsAmount;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
favicon.badge(downMonitors);
|
|
|
|
|
|
|
|
|
|
|
|
this.loadedData = true;
|
|
|
|
this.loadedData = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -501,9 +524,9 @@ export default {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
...monitor,
|
|
|
|
...monitor,
|
|
|
|
tags: newState ? this.$root.monitorList[monitor.id].tags : []
|
|
|
|
tags: newState ? this.$root.monitorList[monitor.id].tags : []
|
|
|
|
}
|
|
|
|
};
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|