NEZ-2232 feat:module配置页面修改

This commit is contained in:
zyh
2022-10-09 11:28:00 +08:00
parent c2f2ff4996
commit 06cb9dacea
2 changed files with 621 additions and 330 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -235,9 +235,21 @@ export default {
unit: '', unit: '',
appName: '', appName: '',
listenAddress: '', listenAddress: '',
apiServer: '',
role: '',
namespaces: {
tags: '',
names: []
},
labels: '', labels: '',
labelModule: [{ key: '', value: '' }], labelModule: [{ key: '', value: '' }],
pipeline: [] pipeline: [],
basic_auth: {
username: '',
password: ''
},
bearer_token: '',
relabel_config: []
}], }],
enable: 1 enable: 1
} }
@@ -323,6 +335,7 @@ export default {
item.showAllRelabelOption = false item.showAllRelabelOption = false
item.tags = '' item.tags = ''
}) })
this.object.configs[1].config.forEach(item => { this.object.configs[1].config.forEach(item => {
item.labelModule = [] item.labelModule = []
if (JSON.stringify(item.labels) !== '{}' && item.labels) { if (JSON.stringify(item.labels) !== '{}' && item.labels) {
@@ -356,18 +369,10 @@ export default {
pipeline.expressions = expressionsArr pipeline.expressions = expressionsArr
} }
}) })
if (item.type === 'file') { item.relabel_config && item.relabel_config.forEach(item => {
item.unit = '' item.showAllRelabelOption = false
item.appName = '' item.tags = ''
item.listenAddress = '' })
} else if (item.type === 'journal') {
item.fileName = ''
item.appName = ''
item.listenAddress = ''
} else if (item.type === 'syslog') {
item.fileName = ''
item.unit = ''
}
}) })
if (JSON.stringify(this.object.configs[0].config.labels) !== '{}' && this.object.configs[0].config.labels) { if (JSON.stringify(this.object.configs[0].config.labels) !== '{}' && this.object.configs[0].config.labels) {
Object.keys(this.object.configs[0].config.labels).forEach(key => { Object.keys(this.object.configs[0].config.labels).forEach(key => {