mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-10 02:23:20 +08:00
implement tcping
This commit is contained in:
@@ -48,7 +48,7 @@ export default {
|
||||
let frames = 12;
|
||||
let step = Math.floor(diff / frames);
|
||||
|
||||
if ((diff > 0 && step < 1) || (diff < 0 && step > 1) || diff === 0) {
|
||||
if (! this.isNum || (diff > 0 && step < 1) || (diff < 0 && step > 1) || diff === 0) {
|
||||
// Lazy to NOT this condition, hahaha.
|
||||
} else {
|
||||
for (let i = 1; i < frames; i++) {
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<h1> {{ monitor.name }}</h1>
|
||||
<p class="url"><a :href="monitor.url" target="_blank" v-if="monitor.type === 'http'">{{ monitor.url }}</a></p>
|
||||
<p class="url">
|
||||
<a :href="monitor.url" target="_blank" v-if="monitor.type === 'http'">{{ monitor.url }}</a>
|
||||
<span v-if="monitor.type === 'port'">{{ monitor.hostname }}:{{ monitor.port }}</span>
|
||||
</p>
|
||||
|
||||
<div class="functions">
|
||||
<button class="btn btn-light" @click="pauseDialog" v-if="monitor.active">Pause</button>
|
||||
|
@@ -22,11 +22,24 @@
|
||||
<input type="text" class="form-control" id="name" v-model="monitor.name" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="mb-3" v-if="monitor.type === 'http' ">
|
||||
<label for="url" class="form-label">URL</label>
|
||||
<input type="url" class="form-control" id="url" v-model="monitor.url" pattern="https?://.+" required>
|
||||
</div>
|
||||
|
||||
<template v-if="monitor.type === 'port' ">
|
||||
<div class="mb-3">
|
||||
<label for="hostname" class="form-label">Hostname</label>
|
||||
<input type="text" class="form-control" id="hostname" v-model="monitor.hostname" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="port" class="form-label">Port</label>
|
||||
<input type="number" class="form-control" id="port" v-model="monitor.port" required min="0" max="65535">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="interval" class="form-label">Heartbeat Interval (Every {{ monitor.interval }} seconds)</label>
|
||||
<input type="number" class="form-control" id="interval" v-model="monitor.interval" required min="20">
|
||||
|
Reference in New Issue
Block a user