Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3942,6 +3942,7 @@
"message.recover.vm": "Please confirm that you would like to recover this Instance.",
"message.reinstall.vm": "NOTE: Proceed with caution. This will cause the Instance to be reinstalled from the Template; data on the root disk will be lost. Extra data volumes, if any, will not be touched.",
"message.related.settings.changed": "'%x' has been changed. Would you like to review or update any related settings below?",
"message.related.settings.may.not.be.exhaustive": "This list of related settings may not be exhaustive. Please check the documentation for other settings that may need to be updated.",
"message.release.ip.failed": "Failed to release IP",
"message.releasing.dedicated.cluster": "Releasing dedicated Cluster...",
"message.releasing.dedicated.host": "Releasing dedicated host...",
Expand Down
42 changes: 31 additions & 11 deletions ui/src/views/setting/ConfigurationValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
:width="'60vw'"
@cancel="closeRelatedModal">
<p>{{ $t('message.related.settings.changed').replace('%x', relatedSourceConfigName) }}</p>
<a-alert
type="info"
showIcon
style="margin-bottom: 12px"
:message="$t('message.related.settings.may.not.be.exhaustive')" />
<a-table
size="small"
:showHeader="false"
Expand Down Expand Up @@ -396,22 +401,37 @@ export default {
},
fetchRelatedConfigurations (configrecord) {
const prefix = this.getRelatedConfigPrefix(configrecord)
if (!prefix) {
return
}
this.relatedLoading = true
const params = {
const scopeParams = {
[this.scopeKey]: this.$route.params?.id,
keyword: prefix,
pagesize: -1,
listAll: true
}
if (this.scopeKey === 'domainid' && !params[this.scopeKey]) {
params[this.scopeKey] = this.resource?.id
if (this.scopeKey === 'domainid' && !scopeParams[this.scopeKey]) {
scopeParams[this.scopeKey] = this.resource?.id
}
const requests = []
if (prefix) {
requests.push(
getAPI('listConfigurations', { ...scopeParams, keyword: prefix }).then(json => {
const list = json?.listconfigurationsresponse?.configuration || []
return list.filter(c => c.name.startsWith(prefix + '.'))
})
)
}
getAPI('listConfigurations', params).then(json => {
const list = json?.listconfigurationsresponse?.configuration || []
this.relatedConfigs = list.filter(c => c.name !== configrecord.name && c.name.startsWith(prefix + '.'))
requests.push(
getAPI('listConfigurations', { ...scopeParams, parent: configrecord.name }).then(json => {
return json?.listconfigurationsresponse?.configuration || []
})
)
this.relatedLoading = true
Promise.all(requests).then(results => {
const merged = new Map()
results.flat().forEach(c => {
if (c.name !== configrecord.name) {
merged.set(c.name, c)
}
})
this.relatedConfigs = Array.from(merged.values())
if (this.relatedConfigs.length > 0) {
this.relatedSourceConfigName = configrecord.name
this.relatedModalVisible = true
Expand Down
Loading