diff --git a/package.json b/package.json index e9b7003bd..1ba25baf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uptime-kuma", - "version": "1.15.1", + "version": "1.16.0-beta.0", "license": "MIT", "repository": { "type": "git", diff --git a/server/model/monitor.js b/server/model/monitor.js index 132f63175..cce9060da 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -185,7 +185,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, ]); @@ -383,9 +383,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/server/notification-providers/apprise.js b/server/notification-providers/apprise.js index 2d795d4e5..887afbf55 100644 --- a/server/notification-providers/apprise.js +++ b/server/notification-providers/apprise.js @@ -6,9 +6,14 @@ class Apprise extends NotificationProvider { name = "apprise"; async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { - let s = childProcess.spawnSync("apprise", [ "-vv", "-b", msg, notification.appriseURL ]); + const args = [ "-vv", "-b", msg, notification.appriseURL ]; + if (notification.title) { + args.push("-t"); + args.push(notification.title); + } + const s = childProcess.spawnSync("apprise", args); - let output = (s.stdout) ? s.stdout.toString() : "ERROR: maybe apprise not found"; + const output = (s.stdout) ? s.stdout.toString() : "ERROR: maybe apprise not found"; if (output) { diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index dd63e74b6..77b04d9d3 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -22,16 +22,23 @@ class Discord extends NotificationProvider { return okMsg; } - let url; - - if (monitorJSON["type"] === "port") { - url = monitorJSON["hostname"]; - if (monitorJSON["port"]) { - url += ":" + monitorJSON["port"]; - } - - } else { - url = monitorJSON["url"]; + let address; + + switch (monitorJSON["type"]) { + case "ping": + address = monitorJSON["hostname"]; + break; + case "port": + case "dns": + case "steam": + address = monitorJSON["hostname"]; + if (monitorJSON["port"]) { + address += ":" + monitorJSON["port"]; + } + break; + default: + address = monitorJSON["url"]; + break; } // If heartbeatJSON is not null, we go into the normal alerting loop. @@ -48,8 +55,8 @@ class Discord extends NotificationProvider { value: monitorJSON["name"], }, { - name: "Service URL", - value: url, + name: "Service URL / Address", + value: address, }, { name: "Time (UTC)", @@ -84,7 +91,7 @@ class Discord extends NotificationProvider { }, { name: "Service URL", - value: url.startsWith("http") ? "[Visit Service](" + url + ")" : url, + value: address.startsWith("http") ? "[Visit Service](" + address + ")" : address, }, { name: "Time (UTC)", diff --git a/src/assets/app.scss b/src/assets/app.scss index e1815d42b..209b084af 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -368,7 +368,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 fbaa68de7..dca0232b8 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -1,6 +1,6 @@ @@ -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,15 +228,27 @@ export default { background-color: $warning; } + .beat-inner { + border-radius: $border-radius; + display: inline-block; + height: 100%; + width: 5px; + } + &.maintenance { background-color: $maintenance; } &: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 a7474c3b7..21257c5d7 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -33,19 +33,19 @@