feat: add ability to group monitors in dashboard

This commit is contained in:
Peace
2023-01-28 02:58:03 +01:00
parent d99d37898e
commit 645fd94bba
11 changed files with 411 additions and 44 deletions

View File

@@ -1,6 +1,7 @@
<template>
<transition name="slide-fade" appear>
<div v-if="monitor">
<span> {{ group }}</span>
<h1> {{ monitor.name }}</h1>
<div class="tags">
<Tag v-for="tag in monitor.tags" :key="tag.id" :item="tag" :size="'sm'" />
@@ -286,6 +287,13 @@ export default {
const endIndex = startIndex + this.perPage;
return this.heartBeatList.slice(startIndex, endIndex);
},
group() {
if (!this.monitor.pathName.includes("/")) {
return "";
}
return this.monitor.pathName.substr(0, this.monitor.pathName.lastIndexOf("/"));
}
},
mounted() {