mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-23 05:39:20 +08:00
Compare commits
4 Commits
custom-hea
...
async-fs
Author | SHA1 | Date | |
---|---|---|---|
|
fd05aad398 | ||
|
a70a2c6b35 | ||
|
2f5a6d9648 | ||
|
21a6b4a131 |
2
.github/workflows/auto-test.yml
vendored
2
.github/workflows/auto-test.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
|||||||
needs: [ check-linters ]
|
needs: [ check-linters ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
if: ${{ github.repository == 'louislam/uptime-kuma' }}
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ARMv7 ]
|
os: [ ARMv7 ]
|
||||||
|
@@ -427,33 +427,7 @@ Currently, there are 3 maintainers:
|
|||||||
### Procedures
|
### Procedures
|
||||||
|
|
||||||
We have a few procedures we follow. These are documented here:
|
We have a few procedures we follow. These are documented here:
|
||||||
- <details><summary>Set up a Docker Builder</summary>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
- amd64, armv7 using local.
|
|
||||||
- arm64 using remote arm64 cpu, as the emulator is too slow and can no longer pass the `npm ci` command.
|
|
||||||
1. Add the public key to the remote server.
|
|
||||||
2. Add the remote context. The remote machine must be arm64 and installed Docker CE.
|
|
||||||
```
|
|
||||||
docker context create oracle-arm64-jp --docker "host=ssh://root@100.107.174.88"
|
|
||||||
```
|
|
||||||
3. Create a new builder.
|
|
||||||
```
|
|
||||||
docker buildx create --name kuma-builder --platform linux/amd64,linux/arm/v7
|
|
||||||
docker buildx use kuma-builder
|
|
||||||
docker buildx inspect --bootstrap
|
|
||||||
```
|
|
||||||
4. Append the remote context to the builder.
|
|
||||||
```
|
|
||||||
docker buildx create --append --name kuma-builder --platform linux/arm64 oracle-arm64-jp
|
|
||||||
```
|
|
||||||
5. Verify the builder and check if the builder is using `kuma-builder`.
|
|
||||||
```
|
|
||||||
docker buildx inspect kuma-builder
|
|
||||||
docker buildx ls
|
|
||||||
```
|
|
||||||
</p>
|
|
||||||
</details>
|
|
||||||
- <details><summary>Release</summary>
|
- <details><summary>Release</summary>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
@@ -516,3 +490,28 @@ We have a few procedures we follow. These are documented here:
|
|||||||
|
|
||||||
</p>
|
</p>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### Set up a Docker Builder
|
||||||
|
|
||||||
|
- amd64, armv7 using local.
|
||||||
|
- arm64 using remote arm64 cpu, as the emulator is too slow and can no longer pass the `npm ci` command.
|
||||||
|
1. Add the public key to the remote server.
|
||||||
|
2. Add the remote context. The remote machine must be arm64 and installed Docker CE.
|
||||||
|
```
|
||||||
|
docker context create oracle-arm64-jp --docker "host=ssh://root@100.107.174.88"
|
||||||
|
```
|
||||||
|
3. Create a new builder.
|
||||||
|
```
|
||||||
|
docker buildx create --name kuma-builder --platform linux/amd64,linux/arm/v7
|
||||||
|
docker buildx use kuma-builder
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
```
|
||||||
|
4. Append the remote context to the builder.
|
||||||
|
```
|
||||||
|
docker buildx create --append --name kuma-builder --platform linux/arm64 oracle-arm64-jp
|
||||||
|
```
|
||||||
|
5. Verify the builder and check if the builder is using `kuma-builder`.
|
||||||
|
```
|
||||||
|
docker buildx inspect kuma-builder
|
||||||
|
docker buildx ls
|
||||||
|
```
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
exports.up = function (knex) {
|
|
||||||
// Insert column for custom HTML code
|
|
||||||
return knex.schema
|
|
||||||
.alterTable("status_page", function (table) {
|
|
||||||
table.text("custom_html").nullable().defaultTo(null);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.down = function (knex) {
|
|
||||||
return knex.schema
|
|
||||||
.alterTable("status_page", function (table) {
|
|
||||||
table.dropColumn("custom_html");
|
|
||||||
});
|
|
||||||
};
|
|
2
package-lock.json
generated
2
package-lock.json
generated
@@ -74,7 +74,7 @@
|
|||||||
"socket.io": "~4.6.1",
|
"socket.io": "~4.6.1",
|
||||||
"socket.io-client": "~4.6.1",
|
"socket.io-client": "~4.6.1",
|
||||||
"socks-proxy-agent": "6.1.1",
|
"socks-proxy-agent": "6.1.1",
|
||||||
"sqlite3": "~5.1.7",
|
"sqlite3": "^5.1.7",
|
||||||
"tar": "~6.2.1",
|
"tar": "~6.2.1",
|
||||||
"tcp-ping": "~0.1.1",
|
"tcp-ping": "~0.1.1",
|
||||||
"thirty-two": "~1.0.2",
|
"thirty-two": "~1.0.2",
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const { R } = require("redbean-node");
|
const { R } = require("redbean-node");
|
||||||
const https = require("https");
|
const https = require("https");
|
||||||
const fs = require("fs");
|
const fs = require("fs/promises");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const Database = require("./database");
|
const Database = require("./database");
|
||||||
const { axiosAbortSignal } = require("./util-server");
|
const { axiosAbortSignal, fileExists } = require("./util-server");
|
||||||
|
|
||||||
class DockerHost {
|
class DockerHost {
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ class DockerHost {
|
|||||||
options.socketPath = dockerHost.dockerDaemon;
|
options.socketPath = dockerHost.dockerDaemon;
|
||||||
} else if (dockerHost.dockerType === "tcp") {
|
} else if (dockerHost.dockerType === "tcp") {
|
||||||
options.baseURL = DockerHost.patchDockerURL(dockerHost.dockerDaemon);
|
options.baseURL = DockerHost.patchDockerURL(dockerHost.dockerDaemon);
|
||||||
options.httpsAgent = new https.Agent(DockerHost.getHttpsAgentOptions(dockerHost.dockerType, options.baseURL));
|
options.httpsAgent = new https.Agent(await DockerHost.getHttpsAgentOptions(dockerHost.dockerType, options.baseURL));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -143,7 +143,7 @@ class DockerHost {
|
|||||||
* @param {string} url The docker host URL rewritten to https://
|
* @param {string} url The docker host URL rewritten to https://
|
||||||
* @returns {object} HTTP agent options
|
* @returns {object} HTTP agent options
|
||||||
*/
|
*/
|
||||||
static getHttpsAgentOptions(dockerType, url) {
|
static async getHttpsAgentOptions(dockerType, url) {
|
||||||
let baseOptions = {
|
let baseOptions = {
|
||||||
maxCachedSessions: 0,
|
maxCachedSessions: 0,
|
||||||
rejectUnauthorized: true
|
rejectUnauthorized: true
|
||||||
@@ -156,10 +156,10 @@ class DockerHost {
|
|||||||
let certPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameCert);
|
let certPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameCert);
|
||||||
let keyPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameKey);
|
let keyPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameKey);
|
||||||
|
|
||||||
if (dockerType === "tcp" && fs.existsSync(caPath) && fs.existsSync(certPath) && fs.existsSync(keyPath)) {
|
if (dockerType === "tcp" && await fileExists(caPath) && await fileExists(certPath) && await fileExists(keyPath)) {
|
||||||
let ca = fs.readFileSync(caPath);
|
let ca = await fs.readFile(caPath);
|
||||||
let key = fs.readFileSync(keyPath);
|
let key = await fs.readFile(keyPath);
|
||||||
let cert = fs.readFileSync(certPath);
|
let cert = await fs.readFile(certPath);
|
||||||
certOptions = {
|
certOptions = {
|
||||||
ca,
|
ca,
|
||||||
key,
|
key,
|
||||||
|
@@ -747,7 +747,7 @@ class Monitor extends BeanModel {
|
|||||||
} else if (dockerHost._dockerType === "tcp") {
|
} else if (dockerHost._dockerType === "tcp") {
|
||||||
options.baseURL = DockerHost.patchDockerURL(dockerHost._dockerDaemon);
|
options.baseURL = DockerHost.patchDockerURL(dockerHost._dockerDaemon);
|
||||||
options.httpsAgent = new https.Agent(
|
options.httpsAgent = new https.Agent(
|
||||||
DockerHost.getHttpsAgentOptions(dockerHost._dockerType, options.baseURL)
|
await DockerHost.getHttpsAgentOptions(dockerHost._dockerType, options.baseURL)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -897,6 +897,7 @@ class Monitor extends BeanModel {
|
|||||||
retries = 0;
|
retries = 0;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
if (error?.name === "CanceledError") {
|
if (error?.name === "CanceledError") {
|
||||||
bean.msg = `timeout by AbortSignal (${this.timeout}s)`;
|
bean.msg = `timeout by AbortSignal (${this.timeout}s)`;
|
||||||
} else {
|
} else {
|
||||||
@@ -969,7 +970,6 @@ class Monitor extends BeanModel {
|
|||||||
} else if (bean.status === MAINTENANCE) {
|
} else if (bean.status === MAINTENANCE) {
|
||||||
log.warn("monitor", `Monitor #${this.id} '${this.name}': Under Maintenance | Type: ${this.type}`);
|
log.warn("monitor", `Monitor #${this.id} '${this.name}': Under Maintenance | Type: ${this.type}`);
|
||||||
} else {
|
} else {
|
||||||
beatInterval = this.retryInterval;
|
|
||||||
log.warn("monitor", `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`);
|
log.warn("monitor", `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -66,10 +66,6 @@ class StatusPage extends BeanModel {
|
|||||||
head.append($(escapedGoogleAnalyticsScript));
|
head.append($(escapedGoogleAnalyticsScript));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.UPTIME_KUMA_ALLOW_CUSTOM_HTML === "1") {
|
|
||||||
head.append(statusPage.customHtml);
|
|
||||||
}
|
|
||||||
|
|
||||||
// OG Meta Tags
|
// OG Meta Tags
|
||||||
let ogTitle = $("<meta property=\"og:title\" content=\"\" />").attr("content", statusPage.title);
|
let ogTitle = $("<meta property=\"og:title\" content=\"\" />").attr("content", statusPage.title);
|
||||||
head.append(ogTitle);
|
head.append(ogTitle);
|
||||||
@@ -251,7 +247,6 @@ class StatusPage extends BeanModel {
|
|||||||
showPoweredBy: !!this.show_powered_by,
|
showPoweredBy: !!this.show_powered_by,
|
||||||
googleAnalyticsId: this.google_analytics_tag_id,
|
googleAnalyticsId: this.google_analytics_tag_id,
|
||||||
showCertificateExpiry: !!this.show_certificate_expiry,
|
showCertificateExpiry: !!this.show_certificate_expiry,
|
||||||
customHtml: this.custom_html
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +270,6 @@ class StatusPage extends BeanModel {
|
|||||||
showPoweredBy: !!this.show_powered_by,
|
showPoweredBy: !!this.show_powered_by,
|
||||||
googleAnalyticsId: this.google_analytics_tag_id,
|
googleAnalyticsId: this.google_analytics_tag_id,
|
||||||
showCertificateExpiry: !!this.show_certificate_expiry,
|
showCertificateExpiry: !!this.show_certificate_expiry,
|
||||||
customHtml: this.custom_html
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,29 +25,25 @@ class Feishu extends NotificationProvider {
|
|||||||
|
|
||||||
if (heartbeatJSON["status"] === DOWN) {
|
if (heartbeatJSON["status"] === DOWN) {
|
||||||
let downdata = {
|
let downdata = {
|
||||||
msg_type: "interactive",
|
msg_type: "post",
|
||||||
card: {
|
content: {
|
||||||
config: {
|
post: {
|
||||||
update_multi: false,
|
zh_cn: {
|
||||||
wide_screen_mode: true,
|
title: "UptimeKuma Alert: [Down] " + monitorJSON["name"],
|
||||||
},
|
content: [
|
||||||
header: {
|
[
|
||||||
title: {
|
{
|
||||||
tag: "plain_text",
|
tag: "text",
|
||||||
content: "UptimeKuma Alert: [Down] " + monitorJSON["name"],
|
text:
|
||||||
|
"[Down] " +
|
||||||
|
heartbeatJSON["msg"] +
|
||||||
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
},
|
},
|
||||||
template: "red",
|
|
||||||
},
|
},
|
||||||
elements: [
|
},
|
||||||
{
|
|
||||||
tag: "div",
|
|
||||||
text: {
|
|
||||||
tag: "lark_md",
|
|
||||||
content: getContent(heartbeatJSON),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
await axios.post(notification.feishuWebHookUrl, downdata);
|
await axios.post(notification.feishuWebHookUrl, downdata);
|
||||||
return okMsg;
|
return okMsg;
|
||||||
@@ -55,29 +51,25 @@ class Feishu extends NotificationProvider {
|
|||||||
|
|
||||||
if (heartbeatJSON["status"] === UP) {
|
if (heartbeatJSON["status"] === UP) {
|
||||||
let updata = {
|
let updata = {
|
||||||
msg_type: "interactive",
|
msg_type: "post",
|
||||||
card: {
|
content: {
|
||||||
config: {
|
post: {
|
||||||
update_multi: false,
|
zh_cn: {
|
||||||
wide_screen_mode: true,
|
title: "UptimeKuma Alert: [Up] " + monitorJSON["name"],
|
||||||
},
|
content: [
|
||||||
header: {
|
[
|
||||||
title: {
|
{
|
||||||
tag: "plain_text",
|
tag: "text",
|
||||||
content: "UptimeKuma Alert: [UP] " + monitorJSON["name"],
|
text:
|
||||||
|
"[Up] " +
|
||||||
|
heartbeatJSON["msg"] +
|
||||||
|
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
},
|
},
|
||||||
template: "green",
|
|
||||||
},
|
},
|
||||||
elements: [
|
},
|
||||||
{
|
|
||||||
tag: "div",
|
|
||||||
text: {
|
|
||||||
tag: "lark_md",
|
|
||||||
content: getContent(heartbeatJSON),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
await axios.post(notification.feishuWebHookUrl, updata);
|
await axios.post(notification.feishuWebHookUrl, updata);
|
||||||
return okMsg;
|
return okMsg;
|
||||||
@@ -88,17 +80,4 @@ class Feishu extends NotificationProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get content
|
|
||||||
* @param {?object} heartbeatJSON Heartbeat details (For Up/Down only)
|
|
||||||
* @returns {string} Return Successful Message
|
|
||||||
*/
|
|
||||||
function getContent(heartbeatJSON) {
|
|
||||||
return [
|
|
||||||
"**Message**: " + heartbeatJSON["msg"],
|
|
||||||
"**Ping**: " + (heartbeatJSON["ping"] == null ? "N/A" : heartbeatJSON["ping"] + " ms"),
|
|
||||||
`**Time (${heartbeatJSON["timezone"]})**: ${heartbeatJSON["localDateTime"]}`
|
|
||||||
].join("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Feishu;
|
module.exports = Feishu;
|
||||||
|
@@ -44,8 +44,9 @@ router.get("/api/entry-page", async (request, response) => {
|
|||||||
response.json(result);
|
response.json(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
router.all("/api/push/:pushToken", async (request, response) => {
|
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 = parseFloat(request.query.ping) || null;
|
let ping = parseFloat(request.query.ping) || null;
|
||||||
|
@@ -4,7 +4,7 @@ const { sendInfo } = require("../client");
|
|||||||
const { checkLogin } = require("../util-server");
|
const { checkLogin } = require("../util-server");
|
||||||
const GameResolver = require("gamedig/lib/GameResolver");
|
const GameResolver = require("gamedig/lib/GameResolver");
|
||||||
const { testChrome } = require("../monitor-types/real-browser-monitor-type");
|
const { testChrome } = require("../monitor-types/real-browser-monitor-type");
|
||||||
const fs = require("fs");
|
const fs = require("fs/promises");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
let gameResolver = new GameResolver();
|
let gameResolver = new GameResolver();
|
||||||
@@ -85,17 +85,17 @@ module.exports.generalSocketHandler = (socket, server) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("getPushExample", (language, callback) => {
|
socket.on("getPushExample", async (language, callback) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let dir = path.join("./extra/push-examples", language);
|
let dir = path.join("./extra/push-examples", language);
|
||||||
let files = fs.readdirSync(dir);
|
let files = await fs.readdir(dir);
|
||||||
|
|
||||||
for (let file of files) {
|
for (let file of files) {
|
||||||
if (file.startsWith("index.")) {
|
if (file.startsWith("index.")) {
|
||||||
callback({
|
callback({
|
||||||
ok: true,
|
ok: true,
|
||||||
code: fs.readFileSync(path.join(dir, file), "utf8"),
|
code: await fs.readFile(path.join(dir, file), "utf8"),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -101,11 +101,10 @@ module.exports.statusPageSocketHandler = (socket) => {
|
|||||||
if (!statusPage) {
|
if (!statusPage) {
|
||||||
throw new Error("No slug?");
|
throw new Error("No slug?");
|
||||||
}
|
}
|
||||||
const config = await statusPage.toJSON();
|
|
||||||
config.allowEditingCustomHtml = import.meta.env.UPTIME_KUMA_ALLOW_CUSTOM_HTML === "1";
|
|
||||||
callback({
|
callback({
|
||||||
ok: true,
|
ok: true,
|
||||||
config,
|
config: await statusPage.toJSON(),
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
callback({
|
callback({
|
||||||
@@ -168,9 +167,6 @@ module.exports.statusPageSocketHandler = (socket) => {
|
|||||||
statusPage.show_certificate_expiry = config.showCertificateExpiry;
|
statusPage.show_certificate_expiry = config.showCertificateExpiry;
|
||||||
statusPage.modified_date = R.isoDateTime();
|
statusPage.modified_date = R.isoDateTime();
|
||||||
statusPage.google_analytics_tag_id = config.googleAnalyticsId;
|
statusPage.google_analytics_tag_id = config.googleAnalyticsId;
|
||||||
if (process.env.UPTIME_KUMA_ALLOW_CUSTOM_HTML === "1") {
|
|
||||||
statusPage.custom_html = config.customHtml;
|
|
||||||
}
|
|
||||||
|
|
||||||
await R.store(statusPage);
|
await R.store(statusPage);
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@ const radiusClient = require("node-radius-client");
|
|||||||
const redis = require("redis");
|
const redis = require("redis");
|
||||||
const oidc = require("openid-client");
|
const oidc = require("openid-client");
|
||||||
const tls = require("tls");
|
const tls = require("tls");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
const {
|
const {
|
||||||
dictionaries: {
|
dictionaries: {
|
||||||
@@ -1062,3 +1063,9 @@ module.exports.axiosAbortSignal = (timeoutMs) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.fileExists = (file) => {
|
||||||
|
return fs.promises.access(file, fs.constants.F_OK)
|
||||||
|
.then(() => true)
|
||||||
|
.catch(() => false);
|
||||||
|
};
|
||||||
|
@@ -776,9 +776,6 @@
|
|||||||
"wayToGetClickSendSMSToken": "You can get API Username and API Key from {0} .",
|
"wayToGetClickSendSMSToken": "You can get API Username and API Key from {0} .",
|
||||||
"Custom Monitor Type": "Custom Monitor Type",
|
"Custom Monitor Type": "Custom Monitor Type",
|
||||||
"Google Analytics ID": "Google Analytics ID",
|
"Google Analytics ID": "Google Analytics ID",
|
||||||
"Custom HTML": "Custom HTML",
|
|
||||||
"customHtmlEnvVarDisabled": "environment variable {allow_custom_html} must be set to inject html to the head",
|
|
||||||
"customHtmlEnvVarEnabled": "Because the environment variable {allow_custom_html} is set, arbitrary html can be injected into the head. Make sure to remove the environment variable after use",
|
|
||||||
"Edit Tag": "Edit Tag",
|
"Edit Tag": "Edit Tag",
|
||||||
"Server Address": "Server Address",
|
"Server Address": "Server Address",
|
||||||
"Learn More": "Learn More",
|
"Learn More": "Learn More",
|
||||||
|
@@ -211,20 +211,6 @@ export default {
|
|||||||
@import "../assets/vars.scss";
|
@import "../assets/vars.scss";
|
||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
&:hover {
|
|
||||||
background-color: $primary;
|
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
.dark & {
|
|
||||||
background-color: $primary;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
background-color: $highlight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.status-page {
|
&.status-page {
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
@@ -370,10 +370,9 @@
|
|||||||
<label for="jsonPath" class="form-label">{{ $t("Json Query") }}</label>
|
<label for="jsonPath" class="form-label">{{ $t("Json Query") }}</label>
|
||||||
<input id="jsonPath" v-model="monitor.jsonPath" type="text" class="form-control" required>
|
<input id="jsonPath" v-model="monitor.jsonPath" type="text" class="form-control" required>
|
||||||
|
|
||||||
<i18n-t tag="div" class="form-text" keypath="jsonQueryDescription">
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||||
<a href="https://jsonata.org/">jsonata.org</a>
|
<div class="form-text" v-html="$t('jsonQueryDescription')">
|
||||||
<a href="https://try.jsonata.org/">{{ $t('here') }}</a>
|
</div>
|
||||||
</i18n-t>
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<label for="expectedValue" class="form-label">{{ $t("Expected Value") }}</label>
|
<label for="expectedValue" class="form-label">{{ $t("Expected Value") }}</label>
|
||||||
|
@@ -104,22 +104,6 @@
|
|||||||
<prism-editor v-model="config.customCSS" class="css-editor" :highlight="highlighter" line-numbers></prism-editor>
|
<prism-editor v-model="config.customCSS" class="css-editor" :highlight="highlighter" line-numbers></prism-editor>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Custom HTML -->
|
|
||||||
<div class="my-3">
|
|
||||||
<div class="mb-1">{{ $t("Custom HTML") }}</div>
|
|
||||||
<prism-editor v-model="config.customHtml" class="css-editor" :highlight="highlighter" line-numbers :readonly="!config.allowEditingCustomHtml"></prism-editor>
|
|
||||||
<i18n-t v-if="config.allowEditingCustomHtml" tag="div" class="form-text" keypath="customHtmlEnvVarEnabled">
|
|
||||||
<template #allow_custom_html>
|
|
||||||
<code>UPTIME_KUMA_ALLOW_CUSTOM_HTML</code>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
<i18n-t v-else tag="div" class="form-text" keypath="customHtmlEnvVarDisabled">
|
|
||||||
<template #allow_custom_html>
|
|
||||||
<code>UPTIME_KUMA_ALLOW_CUSTOM_HTML=1</code>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="danger-zone">
|
<div class="danger-zone">
|
||||||
<button class="btn btn-danger me-2" @click="deleteDialog">
|
<button class="btn btn-danger me-2" @click="deleteDialog">
|
||||||
<font-awesome-icon icon="trash" />
|
<font-awesome-icon icon="trash" />
|
||||||
|
Reference in New Issue
Block a user