From 80efe9b831331da2e96f0f090f05fc6997ad3ec4 Mon Sep 17 00:00:00 2001 From: dakriy Date: Wed, 29 Nov 2023 01:25:33 -0800 Subject: [PATCH 01/93] Handle cookies on redirection (#3589) * feat: Set and send cookies on redirection (louislam#3587). * feat: Make proxy agents handle cookies * Merge package-lock.json * Merge package-lock.json * Fix lint --------- Co-authored-by: Louis Lam --- package-lock.json | 52 ++++++++++++++++++++++++++++++++++------- package.json | 2 ++ server/model/monitor.js | 10 ++++++-- server/proxy.js | 20 ++++++++++++---- 4 files changed, 69 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index d5f1699f6..cf5ff68cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "form-data": "~4.0.0", "gamedig": "~4.1.0", "html-escaper": "^3.0.3", + "http-cookie-agent": "~5.0.4", "http-graceful-shutdown": "~3.1.7", "http-proxy-agent": "~5.0.0", "https-proxy-agent": "~5.0.1", @@ -76,6 +77,7 @@ "tar": "~6.1.11", "tcp-ping": "~0.1.1", "thirty-two": "~1.0.2", + "tough-cookie": "~4.1.3", "ws": "^8.13.0" }, "devDependencies": { @@ -9077,6 +9079,44 @@ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, + "node_modules/http-cookie-agent": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/http-cookie-agent/-/http-cookie-agent-5.0.4.tgz", + "integrity": "sha512-OtvikW69RvfyP6Lsequ0fN5R49S+8QcS9zwd58k6VSr6r57T8G29BkPdyrBcSwLq6ExLs9V+rBlfxu7gDstJag==", + "dependencies": { + "agent-base": "^7.1.0" + }, + "engines": { + "node": ">=14.18.0 <15.0.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/3846masa" + }, + "peerDependencies": { + "deasync": "^0.1.26", + "tough-cookie": "^4.0.0", + "undici": "^5.11.0" + }, + "peerDependenciesMeta": { + "deasync": { + "optional": true + }, + "undici": { + "optional": true + } + } + }, + "node_modules/http-cookie-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/http-errors": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", @@ -13000,8 +13040,7 @@ "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, "node_modules/pump": { "version": "3.0.0", @@ -13155,8 +13194,7 @@ "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -13640,8 +13678,7 @@ "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, "node_modules/resolve": { "version": "1.22.8", @@ -15320,7 +15357,6 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", - "dev": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -15335,7 +15371,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -15670,7 +15705,6 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" diff --git a/package.json b/package.json index 3d4ac3fb0..681efb9d8 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "express-static-gzip": "~2.1.7", "form-data": "~4.0.0", "gamedig": "~4.1.0", + "http-cookie-agent": "~5.0.4", "html-escaper": "^3.0.3", "http-graceful-shutdown": "~3.1.7", "http-proxy-agent": "~5.0.0", @@ -140,6 +141,7 @@ "tar": "~6.1.11", "tcp-ping": "~0.1.1", "thirty-two": "~1.0.2", + "tough-cookie": "~4.1.3", "ws": "^8.13.0" }, "devDependencies": { diff --git a/server/model/monitor.js b/server/model/monitor.js index 97cfcb181..42d6ad0fb 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1,4 +1,3 @@ -const https = require("https"); const dayjs = require("dayjs"); const axios = require("axios"); const { Prometheus } = require("../prometheus"); @@ -23,6 +22,8 @@ const jsonata = require("jsonata"); const jwt = require("jsonwebtoken"); const crypto = require("crypto"); const { UptimeCalculator } = require("../uptime-calculator"); +const { CookieJar } = require("tough-cookie"); +const { HttpsCookieAgent } = require("http-cookie-agent/http"); const rootCertificates = rootCertificatesFingerprints(); @@ -507,7 +508,12 @@ class Monitor extends BeanModel { } if (!options.httpsAgent) { - options.httpsAgent = new https.Agent(httpsAgentOptions); + let jar = new CookieJar(); + let httpsCookieAgentOptions = { + ...httpsAgentOptions, + cookies: { jar } + }; + options.httpsAgent = new HttpsCookieAgent(httpsCookieAgentOptions); } if (this.auth_method === "mtls") { diff --git a/server/proxy.js b/server/proxy.js index a0b4378d1..3f3771ab9 100644 --- a/server/proxy.js +++ b/server/proxy.js @@ -4,6 +4,8 @@ const HttpsProxyAgent = require("https-proxy-agent"); const SocksProxyAgent = require("socks-proxy-agent"); const { debug } = require("../src/util"); const { UptimeKumaServer } = require("./uptime-kuma-server"); +const { CookieJar } = require("tough-cookie"); +const { createCookieAgent } = require("http-cookie-agent/http"); class Proxy { @@ -95,10 +97,13 @@ class Proxy { let httpAgent; let httpsAgent; + let jar = new CookieJar(); + const proxyOptions = { protocol: proxy.protocol, host: proxy.host, port: proxy.port, + cookies: { jar }, }; if (proxy.auth) { @@ -112,12 +117,17 @@ class Proxy { switch (proxy.protocol) { case "http": case "https": - httpAgent = new HttpProxyAgent({ + // eslint-disable-next-line no-case-declarations + const HttpCookieProxyAgent = createCookieAgent(HttpProxyAgent); + // eslint-disable-next-line no-case-declarations + const HttpsCookieProxyAgent = createCookieAgent(HttpsProxyAgent); + + httpAgent = new HttpCookieProxyAgent({ ...httpAgentOptions || {}, - ...proxyOptions + ...proxyOptions, }); - httpsAgent = new HttpsProxyAgent({ + httpsAgent = new HttpsCookieProxyAgent({ ...httpsAgentOptions || {}, ...proxyOptions, }); @@ -126,7 +136,9 @@ class Proxy { case "socks5": case "socks5h": case "socks4": - agent = new SocksProxyAgent({ + // eslint-disable-next-line no-case-declarations + const SocksCookieProxyAgent = createCookieAgent(SocksProxyAgent); + agent = new SocksCookieProxyAgent({ ...httpAgentOptions, ...httpsAgentOptions, ...proxyOptions, From 01855e0ffefa7ca8b062c4be326c4239e8f5043a Mon Sep 17 00:00:00 2001 From: Nenad Gal Date: Thu, 30 Nov 2023 08:58:01 +0100 Subject: [PATCH 02/93] monitor path as a notification title mattermost (#3801) --- server/notification-providers/mattermost.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/notification-providers/mattermost.js b/server/notification-providers/mattermost.js index 9cbb51bbf..5a6a8e2c5 100644 --- a/server/notification-providers/mattermost.js +++ b/server/notification-providers/mattermost.js @@ -78,12 +78,12 @@ class Mattermost extends NotificationProvider { { fallback: "Your " + - monitorJSON.name + + monitorJSON.pathName + " service went " + statusText, color: color, title: - monitorJSON.name + + monitorJSON.pathName + " service went " + statusText, title_link: monitorJSON.url, From 1708b67949ca183b2ee86ef70e9e51c5f721a73e Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 30 Nov 2023 16:12:04 +0800 Subject: [PATCH 03/93] Change execSync/spawnSync to async (#4123) * WIP * Add missing await * Update package-lock.json --- package-lock.json | 9 +++++++++ package.json | 1 + server/monitor-types/tailscale-ping.js | 7 ++----- server/notification-providers/apprise.js | 4 ++-- server/server.js | 4 ++-- server/uptime-kuma-server.js | 14 +++++++------- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 248e64a5e..705fe812a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,6 +63,7 @@ "playwright-core": "~1.35.1", "prom-client": "~13.2.0", "prometheus-api-metrics": "~3.2.1", + "promisify-child-process": "~4.1.2", "protobufjs": "~7.2.4", "qs": "~6.10.4", "redbean-node": "~0.3.0", @@ -15751,6 +15752,14 @@ "node": ">=10" } }, + "node_modules/promisify-child-process": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/promisify-child-process/-/promisify-child-process-4.1.2.tgz", + "integrity": "sha512-APnkIgmaHNJpkAn7k+CrJSi9WMuff5ctYFbD0CO2XIPkM8yO7d/ShouU2clywbpHV/DUsyc4bpJCsNgddNtx4g==", + "engines": { + "node": ">=8" + } + }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", diff --git a/package.json b/package.json index b24f3ec21..a9db8556f 100644 --- a/package.json +++ b/package.json @@ -130,6 +130,7 @@ "playwright-core": "~1.35.1", "prom-client": "~13.2.0", "prometheus-api-metrics": "~3.2.1", + "promisify-child-process": "~4.1.2", "protobufjs": "~7.2.4", "qs": "~6.10.4", "redbean-node": "~0.3.0", diff --git a/server/monitor-types/tailscale-ping.js b/server/monitor-types/tailscale-ping.js index 3b2ac487f..1b2be2003 100644 --- a/server/monitor-types/tailscale-ping.js +++ b/server/monitor-types/tailscale-ping.js @@ -1,6 +1,6 @@ const { MonitorType } = require("./monitor-type"); const { UP } = require("../../src/util"); -const childProcess = require("child_process"); +const childProcessAsync = require("promisify-child-process"); /** * A TailscalePing class extends the MonitorType. @@ -38,12 +38,9 @@ class TailscalePing extends MonitorType { */ async runTailscalePing(hostname, interval) { let timeout = interval * 1000 * 0.8; - let res = childProcess.spawnSync("tailscale", [ "ping", hostname ], { + let res = await childProcessAsync.spawn("tailscale", [ "ping", "--c", "1", hostname ], { timeout: timeout }); - if (res.error) { - throw new Error(`Execution error: ${res.error.message}`); - } if (res.stderr && res.stderr.toString()) { throw new Error(`Error in output: ${res.stderr.toString()}`); } diff --git a/server/notification-providers/apprise.js b/server/notification-providers/apprise.js index 887afbf55..1943aaa60 100644 --- a/server/notification-providers/apprise.js +++ b/server/notification-providers/apprise.js @@ -1,5 +1,5 @@ const NotificationProvider = require("./notification-provider"); -const childProcess = require("child_process"); +const childProcessAsync = require("promisify-child-process"); class Apprise extends NotificationProvider { @@ -11,7 +11,7 @@ class Apprise extends NotificationProvider { args.push("-t"); args.push(notification.title); } - const s = childProcess.spawnSync("apprise", args); + const s = await childProcessAsync.spawn("apprise", args); const output = (s.stdout) ? s.stdout.toString() : "ERROR: maybe apprise not found"; diff --git a/server/server.js b/server/server.js index 9d509b45e..13dd16018 100644 --- a/server/server.js +++ b/server/server.js @@ -1223,9 +1223,9 @@ let needSetup = false; // Update nscd status if (previousNSCDStatus !== data.nscd) { if (data.nscd) { - server.startNSCDServices(); + await server.startNSCDServices(); } else { - server.stopNSCDServices(); + await server.stopNSCDServices(); } } diff --git a/server/uptime-kuma-server.js b/server/uptime-kuma-server.js index 6acc8d4df..28df64615 100644 --- a/server/uptime-kuma-server.js +++ b/server/uptime-kuma-server.js @@ -10,7 +10,7 @@ const util = require("util"); const { CacheableDnsHttpAgent } = require("./cacheable-dns-http-agent"); const { Settings } = require("./settings"); const dayjs = require("dayjs"); -const childProcess = require("child_process"); +const childProcessAsync = require("promisify-child-process"); const path = require("path"); // DO NOT IMPORT HERE IF THE MODULES USED `UptimeKumaServer.getInstance()`, put at the bottom of this file instead. @@ -344,7 +344,7 @@ class UptimeKumaServer { let enable = await Settings.get("nscd"); if (enable || enable === null) { - this.startNSCDServices(); + await this.startNSCDServices(); } } @@ -356,7 +356,7 @@ class UptimeKumaServer { let enable = await Settings.get("nscd"); if (enable || enable === null) { - this.stopNSCDServices(); + await this.stopNSCDServices(); } } @@ -364,11 +364,11 @@ class UptimeKumaServer { * Start all system services (e.g. nscd) * For now, only used in Docker */ - startNSCDServices() { + async startNSCDServices() { if (process.env.UPTIME_KUMA_IS_CONTAINER) { try { log.info("services", "Starting nscd"); - childProcess.execSync("sudo service nscd start", { stdio: "pipe" }); + await childProcessAsync.exec("sudo service nscd start"); } catch (e) { log.info("services", "Failed to start nscd"); } @@ -378,11 +378,11 @@ class UptimeKumaServer { /** * Stop all system services */ - stopNSCDServices() { + async stopNSCDServices() { if (process.env.UPTIME_KUMA_IS_CONTAINER) { try { log.info("services", "Stopping nscd"); - childProcess.execSync("sudo service nscd stop"); + await childProcessAsync.exec("sudo service nscd stop"); } catch (e) { log.info("services", "Failed to stop nscd"); } From 0294118cbf39018d1bfada5d10a8917eee5d3439 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 30 Nov 2023 20:37:07 +0800 Subject: [PATCH 04/93] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1502f392a..c79eefcaa 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,12 @@ I recommend using Google, GitHub Issues, or Uptime Kuma's subreddit for finding My Reddit account: [u/louislamlam](https://reddit.com/u/louislamlam) You can mention me if you ask a question on the subreddit. -## Contribute +## Contributions + +### Create Pull Requests + +We DO NOT accept all types of pull requests and do not want to waste your time. Please be sure that you have read and follow pull request rules: +[CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma) ### Test Pull Requests @@ -183,6 +188,4 @@ If you want to translate Uptime Kuma into your language, please visit [Weblate R Feel free to correct the grammar in the documentation or code. My mother language is not English and my grammar is not that great. -### Create Pull Requests -If you want to modify Uptime Kuma, please read this guide and follow the rules here: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md From 57a18958d6bbbb317bf995095051cedcd37ebae7 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 1 Dec 2023 11:42:31 +0800 Subject: [PATCH 05/93] Update gamedig from ~4.1.0 to ^4.2.0 (#4136) --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 705fe812a..2d19814bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "express-basic-auth": "~1.2.1", "express-static-gzip": "~2.1.7", "form-data": "~4.0.0", - "gamedig": "~4.1.0", + "gamedig": "^4.2.0", "html-escaper": "^3.0.3", "http-graceful-shutdown": "~3.1.7", "http-proxy-agent": "~5.0.0", @@ -10252,9 +10252,9 @@ } }, "node_modules/gamedig": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/gamedig/-/gamedig-4.1.0.tgz", - "integrity": "sha512-jvLUEakihJgpiw9t9yQRsbcemeALeTNlnaWY1gvYdwI63ZlkxznTaLqX5K/eluRTTCtAWNW3YceT6NVjyAZIwA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/gamedig/-/gamedig-4.2.0.tgz", + "integrity": "sha512-UwV9gT1PrOTxjwGzj9/i8XJLx9QqmzFtrRJnRLqN7fZWEIRHjbuUpx2b6Y3v/5QyRDFP+vaB3Pm0hw3Xg4RnOQ==", "dependencies": { "cheerio": "^1.0.0-rc.10", "gbxremote": "^0.2.1", diff --git a/package.json b/package.json index a9db8556f..d1861fbb4 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "express-basic-auth": "~1.2.1", "express-static-gzip": "~2.1.7", "form-data": "~4.0.0", - "gamedig": "~4.1.0", + "gamedig": "^4.2.0", "html-escaper": "^3.0.3", "http-graceful-shutdown": "~3.1.7", "http-proxy-agent": "~5.0.0", From cb3a104dc0ec3727015e5531d01bdf65f0e57091 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 1 Dec 2023 14:09:13 +0800 Subject: [PATCH 06/93] Default Retries from 1 to 0 (#4139) * Default "Retries" from 1 to 0 --- src/pages/EditMonitor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index f83eec017..cb04f138e 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -860,7 +860,7 @@ const monitorDefaults = { interval: 60, retryInterval: 60, resendInterval: 0, - maxretries: 1, + maxretries: 0, timeout: 48, notificationIDList: {}, ignoreTls: false, From 1e75d81bcff7d2d16c0517f98236eda3a5dcb72d Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 1 Dec 2023 14:16:35 +0800 Subject: [PATCH 07/93] Update apprise from 1.4.5 to 1.6.0 (#4140) --- docker/debian-base.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/debian-base.dockerfile b/docker/debian-base.dockerfile index bd609830a..2be159d03 100644 --- a/docker/debian-base.dockerfile +++ b/docker/debian-base.dockerfile @@ -27,7 +27,7 @@ RUN apt-get update && \ ca-certificates \ sudo \ nscd && \ - pip3 --no-cache-dir install apprise==1.4.5 && \ + pip3 --no-cache-dir install apprise==1.6.0 && \ rm -rf /var/lib/apt/lists/* && \ apt --yes autoremove From 9fb95fe95e3a05b3436fd735a87a2072d22d7df5 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 1 Dec 2023 14:25:41 +0800 Subject: [PATCH 08/93] Add support for /snap/bin/chromium (#4141) --- server/monitor-types/real-browser-monitor-type.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/monitor-types/real-browser-monitor-type.js b/server/monitor-types/real-browser-monitor-type.js index f3e5695f8..5e5a56a00 100644 --- a/server/monitor-types/real-browser-monitor-type.js +++ b/server/monitor-types/real-browser-monitor-type.js @@ -40,6 +40,7 @@ if (process.platform === "win32") { "/usr/bin/chromium", "/usr/bin/chromium-browser", "/usr/bin/google-chrome", + "/snap/bin/chromium", // Ubuntu ]; } else if (process.platform === "darwin") { // TODO: Generated by GitHub Copilot, but not sure if it's correct From 9c9a086788f76a88dc833348eaa0fb042e9623f0 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 1 Dec 2023 07:34:37 +0100 Subject: [PATCH 09/93] accessible `ActionSelect`/ `ActionInput` (#4132) * made sure that the ActionSelect'or has correct accessibiltiy tags * fixed linting error * improved the ActionInputs accessibility --- src/components/ActionInput.vue | 11 +++++++++-- src/components/ActionSelect.vue | 22 ++++++++++++++++++---- src/components/settings/Notifications.vue | 6 +++--- src/lang/en.json | 4 ++++ src/pages/EditMonitor.vue | 6 +++++- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/components/ActionInput.vue b/src/components/ActionInput.vue index fe3504b17..44c9e586f 100644 --- a/src/components/ActionInput.vue +++ b/src/components/ActionInput.vue @@ -8,9 +8,9 @@ :placeholder="placeholder" :disabled="!enabled" > - + @@ -66,6 +66,13 @@ export default { action: { type: Function, default: () => {}, + }, + /** + * The aria-label of the action button + */ + actionAriaLabel: { + type: String, + required: true, } }, emits: [ "update:modelValue" ], diff --git a/src/components/ActionSelect.vue b/src/components/ActionSelect.vue index 78daebc26..b163cd3a0 100644 --- a/src/components/ActionSelect.vue +++ b/src/components/ActionSelect.vue @@ -1,11 +1,11 @@ @@ -20,6 +20,13 @@ export default { type: Array, default: () => [], }, + /** + * The id of the form which will be targeted by a