@ -38,7 +38,8 @@
< font -awesome -icon v -if = " editMode " icon = "arrows-alt-v" class = "action drag me-3" / >
< font -awesome -icon v -if = " editMode " icon = "arrows-alt-v" class = "action drag me-3" / >
< font -awesome -icon v -if = " editMode " icon = "times" class = "action remove me-3" @ click = "removeMonitor(group.index, monitor.index)" / >
< font -awesome -icon v -if = " editMode " icon = "times" class = "action remove me-3" @ click = "removeMonitor(group.index, monitor.index)" / >
< Uptime :monitor ="monitor.element" type = "24" :pill ="true" / >
< Status v -if = " hideUptimePercentage " :status ="statusOfLastHeartbeat(monitor.element.id)" / >
< Uptime v -if = " ! hideUptimePercentage " :monitor ="monitor.element" type = "24" :pill ="true" / >
< a
< a
v - if = "showLink(monitor)"
v - if = "showLink(monitor)"
: href = "monitor.element.url"
: href = "monitor.element.url"
@ -90,6 +91,8 @@ import Draggable from "vuedraggable";
import HeartbeatBar from "./HeartbeatBar.vue" ;
import HeartbeatBar from "./HeartbeatBar.vue" ;
import Uptime from "./Uptime.vue" ;
import Uptime from "./Uptime.vue" ;
import Tag from "./Tag.vue" ;
import Tag from "./Tag.vue" ;
import Status from "./Status.vue" ;
import PublicStatus from "./PublicStatus.vue" ;
export default {
export default {
components : {
components : {
@ -98,6 +101,8 @@ export default {
HeartbeatBar ,
HeartbeatBar ,
Uptime ,
Uptime ,
Tag ,
Tag ,
Status ,
PublicStatus
} ,
} ,
props : {
props : {
/** Are we in edit mode? */
/** Are we in edit mode? */
@ -112,7 +117,11 @@ export default {
/** Should expiry be shown? */
/** Should expiry be shown? */
showCertificateExpiry : {
showCertificateExpiry : {
type : Boolean ,
type : Boolean ,
}
} ,
/** Should uptime be hidden? */
hideUptimePercentage : {
type : Boolean ,
} ,
} ,
} ,
data ( ) {
data ( ) {
return {
return {
@ -181,6 +190,17 @@ export default {
}
}
} ,
} ,
/ * *
* Returns the status of the last heartbeat
* @ param { object } monitor Monitor to get status for
* @ returns { number } Status of the last heartbeat
* /
statusOfLastHeartbeat ( monitor ) {
let heartbeats = this . $root . heartbeatList [ this . monitorId ] ? ? [ ] ;
let lastHeartbeat = heartbeats [ heartbeats . length - 1 ] ;
return lastHeartbeat ? . status ;
} ,
/ * *
/ * *
* Returns certificate expiry color based on days remaining
* Returns certificate expiry color based on days remaining
* @ param { object } monitor Monitor to show expiry for
* @ param { object } monitor Monitor to show expiry for