diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue
index 141dfd69530a..2c9d0e18e1f1 100644
--- a/ui/src/components/view/ListView.vue
+++ b/ui/src/components/view/ListView.vue
@@ -921,7 +921,7 @@
@onClick="$resetConfigurationValueConfirm(item, resetConfig)"
v-if="editableValueKey !== record.key"
icon="reload-outlined"
- :disabled="!('updateConfiguration' in $store.getters.apis)"
+ :disabled="!('resetConfiguration' in $store.getters.apis) || record.value === record.defaultvalue"
/>
diff --git a/ui/src/components/view/SettingsTab.vue b/ui/src/components/view/SettingsTab.vue
index be55d03c4b94..e07d7d7347d7 100644
--- a/ui/src/components/view/SettingsTab.vue
+++ b/ui/src/components/view/SettingsTab.vue
@@ -25,7 +25,8 @@
@search="handleSearch" />
+ :config="items"
+ @refresh-config="handleConfigRefresh" />
@@ -139,6 +140,13 @@ export default {
handleSearch (value) {
this.filter = value
this.fetchData()
+ },
+ handleConfigRefresh (name, updatedRecord) {
+ if (!name || !updatedRecord) return
+ const index = this.items.findIndex(item => item.name === name)
+ if (index !== -1) {
+ this.items.splice(index, 1, updatedRecord)
+ }
}
}
}
diff --git a/ui/src/views/setting/ConfigurationHierarchy.vue b/ui/src/views/setting/ConfigurationHierarchy.vue
index 80b464e657cc..815a048bc257 100644
--- a/ui/src/views/setting/ConfigurationHierarchy.vue
+++ b/ui/src/views/setting/ConfigurationHierarchy.vue
@@ -34,7 +34,7 @@
{{ record.description }}
-
+
@@ -83,6 +83,9 @@ export default {
return 'light-row'
}
return 'dark-row'
+ },
+ handleConfigRefresh (name, updatedRecord) {
+ this.$emit('refresh-config', name, updatedRecord)
}
}
}
diff --git a/ui/src/views/setting/ConfigurationTab.vue b/ui/src/views/setting/ConfigurationTab.vue
index 75905cbd1748..65b256c94c95 100644
--- a/ui/src/views/setting/ConfigurationTab.vue
+++ b/ui/src/views/setting/ConfigurationTab.vue
@@ -58,7 +58,8 @@
:count="count"
:page="page"
:pagesize="pagesize"
- @change-page="changePage" />
+ @change-page="changePage"
+ @refresh-config="handleConfigRefresh" />
+ :config="config"
+ @refresh-config="handleConfigRefresh" />
@@ -322,6 +324,13 @@ export default {
'#' + this.$route.path
)
}
+ },
+ handleConfigRefresh (name, updatedRecord) {
+ if (!name || !updatedRecord) return
+ const index = this.config.findIndex(item => item.name === name)
+ if (index !== -1) {
+ this.config.splice(index, 1, updatedRecord)
+ }
}
}
}
diff --git a/ui/src/views/setting/ConfigurationTable.vue b/ui/src/views/setting/ConfigurationTable.vue
index 56518d2570b1..e4d72c067490 100644
--- a/ui/src/views/setting/ConfigurationTable.vue
+++ b/ui/src/views/setting/ConfigurationTable.vue
@@ -32,7 +32,7 @@
{{record.displaytext }} {{ ' (' + record.name + ')' }}
{{ record.description }}
-
+
@@ -109,6 +109,9 @@ export default {
return 'config-light-row'
}
return 'config-dark-row'
+ },
+ handleConfigRefresh (name, updatedRecord) {
+ this.$emit('refresh-config', name, updatedRecord)
}
}
}
diff --git a/ui/src/views/setting/ConfigurationValue.vue b/ui/src/views/setting/ConfigurationValue.vue
index e438f0eb8315..4eae5daf962b 100644
--- a/ui/src/views/setting/ConfigurationValue.vue
+++ b/ui/src/views/setting/ConfigurationValue.vue
@@ -187,7 +187,7 @@
@onClick="$resetConfigurationValueConfirm(configrecord, resetConfigurationValue)"
v-if="editableValueKey === null"
icon="reload-outlined"
- :disabled="(!('resetConfiguration' in $store.getters.apis) || configDisabled || valueLoading)" />
+ :disabled="(!('resetConfiguration' in $store.getters.apis) || configDisabled || valueLoading || configrecord.value === configrecord.defaultvalue)" />
@@ -263,6 +263,7 @@ export default {
this.editableValueKey = null
},
updateConfigurationValue (configrecord) {
+ let configRecordEntry = this.configrecord
this.valueLoading = true
this.editableValueKey = null
var newValue = this.editableValue
@@ -281,7 +282,8 @@ export default {
value: newValue
}
postAPI('updateConfiguration', params).then(json => {
- this.editableValue = this.getEditableValue(json.updateconfigurationresponse.configuration)
+ configRecordEntry = json.updateconfigurationresponse.configuration
+ this.editableValue = this.getEditableValue(configRecordEntry)
this.actualValue = this.editableValue
this.$emit('change-config', { value: newValue })
this.$store.dispatch('RefreshFeatures')
@@ -305,10 +307,11 @@ export default {
})
}).finally(() => {
this.valueLoading = false
- this.$emit('refresh')
+ this.$emit('refresh', configrecord.name, configRecordEntry)
})
},
resetConfigurationValue (configrecord) {
+ let configRecordEntry = this.configrecord
this.valueLoading = true
this.editableValueKey = null
const params = {
@@ -316,7 +319,8 @@ export default {
name: configrecord.name
}
postAPI('resetConfiguration', params).then(json => {
- this.editableValue = this.getEditableValue(json.resetconfigurationresponse.configuration)
+ configRecordEntry = json.resetconfigurationresponse.configuration
+ this.editableValue = this.getEditableValue(configRecordEntry)
this.actualValue = this.editableValue
var newValue = this.editableValue
if (configrecord.type === 'Range') {
@@ -344,7 +348,7 @@ export default {
})
}).finally(() => {
this.valueLoading = false
- this.$emit('refresh')
+ this.$emit('refresh', configrecord.name, configRecordEntry)
})
},
getEditableValue (configrecord) {