mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-16 19:24:41 -05:00
[push type] add ping parameter
This commit is contained in:
parent
9d079eeec0
commit
7fa1cb83af
@ -20,6 +20,7 @@ router.get("/api/push/:pushToken", async (request, response) => {
|
|||||||
try {
|
try {
|
||||||
let pushToken = request.params.pushToken;
|
let pushToken = request.params.pushToken;
|
||||||
let msg = request.query.msg || "OK";
|
let msg = request.query.msg || "OK";
|
||||||
|
let ping = request.query.ping;
|
||||||
|
|
||||||
let monitor = await R.findOne("monitor", " push_token = ? AND active = 1 ", [
|
let monitor = await R.findOne("monitor", " push_token = ? AND active = 1 ", [
|
||||||
pushToken
|
pushToken
|
||||||
@ -34,9 +35,7 @@ router.get("/api/push/:pushToken", async (request, response) => {
|
|||||||
bean.time = R.isoDateTime(dayjs.utc());
|
bean.time = R.isoDateTime(dayjs.utc());
|
||||||
bean.status = UP;
|
bean.status = UP;
|
||||||
bean.msg = msg;
|
bean.msg = msg;
|
||||||
|
bean.ping = ping;
|
||||||
// TODO: HOW TO?
|
|
||||||
//bean.ping
|
|
||||||
|
|
||||||
await R.store(bean);
|
await R.store(bean);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="input-group mb-3">
|
<div class="input-group">
|
||||||
<input
|
<input
|
||||||
:id="id"
|
:id="id"
|
||||||
ref="input"
|
ref="input"
|
||||||
|
@ -48,6 +48,10 @@
|
|||||||
<div v-if="monitor.type === 'push' " class="my-3">
|
<div v-if="monitor.type === 'push' " class="my-3">
|
||||||
<label for="push-url" class="form-label">{{ $t("Push URL") }}</label>
|
<label for="push-url" class="form-label">{{ $t("Push URL") }}</label>
|
||||||
<CopyableInput id="push-url" v-model="pushURL" type="url" disabled="disabled" />
|
<CopyableInput id="push-url" v-model="pushURL" type="url" disabled="disabled" />
|
||||||
|
<div class="form-text">
|
||||||
|
You should call this url every {{ monitor.interval }} seconds.<br />
|
||||||
|
Optional parameters: msg, ping
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Keyword -->
|
<!-- Keyword -->
|
||||||
@ -105,6 +109,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!-- Interval -->
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
<label for="interval" class="form-label">{{ $t("Heartbeat Interval") }} ({{ $t("checkEverySecond", [ monitor.interval ]) }})</label>
|
<label for="interval" class="form-label">{{ $t("Heartbeat Interval") }} ({{ $t("checkEverySecond", [ monitor.interval ]) }})</label>
|
||||||
<input id="interval" v-model="monitor.interval" type="number" class="form-control" required min="20" step="1">
|
<input id="interval" v-model="monitor.interval" type="number" class="form-control" required min="20" step="1">
|
||||||
@ -279,8 +284,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
pushURL() {
|
pushURL() {
|
||||||
|
return this.$root.baseURL + "/api/push/" + this.monitor.pushToken + "?msg=OK&ping=";
|
||||||
return this.$root.baseURL + "/api/push/" + this.monitor.pushToken + "?msg=OK";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user