UI: Update and reset domain level configuration (#11571)

This commit is contained in:
Pearl Dsilva 2025-11-11 03:29:54 -05:00 committed by GitHub
parent 50fe265017
commit 15439ede7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 2 deletions

View File

@ -25,7 +25,8 @@
@search="handleSearch" /> @search="handleSearch" />
<ConfigurationTable <ConfigurationTable
:columns="columns" :columns="columns"
:config="items" /> :config="items"
:resource="resource" />
</a-col> </a-col>
</div> </div>
</template> </template>

View File

@ -32,7 +32,7 @@
<b> {{record.displaytext }} </b> {{ ' (' + record.name + ')' }} <br/> {{ record.description }} <b> {{record.displaytext }} </b> {{ ' (' + record.name + ')' }} <br/> {{ record.description }}
</template> </template>
<template v-if="column.key === 'value'"> <template v-if="column.key === 'value'">
<ConfigurationValue :configrecord="record" /> <ConfigurationValue :configrecord="record" :resource="resource" />
</template> </template>
</template> </template>
</a-table> </a-table>
@ -85,6 +85,10 @@ export default {
pagesize: { pagesize: {
type: Number, type: Number,
default: 20 default: 20
},
resource: {
type: Object,
required: false
} }
}, },
data () { data () {

View File

@ -217,6 +217,10 @@ export default {
actions: { actions: {
type: Array, type: Array,
default: () => [] default: () => []
},
resource: {
type: Object,
required: false
} }
}, },
data () { data () {
@ -254,6 +258,12 @@ export default {
this.setConfigData() this.setConfigData()
}, },
watch: { watch: {
configrecord: {
handler () {
this.setConfigData()
},
deep: true
}
}, },
methods: { methods: {
setConfigData () { setConfigData () {
@ -280,6 +290,9 @@ export default {
name: configrecord.name, name: configrecord.name,
value: newValue value: newValue
} }
if (this.scopeKey === 'domainid' && !params[this.scopeKey]) {
params[this.scopeKey] = this.resource?.id
}
postAPI('updateConfiguration', params).then(json => { postAPI('updateConfiguration', params).then(json => {
this.editableValue = this.getEditableValue(json.updateconfigurationresponse.configuration) this.editableValue = this.getEditableValue(json.updateconfigurationresponse.configuration)
this.actualValue = this.editableValue this.actualValue = this.editableValue
@ -315,6 +328,9 @@ export default {
[this.scopeKey]: this.$route.params?.id, [this.scopeKey]: this.$route.params?.id,
name: configrecord.name name: configrecord.name
} }
if (this.scopeKey === 'domainid' && !params[this.scopeKey]) {
params[this.scopeKey] = this.resource?.id
}
postAPI('resetConfiguration', params).then(json => { postAPI('resetConfiguration', params).then(json => {
this.editableValue = this.getEditableValue(json.resetconfigurationresponse.configuration) this.editableValue = this.getEditableValue(json.resetconfigurationresponse.configuration)
this.actualValue = this.editableValue this.actualValue = this.editableValue