mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-05-17 08:26:56 +03:00
Replaced some tabs
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
const { settings } = require("../../server/util-server");
|
||||
|
||||
/**
|
||||
* @param {import("knex").Knex} knex
|
||||
* @param {import("knex").Knex} knex Database connection
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable("monitor", (table) => {
|
||||
@@ -12,7 +11,8 @@ exports.up = async (knex) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {import("knex").Knex} knex
|
||||
* @param {import("knex").Knex} knex Database connection
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
exports.down = async (knex) => {
|
||||
if (await knex.schema.hasColumn("monitor", "local_service_command")) {
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
const { MonitorType } = require("./monitor-type");
|
||||
const { exec } = require("child_process");
|
||||
const { DOWN, UP, log, evaluateJsonQuery } = require("../../src/util");
|
||||
const { DOWN, UP, evaluateJsonQuery } = require("../../src/util");
|
||||
|
||||
class LocalServiceMonitorType extends MonitorType {
|
||||
name = "local-service";
|
||||
description = "Checks if a local service is running by executing a command.";
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
async check(monitor, heartbeat, server) {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(monitor.local_service_command, async (error, stdout, stderr) => {
|
||||
@@ -59,4 +62,4 @@ class LocalServiceMonitorType extends MonitorType {
|
||||
|
||||
module.exports = {
|
||||
LocalServiceMonitorType,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -659,7 +659,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- SQL Server / PostgreSQL / MySQL / Redis / MongoDB -->
|
||||
<template v-if="monitor.type === 'sqlserver' || monitor.type === 'postgres' || monitor.type === 'mysql' || monitor.type === 'redis' || monitor.type === 'mongodb'">
|
||||
<div class="my-3">
|
||||
@@ -732,16 +731,16 @@
|
||||
<HiddenInput id="mysql-password" v-model="monitor.radiusPassword" autocomplete="false"></HiddenInput>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- SQL Server / PostgreSQL / MySQL -->
|
||||
|
||||
<!-- SQL Server / PostgreSQL / MySQL -->
|
||||
<template v-if="monitor.type === 'sqlserver' || monitor.type === 'postgres' || monitor.type === 'mysql'">
|
||||
<div class="my-3">
|
||||
<label for="sqlQuery" class="form-label">{{ $t("Query") }}</label>
|
||||
<textarea id="sqlQuery" v-model="monitor.databaseQuery" class="form-control" :placeholder="$t('Example:', [ 'SELECT 1' ])"></textarea>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- MongoDB -->
|
||||
|
||||
<!-- MongoDB -->
|
||||
<template v-if="monitor.type === 'mongodb'">
|
||||
<div class="my-3">
|
||||
<label for="mongodbCommand" class="form-label">{{ $t("Command") }}</label>
|
||||
@@ -766,8 +765,8 @@
|
||||
<input id="expectedValue" v-model="monitor.expectedValue" type="text" class="form-control">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Conditions -->
|
||||
|
||||
<!-- Conditions -->
|
||||
<EditMonitorConditions
|
||||
v-if="supportsConditions && conditionVariables.length > 0"
|
||||
v-model="monitor.conditions"
|
||||
@@ -799,8 +798,8 @@
|
||||
{{ $t("minimumIntervalWarning") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="my-3">
|
||||
|
||||
<div class="my-3">
|
||||
<label for="maxRetries" class="form-label">{{ $t("Retries") }}</label>
|
||||
<input id="maxRetries" v-model="monitor.maxretries" type="number" class="form-control" required min="0" step="1">
|
||||
<div class="form-text">
|
||||
@@ -827,8 +826,8 @@
|
||||
{{ $t("minimumIntervalWarning") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Timeout: HTTP / JSON query / Keyword / Ping / RabbitMQ / SNMP only -->
|
||||
|
||||
<!-- Timeout: HTTP / JSON query / Keyword / Ping / RabbitMQ / SNMP only -->
|
||||
<div v-if="monitor.type === 'http' || monitor.type === 'json-query' || monitor.type === 'keyword' || monitor.type === 'ping' || monitor.type === 'rabbitmq' || monitor.type === 'snmp'" class="my-3">
|
||||
<label for="timeout" class="form-label">
|
||||
{{ monitor.type === 'ping' ? $t("pingGlobalTimeoutLabel") : $t("Request Timeout") }}
|
||||
@@ -846,8 +845,8 @@
|
||||
</label>
|
||||
<input id="resend-interval" v-model="monitor.resendInterval" type="number" class="form-control" required min="0" step="1">
|
||||
</div>
|
||||
|
||||
<h2 v-if="monitor.type !== 'push'" class="mt-5 mb-2">{{ $t("Advanced") }}</h2>
|
||||
|
||||
<h2 v-if="monitor.type !== 'push'" class="mt-5 mb-2">{{ $t("Advanced") }}</h2>
|
||||
|
||||
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' || (monitor.type === 'port' && ['starttls', 'secure'].includes(monitor.smtpSecurity))" class="my-3 form-check" :title="monitor.ignoreTls ? $t('ignoredTLSError') : ''">
|
||||
<input id="expiry-notification" v-model="monitor.expiryNotification" class="form-check-input" type="checkbox" :disabled="monitor.ignoreTls">
|
||||
@@ -857,8 +856,8 @@
|
||||
<div class="form-text">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="monitor.type === 'websocket-upgrade' " class="my-3 form-check">
|
||||
|
||||
<div v-if="monitor.type === 'websocket-upgrade' " class="my-3 form-check">
|
||||
<input id="wsIgnoreSecWebsocketAcceptHeader" v-model="monitor.wsIgnoreSecWebsocketAcceptHeader" class="form-check-input" type="checkbox">
|
||||
<i18n-t tag="label" keypath="Ignore Sec-WebSocket-Accept header" class="form-check-label" for="wsIgnoreSecWebsocketAcceptHeader">
|
||||
<code>Sec-Websocket-Accept</code>
|
||||
@@ -874,8 +873,8 @@
|
||||
{{ monitor.type === "redis" ? $t("ignoreTLSErrorGeneral") : $t("ignoreTLSError") }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' " class="my-3 form-check">
|
||||
|
||||
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' " class="my-3 form-check">
|
||||
<input id="cache-bust" v-model="monitor.cacheBust" class="form-check-input" type="checkbox" value="">
|
||||
<label class="form-check-label" for="cache-bust">
|
||||
<i18n-t tag="label" keypath="cacheBusterParam" class="form-check-label" for="cache-bust">
|
||||
@@ -896,8 +895,8 @@
|
||||
{{ $t("upsideDownModeDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="monitor.type === 'gamedig'" class="my-3 form-check">
|
||||
|
||||
<div v-if="monitor.type === 'gamedig'" class="my-3 form-check">
|
||||
<input id="gamedig-guess-port" v-model="monitor.gamedigGivenPortOnly" :true-value="false" :false-value="true" class="form-check-input" type="checkbox">
|
||||
<label class="form-check-label" for="gamedig-guess-port">
|
||||
{{ $t("gamedigGuessPort") }}
|
||||
@@ -915,8 +914,8 @@
|
||||
{{ $t("pingCountDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Numeric Output -->
|
||||
|
||||
<!-- Numeric Output -->
|
||||
<div v-if="monitor.type === 'ping'" class="my-3 form-check">
|
||||
<input id="ping_numeric" v-model="monitor.ping_numeric" type="checkbox" class="form-check-input" :checked="monitor.ping_numeric">
|
||||
<label class="form-check-label" for="ping_numeric">
|
||||
@@ -932,8 +931,8 @@
|
||||
<label for="packet-size" class="form-label">{{ $t("Packet Size") }}</label>
|
||||
<input id="packet-size" v-model="monitor.packetSize" type="number" class="form-control" required min="1" :max="65500" step="1">
|
||||
</div>
|
||||
|
||||
<!-- per-request timeout -->
|
||||
|
||||
<!-- per-request timeout -->
|
||||
<div v-if="monitor.type === 'ping'" class="my-3">
|
||||
<label for="ping_per_request_timeout" class="form-label">{{ $t("pingPerRequestTimeoutLabel") }}</label>
|
||||
<input id="ping_per_request_timeout" v-model="monitor.ping_per_request_timeout" type="number" class="form-control" required min="0" max="300" step="1">
|
||||
@@ -973,8 +972,8 @@
|
||||
{{ $t("acceptedStatusCodesDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="my-3">
|
||||
|
||||
<div class="my-3">
|
||||
<label for="ipFamily" class="form-label">{{ $t("Ip Family") }}</label>
|
||||
<select id="ipFamily" v-model="monitor.ipFamily" class="form-select">
|
||||
<option :value="null">{{ $t("auto-select") }}</option>
|
||||
@@ -1002,8 +1001,8 @@
|
||||
:action="() => $refs.createGroupDialog.show()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
|
||||
<!-- Description -->
|
||||
<div class="my-3">
|
||||
<label for="description" class="form-label">{{ $t("Description") }}</label>
|
||||
<input id="description" v-model="monitor.description" type="text" class="form-control">
|
||||
@@ -1017,8 +1016,8 @@
|
||||
|
||||
<div class="col-md-6">
|
||||
<div v-if="$root.isMobile" class="mt-3" />
|
||||
|
||||
<!-- Notifications -->
|
||||
|
||||
<!-- Notifications -->
|
||||
<h2 class="mb-2">{{ $t("Notifications") }}</h2>
|
||||
<p v-if="$root.notificationList.length === 0">
|
||||
{{ $t("Not available, please setup.") }}
|
||||
@@ -1038,8 +1037,8 @@
|
||||
<button class="btn btn-primary me-2" type="button" @click="$refs.notificationDialog.show()">
|
||||
{{ $t("Setup Notification") }}
|
||||
</button>
|
||||
|
||||
<!-- Proxies -->
|
||||
|
||||
<!-- Proxies -->
|
||||
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query'">
|
||||
<h2 class="mt-5 mb-2">{{ $t("Proxy") }}</h2>
|
||||
<p v-if="$root.proxyList.length === 0">
|
||||
@@ -1058,8 +1057,8 @@
|
||||
{{ proxy.host }}:{{ proxy.port }} ({{ proxy.protocol }})
|
||||
<a href="#" @click="$refs.proxyDialog.show(proxy.id)">{{ $t("Edit") }}</a>
|
||||
</label>
|
||||
|
||||
<span v-if="proxy.default === true" class="badge bg-primary ms-2">{{ $t("default") }}</span>
|
||||
|
||||
<span v-if="proxy.default === true" class="badge bg-primary ms-2">{{ $t("default") }}</span>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary me-2" type="button" @click="$refs.proxyDialog.show()">
|
||||
@@ -1102,7 +1101,7 @@
|
||||
<label for="kafkaProducerSaslAuthorizationIdentity" class="form-label">{{ $t("Authorization Identity") }}</label>
|
||||
<input id="kafkaProducerSaslAuthorizationIdentity" v-model="monitor.kafkaProducerSaslOptions.authorizationIdentity" type="text" autocomplete="kafkaProducerSaslAuthorizationIdentity" class="form-control" required>
|
||||
</div>
|
||||
<div v-if="monitor.kafkaProducerSaslOptions.mechanism === 'aws'" class="my-3">
|
||||
<div vif="monitor.kafkaProducerSaslOptions.mechanism === 'aws'" class="my-3">
|
||||
<label for="kafkaProducerSaslAccessKeyId" class="form-label">{{ $t("AccessKey Id") }}</label>
|
||||
<input id="kafkaProducerSaslAccessKeyId" v-model="monitor.kafkaProducerSaslOptions.accessKeyId" type="text" autocomplete="kafkaProducerSaslAccessKeyId" class="form-control" required>
|
||||
</div>
|
||||
@@ -1170,8 +1169,8 @@
|
||||
<label for="headers" class="form-label">{{ $t("Headers") }}</label>
|
||||
<textarea id="headers" v-model="monitor.headers" class="form-control" :placeholder="headersPlaceholder"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- HTTP Auth -->
|
||||
|
||||
<!-- HTTP Auth -->
|
||||
<h4 class="mt-5 mb-2">{{ $t("Authentication") }}</h4>
|
||||
|
||||
<!-- Method -->
|
||||
@@ -1250,8 +1249,8 @@
|
||||
<label for="basicauth-user" class="form-label">{{ $t("Username") }}</label>
|
||||
<input id="basicauth-user" v-model="monitor.basic_auth_user" type="text" class="form-control" :placeholder="$t('Username')">
|
||||
</div>
|
||||
|
||||
<div class="my-3">
|
||||
|
||||
<div class="my-3">
|
||||
<label for="basicauth-pass" class="form-label">{{ $t("Password") }}</label>
|
||||
<input id="basicauth-pass" v-model="monitor.basic_auth_pass" type="password" autocomplete="new-password" class="form-control" :placeholder="$t('Password')">
|
||||
</div>
|
||||
@@ -1297,8 +1296,8 @@
|
||||
{{ $t("grpcMethodDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Proto data -->
|
||||
|
||||
<!-- Proto data -->
|
||||
<div class="my-3">
|
||||
<label for="protobuf" class="form-label">{{ $t("Proto Content") }}</label>
|
||||
<textarea id="protobuf" v-model="monitor.grpcProtobuf" class="form-control" :placeholder="protoBufDataPlaceholder"></textarea>
|
||||
|
||||
Reference in New Issue
Block a user