LouisLam
3 years ago
6 changed files with 205 additions and 59 deletions
@ -0,0 +1,96 @@ |
|||
<template> |
|||
<!-- Group List --> |
|||
<Draggable |
|||
v-model="$root.publicGroupList" |
|||
:disabled="!editMode" |
|||
item-key="id" |
|||
:animation="100" |
|||
> |
|||
<template #item="{ element }"> |
|||
<div> |
|||
<h2 class="mt-5">{{ element.name }}</h2> |
|||
|
|||
<div class="shadow-box monitor-list mt-4 position-relative"> |
|||
<div v-if="element.monitorList.length === 0" class="text-center no-monitor-msg"> |
|||
{{ $t("No Monitors") }} |
|||
</div> |
|||
|
|||
<!-- Monitor List --> |
|||
<Draggable |
|||
v-model="element.monitorList" |
|||
class="monitor-list" |
|||
group="same-group" |
|||
:disabled="!editMode" |
|||
:animation="100" |
|||
> |
|||
<template #item="{ element }"> |
|||
<div class="item"> |
|||
<div class="row"> |
|||
<div class="col-6 col-md-8 small-padding"> |
|||
<div class="info"> |
|||
<Uptime :monitor="element" type="24" :pill="true" /> |
|||
{{ element.name }} |
|||
</div> |
|||
</div> |
|||
<div :key="$root.userHeartbeatBar" class="col-6 col-md-4"> |
|||
<HeartbeatBar size="small" :monitor-id="element.id" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
</Draggable> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
</Draggable> |
|||
</template> |
|||
|
|||
<script> |
|||
import Draggable from "vuedraggable"; |
|||
import HeartbeatBar from "./HeartbeatBar.vue"; |
|||
import Uptime from "./Uptime.vue"; |
|||
|
|||
export default { |
|||
name: "GroupList", |
|||
components: { |
|||
Draggable, |
|||
HeartbeatBar, |
|||
Uptime, |
|||
}, |
|||
props: { |
|||
editMode: { |
|||
type: Boolean, |
|||
required: true, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.no-monitor-msg { |
|||
position: absolute; |
|||
width: 100%; |
|||
top: 20px; |
|||
left: 0; |
|||
} |
|||
|
|||
.monitor-list { |
|||
min-height: 46px; |
|||
} |
|||
|
|||
.flip-list-move { |
|||
transition: transform 0.5s; |
|||
} |
|||
|
|||
.no-move { |
|||
transition: transform 0s; |
|||
} |
|||
</style> |
@ -1,10 +1,10 @@ |
|||
import { library } from "@fortawesome/fontawesome-svg-core" |
|||
import { faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp, faEye, faEyeSlash, faCheckCircle, faStream } from "@fortawesome/free-solid-svg-icons" |
|||
import { faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp, faEye, faEyeSlash, faCheckCircle, faStream, faSave } from "@fortawesome/free-solid-svg-icons" |
|||
//import { fa } from '@fortawesome/free-regular-svg-icons'
|
|||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome" |
|||
|
|||
// Add Free Font Awesome Icons here
|
|||
// https://fontawesome.com/v5.15/icons?d=gallery&p=2&s=solid&m=free
|
|||
library.add(faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp, faEye, faEyeSlash, faCheckCircle, faStream); |
|||
library.add(faCog, faEdit, faPlus, faPause, faPlay, faTachometerAlt, faTrash, faList, faArrowAltCircleUp, faEye, faEyeSlash, faCheckCircle, faStream, faSave); |
|||
|
|||
export { FontAwesomeIcon } |
|||
|
@ -0,0 +1,7 @@ |
|||
export default { |
|||
data() { |
|||
return { |
|||
publicGroupList: [], |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue