summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorUdo Walter2019-11-27 18:20:15 +0100
committerUdo Walter2019-11-27 18:20:15 +0100
commitf28f21b2f67f5e152e6e9d13814150a4adf316c7 (patch)
tree263c88400d5061d0660cde0f20b44ceeefcabaa3 /webapp
parent[server/external-backends/infoblox] Add infoblox fix for a client registratio... (diff)
downloadbas-f28f21b2f67f5e152e6e9d13814150a4adf316c7.tar.gz
bas-f28f21b2f67f5e152e6e9d13814150a4adf316c7.tar.xz
bas-f28f21b2f67f5e152e6e9d13814150a4adf316c7.zip
[configloader] bugfixes in the beta configloader:
add hook sources correct handeling of multiple sources remove merging of multiple sources with the same config
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/ConfigChip.vue47
1 files changed, 32 insertions, 15 deletions
diff --git a/webapp/src/components/ConfigChip.vue b/webapp/src/components/ConfigChip.vue
index f278fe3..7ae0d08 100644
--- a/webapp/src/components/ConfigChip.vue
+++ b/webapp/src/components/ConfigChip.vue
@@ -27,25 +27,18 @@
<div>
<div v-if="active" class="success--text" style="text-align: center; font-weight: bold; font-size: 1.2em">{{ $t('active') }}</div>
<div v-if="assigned" class="primary--text" style="text-align: center; font-weight: bold; font-size: 1.2em">{{ $t('assigned') }}</div>
- <div v-if="config.source">
- <table>
- <tr><td class="config-source-key">{{ $t('source') }}</td><td>{{ config.source.type }}</td></tr>
- <tr v-if="config.source.id"><td class="config-source-key">{{ $t('id') }}</td><td>{{ config.source.id }}</td></tr>
- <tr v-if="config.source.name"><td class="config-source-key">{{ $t('name') }}</td><td>{{ config.source.name }}</td></tr>
- </table>
- </div>
- <div v-else-if="config.configs">
- <div v-for="(subConfig, index) in config.configs" :key="subConfig.id">
+ <v-divider v-if="active || assigned" style="margin-bottom: 4px"></v-divider>
+ <div>
+ <div v-for="(source, index) in sources" :key="source.data.id">
<v-divider v-if="index > 0" style="margin-bottom: 4px"></v-divider>
- <div style="text-align: center; font-weight: bold;">[{{ subConfig.id}}] {{ subConfig.name }}</div>
+ <div style="text-align: center; font-weight: bold;">{{ source.title }}</div>
<table>
- <tr><td class="config-source-key">{{ $t('source') }}</td><td>{{ subConfig.source.type }}</td></tr>
- <tr v-if="subConfig.source.id"><td class="config-source-key">{{ $t('id') }}</td><td>{{ subConfig.source.id }}</td></tr>
- <tr v-if="subConfig.source.name"><td class="config-source-key">{{ $t('name') }}</td><td>{{ subConfig.source.name }}</td></tr>
+ <tr><td class="config-source-key">{{ $t('source') }}</td><td>{{ source.data.type }}</td></tr>
+ <tr v-if="source.data.id"><td class="config-source-key">{{ $t('id') }}</td><td>{{ source.data.id }}</td></tr>
+ <tr v-if="source.data.name"><td class="config-source-key">{{ $t('name') }}</td><td>{{ source.data.name }}</td></tr>
</table>
</div>
</div>
- <span v-else>{{ config.name || config.id }}</span>
</div>
</v-tooltip>
</template>
@@ -79,10 +72,34 @@ export default {
return ''
},
isEvent () {
- return this.config.source && (this.config.source.type === 'IMPORTANT_EVENT' || this.config.source.type === 'EVENT')
+ return this.sources.some(source => (source.data.type === 'IMPORTANT_EVENT' || source.data.type === 'EVENT'))
+ },
+ sources () {
+ return this.getSources(this.config)
}
},
methods: {
+ getSources (config) {
+ const sources = []
+ if (config.merged) {
+ config.configs.forEach(c => {
+ sources.push(...this.getSources(c))
+ })
+ } else {
+ if (Array.isArray(config.source)) {
+ sources.push(...config.source.map(source => ({
+ title: '[' + config.id + '] ' + config.name,
+ data: source
+ })))
+ } else {
+ sources.push({
+ title: '[' + config.id + '] ' + config.name,
+ data: config.source
+ })
+ }
+ }
+ return sources
+ }
}
}
</script>