mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-17 11:44:38 -05:00
Merge branch 'import-export'
# Conflicts: # src/languages/it-IT.js # src/languages/nl-NL.js
This commit is contained in:
commit
80322cbfe7
104
server/server.js
104
server/server.js
@ -927,7 +927,7 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("uploadBackup", async (uploadedJSON, callback) => {
|
socket.on("uploadBackup", async (uploadedJSON, importHandle, callback) => {
|
||||||
try {
|
try {
|
||||||
checkLogin(socket)
|
checkLogin(socket)
|
||||||
|
|
||||||
@ -935,54 +935,80 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
|
|||||||
|
|
||||||
console.log(`Importing Backup, User ID: ${socket.userID}, Version: ${backupData.version}`)
|
console.log(`Importing Backup, User ID: ${socket.userID}, Version: ${backupData.version}`)
|
||||||
|
|
||||||
let notificationList = backupData.notificationList;
|
let notificationListData = backupData.notificationList;
|
||||||
let monitorList = backupData.monitorList;
|
let monitorListData = backupData.monitorList;
|
||||||
|
|
||||||
if (notificationList.length >= 1) {
|
if (importHandle == "overwrite") {
|
||||||
for (let i = 0; i < notificationList.length; i++) {
|
for (let id in monitorList) {
|
||||||
let notification = JSON.parse(notificationList[i].config);
|
let monitor = monitorList[id]
|
||||||
await Notification.save(notification, null, socket.userID)
|
await monitor.stop()
|
||||||
|
}
|
||||||
|
await R.exec("DELETE FROM heartbeat");
|
||||||
|
await R.exec("DELETE FROM monitor_notification");
|
||||||
|
await R.exec("DELETE FROM monitor_tls_info");
|
||||||
|
await R.exec("DELETE FROM notification");
|
||||||
|
await R.exec("DELETE FROM monitor");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (notificationListData.length >= 1) {
|
||||||
|
let notificationNameList = await R.getAll("SELECT name FROM notification");
|
||||||
|
let notificationNameListString = JSON.stringify(notificationNameList);
|
||||||
|
|
||||||
|
for (let i = 0; i < notificationListData.length; i++) {
|
||||||
|
if ((importHandle == "skip" && notificationNameListString.includes(notificationListData[i].name) == false) || importHandle == "keep" || importHandle == "overwrite") {
|
||||||
|
|
||||||
|
let notification = JSON.parse(notificationListData[i].config);
|
||||||
|
await Notification.save(notification, null, socket.userID)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (monitorList.length >= 1) {
|
if (monitorListData.length >= 1) {
|
||||||
for (let i = 0; i < monitorList.length; i++) {
|
let monitorNameList = await R.getAll("SELECT name FROM monitor");
|
||||||
let monitor = {
|
let monitorNameListString = JSON.stringify(monitorNameList);
|
||||||
name: monitorList[i].name,
|
|
||||||
type: monitorList[i].type,
|
|
||||||
url: monitorList[i].url,
|
|
||||||
interval: monitorList[i].interval,
|
|
||||||
hostname: monitorList[i].hostname,
|
|
||||||
maxretries: monitorList[i].maxretries,
|
|
||||||
port: monitorList[i].port,
|
|
||||||
keyword: monitorList[i].keyword,
|
|
||||||
ignoreTls: monitorList[i].ignoreTls,
|
|
||||||
upsideDown: monitorList[i].upsideDown,
|
|
||||||
maxredirects: monitorList[i].maxredirects,
|
|
||||||
accepted_statuscodes: monitorList[i].accepted_statuscodes,
|
|
||||||
dns_resolve_type: monitorList[i].dns_resolve_type,
|
|
||||||
dns_resolve_server: monitorList[i].dns_resolve_server,
|
|
||||||
notificationIDList: {},
|
|
||||||
}
|
|
||||||
|
|
||||||
let bean = R.dispense("monitor")
|
for (let i = 0; i < monitorListData.length; i++) {
|
||||||
|
if ((importHandle == "skip" && monitorNameListString.includes(monitorListData[i].name) == false) || importHandle == "keep" || importHandle == "overwrite") {
|
||||||
|
|
||||||
let notificationIDList = monitor.notificationIDList;
|
let monitor = {
|
||||||
delete monitor.notificationIDList;
|
name: monitorListData[i].name,
|
||||||
|
type: monitorListData[i].type,
|
||||||
|
url: monitorListData[i].url,
|
||||||
|
interval: monitorListData[i].interval,
|
||||||
|
hostname: monitorListData[i].hostname,
|
||||||
|
maxretries: monitorListData[i].maxretries,
|
||||||
|
port: monitorListData[i].port,
|
||||||
|
keyword: monitorListData[i].keyword,
|
||||||
|
ignoreTls: monitorListData[i].ignoreTls,
|
||||||
|
upsideDown: monitorListData[i].upsideDown,
|
||||||
|
maxredirects: monitorListData[i].maxredirects,
|
||||||
|
accepted_statuscodes: monitorListData[i].accepted_statuscodes,
|
||||||
|
dns_resolve_type: monitorListData[i].dns_resolve_type,
|
||||||
|
dns_resolve_server: monitorListData[i].dns_resolve_server,
|
||||||
|
notificationIDList: {},
|
||||||
|
}
|
||||||
|
|
||||||
monitor.accepted_statuscodes_json = JSON.stringify(monitor.accepted_statuscodes);
|
let bean = R.dispense("monitor")
|
||||||
delete monitor.accepted_statuscodes;
|
|
||||||
|
|
||||||
bean.import(monitor)
|
let notificationIDList = monitor.notificationIDList;
|
||||||
bean.user_id = socket.userID
|
delete monitor.notificationIDList;
|
||||||
await R.store(bean)
|
|
||||||
|
|
||||||
await updateMonitorNotification(bean.id, notificationIDList)
|
monitor.accepted_statuscodes_json = JSON.stringify(monitor.accepted_statuscodes);
|
||||||
|
delete monitor.accepted_statuscodes;
|
||||||
|
|
||||||
|
bean.import(monitor)
|
||||||
|
bean.user_id = socket.userID
|
||||||
|
await R.store(bean)
|
||||||
|
|
||||||
|
await updateMonitorNotification(bean.id, notificationIDList)
|
||||||
|
|
||||||
|
if (monitorListData[i].active == 1) {
|
||||||
|
await startMonitor(socket.userID, bean.id);
|
||||||
|
} else {
|
||||||
|
await pauseMonitor(socket.userID, bean.id);
|
||||||
|
}
|
||||||
|
|
||||||
if (monitorList[i].active == 1) {
|
|
||||||
await startMonitor(socket.userID, bean.id);
|
|
||||||
} else {
|
|
||||||
await pauseMonitor(socket.userID, bean.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For hver ny overvåger aktiveres denne underretning som standard. Du kan stadig deaktivere underretningen separat for hver skærm.",
|
enableDefaultNotificationDescription: "For hver ny overvåger aktiveres denne underretning som standard. Du kan stadig deaktivere underretningen separat for hver skærm.",
|
||||||
"Default enabled": "Standard aktiveret",
|
"Default enabled": "Standard aktiveret",
|
||||||
"Also apply to existing monitors": "Anvend også på eksisterende overvågere",
|
"Also apply to existing monitors": "Anvend også på eksisterende overvågere",
|
||||||
"Import/Export Backup": " Importér/Eksportér sikkerhedskopi",
|
|
||||||
Export: "Eksport",
|
Export: "Eksport",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "Du kan sikkerhedskopiere alle Overvågere og alle underretninger til en JSON-fil.",
|
backupDescription: "Du kan sikkerhedskopiere alle Overvågere og alle underretninger til en JSON-fil.",
|
||||||
|
@ -113,6 +113,8 @@ export default {
|
|||||||
"Create your admin account": "Erstelle dein Admin Konto",
|
"Create your admin account": "Erstelle dein Admin Konto",
|
||||||
"Repeat Password": "Wiederhole das Passwort",
|
"Repeat Password": "Wiederhole das Passwort",
|
||||||
"Resource Record Type": "Resource Record Type",
|
"Resource Record Type": "Resource Record Type",
|
||||||
|
"Export": "Export",
|
||||||
|
"Import": "Import",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
"Import/Export Backup": "Import/Export Backup",
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
@ -128,6 +130,13 @@ export default {
|
|||||||
backupDescription3: "Sensible Daten wie Benachrichtigungstoken sind in der Exportdatei enthalten, bitte bewahre sie sorgfältig auf.",
|
backupDescription3: "Sensible Daten wie Benachrichtigungstoken sind in der Exportdatei enthalten, bitte bewahre sie sorgfältig auf.",
|
||||||
alertNoFile: "Bitte wähle eine Datei zum importieren aus.",
|
alertNoFile: "Bitte wähle eine Datei zum importieren aus.",
|
||||||
alertWrongFileType: "Bitte wähle eine JSON Datei aus.",
|
alertWrongFileType: "Bitte wähle eine JSON Datei aus.",
|
||||||
|
"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",
|
||||||
|
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",
|
twoFAVerifyLabel: "Bitte trage deinen Token ein um zu verifizieren das 2FA funktioniert",
|
||||||
"Verify Token": "Token verifizieren",
|
"Verify Token": "Token verifizieren",
|
||||||
"Setup 2FA": "2FA Einrichten",
|
"Setup 2FA": "2FA Einrichten",
|
||||||
|
@ -20,6 +20,8 @@ export default {
|
|||||||
clearEventsMsg: "Are you sure want to delete all events for this monitor?",
|
clearEventsMsg: "Are you sure want to delete all events for this monitor?",
|
||||||
clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?",
|
clearHeartbeatsMsg: "Are you sure want to delete all heartbeats for this monitor?",
|
||||||
confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?",
|
confirmClearStatisticsMsg: "Are you sure want to delete ALL statistics?",
|
||||||
|
importHandleDescription: "Choose 'Skip existing' if you want to skip every monitor or notification with the same name. 'Overwrite' will delete every existing monitor and notification.",
|
||||||
|
confirmImportMsg: "Are you sure to import the backup? Please make sure you've selected the right import option.",
|
||||||
twoFAVerifyLabel: "Please type in your token to verify that 2FA is working",
|
twoFAVerifyLabel: "Please type in your token to verify that 2FA is working",
|
||||||
tokenValidSettingsMsg: "Token is valid! You can now save the 2FA settings.",
|
tokenValidSettingsMsg: "Token is valid! You can now save the 2FA settings.",
|
||||||
confirmEnableTwoFAMsg: "Are you sure you want to enable 2FA?",
|
confirmEnableTwoFAMsg: "Are you sure you want to enable 2FA?",
|
||||||
@ -115,7 +117,8 @@ export default {
|
|||||||
"Last Result": "Last Result",
|
"Last Result": "Last Result",
|
||||||
"Create your admin account": "Create your admin account",
|
"Create your admin account": "Create your admin account",
|
||||||
"Repeat Password": "Repeat Password",
|
"Repeat Password": "Repeat Password",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
"Import Backup": "Import Backup",
|
||||||
|
"Export Backup": "Export Backup",
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
respTime: "Resp. Time (ms)",
|
respTime: "Resp. Time (ms)",
|
||||||
@ -132,6 +135,11 @@ export default {
|
|||||||
backupDescription3: "Sensitive data such as notification tokens is included in the export file, please keep it carefully.",
|
backupDescription3: "Sensitive data such as notification tokens is included in the export file, please keep it carefully.",
|
||||||
alertNoFile: "Please select a file to import.",
|
alertNoFile: "Please select a file to import.",
|
||||||
alertWrongFileType: "Please select a JSON file.",
|
alertWrongFileType: "Please select a JSON file.",
|
||||||
|
"Clear all statistics": "Clear all Statistics",
|
||||||
|
"Skip existing": "Skip existing",
|
||||||
|
"Overwrite": "Overwrite",
|
||||||
|
"Options": "Options",
|
||||||
|
"Keep both": "Keep both",
|
||||||
"Verify Token": "Verify Token",
|
"Verify Token": "Verify Token",
|
||||||
"Setup 2FA": "Setup 2FA",
|
"Setup 2FA": "Setup 2FA",
|
||||||
"Enable 2FA": "Enable 2FA",
|
"Enable 2FA": "Enable 2FA",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -113,7 +113,6 @@ export default {
|
|||||||
clearEventsMsg: "Kas soovid seire kõik sündmused kustutada?",
|
clearEventsMsg: "Kas soovid seire kõik sündmused kustutada?",
|
||||||
clearHeartbeatsMsg: "Kas soovid seire kõik tuksed kustutada?",
|
clearHeartbeatsMsg: "Kas soovid seire kõik tuksed kustutada?",
|
||||||
confirmClearStatisticsMsg: "Kas soovid KÕIK statistika kustutada?",
|
confirmClearStatisticsMsg: "Kas soovid KÕIK statistika kustutada?",
|
||||||
"Import/Export Backup": "Impordi/Ekspordi varukoopia",
|
|
||||||
Export: "Eksport",
|
Export: "Eksport",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
"Default enabled": "Kasuta vaikimisi",
|
"Default enabled": "Kasuta vaikimisi",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -127,6 +127,7 @@ export default {
|
|||||||
Events: "Eventi",
|
Events: "Eventi",
|
||||||
Heartbeats: "Controlli",
|
Heartbeats: "Controlli",
|
||||||
"Auto Get": "Auto Get",
|
"Auto Get": "Auto Get",
|
||||||
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
backupDescription: "È possibile fare il backup di tutti i monitoraggi e di tutte le notifiche in un file JSON.",
|
backupDescription: "È possibile fare il backup di tutti i monitoraggi e di tutte le notifiche in un file JSON.",
|
||||||
backupDescription2: "P.S.: lo storico e i dati relativi agli eventi non saranno inclusi.",
|
backupDescription2: "P.S.: lo storico e i dati relativi agli eventi non saranno inclusi.",
|
||||||
backupDescription3: "Dati sensibili come i token di autenticazione saranno inclusi nel backup, tenere quindi in un luogo sicuro.",
|
backupDescription3: "Dati sensibili come i token di autenticazione saranno inclusi nel backup, tenere quindi in un luogo sicuro.",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -140,6 +140,7 @@ export default {
|
|||||||
"Two Factor Authentication": "Two Factor Authenticatie",
|
"Two Factor Authentication": "Two Factor Authenticatie",
|
||||||
Active: "Actief",
|
Active: "Actief",
|
||||||
Inactive: "Inactief",
|
Inactive: "Inactief",
|
||||||
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
Token: "Token",
|
Token: "Token",
|
||||||
"Show URI": "Toon URI",
|
"Show URI": "Toon URI",
|
||||||
"Clear all statistics": "Wis alle statistieken",
|
"Clear all statistics": "Wis alle statistieken",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -120,7 +120,6 @@ export default {
|
|||||||
enableDefaultNotificationDescription: "For every new monitor this notification will be enabled by default. You can still disable the notification separately for each monitor.",
|
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",
|
"Default enabled": "Default enabled",
|
||||||
"Also apply to existing monitors": "Also apply to existing monitors",
|
"Also apply to existing monitors": "Also apply to existing monitors",
|
||||||
"Import/Export Backup": "Import/Export Backup",
|
|
||||||
Export: "Export",
|
Export: "Export",
|
||||||
Import: "Import",
|
Import: "Import",
|
||||||
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
backupDescription: "You can backup all monitors and all notifications into a JSON file.",
|
||||||
|
@ -119,6 +119,7 @@ export default {
|
|||||||
"Auto Get": "自动获取",
|
"Auto Get": "自动获取",
|
||||||
enableDefaultNotificationDescription: "新的监控项将默认启用,你也可以在每个监控项中分别设置",
|
enableDefaultNotificationDescription: "新的监控项将默认启用,你也可以在每个监控项中分别设置",
|
||||||
"Default enabled": "默认开启",
|
"Default enabled": "默认开启",
|
||||||
|
"Also apply to existing monitors": "应用到所有监控项",
|
||||||
"Import/Export Backup": "导入/导出备份",
|
"Import/Export Backup": "导入/导出备份",
|
||||||
Export: "导出",
|
Export: "导出",
|
||||||
Import: "导入",
|
Import: "导入",
|
||||||
|
@ -119,6 +119,7 @@ export default {
|
|||||||
"Auto Get": "自動獲取",
|
"Auto Get": "自動獲取",
|
||||||
enableDefaultNotificationDescription: "新增監測器時這個通知會預設啟用,當然每個監測器亦可分別控制開關。",
|
enableDefaultNotificationDescription: "新增監測器時這個通知會預設啟用,當然每個監測器亦可分別控制開關。",
|
||||||
"Default enabled": "預設通知",
|
"Default enabled": "預設通知",
|
||||||
|
"Also apply to existing monitors": "同時取用至目前所有監測器",
|
||||||
"Import/Export Backup": "匯入/匯出 備份",
|
"Import/Export Backup": "匯入/匯出 備份",
|
||||||
Export: "匯出",
|
Export: "匯出",
|
||||||
Import: "匯入",
|
Import: "匯入",
|
||||||
|
@ -284,8 +284,8 @@ export default {
|
|||||||
this.importantHeartbeatList = {}
|
this.importantHeartbeatList = {}
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadBackup(uploadedJSON, callback) {
|
uploadBackup(uploadedJSON, importHandle, callback) {
|
||||||
socket.emit("uploadBackup", uploadedJSON, callback)
|
socket.emit("uploadBackup", uploadedJSON, importHandle, callback)
|
||||||
},
|
},
|
||||||
|
|
||||||
clearEvents(monitorID, callback) {
|
clearEvents(monitorID, callback) {
|
||||||
|
@ -127,27 +127,54 @@
|
|||||||
<button class="btn btn-primary me-2" type="button" @click="$refs.TwoFADialog.show()">{{ $t("2FA Settings") }}</button>
|
<button class="btn btn-primary me-2" type="button" @click="$refs.TwoFADialog.show()">{{ $t("2FA Settings") }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 class="mt-5 mb-2">{{ $t("Import/Export Backup") }}</h2>
|
<h2 class="mt-5 mb-2">{{ $t("Export Backup") }}</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{ $t("backupDescription") }} <br />
|
{{ $t("backupDescription") }} <br />
|
||||||
({{ $t("backupDescription2") }}) <br />
|
({{ $t("backupDescription2") }}) <br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="input-group mb-3">
|
<div class="mb-2">
|
||||||
<button class="btn btn-outline-primary" @click="downloadBackup">{{ $t("Export") }}</button>
|
<button class="btn btn-primary" @click="downloadBackup">{{ $t("Export") }}</button>
|
||||||
<button type="button" class="btn btn-outline-primary" :disabled="processing" @click="importBackup">
|
|
||||||
<div v-if="processing" class="spinner-border spinner-border-sm me-1"></div>
|
|
||||||
{{ $t("Import") }}
|
|
||||||
</button>
|
|
||||||
<input id="importBackup" type="file" class="form-control" accept="application/json">
|
|
||||||
</div>
|
|
||||||
<div v-if="importAlert" class="alert alert-danger mt-3" style="padding: 6px 16px;">
|
|
||||||
{{ importAlert }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><strong>{{ $t("backupDescription3") }}</strong></p>
|
<p><strong>{{ $t("backupDescription3") }}</strong></p>
|
||||||
|
|
||||||
|
<h2 class="mt-5 mb-2">{{ $t("Import Backup") }}</h2>
|
||||||
|
|
||||||
|
<label class="form-label">{{ $t("Options") }}:</label>
|
||||||
|
<br>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input id="radioKeep" v-model="importHandle" class="form-check-input" type="radio" name="radioImportHandle" value="keep">
|
||||||
|
<label class="form-check-label" for="radioKeep">{{ $t("Keep both") }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input id="radioSkip" v-model="importHandle" class="form-check-input" type="radio" name="radioImportHandle" value="skip">
|
||||||
|
<label class="form-check-label" for="radioSkip">{{ $t("Skip existing") }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input id="radioOverwrite" v-model="importHandle" class="form-check-input" type="radio" name="radioImportHandle" value="overwrite">
|
||||||
|
<label class="form-check-label" for="radioOverwrite">{{ $t("Overwrite") }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-text mb-2">
|
||||||
|
{{ $t("importHandleDescription") }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-2">
|
||||||
|
<input id="importBackup" type="file" class="form-control" accept="application/json">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-2 justify-content-end">
|
||||||
|
<button type="button" class="btn btn-outline-primary" :disabled="processing" @click="confirmImport">
|
||||||
|
<div v-if="processing" class="spinner-border spinner-border-sm me-1"></div>
|
||||||
|
{{ $t("Import") }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="importAlert" class="alert alert-danger mt-3" style="padding: 6px 16px;">
|
||||||
|
{{ importAlert }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2 class="mt-5 mb-2">{{ $t("Advanced") }}</h2>
|
<h2 class="mt-5 mb-2">{{ $t("Advanced") }}</h2>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
@ -273,6 +300,9 @@
|
|||||||
<Confirm ref="confirmClearStatistics" btn-style="btn-danger" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="clearStatistics">
|
<Confirm ref="confirmClearStatistics" btn-style="btn-danger" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="clearStatistics">
|
||||||
{{ $t("confirmClearStatisticsMsg") }}
|
{{ $t("confirmClearStatisticsMsg") }}
|
||||||
</Confirm>
|
</Confirm>
|
||||||
|
<Confirm ref="confirmImport" btn-style="btn-danger" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="importBackup">
|
||||||
|
{{ $t("confirmImportMsg") }}
|
||||||
|
</Confirm>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
@ -313,6 +343,7 @@ export default {
|
|||||||
},
|
},
|
||||||
loaded: false,
|
loaded: false,
|
||||||
importAlert: null,
|
importAlert: null,
|
||||||
|
importHandle: "skip",
|
||||||
processing: false,
|
processing: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -379,6 +410,10 @@ export default {
|
|||||||
this.$refs.confirmClearStatistics.show();
|
this.$refs.confirmClearStatistics.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
confirmImport() {
|
||||||
|
this.$refs.confirmImport.show();
|
||||||
|
},
|
||||||
|
|
||||||
disableAuth() {
|
disableAuth() {
|
||||||
this.settings.disableAuth = true;
|
this.settings.disableAuth = true;
|
||||||
this.saveSettings();
|
this.saveSettings();
|
||||||
@ -424,7 +459,7 @@ export default {
|
|||||||
fileReader.readAsText(uploadItem.item(0));
|
fileReader.readAsText(uploadItem.item(0));
|
||||||
|
|
||||||
fileReader.onload = item => {
|
fileReader.onload = item => {
|
||||||
this.$root.uploadBackup(item.target.result, (res) => {
|
this.$root.uploadBackup(item.target.result, this.importHandle, (res) => {
|
||||||
this.processing = false;
|
this.processing = false;
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
|
Loading…
Reference in New Issue
Block a user