Skip to content

Commit 15439ed

Browse files
authored
UI: Update and reset domain level configuration (#11571)
1 parent 50fe265 commit 15439ed

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

ui/src/components/view/SettingsTab.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
@search="handleSearch" />
2626
<ConfigurationTable
2727
:columns="columns"
28-
:config="items" />
28+
:config="items"
29+
:resource="resource" />
2930
</a-col>
3031
</div>
3132
</template>

ui/src/views/setting/ConfigurationTable.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<b> {{record.displaytext }} </b> {{ ' (' + record.name + ')' }} <br/> {{ record.description }}
3333
</template>
3434
<template v-if="column.key === 'value'">
35-
<ConfigurationValue :configrecord="record" />
35+
<ConfigurationValue :configrecord="record" :resource="resource" />
3636
</template>
3737
</template>
3838
</a-table>
@@ -85,6 +85,10 @@ export default {
8585
pagesize: {
8686
type: Number,
8787
default: 20
88+
},
89+
resource: {
90+
type: Object,
91+
required: false
8892
}
8993
},
9094
data () {

ui/src/views/setting/ConfigurationValue.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ export default {
217217
actions: {
218218
type: Array,
219219
default: () => []
220+
},
221+
resource: {
222+
type: Object,
223+
required: false
220224
}
221225
},
222226
data () {
@@ -254,6 +258,12 @@ export default {
254258
this.setConfigData()
255259
},
256260
watch: {
261+
configrecord: {
262+
handler () {
263+
this.setConfigData()
264+
},
265+
deep: true
266+
}
257267
},
258268
methods: {
259269
setConfigData () {
@@ -280,6 +290,9 @@ export default {
280290
name: configrecord.name,
281291
value: newValue
282292
}
293+
if (this.scopeKey === 'domainid' && !params[this.scopeKey]) {
294+
params[this.scopeKey] = this.resource?.id
295+
}
283296
postAPI('updateConfiguration', params).then(json => {
284297
this.editableValue = this.getEditableValue(json.updateconfigurationresponse.configuration)
285298
this.actualValue = this.editableValue
@@ -315,6 +328,9 @@ export default {
315328
[this.scopeKey]: this.$route.params?.id,
316329
name: configrecord.name
317330
}
331+
if (this.scopeKey === 'domainid' && !params[this.scopeKey]) {
332+
params[this.scopeKey] = this.resource?.id
333+
}
318334
postAPI('resetConfiguration', params).then(json => {
319335
this.editableValue = this.getEditableValue(json.resetconfigurationresponse.configuration)
320336
this.actualValue = this.editableValue

0 commit comments

Comments
 (0)