Compare commits

...

3 commits

Author SHA1 Message Date
Frank Elsinga 76490bf0bf
Merge 7cae3e1999 into cd5644d6d2 2024-07-31 15:58:29 +00:00
taisei cd5644d6d2
Remove markdown with meta tags (#4968)
Some checks failed
Auto Test / check-linters (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
json-yaml-validate / json-yaml-validate (push) Has been cancelled
Auto Test / auto-test (18, ARM64) (push) Has been cancelled
Auto Test / auto-test (18, macos-latest) (push) Has been cancelled
Auto Test / auto-test (18, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (18, windows-latest) (push) Has been cancelled
Auto Test / auto-test (20.5, ARM64) (push) Has been cancelled
Auto Test / auto-test (20.5, macos-latest) (push) Has been cancelled
Auto Test / auto-test (20.5, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (20.5, windows-latest) (push) Has been cancelled
Auto Test / armv7-simple-test (18, ARMv7) (push) Has been cancelled
Auto Test / armv7-simple-test (20, ARMv7) (push) Has been cancelled
Auto Test / e2e-test (push) Has been cancelled
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2024-07-31 17:58:13 +02:00
Cyril59310 7cae3e1999 Made sure that "time ago" is translatable
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2024-06-03 22:07:33 +02:00
3 changed files with 14 additions and 6 deletions

View file

@ -4,6 +4,7 @@ const cheerio = require("cheerio");
const { UptimeKumaServer } = require("../uptime-kuma-server");
const jsesc = require("jsesc");
const googleAnalytics = require("../google-analytics");
const { marked } = require("marked");
class StatusPage extends BeanModel {
@ -46,7 +47,11 @@ class StatusPage extends BeanModel {
*/
static async renderHTML(indexHTML, statusPage) {
const $ = cheerio.load(indexHTML);
const description155 = statusPage.description?.substring(0, 155) ?? "";
const description155 = marked(statusPage.description ?? "")
.replace(/<[^>]+>/gm, "")
.trim()
.substring(0, 155);
$("title").text(statusPage.title);
$("meta[name=description]").attr("content", description155);

View file

@ -14,7 +14,7 @@
v-if="!$root.isMobile && size !== 'small' && beatList.length > 4 && $root.styleElapsedTime !== 'none'"
class="d-flex justify-content-between align-items-center word" :style="timeStyle"
>
<div>{{ timeSinceFirstBeat }} ago</div>
<div>{{ $t("time ago", [timeSinceFirstBeat]) }}</div>
<div v-if="$root.styleElapsedTime === 'with-line'" class="connecting-line"></div>
<div>{{ timeSinceLastBeat }}</div>
</div>
@ -184,11 +184,11 @@ export default {
}
if (seconds < tolerance) {
return "now";
return (this.$t("now"));
} else if (seconds < 60 * 60) {
return (seconds / 60).toFixed(0) + "m ago";
return (seconds / 60).toFixed(0) + "m";
} else {
return (seconds / 60 / 60).toFixed(0) + "h ago";
return (seconds / 60 / 60).toFixed(0) + "h";
}
}
},

View file

@ -49,10 +49,13 @@
"Uptime": "Uptime",
"Cert Exp.": "Cert Exp.",
"Monitor": "Monitor | Monitors",
"now": "now",
"time ago": "{0} ago",
"day": "day | days",
"-day": "-day",
"hour": "hour",
"-hour": "-hour",
"-year": "-year",
"Response": "Response",
"Ping": "Ping",
"Monitor Type": "Monitor Type",
@ -80,7 +83,7 @@
"resendDisabled": "Resend disabled",
"retriesDescription": "Maximum retries before the service is marked as down and a notification is sent",
"ignoreTLSError": "Ignore TLS/SSL errors for HTTPS websites",
"ignoreTLSErrorGeneral": "Ignore TLS/SSL error for connection",
"ignoreTLSErrorGeneral": "Ignore TLS/SSL error for connection",
"upsideDownModeDescription": "Flip the status upside down. If the service is reachable, it is DOWN.",
"maxRedirectDescription": "Maximum number of redirects to follow. Set to 0 to disable redirects.",
"Upside Down Mode": "Upside Down Mode",