improve monitor list

This commit is contained in:
LouisLam 2021-08-30 02:22:49 +08:00
parent e644a1e36f
commit 3ad736692f
7 changed files with 34 additions and 32 deletions

View file

@ -1,5 +1,5 @@
<template>
<div class="shadow-box list mb-4">
<div class="shadow-box list mb-3" :class="{ scrollbar: scrollbar }">
<div v-if="Object.keys($root.monitorList).length === 0" class="text-center mt-3">
{{ $t("No Monitors, please") }} <router-link to="/add">{{ $t("add one") }}</router-link>
</div>
@ -34,6 +34,11 @@ export default {
Uptime,
HeartbeatBar,
},
props: {
scrollbar: {
type: Boolean,
},
},
computed: {
sortedMonitorList() {
let result = Object.values(this.$root.monitorList);
@ -83,8 +88,12 @@ export default {
}
.list {
height: auto;
min-height: calc(100vh - 240px);
&.scrollbar {
height: calc(100vh - 20px);
overflow-y: scroll;
position: sticky;
top: 10px;
}
.item {
display: block;