diff --git a/src/components/settings/Backup.vue b/src/components/settings/Backup.vue index ba0f92f0..685a4c6b 100644 --- a/src/components/settings/Backup.vue +++ b/src/components/settings/Backup.vue @@ -133,10 +133,15 @@ export default { }, methods: { + /** + * Show the confimation dialog confirming the configuration + * be imported + */ confirmImport() { this.$refs.confirmImport.show(); }, + /** Download a backup of the configuration */ downloadBackup() { let time = dayjs().format("YYYY_MM_DD-hh_mm_ss"); let fileName = `Uptime_Kuma_Backup_${time}.json`; @@ -157,6 +162,10 @@ export default { downloadItem.click(); }, + /** + * Import the specified backup file + * @returns {?string} + */ importBackup() { this.processing = true; let uploadItem = document.getElementById("import-backend").files; diff --git a/src/components/settings/General.vue b/src/components/settings/General.vue index a175988b..19dc8077 100644 --- a/src/components/settings/General.vue +++ b/src/components/settings/General.vue @@ -178,10 +178,12 @@ export default { }, methods: { + /** Save the settings */ saveGeneral() { localStorage.timezone = this.$root.userTimezone; this.saveSettings(); }, + /** Get the base URL of the application */ autoGetPrimaryBaseURL() { this.settings.primaryBaseURL = location.protocol + "//" + location.host; }, diff --git a/src/components/settings/MonitorHistory.vue b/src/components/settings/MonitorHistory.vue index 0092727f..c78c6aaf 100644 --- a/src/components/settings/MonitorHistory.vue +++ b/src/components/settings/MonitorHistory.vue @@ -90,6 +90,7 @@ export default { }, methods: { + /** Get the current size of the database */ loadDatabaseSize() { log.debug("monitorhistory", "load database size"); this.$root.getSocket().emit("getDatabaseSize", (res) => { @@ -102,6 +103,7 @@ export default { }); }, + /** Request that the database is shrunk */ shrinkDatabase() { this.$root.getSocket().emit("shrinkDatabase", (res) => { if (res.ok) { @@ -113,10 +115,12 @@ export default { }); }, + /** Show the dialog to confirm clearing stats */ confirmClearStatistics() { this.$refs.confirmClearStatistics.show(); }, + /** Send the request to clear stats */ clearStatistics() { this.$root.clearStatistics((res) => { if (res.ok) { diff --git a/src/components/settings/ReverseProxy.vue b/src/components/settings/ReverseProxy.vue index 97db4d59..e93bd0ef 100644 --- a/src/components/settings/ReverseProxy.vue +++ b/src/components/settings/ReverseProxy.vue @@ -120,14 +120,17 @@ export default { this.$root.getSocket().emit(prefix + "leave"); }, methods: { + /** Start the Cloudflare tunnel */ start() { this.$root.getSocket().emit(prefix + "start", this.cloudflareTunnelToken); }, + /** Stop the Cloudflare tunnel */ stop() { this.$root.getSocket().emit(prefix + "stop", this.currentPassword, (res) => { this.$root.toastRes(res); }); }, + /** Remove the token for the Cloudflare tunnel */ removeToken() { this.$root.getSocket().emit(prefix + "removeToken"); this.cloudflareTunnelToken = ""; diff --git a/src/components/settings/Security.vue b/src/components/settings/Security.vue index a5d42f82..60e72bda 100644 --- a/src/components/settings/Security.vue +++ b/src/components/settings/Security.vue @@ -303,6 +303,7 @@ export default { }, methods: { + /** Check new passwords match before saving them */ savePassword() { if (this.password.newPassword !== this.password.repeatNewPassword) { this.invalidPassword = true; @@ -320,6 +321,7 @@ export default { } }, + /** Disable authentication for web app access */ disableAuth() { this.settings.disableAuth = true; @@ -332,6 +334,7 @@ export default { }, this.password.currentPassword); }, + /** Enable authentication for web app access */ enableAuth() { this.settings.disableAuth = false; this.saveSettings();