fix:修改 endponit module 切换 logs Type 对应值无法输入的问题
This commit is contained in:
@@ -454,7 +454,7 @@
|
|||||||
{{$t('overall.preview')}}
|
{{$t('overall.preview')}}
|
||||||
</div>
|
</div>
|
||||||
<div class="right-box-line"></div>
|
<div class="right-box-line"></div>
|
||||||
<div class="configs-copy-value">
|
<div class="configs-copy-value">logsLogsArrAdd
|
||||||
<span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue"></i></span>
|
<span class="copy-value-content"> <i class="nz-icon nz-icon-override" @click="copyValue"></i></span>
|
||||||
<pre style="overflow-y: auto;height:100%">{{configsCopyValue}}</pre>
|
<pre style="overflow-y: auto;height:100%">{{configsCopyValue}}</pre>
|
||||||
</div>
|
</div>
|
||||||
@@ -784,6 +784,18 @@ export default {
|
|||||||
pipeline.labels = this.labelsToJson(pipeline.labels)
|
pipeline.labels = this.labelsToJson(pipeline.labels)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (item.type === 'file') {
|
||||||
|
delete item.unit
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'journal') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'syslog') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.unit
|
||||||
|
}
|
||||||
})
|
})
|
||||||
params.configs = JSON.stringify(params.configs)
|
params.configs = JSON.stringify(params.configs)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -883,6 +895,9 @@ export default {
|
|||||||
this.editEndpoint.configs[1].config.push({
|
this.editEndpoint.configs[1].config.push({
|
||||||
type: 'file',
|
type: 'file',
|
||||||
fileName: '',
|
fileName: '',
|
||||||
|
unit: '',
|
||||||
|
appName: '',
|
||||||
|
listenAddress: '',
|
||||||
labels: '',
|
labels: '',
|
||||||
labelModule: [{ key: '', value: '' }],
|
labelModule: [{ key: '', value: '' }],
|
||||||
pipeline: []
|
pipeline: []
|
||||||
@@ -894,23 +909,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
logsBasicTypeChange (i) {
|
logsBasicTypeChange (i) {
|
||||||
const type = this.editEndpoint.configs[1].config[i].type
|
|
||||||
if (type === 'file') {
|
|
||||||
this.editEndpoint.configs[1].config[i].fileName = ''
|
this.editEndpoint.configs[1].config[i].fileName = ''
|
||||||
delete this.editEndpoint.configs[1].config[i].unit
|
|
||||||
delete this.editEndpoint.configs[1].config[i].appName
|
|
||||||
delete this.editEndpoint.configs[1].config[i].listenAddress
|
|
||||||
} else if (type === 'journal') {
|
|
||||||
delete this.editEndpoint.configs[1].config[i].fileName
|
|
||||||
this.editEndpoint.configs[1].config[i].unit = ''
|
this.editEndpoint.configs[1].config[i].unit = ''
|
||||||
delete this.editEndpoint.configs[1].config[i].appName
|
|
||||||
delete this.editEndpoint.configs[1].config[i].listenAddress
|
|
||||||
} else if (type === 'syslog') {
|
|
||||||
delete this.editEndpoint.configs[1].config[i].fileName
|
|
||||||
delete this.editEndpoint.configs[1].config[i].unit
|
|
||||||
this.editEndpoint.configs[1].config[i].appName = ''
|
this.editEndpoint.configs[1].config[i].appName = ''
|
||||||
this.editEndpoint.configs[1].config[i].listenAddress = ''
|
this.editEndpoint.configs[1].config[i].listenAddress = ''
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/* 获取project列表 */
|
/* 获取project列表 */
|
||||||
getProjectList () {
|
getProjectList () {
|
||||||
@@ -1243,6 +1245,18 @@ export default {
|
|||||||
item.labels = this.labelsToJson(item.labelModule)
|
item.labels = this.labelsToJson(item.labelModule)
|
||||||
delete item.labelModule
|
delete item.labelModule
|
||||||
}
|
}
|
||||||
|
if (item.type === 'file') {
|
||||||
|
delete item.unit
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'journal') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'syslog') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.unit
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.configsCopyValue = JSON.stringify(params, null, 2)
|
this.configsCopyValue = JSON.stringify(params, null, 2)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -762,6 +762,18 @@ export default {
|
|||||||
pipeline.labels = this.labelsToJson(pipeline.labels)
|
pipeline.labels = this.labelsToJson(pipeline.labels)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (item.type === 'file') {
|
||||||
|
delete item.unit
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'journal') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'syslog') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.unit
|
||||||
|
}
|
||||||
})
|
})
|
||||||
params.configs = JSON.stringify(params.configs)
|
params.configs = JSON.stringify(params.configs)
|
||||||
this.$refs.moduleForm.validate((valid, errorKey) => {
|
this.$refs.moduleForm.validate((valid, errorKey) => {
|
||||||
@@ -943,6 +955,9 @@ export default {
|
|||||||
this.editModule.configs[1].config.push({
|
this.editModule.configs[1].config.push({
|
||||||
type: 'file',
|
type: 'file',
|
||||||
fileName: '',
|
fileName: '',
|
||||||
|
unit: '',
|
||||||
|
appName: '',
|
||||||
|
listenAddress: '',
|
||||||
labels: '',
|
labels: '',
|
||||||
labelModule: [{ key: '', value: '' }],
|
labelModule: [{ key: '', value: '' }],
|
||||||
pipeline: []
|
pipeline: []
|
||||||
@@ -954,23 +969,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
logsBasicTypeChange (i) {
|
logsBasicTypeChange (i) {
|
||||||
const type = this.editModule.configs[1].config[i].type
|
|
||||||
if (type === 'file') {
|
|
||||||
this.editModule.configs[1].config[i].fileName = ''
|
this.editModule.configs[1].config[i].fileName = ''
|
||||||
delete this.editModule.configs[1].config[i].unit
|
|
||||||
delete this.editModule.configs[1].config[i].appName
|
|
||||||
delete this.editModule.configs[1].config[i].listenAddress
|
|
||||||
} else if (type === 'journal') {
|
|
||||||
delete this.editModule.configs[1].config[i].fileName
|
|
||||||
this.editModule.configs[1].config[i].unit = ''
|
this.editModule.configs[1].config[i].unit = ''
|
||||||
delete this.editModule.configs[1].config[i].appName
|
|
||||||
delete this.editModule.configs[1].config[i].listenAddress
|
|
||||||
} else if (type === 'syslog') {
|
|
||||||
delete this.editModule.configs[1].config[i].fileName
|
|
||||||
delete this.editModule.configs[1].config[i].unit
|
|
||||||
this.editModule.configs[1].config[i].appName = ''
|
this.editModule.configs[1].config[i].appName = ''
|
||||||
this.editModule.configs[1].config[i].listenAddress = ''
|
this.editModule.configs[1].config[i].listenAddress = ''
|
||||||
}
|
|
||||||
},
|
},
|
||||||
copyValue () {
|
copyValue () {
|
||||||
const domUrl = document.createElement('input')
|
const domUrl = document.createElement('input')
|
||||||
@@ -1179,6 +1181,18 @@ export default {
|
|||||||
item.labels = this.labelsToJson(item.labelModule)
|
item.labels = this.labelsToJson(item.labelModule)
|
||||||
delete item.labelModule
|
delete item.labelModule
|
||||||
}
|
}
|
||||||
|
if (item.type === 'file') {
|
||||||
|
delete item.unit
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'journal') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.appName
|
||||||
|
delete item.listenAddress
|
||||||
|
} else if (item.type === 'syslog') {
|
||||||
|
delete item.fileName
|
||||||
|
delete item.unit
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.configsCopyValue = JSON.stringify(params, null, 2)
|
this.configsCopyValue = JSON.stringify(params, null, 2)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,6 +193,9 @@ export default {
|
|||||||
config: [{
|
config: [{
|
||||||
type: 'file',
|
type: 'file',
|
||||||
fileName: '',
|
fileName: '',
|
||||||
|
unit: '',
|
||||||
|
appName: '',
|
||||||
|
listenAddress: '',
|
||||||
labels: '',
|
labels: '',
|
||||||
labelModule: [{ key: '', value: '' }],
|
labelModule: [{ key: '', value: '' }],
|
||||||
pipeline: []
|
pipeline: []
|
||||||
@@ -356,6 +359,18 @@ export default {
|
|||||||
pipeline.labels = labelsArr
|
pipeline.labels = labelsArr
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (item.type === 'file') {
|
||||||
|
item.unit = ''
|
||||||
|
item.appName = ''
|
||||||
|
item.listenAddress = ''
|
||||||
|
} else if (item.type === 'journal') {
|
||||||
|
item.fileName = ''
|
||||||
|
item.appName = ''
|
||||||
|
item.listenAddress = ''
|
||||||
|
} else if (item.type === 'syslog') {
|
||||||
|
item.fileName = ''
|
||||||
|
item.unit = ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.object.configs = [this.object.configs[0], this.object.configs[1]]
|
this.object.configs = [this.object.configs[0], this.object.configs[1]]
|
||||||
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) {
|
||||||
@@ -475,7 +490,7 @@ export default {
|
|||||||
]
|
]
|
||||||
this.titleSearchList.type.children = [
|
this.titleSearchList.type.children = [
|
||||||
{ key: 'Metrics', value: 'metrics', name: 'Metrics' },
|
{ key: 'Metrics', value: 'metrics', name: 'Metrics' },
|
||||||
{ key: 'Logs', value: 'logs', name: 'Logs' },
|
{ key: 'Logs', value: 'logs', name: 'Logs' }
|
||||||
]
|
]
|
||||||
this.titleSearchList.state.show = true
|
this.titleSearchList.state.show = true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ export default {
|
|||||||
config: [{
|
config: [{
|
||||||
type: 'file',
|
type: 'file',
|
||||||
fileName: '',
|
fileName: '',
|
||||||
|
unit: '',
|
||||||
|
appName: '',
|
||||||
|
listenAddress: '',
|
||||||
labels: '',
|
labels: '',
|
||||||
labelModule: [{ key: '', value: '' }],
|
labelModule: [{ key: '', value: '' }],
|
||||||
pipeline: []
|
pipeline: []
|
||||||
@@ -218,6 +221,18 @@ export default {
|
|||||||
pipeline.labels = labelsArr
|
pipeline.labels = labelsArr
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (item.type === 'file') {
|
||||||
|
item.unit = ''
|
||||||
|
item.appName = ''
|
||||||
|
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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user