Repository: louislam/uptime-kuma
File: src/pages/Settings.vue (Vue)

Code before:
        confirmClearStatistics() {
            this.$refs.confirmClearStatistics.show();
        },

        disableAuth() {
            this.settings.disableAuth = true;
            this.saveSettings();
        },

        enableAuth() {
            this.settings.disableAuth = false;
            this.saveSettings();
            this.$root.storage().removeItem("token");
        },

        downloadBackup() {
            let time = dayjs().format("YYYY_MM_DD-hh_mm_ss");
            let fileName = `Uptime_Kuma_Backup_${time}.json`;
            let monitorList = Object.values(this.$root.monitorList);
            let exportData = {
                version: this.$root.info.version,
                notificationList: this.$root.notificationList,
                monitorList: monitorList,
            }
            exportData = JSON.stringify(exportData);
            let downloadItem = document.createElement("a");
            downloadItem.setAttribute("href", `data:application/json;charset=utf-8, ${exportData}`);
            downloadItem.setAttribute("download", fileName);
            downloadItem.click();
        },

        importBackup() {
            this.processing = true;
            let uploadItem = document.getElementById("importBackup").files;

            if (uploadItem.length <= 0) {
                this.processing = false;
                return this.importAlert = this.$t("alertNoFile")
            }

            if (uploadItem.item(0).type !== "application/json") {
                this.processing = false;
                return this.importAlert = this.$t("alertWrongFileType")
            }

            let fileReader = new FileReader();
            fileReader.readAsText(uploadItem.item(0));

            fileReader.onload = item => {
                this.$root.uploadBackup(item.target.result, (res) => {
                    this.processing = false;

Review comment (suggestion):
checked, exportData is ok, should be the problem of downloadItem, which remove all spaces unexpectedly.

Code after:
        confirmClearStatistics() {
            this.$refs.confirmClearStatistics.show();
        },

        disableAuth() {
            this.settings.disableAuth = true;
            this.saveSettings();
        },

        enableAuth() {
            this.settings.disableAuth = false;
            this.saveSettings();
            this.$root.storage().removeItem("token");
        },

        downloadBackup() {
            let time = dayjs().format("YYYY_MM_DD-hh_mm_ss");
            let fileName = `Uptime_Kuma_Backup_${time}.json`;
            let monitorList = Object.values(this.$root.monitorList);
            let exportData = {
                version: this.$root.info.version,
                notificationList: this.$root.notificationList,
                monitorList: monitorList,
            }
            exportData = JSON.stringify(exportData);
            let downloadItem = document.createElement("a");
            downloadItem.setAttribute("href", "data:application/json;charset=utf-8," + encodeURI(exportData));
            downloadItem.setAttribute("download", fileName);
            downloadItem.click();
        },

        importBackup() {
            this.processing = true;
            let uploadItem = document.getElementById("importBackup").files;

            if (uploadItem.length <= 0) {
                this.processing = false;
                return this.importAlert = this.$t("alertNoFile")
            }

            if (uploadItem.item(0).type !== "application/json") {
                this.processing = false;
                return this.importAlert = this.$t("alertWrongFileType")
            }

            let fileReader = new FileReader();
            fileReader.readAsText(uploadItem.item(0));

            fileReader.onload = item => {
                this.$root.uploadBackup(item.target.result, (res) => {
                    this.processing = false;