From a8d016f461c964668d3f04cefb226a3a89bf312f Mon Sep 17 00:00:00 2001 From: Fabricio Duarte Date: Mon, 16 Nov 2026 09:41:43 -0300 Subject: [PATCH] ui: fix and block configuration of global settings at a scoped settings page --- ui/src/views/setting/ConfigurationValue.vue | 26 ++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/ui/src/views/setting/ConfigurationValue.vue b/ui/src/views/setting/ConfigurationValue.vue index 31c0798a7178..6eba1a3f2663 100644 --- a/ui/src/views/setting/ConfigurationValue.vue +++ b/ui/src/views/setting/ConfigurationValue.vue @@ -252,6 +252,9 @@ export default { case 'imagestore': this.scopeKey = 'imagestoreuuid' break + case 'managementserver': + this.scopeKey = 'managementserverid' + break default: this.scopeKey = '' } @@ -286,12 +289,18 @@ export default { newValue = newValue.join(' ') } const params = { - [this.scopeKey]: this.$route.params?.id, name: configrecord.name, value: newValue } - if (this.scopeKey === 'domainid' && !params[this.scopeKey]) { - params[this.scopeKey] = this.resource?.id + if (this.scopeKey) { + const scopeId = this.resource?.id + if (!scopeId) { + this.editableValue = this.actualValue + this.valueLoading = false + this.$message.error(this.$t('message.error.save.setting')) + return + } + params[this.scopeKey] = scopeId } postAPI('updateConfiguration', params).then(json => { this.editableValue = this.getEditableValue(json.updateconfigurationresponse.configuration) @@ -317,11 +326,16 @@ export default { this.valueLoading = true this.editableValueKey = null const params = { - [this.scopeKey]: this.$route.params?.id, name: configrecord.name } - if (this.scopeKey === 'domainid' && !params[this.scopeKey]) { - params[this.scopeKey] = this.resource?.id + if (this.scopeKey) { + const scopeId = this.resource?.id + if (!scopeId) { + this.valueLoading = false + this.$message.error(this.$t('message.error.reset.config')) + return + } + params[this.scopeKey] = scopeId } postAPI('resetConfiguration', params).then(json => { this.editableValue = this.getEditableValue(json.resetconfigurationresponse.configuration)