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/docker/docker-compose.yml b/docker/docker-compose.yml index a6499ef9f..f01f0ea52 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -8,7 +8,7 @@ services: image: louislam/uptime-kuma:1 container_name: uptime-kuma volumes: - - ./uptime-kuma:/app/data + - ./uptime-kuma-data:/app/data ports: - - 3001:3001 + - 3001:3001 # : restart: always 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/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/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; + let address; - if (monitorJSON["type"] === "port") { - url = monitorJSON["hostname"]; - if (monitorJSON["port"]) { - url += ":" + monitorJSON["port"]; - } - - } else { - url = monitorJSON["url"]; + 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/components/CountUp.vue b/src/components/CountUp.vue index 41edc4a0e..df1d1ac6c 100644 --- a/src/components/CountUp.vue +++ b/src/components/CountUp.vue @@ -10,7 +10,10 @@ import { sleep } from "../util.ts"; export default { props: { - value: [ String, Number ], + value: { + type: [ String, Number ], + default: 0, + }, time: { type: Number, default: 0.3, diff --git a/src/components/Datetime.vue b/src/components/Datetime.vue index ed38c434d..fa68d02c7 100644 --- a/src/components/Datetime.vue +++ b/src/components/Datetime.vue @@ -13,7 +13,10 @@ dayjs.extend(relativeTime); export default { props: { - value: String, + value: { + type: String, + default: null, + }, dateOnly: { type: Boolean, default: false, diff --git a/src/components/HeartbeatBar.vue b/src/components/HeartbeatBar.vue index 245a8512c..ce888a989 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -168,7 +168,8 @@ export default { getBeatTitle(beat) { return `${this.$root.datetime(beat.time)}` + ((beat.msg) ? ` - ${beat.msg}` : ""); - } + }, + }, }; diff --git a/src/components/PublicGroupList.vue b/src/components/PublicGroupList.vue index df94eec98..98c0b7ff7 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -41,7 +41,7 @@ {{ monitor.element.name }} -
+
diff --git a/src/components/Status.vue b/src/components/Status.vue index a3916adce..1985d8518 100644 --- a/src/components/Status.vue +++ b/src/components/Status.vue @@ -5,7 +5,10 @@