diff --git a/CNAME b/CNAME index a5348b076..442505166 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -git.kuma.pet \ No newline at end of file +git.kuma.pet diff --git a/public/icon.svg b/public/icon.svg index 825c344e2..9c0bc6cae 100644 --- a/public/icon.svg +++ b/public/icon.svg @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/server/model/monitor.js b/server/model/monitor.js index f2d16524b..eaafb7755 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -182,7 +182,7 @@ class Monitor extends BeanModel { // undefined if not https let tlsInfo = undefined; - if (!previousBeat) { + if (!previousBeat || this.type === "push") { previousBeat = await R.findOne("heartbeat", " monitor_id = ? ORDER BY time DESC", [ this.id, ]); @@ -377,9 +377,6 @@ class Monitor extends BeanModel { log.debug("monitor", "heartbeatCount" + heartbeatCount + " " + time); if (heartbeatCount <= 0) { - // Fix #922, since previous heartbeat could be inserted by api, it should get from database - previousBeat = await Monitor.getPreviousHeartbeat(this.id); - throw new Error("No heartbeat in the time window"); } else { // No need to insert successful heartbeat for push type, so end here diff --git a/src/assets/app.scss b/src/assets/app.scss index c3f2fa798..8eaff4996 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -367,7 +367,7 @@ textarea.form-control { .item { display: block; text-decoration: none; - padding: 13px 15px 10px 15px; + padding: 15px; border-radius: 10px; transition: all ease-in-out 0.15s; diff --git a/src/components/HeartbeatBar.vue b/src/components/HeartbeatBar.vue index 245a8512c..10b1f761d 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -1,6 +1,6 @@ - + + @mouseenter="toggleActivateSibling" + @mouseleave="toggleActivateSibling" + > + + @@ -168,6 +172,29 @@ export default { getBeatTitle(beat) { return `${this.$root.datetime(beat.time)}` + ((beat.msg) ? ` - ${beat.msg}` : ""); + }, + + // Toggling the activeSibling class on hover over the current hover item + toggleActivateSibling(e) { + // Variable definition + const element = e.target; + const previous = element.previousSibling; + const next = element.nextSibling; + + // Return if the hovered element has empty class + if (element.classList.contains("empty")) { + return; + } + + // Check if Previous Sibling is heartbar element and doesn't have the empty class + if (previous.children && !previous.classList.contains("empty")) { + previous.classList.toggle("active-sibling"); + } + + // Check if Next Sibling is heartbar element and doesn't have the empty class + if (next.children && !next.classList.contains("empty")) { + next.classList.toggle("active-sibling"); + } } }, }; @@ -184,9 +211,10 @@ export default { .hp-bar-big { .beat { - display: inline-block; background-color: $primary; border-radius: $border-radius; + display: inline-block; + transition: all ease 0.6s; &.empty { background-color: aliceblue; @@ -200,11 +228,23 @@ export default { background-color: $warning; } + .beat-inner { + border-radius: $border-radius; + display: inline-block; + height: 100%; + width: 5px; + } + &:not(.empty):hover { - transition: all ease-in-out 0.15s; + transition: all ease 0.15s; opacity: 0.8; transform: scale(var(--hover-scale)); } + + &.active-sibling { + transform: scale(1.15); + transition: all ease 0.15s; + } } } diff --git a/src/components/PublicGroupList.vue b/src/components/PublicGroupList.vue index df94eec98..4d0ada5c9 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -33,19 +33,19 @@ - - + + {{ monitor.element.name }} - + - +