diff --git a/src/lang/en.js b/src/lang/en.js index 314672f8..2e504315 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -387,7 +387,8 @@ export default { corsPlug: 'CORS plug config', instanceReboot: 'Reboot Instance', restartApp: 'You must restart the instance to apply settings', - restartSuccess: 'Instance rebooted successfully!' + restartSuccess: 'Instance rebooted successfully!', + removeSettingConfirmation: 'Are you sure you want to remove this setting\'s value from the database?' }, invites: { inviteTokens: 'Invite tokens', diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 744276dc..c0d62c6d 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -296,17 +296,30 @@ export default { { group, key: parentKey, input: setting.key, value: valueForState }) }, async removeSetting() { - const config = this.settingGroup.key - ? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [this.setting.key] }] - : [{ group: this.settingGroup.group, key: this.setting.key, delete: true }] - try { - await this.$store.dispatch('RemoveSetting', config) - } catch (e) { - return - } - this.$message({ - type: 'success', - message: i18n.t('settings.successfullyRemoved') + this.$confirm( + this.$t('settings.removeSettingConfirmation'), + { + confirmButtonText: this.$t('users.ok'), + cancelButtonText: this.$t('users.cancel'), + type: 'warning' + }).then(async() => { + const config = this.settingGroup.key + ? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [this.setting.key] }] + : [{ group: this.settingGroup.group, key: this.setting.key, delete: true }] + try { + await this.$store.dispatch('RemoveSetting', config) + } catch (e) { + return + } + this.$message({ + type: 'success', + message: i18n.t('settings.successfullyRemoved') + }) + }).catch(() => { + this.$message({ + type: 'info', + message: this.$t('users.canceled') + }) }) }, renderMultipleSelect(type) { diff --git a/src/views/settings/components/Setting.vue b/src/views/settings/components/Setting.vue index 9794cc63..7bd28e09 100644 --- a/src/views/settings/components/Setting.vue +++ b/src/views/settings/components/Setting.vue @@ -130,17 +130,30 @@ export default { return marked(desc) }, async removeSetting(key) { - const config = this.settingGroup.key - ? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [key] }] - : [{ group: this.settingGroup.group, key, delete: true }] - try { - await this.$store.dispatch('RemoveSetting', config) - } catch (e) { - return - } - this.$message({ - type: 'success', - message: i18n.t('settings.successfullyRemoved') + this.$confirm( + this.$t('settings.removeSettingConfirmation'), + { + confirmButtonText: this.$t('users.ok'), + cancelButtonText: this.$t('users.cancel'), + type: 'warning' + }).then(async() => { + const config = this.settingGroup.key + ? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [key] }] + : [{ group: this.settingGroup.group, key, delete: true }] + try { + await this.$store.dispatch('RemoveSetting', config) + } catch (e) { + return + } + this.$message({ + type: 'success', + message: i18n.t('settings.successfullyRemoved') + }) + }).catch(() => { + this.$message({ + type: 'info', + message: this.$t('users.canceled') + }) }) }, updateSetting(value, tab, input) { diff --git a/src/views/settings/styles/main.scss b/src/views/settings/styles/main.scss index fde17499..abbd3d93 100644 --- a/src/views/settings/styles/main.scss +++ b/src/views/settings/styles/main.scss @@ -55,7 +55,7 @@ padding-right: 10px; } .el-tabs__header { - z-index: 3000; + z-index: 2002; } .esshd-list { margin: 0;