shwstppr commented on code in PR #13965:
URL: https://github.com/apache/cloudstack/pull/13965#discussion_r3852176667
##########
ui/src/views/setting/ConfigurationValue.vue:
##########
@@ -319,6 +375,66 @@ export default {
this.$emit('refresh', configrecord.name, configRecordEntry)
})
},
+ isConfigNowActive (configrecord) {
+ const name = configrecord.name || ''
+ if (name.endsWith('.disabled')) {
+ return configrecord.value === 'false'
+ }
+ return configrecord.value === 'true'
+ },
+ getRelatedConfigPrefix (configrecord) {
+ const name = configrecord.name || ''
+ const segments = name.split('.')
+ if (segments.length < 2) {
+ return null
+ }
+ let prefixSegments = segments.slice(0, -1)
+ if ((name.endsWith('.service.enabled') ||
name.endsWith('.service.disabled')) && prefixSegments.length > 1) {
+ prefixSegments = prefixSegments.slice(0, -1)
+ }
+ return prefixSegments.join('.')
+ },
+ fetchRelatedConfigurations (configrecord) {
+ const prefix = this.getRelatedConfigPrefix(configrecord)
+ if (!prefix) {
+ return
+ }
+ this.relatedLoading = true
+ const params = {
+ [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
+ }
+ getAPI('listConfigurations', params).then(json => {
+ const list = json?.listconfigurationsresponse?.configuration || []
+ this.relatedConfigs = list.filter(c => c.name !== configrecord.name &&
c.name.startsWith(prefix + '.'))
+ if (this.relatedConfigs.length > 0) {
+ this.relatedSourceConfigName = configrecord.name
+ this.relatedModalVisible = true
+ }
+ }).catch(error => {
+ console.error(error)
+ }).finally(() => {
Review Comment:
Not needed because we show popup only if relatedSettings is not empty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]