1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-12-24 22:14:47 +02:00

Merge branch 'master' into public-dashboard

This commit is contained in:
LouisLam 2021-09-16 22:52:05 +08:00
commit 579e07ded4
16 changed files with 99 additions and 76 deletions

View File

@ -1,4 +1,5 @@
module.exports = {
root: true,
env: {
browser: true,
commonjs: true,

View File

@ -1,4 +1,4 @@
// Need to use es6 to read language files
// Need to use ES6 to read language files
import fs from "fs";
import path from "path";
@ -14,6 +14,7 @@ const copyRecursiveSync = function (src, dest) {
let exists = fs.existsSync(src);
let stats = exists && fs.statSync(src);
let isDirectory = exists && stats.isDirectory();
if (isDirectory) {
fs.mkdirSync(dest);
fs.readdirSync(src).forEach(function (childItemName) {
@ -24,8 +25,9 @@ const copyRecursiveSync = function (src, dest) {
fs.copyFileSync(src, dest);
}
};
console.log(process.argv)
const baseLangCode = process.argv[2] || "zh-HK";
console.log("Arguments:", process.argv)
const baseLangCode = process.argv[2] || "en";
console.log("Base Lang: " + baseLangCode);
fs.rmdirSync("./languages", { recursive: true });
copyRecursiveSync("../../src/languages", "./languages");
@ -33,46 +35,50 @@ copyRecursiveSync("../../src/languages", "./languages");
const en = (await import("./languages/en.js")).default;
const baseLang = (await import(`./languages/${baseLangCode}.js`)).default;
const files = fs.readdirSync("./languages");
console.log(files);
console.log("Files:", files);
for (const file of files) {
if (file.endsWith(".js")) {
console.log("Processing " + file);
const lang = await import("./languages/" + file);
if (!file.endsWith(".js")) {
console.log("Skipping " + file)
continue;
}
let obj;
console.log("Processing " + file);
const lang = await import("./languages/" + file);
if (lang.default) {
console.log("is js module");
obj = lang.default;
} else {
console.log("empty file");
obj = {
languageName: "<Your Language name in your language (not in English)>"
};
}
// En first
for (const key in en) {
if (! obj[key]) {
obj[key] = en[key];
}
let obj;
if (lang.default) {
obj = lang.default;
} else {
console.log("Empty file");
obj = {
languageName: "<Your Language name in your language (not in English)>"
};
}
// En first
for (const key in en) {
if (! obj[key]) {
obj[key] = en[key];
}
}
if (baseLang !== en) {
// Base second
for (const key in baseLang) {
if (! obj[key]) {
obj[key] = key;
}
}
const code = "export default " + util.inspect(obj, {
depth: null,
});
fs.writeFileSync(`../../src/languages/${file}`, code);
}
const code = "export default " + util.inspect(obj, {
depth: null,
});
fs.writeFileSync(`../../src/languages/${file}`, code);
}
fs.rmdirSync("./languages", { recursive: true });
console.log("Done, fix the format by eslint now");
console.log("Done. Fixing formatting by ESLint...");

View File

@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<link rel="manifest" href="manifest.json" />
<meta name="theme-color" id="theme-color" content="" />
<meta name="description" content="Uptime Kuma monitoring tool" />
<title>Uptime Kuma</title>

View File

@ -35,7 +35,8 @@
"test-install-script-ubuntu": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu.dockerfile .",
"test-install-script-ubuntu1604": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu1604.dockerfile .",
"simple-dns-server": "node extra/simple-dns-server.js",
"update-language-files": "cd extra/update-language-files && node index.js %npm_config_base_lang% && eslint ../../src/languages/**.js --fix"
"update-language-files_old": "cd extra/update-language-files && node index.js %npm_config_base_lang% && eslint ../../src/languages/**.js --fix",
"update-language-files": "cd extra/update-language-files && node index.js && eslint ../../src/languages/**.js --fix"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.36",

BIN
public/icon-192x192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
public/icon-512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

19
public/manifest.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "Uptime Kuma",
"short_name": "Uptime Kuma",
"start_url": "/",
"background_color": "#fff",
"display": "standalone",
"icons": [
{
"src": "icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@ -1,8 +1,8 @@
# How to translate
1. Fork this repo.
2. Create a language file. (e.g. `zh-TW.js`) The filename must be ISO language code: http://www.lingoes.net/en/translator/langcode.htm
3. `npm run update-language-files --base-lang=de-DE`
2. Create a language file (e.g. `zh-TW.js`). The filename must be ISO language code: http://www.lingoes.net/en/translator/langcode.htm
3. Run `npm run update-language-files`. You can also use this command to check if there are new strings to translate for your language.
4. Your language file should be filled in. You can translate now.
5. Translate `src/pages/Settings.vue` (search for a `Confirm` component with `rel="confirmDisableAuth"`).
6. Import your language file in `src/i18n.js` and add it to `languageList` constant.

View File

@ -113,9 +113,6 @@ export default {
"Create your admin account": "Erstelle dein Admin Konto",
"Repeat Password": "Wiederhole das Passwort",
"Resource Record Type": "Resource Record Type",
"Export": "Export",
"Import": "Import",
"Import/Export Backup": "Import/Export Backup",
Export: "Export",
Import: "Import",
respTime: "Antw. Zeit (ms)",
@ -133,8 +130,8 @@ export default {
"Clear all statistics": "Lösche alle Statistiken",
importHandleDescription: "Wähle 'Vorhandene überspringen' aus, wenn jeder Monitor oder Benachrichtigung mit demselben Namen übersprungen werden soll. 'Überschreiben' löscht jeden vorhandenen Monitor sowie Benachrichtigungen.",
"Skip existing": "Vorhandene überspringen",
"Overwrite": "Überschreiben",
"Options": "Optionen",
Overwrite: "Überschreiben",
Options: "Optionen",
confirmImportMsg: "Möchtest du das Backup wirklich importieren? Bitte stelle sicher, dass die richtige Import Option ausgewählt ist.",
"Keep both": "Beide behalten",
twoFAVerifyLabel: "Bitte trage deinen Token ein um zu verifizieren das 2FA funktioniert",
@ -151,7 +148,6 @@ export default {
Inactive: "Inaktiv",
Token: "Token",
"Show URI": "URI Anzeigen",
"Clear all statistics": "Lösche alle Statistiken",
Tags: "Tags",
"Add New below or Select...": "Füge neuen hinzu oder wähle aus...",
"Tag with this name already exist.": "Ein Tag mit dem Namen existiert bereits.",
@ -167,4 +163,8 @@ export default {
Purple: "Lila",
Pink: "Pink",
"Search...": "Suchen...",
"Heartbeat Retry Interval": "Takt-Wiederholungsintervall",
retryCheckEverySecond: "Versuche alle {0} Sekunden",
"Import Backup": "Import Backup",
"Export Backup": "Export Backup",
}

View File

@ -139,8 +139,8 @@ export default {
alertWrongFileType: "Please select a JSON file.",
"Clear all statistics": "Clear all Statistics",
"Skip existing": "Skip existing",
"Overwrite": "Overwrite",
"Options": "Options",
Overwrite: "Overwrite",
Options: "Options",
"Keep both": "Keep both",
"Verify Token": "Verify Token",
"Setup 2FA": "Setup 2FA",
@ -152,7 +152,6 @@ export default {
Inactive: "Inactive",
Token: "Token",
"Show URI": "Show URI",
"Clear all statistics": "Clear all Statistics",
Tags: "Tags",
"Add New below or Select...": "Add New below or Select...",
"Tag with this name already exist.": "Tag with this name already exist.",

View File

@ -115,7 +115,6 @@ export default {
"Last Result": "Ultimo risultato",
"Create your admin account": "Crea l'account amministratore",
"Repeat Password": "Ripeti Password",
"Import/Export Backup": "Importa/Esporta Backup",
Export: "Esporta",
Import: "Importa",
respTime: "Tempo di Risposta (ms)",

View File

@ -115,7 +115,6 @@ export default {
"Last Result": "Laatste resultaat",
"Create your admin account": "Maak uw beheerdersaccount aan",
"Repeat Password": "Herhaal wachtwoord",
"Import/Export Backup": "Backup importeren/exporteren",
Export: "Exporteren",
Import: "Importeren",
respTime: "resp. tijd (ms)",

View File

@ -110,37 +110,37 @@ export default {
respTime: "Czas odp. (ms)",
notAvailableShort: "N/A",
Create: "Stwórz",
clearEventsMsg: "Are you sure want to delete all events for this monitor?",
clearEventsMsg: "Jesteś pewien, że chcesz usunąć wszystkie monity dla tej strony?",
clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?",
confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?",
"Clear Data": "Clear Data",
Events: "Events",
confirmClearStatisticsMsg: "Jesteś pewien, że chcesz usunąć WSZYSTKIE statystyki?",
"Clear Data": "Usuń dane",
Events: "Wydarzenia",
Heartbeats: "Heartbeats",
"Auto Get": "Auto Get",
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
"Default enabled": "Default enabled",
"Also apply to existing monitors": "Also apply to existing monitors",
Export: "Export",
enableDefaultNotificationDescription: "Dla każdego nowego monitora to powiadomienie będzie domyślnie włączone. Nadal możesz wyłączyć powiadomienia osobno dla każdego monitora.",
"Default enabled": "Domyślnie włączone",
"Also apply to existing monitors": "Również zastosuj do obecnych monitów",
Export: "Eksport",
Import: "Import",
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
backupDescription2: "PS: History and event data is not included.",
backupDescription3: "Sensitive data such as notification tokens is included in the export file, please keep it carefully.",
alertNoFile: "Please select a file to import.",
alertWrongFileType: "Please select a JSON file.",
twoFAVerifyLabel: "Please type in your token to verify that 2FA is working",
tokenValidSettingsMsg: "Token is valid! You can now save the 2FA settings.",
confirmEnableTwoFAMsg: "Are you sure you want to enable 2FA?",
confirmDisableTwoFAMsg: "Are you sure you want to disable 2FA?",
"Apply on all existing monitors": "Apply on all existing monitors",
"Verify Token": "Verify Token",
"Setup 2FA": "Setup 2FA",
"Enable 2FA": "Enable 2FA",
"Disable 2FA": "Disable 2FA",
"2FA Settings": "2FA Settings",
"Two Factor Authentication": "Two Factor Authentication",
Active: "Active",
Inactive: "Inactive",
backupDescription: "Możesz wykonać kopię zapasową wszystkich monitorów i wszystkich powiadomień w pliku JSON.",
backupDescription2: "PS: Historia i dane zdarzeń nie są uwzględniane.",
backupDescription3: "Poufne dane, takie jak tokeny powiadomień, są zawarte w pliku eksportu, prosimy o ostrożne przechowywanie.",
alertNoFile: "Proszę wybrać plik do importu.",
alertWrongFileType: "Proszę wybrać plik JSON.",
twoFAVerifyLabel: "Proszę podaj swój token 2FA, aby sprawdzić go",
tokenValidSettingsMsg: "Token jest poprawny! Możesz teraz zapisać ustawienia 2FA.",
confirmEnableTwoFAMsg: "Jesteś prwien że chcesz włączyć 2FA?",
confirmDisableTwoFAMsg: "Jesteś prwien że chcesz wyłączyć 2FA?",
"Apply on all existing monitors": "Zastosuj do wszystki obecnych monitów",
"Verify Token": "Weryfikuj Token",
"Setup 2FA": "Ustaw 2FA",
"Enable 2FA": "Włącz 2FA",
"Disable 2FA": "Wyłącz 2FA",
"2FA Settings": "Ustawienia 2FA",
"Two Factor Authentication": "Podwójna weryfikacja",
Active: "Włączone",
Inactive: "Wyłączone",
Token: "Token",
"Show URI": "Show URI",
"Clear all statistics": "Clear all Statistics",
"Show URI": "Pokaż URI",
"Clear all statistics": "Wyczyść wszystkie statystyki",
}

View File

@ -116,5 +116,5 @@ export default {
"Clear Data": "Verileri Temizle",
Events: "Olaylar",
Heartbeats: "Sağlık Durumları",
"Auto Get": "Otomatik Al"
"Auto Get": "Otomatik Al",
}

View File

@ -120,7 +120,6 @@ export default {
enableDefaultNotificationDescription: "新的监控项将默认启用,你也可以在每个监控项中分别设置",
"Default enabled": "默认开启",
"Also apply to existing monitors": "应用到所有监控项",
"Import/Export Backup": "导入/导出备份",
Export: "导出",
Import: "导入",
backupDescription: "你可以将所有的监控项和消息通知备份到一个 JSON 文件中",

View File

@ -120,7 +120,6 @@ export default {
enableDefaultNotificationDescription: "新增監測器時這個通知會預設啟用,當然每個監測器亦可分別控制開關。",
"Default enabled": "預設通知",
"Also apply to existing monitors": "同時取用至目前所有監測器",
"Import/Export Backup": "匯入/匯出 備份",
Export: "匯出",
Import: "匯入",
backupDescription: "您可以備份所有監測器及所有通知。",