Merge branch 'dev-2.0' of https://git.mesalab.cn/nezha/nezha-fronted into dev-2.0
This commit is contained in:
@@ -18,11 +18,11 @@ export const agent = {
|
|||||||
value: 2,
|
value: 2,
|
||||||
text: 'Per-datacenter'
|
text: 'Per-datacenter'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: 'Loki',
|
// label: 'Loki',
|
||||||
value: 11,
|
// value: 11,
|
||||||
text: 'Loki'
|
// text: 'Loki'
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -70,12 +70,12 @@ export const agent2 = {
|
|||||||
label: 'Per-datacenter',
|
label: 'Per-datacenter',
|
||||||
value: 2,
|
value: 2,
|
||||||
text: 'Per-datacenter'
|
text: 'Per-datacenter'
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Loki',
|
|
||||||
value: 11,
|
|
||||||
text: 'Loki'
|
|
||||||
}
|
}
|
||||||
|
// {
|
||||||
|
// label: 'Loki',
|
||||||
|
// value: 11,
|
||||||
|
// text: 'Loki'
|
||||||
|
// }
|
||||||
],
|
],
|
||||||
theDataGroup: [
|
theDataGroup: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -170,6 +170,14 @@ export function checkExprTempAge (rule, value, callback) {
|
|||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function arrLength (rule, value, callback) { // 校验经纬度
|
||||||
|
if (value.length > 0) {
|
||||||
|
callback()
|
||||||
|
} else {
|
||||||
|
callback(new Error(vm.$t('validate.required')))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function longAndLat (rule, value, callback) { // 校验经纬度
|
export function longAndLat (rule, value, callback) { // 校验经纬度
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ const cn = {
|
|||||||
generate: '生产',
|
generate: '生产',
|
||||||
personalCenter: '个人中心',
|
personalCenter: '个人中心',
|
||||||
operationRecord: '操作记录',
|
operationRecord: '操作记录',
|
||||||
changePassword: '修改密码'
|
changePassword: '修改密码',
|
||||||
|
relabelConfigRegex: '默认是 (.*) ',
|
||||||
|
relabelConfigReplacement: '默认是 $1'
|
||||||
},
|
},
|
||||||
setup: {
|
setup: {
|
||||||
step0: '欢迎',
|
step0: '欢迎',
|
||||||
|
|||||||
@@ -155,7 +155,9 @@ const en = {
|
|||||||
generate: 'Generate',
|
generate: 'Generate',
|
||||||
personalCenter: 'Profile',
|
personalCenter: 'Profile',
|
||||||
operationRecord: 'Operation record',
|
operationRecord: 'Operation record',
|
||||||
changePassword: 'Change password'
|
changePassword: 'Change password',
|
||||||
|
relabelConfigRegex: 'Default is (.*) ',
|
||||||
|
relabelConfigReplacement: 'Default is $1'
|
||||||
},
|
},
|
||||||
pageSize: '/page',
|
pageSize: '/page',
|
||||||
setup: {
|
setup: {
|
||||||
|
|||||||
@@ -43,14 +43,15 @@
|
|||||||
<!-- :props="{ multiple: false, checkStrictly: false ,emitPath:false}"-->
|
<!-- :props="{ multiple: false, checkStrictly: false ,emitPath:false}"-->
|
||||||
<!-- clearable></el-cascader>-->
|
<!-- clearable></el-cascader>-->
|
||||||
<el-select v-model="editPromServer.type" :disabled="editPromServer.id != null&& editPromServer.id != ''" placeholder="" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="value">
|
<el-select v-model="editPromServer.type" :disabled="editPromServer.id != null&& editPromServer.id != ''" placeholder="" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="value">
|
||||||
<el-option-group
|
<!-- <el-option-group-->
|
||||||
v-for="group in agent2.theDataGroup"
|
<!-- v-for="group in agent2.theData"-->
|
||||||
:key="group.label"
|
<!-- :key="group.label"-->
|
||||||
:label="group.label">
|
<!-- :label="group.label">-->
|
||||||
<el-option v-for="item in group.option" :key="item.value" :label="item.label" :value="item.value" :disabled="federationEnabled && item.value == 2">
|
<!-- -->
|
||||||
<span class="panel-dropdown-label-txt" >{{item.label}}</span>
|
<!-- </el-option-group>-->
|
||||||
</el-option>
|
<el-option v-for="item in agent2.theData" :key="item.value" :label="item.label" :value="item.value" :disabled="federationEnabled && item.value == 2">
|
||||||
</el-option-group>
|
<span class="panel-dropdown-label-txt" >{{item.label}}</span>
|
||||||
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Token" prop="token">
|
<el-form-item label="Token" prop="token">
|
||||||
|
|||||||
@@ -404,6 +404,13 @@ export default {
|
|||||||
// this.object.port = this.object.configs.port ? JSON.parse(JSON.stringify(this.object.configs.port)) : ''
|
// this.object.port = this.object.configs.port ? JSON.parse(JSON.stringify(this.object.configs.port)) : ''
|
||||||
this.object.paramObj = []
|
this.object.paramObj = []
|
||||||
this.object.labelModule = []
|
this.object.labelModule = []
|
||||||
|
if (!this.object.configs[0].config.relabel_config) {
|
||||||
|
this.object.configs[0].config.relabel_config = []
|
||||||
|
}
|
||||||
|
this.object.configs[0].config.relabel_config && this.object.configs[0].config.relabel_config.forEach(item => {
|
||||||
|
item.showAllRelabelOption = false
|
||||||
|
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) {
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
<!--port-->
|
<!--port-->
|
||||||
<el-form-item :label='$t("project.endpoint.port")' class="half-form-item" prop="configs.0.config.port" :rules="[
|
<el-form-item :label='$t("project.endpoint.port")' class="half-form-item" prop="configs.0.config.port" :rules="[
|
||||||
{ validator: port, trigger: 'blur' },
|
{ validator: port, trigger: 'blur' },
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
{ required: true, message: $t('validate.required'), trigger: 'blur' }
|
||||||
]">
|
]">
|
||||||
<el-input id="module-box-input-port" v-model.number="editEndpoint.configs[0].config.port" placeholder="" size="small"></el-input>
|
<el-input id="module-box-input-port" v-model.number="editEndpoint.configs[0].config.port" placeholder="" size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
<div class="sub-label sub-label-required" style="padding-left: 0">{{$t('project.module.walk')}}</div>
|
<div class="sub-label sub-label-required" style="padding-left: 0">{{$t('project.module.walk')}}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item prop="configs.0.config.walk" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item prop="configs.0.config.walk" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<select-walk ref="selectWalk" :currentWalk="editEndpoint.configs[0].config.walk" :expandedWalk="expandedWalkData" :placement="'bottom-start'" :walkData="walkData" @selectWalk="selectWalk">
|
<select-walk ref="selectWalk" :currentWalk="editEndpoint.configs[0].config.walk" :expandedWalk="expandedWalkData" :placement="'bottom-start'" :walkData="walkData" @selectWalk="selectWalk">
|
||||||
<template v-slot:trigger>
|
<template v-slot:trigger>
|
||||||
<div class="el-cascader">
|
<div class="el-cascader">
|
||||||
@@ -235,6 +235,61 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="Relabel" name="Relabel">
|
||||||
|
<div id="module-box-relabel" ref="labelBoxScrollbar" style="height: 100%; overflow: hidden;">
|
||||||
|
<div v-for="(item, index) in this.editEndpoint.configs[0].config.relabel_config" :key="index" class="">
|
||||||
|
<div class="pipeline-box">
|
||||||
|
<span class="pipeline-title">{{'item' + index}}</span>
|
||||||
|
<span class="pipeline-option">
|
||||||
|
<i class="nz-icon nz-icon-shanchu1" @click="removeRelabel(index)"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-form-item :prop="'configs.0.config.relabel_config.' + index + '.source_labels'" class="" :label="'Source labels'" :rules="[{ required: true, message: $t('validate.required'), trigger: 'change' },{ validator: arrLength, trigger: 'change' }]">
|
||||||
|
<vue-tags-input
|
||||||
|
v-model="item.tags"
|
||||||
|
:maxlength="32"
|
||||||
|
:placeholder="'add parameter'"
|
||||||
|
:tags="item.source_labels"
|
||||||
|
@tags-changed="(newTags)=>{tagsChangeRelabel(newTags, index)}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :prop="'configs.0.config.relabel_config.' + index + '.action'" class="half-form-item" :label="'Action'">
|
||||||
|
<el-select v-model="item.action" :id="'action' + index " class="right-box__select " placeholder="" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" @change="actionChange(index)" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
|
<el-option v-for="item2 in actionList" :id="'module-action-'+item2.label" :key="item2.label" :label="item2.label" :value="item2.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :prop="'configs.0.config.relabel_config.' + index + '.target_label'" class="half-form-item" :label="'Target label'" :rules="[{ required: item.action === 'replace', message: $t('validate.required'), trigger: 'blur' },{ pattern: /[a-zA-Z_:][a-zA-Z0-9_:]*/, message: $t('validate.key') ,trigger: 'blur'}]">
|
||||||
|
<el-input id="module-box-input-target_label" v-model="item.target_label" placeholder='' size="small"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<!-- <span :id="'moduel-remove-label-'+index" class="param-box-row-symbol" @click="removeRelabel(index)"><i class="nz-icon nz-icon-shanchu1" style="color:#666;"></i></span>-->
|
||||||
|
<transition name="el-zoom-in-top">
|
||||||
|
<div v-show="item.showAllRelabelOption" >
|
||||||
|
<!--scrape_interval-->
|
||||||
|
<el-form-item :label='"Regex"' class="half-form-item" :prop="'configs.0.config.relabel_config.' + index + '.regex'">
|
||||||
|
<el-input id="module-box-input-regex" v-model="item.regex" :placeholder="$t('overall.relabelConfigRegex')" size="small"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!--scrape_timeout-->
|
||||||
|
<el-form-item :label='"Replacement"' class="half-form-item" :prop="'configs.0.config.relabel_config.' + index + '.replacement'">
|
||||||
|
<el-input id="module-box-input-replacement" v-model="item.replacement" :placeholder="$t('overall.relabelConfigReplacement')" size="small"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<span class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" style="border: none" @click="item.showAllRelabelOption=!item.showAllRelabelOption">
|
||||||
|
{{$t('overall.moreOption')}}
|
||||||
|
<i :class="item.showAllRelabelOption?'is-active':''" class="nz-icon nz-icon-arrow-down need-rotate" ></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<span id="module-add-relabel" class="right-box-form-add module-add-label margin-t-10" type="button" @click="addRelabel">
|
||||||
|
<span><i class="nz-icon nz-icon-plus" style="font-size: 16px;"></i></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane v-if="editEndpoint.configs[0].config.protocol !== 'snmp'" label="Auth" name="Auth">
|
<el-tab-pane v-if="editEndpoint.configs[0].config.protocol !== 'snmp'" label="Auth" name="Auth">
|
||||||
<!--authtype-->
|
<!--authtype-->
|
||||||
<el-form-item :label='$t("project.endpoint.type")' prop="authtype">
|
<el-form-item :label='$t("project.endpoint.type")' prop="authtype">
|
||||||
@@ -244,16 +299,16 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!--authtype 1-->
|
<!--authtype 1-->
|
||||||
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.username")' class="half-form-item" prop="configs.0.config.basic_auth.username" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.username")' class="half-form-item" prop="configs.0.config.basic_auth.username" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<el-input id="module-box-input-uername" v-model="editEndpoint.configs[0].config.basic_auth.username" placeholder='' size="small"></el-input>
|
<el-input id="module-box-input-uername" v-model="editEndpoint.configs[0].config.basic_auth.username" placeholder='' size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<el-input id="module-box-input-password" v-model="editEndpoint.configs[0].config.basic_auth.pin" type="password" autocomplete="new-password" placeholder='' size="small"></el-input>
|
<el-input id="module-box-input-password" v-model="editEndpoint.configs[0].config.basic_auth.pin" type="password" autocomplete="new-password" placeholder='' size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!--authtype 2-->
|
<!--authtype 2-->
|
||||||
<el-form-item v-if="authType === 2" :label='$t("project.endpoint.bearer_token")' prop="configs.0.config.bearer_token" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item v-if="authType === 2" :label='$t("project.endpoint.bearer_token")' prop="configs.0.config.bearer_token" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<el-input id="module-box-input-bearer_token" v-model="editEndpoint.configs[0].config.bearer_token" placeholder='' size="small"></el-input>
|
<el-input id="module-box-input-bearer_token" v-model="editEndpoint.configs[0].config.bearer_token" placeholder='' size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -501,12 +556,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { noSpecialChar, port } from '../js/validate'
|
import { noSpecialChar, port, arrLength } from '../js/validate'
|
||||||
import pipelineSelect from './pipelineSelect'
|
import pipelineSelect from './pipelineSelect'
|
||||||
import selectWalk from '../popBox/selectWalk'
|
import selectWalk from '../popBox/selectWalk'
|
||||||
import editRigthBox from '../mixin/editRigthBox'
|
import editRigthBox from '../mixin/editRigthBox'
|
||||||
import VueTagsInput from '@johmun/vue-tags-input'
|
import VueTagsInput from '@johmun/vue-tags-input'
|
||||||
import project from '@/components/page/monitor/project/project'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'editEndpointBoxNew',
|
name: 'editEndpointBoxNew',
|
||||||
@@ -701,11 +755,31 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
timestampList: ['ANSIC', 'UnixDate', 'RubyDate', 'RFC822', 'RFC822Z', 'RFC850', 'RFC1123', 'RFC1123Z', 'RFC3339', 'RFC3339Nano', 'Unix', 'UnixMs', 'UnixUs', 'UnixNs'],
|
timestampList: ['ANSIC', 'UnixDate', 'RubyDate', 'RFC822', 'RFC822Z', 'RFC850', 'RFC1123', 'RFC1123Z', 'RFC3339', 'RFC3339Nano', 'Unix', 'UnixMs', 'UnixUs', 'UnixNs'],
|
||||||
|
actionList: [{
|
||||||
|
value: 'replace',
|
||||||
|
label: 'Replace'
|
||||||
|
}, {
|
||||||
|
value: 'keep',
|
||||||
|
label: 'Keep'
|
||||||
|
}, {
|
||||||
|
value: 'drop',
|
||||||
|
label: 'Drop'
|
||||||
|
}, {
|
||||||
|
value: 'labelmap',
|
||||||
|
label: 'Labelmap'
|
||||||
|
}, {
|
||||||
|
value: 'labeldrop',
|
||||||
|
label: 'Labeldrop'
|
||||||
|
}, {
|
||||||
|
value: 'labelkeep',
|
||||||
|
label: 'Labelkeep'
|
||||||
|
}],
|
||||||
metricsShow: true,
|
metricsShow: true,
|
||||||
logsShow: true
|
logsShow: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
arrLength: arrLength,
|
||||||
port: port,
|
port: port,
|
||||||
selectWalk (walk) {
|
selectWalk (walk) {
|
||||||
if (this.editEndpoint.configs[0].config.walk.indexOf(walk) != -1) {
|
if (this.editEndpoint.configs[0].config.walk.indexOf(walk) != -1) {
|
||||||
@@ -858,6 +932,10 @@ export default {
|
|||||||
delete item.unit
|
delete item.unit
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
params.configs[0].config.relabel_config.relabel_config && params.configs[0].config.relabel_config.forEach(item => {
|
||||||
|
delete item.tags
|
||||||
|
delete item.showAllRelabelOption
|
||||||
|
})
|
||||||
params.configs = JSON.stringify(params.configs)
|
params.configs = JSON.stringify(params.configs)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.moduleForm.validate((valid, errorKey) => {
|
this.$refs.moduleForm.validate((valid, errorKey) => {
|
||||||
@@ -868,8 +946,10 @@ export default {
|
|||||||
const keyArr = key.split('.')
|
const keyArr = key.split('.')
|
||||||
if (keyArr[3] === 'basic_auth' || keyArr[3] === 'bearer_token') {
|
if (keyArr[3] === 'basic_auth' || keyArr[3] === 'bearer_token') {
|
||||||
this.activeName = 'Auth'
|
this.activeName = 'Auth'
|
||||||
} else if (keyArr[3] === 'basic' || keyArr[3] === 'port') {
|
} else if (keyArr[3] === 'basic' || keyArr[3] === 'port' || keyArr[3] === 'host') {
|
||||||
this.activeName = 'Basic'
|
this.activeName = 'Basic'
|
||||||
|
} else {
|
||||||
|
this.activeName = 'Relabel'
|
||||||
}
|
}
|
||||||
} else if (key.indexOf('configs.1') !== -1) {
|
} else if (key.indexOf('configs.1') !== -1) {
|
||||||
const keyArr = key.split('.')
|
const keyArr = key.split('.')
|
||||||
@@ -1284,6 +1364,10 @@ export default {
|
|||||||
})
|
})
|
||||||
this.editEndpoint.paramObj = []
|
this.editEndpoint.paramObj = []
|
||||||
this.editEndpoint.labelModule = []
|
this.editEndpoint.labelModule = []
|
||||||
|
this.editEndpoint.configs[0].config.relabel_config && this.editEndpoint.configs[0].config.relabel_config.forEach(item => {
|
||||||
|
item.showAllRelabelOption = false
|
||||||
|
item.tags = ''
|
||||||
|
})
|
||||||
if (JSON.stringify(this.editEndpoint.configs[0].config.labels) !== '{}' && this.editEndpoint.configs[0].config.labels) {
|
if (JSON.stringify(this.editEndpoint.configs[0].config.labels) !== '{}' && this.editEndpoint.configs[0].config.labels) {
|
||||||
Object.keys(this.editEndpoint.configs[0].config.labels).forEach(key => {
|
Object.keys(this.editEndpoint.configs[0].config.labels).forEach(key => {
|
||||||
this.editEndpoint.labelModule.push({ key, value: this.editEndpoint.configs[0].config.labels[key] })
|
this.editEndpoint.labelModule.push({ key, value: this.editEndpoint.configs[0].config.labels[key] })
|
||||||
@@ -1307,6 +1391,37 @@ export default {
|
|||||||
// }
|
// }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
removeRelabel (index) {
|
||||||
|
// if (this.editEndpoint.configs[0].config.relabel_config.length === 1) {
|
||||||
|
// this.editEndpoint.configs[0].config.relabel_config = [{
|
||||||
|
// source_labels: [],
|
||||||
|
// target_label: '',
|
||||||
|
// action: '',
|
||||||
|
// regex: '',
|
||||||
|
// replacement: '',
|
||||||
|
// showAllRelabelOption: false
|
||||||
|
// }]
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
this.editEndpoint.configs[0].config.relabel_config.splice(index, 1)
|
||||||
|
},
|
||||||
|
tagsChangeRelabel (newTags, index) {
|
||||||
|
this.editEndpoint.configs[0].config.relabel_config[index].source_labels = newTags.map(item => item.text)
|
||||||
|
this.$refs.moduleForm.clearValidate('configs.0.config.relabel_config.' + index + '.source_labels')
|
||||||
|
},
|
||||||
|
actionChange (index) {
|
||||||
|
this.$refs.moduleForm.clearValidate('configs.0.config.relabel_config.' + index + '.target_label')
|
||||||
|
},
|
||||||
|
addRelabel () {
|
||||||
|
this.editEndpoint.configs[0].config.relabel_config.push({
|
||||||
|
source_labels: [],
|
||||||
|
target_label: '',
|
||||||
|
action: 'replace',
|
||||||
|
regex: '(.*)',
|
||||||
|
replacement: '$1',
|
||||||
|
showAllRelabelOption: false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@@ -1380,6 +1495,10 @@ export default {
|
|||||||
if (params[0].config.labels && !Object.keys(params[0].config.labels).length) {
|
if (params[0].config.labels && !Object.keys(params[0].config.labels).length) {
|
||||||
delete params[0].config.labels
|
delete params[0].config.labels
|
||||||
}
|
}
|
||||||
|
params[0].config.relabel_config && params[0].config.relabel_config.forEach(item => {
|
||||||
|
delete item.tags
|
||||||
|
delete item.showAllRelabelOption
|
||||||
|
})
|
||||||
params[1].config.forEach(item => {
|
params[1].config.forEach(item => {
|
||||||
if (item.labelModule) {
|
if (item.labelModule) {
|
||||||
item.labels = this.labelsToJson(item.labelModule)
|
item.labels = this.labelsToJson(item.labelModule)
|
||||||
@@ -1596,6 +1715,12 @@ export default {
|
|||||||
color: #FA901C;
|
color: #FA901C;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
#module-box-relabel /deep/ .vue-tags-input{
|
||||||
|
max-width: unset;
|
||||||
|
}
|
||||||
|
/deep/ .is-error .vue-tags-input{
|
||||||
|
border: 1px solid #F56C6C;
|
||||||
|
}
|
||||||
.pipeline-box{
|
.pipeline-box{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
<!--port-->
|
<!--port-->
|
||||||
<el-form-item :label='$t("project.endpoint.port")' class="half-form-item" prop="configs.0.config.port" :rules="[
|
<el-form-item :label='$t("project.endpoint.port")' class="half-form-item" prop="configs.0.config.port" :rules="[
|
||||||
{ validator: port, trigger: 'blur' },
|
{ validator: port, trigger: 'blur' },
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
{ required: true, message: $t('validate.required'), trigger: 'blur' }
|
||||||
]">
|
]">
|
||||||
<el-input id="module-box-input-port" v-model.number="editModule.configs[0].config.port" placeholder="" size="small"></el-input>
|
<el-input id="module-box-input-port" v-model.number="editModule.configs[0].config.port" placeholder="" size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!--host-->
|
<!--host-->
|
||||||
<el-form-item :label='$t("project.endpoint.host")' class="half-form-item" prop="configs.0.config.host" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item :label='$t("project.endpoint.host")' class="half-form-item" prop="configs.0.config.host" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<el-input id="module-box-input-host" v-model="editModule.configs[0].config.host" placeholder="" size="small"></el-input>
|
<el-input id="module-box-input-host" v-model="editModule.configs[0].config.host" placeholder="" size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- snmp表单 -->
|
<!-- snmp表单 -->
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
<div class="sub-label sub-label-required" style="padding-left: 0">{{$t('project.module.walk')}}</div>
|
<div class="sub-label sub-label-required" style="padding-left: 0">{{$t('project.module.walk')}}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item prop="configs.0.config.walk" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item prop="configs.0.config.walk" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<select-walk ref="selectWalk" :currentWalk="editModule.configs[0].config.walk" :expandedWalk="expandedWalkData" :placement="'bottom-start'" :walkData="walkData" @selectWalk="selectWalk">
|
<select-walk ref="selectWalk" :currentWalk="editModule.configs[0].config.walk" :expandedWalk="expandedWalkData" :placement="'bottom-start'" :walkData="walkData" @selectWalk="selectWalk">
|
||||||
<template v-slot:trigger>
|
<template v-slot:trigger>
|
||||||
<div class="el-cascader">
|
<div class="el-cascader">
|
||||||
@@ -147,6 +147,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- more option-->
|
||||||
<transition name="el-zoom-in-top">
|
<transition name="el-zoom-in-top">
|
||||||
<div v-show="showAllBasicOption" >
|
<div v-show="showAllBasicOption" >
|
||||||
<!--scrape_interval-->
|
<!--scrape_interval-->
|
||||||
@@ -215,6 +216,61 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="Relabel" name="Relabel">
|
||||||
|
<div id="module-box-relabel" ref="labelBoxScrollbar" style="height: 100%; overflow: hidden;">
|
||||||
|
<div v-for="(item, index) in this.editModule.configs[0].config.relabel_config" :key="index" class="">
|
||||||
|
<div class="pipeline-box">
|
||||||
|
<span class="pipeline-title">{{'item' + index}}</span>
|
||||||
|
<span class="pipeline-option">
|
||||||
|
<i class="nz-icon nz-icon-shanchu1" @click="removeRelabel(index)"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-form-item :prop="'configs.0.config.relabel_config.' + index + '.source_labels'" class="" :label="'Source labels'" :rules="[{ required: true, message: $t('validate.required'), trigger: 'change' },{ validator: arrLength, trigger: 'change' }]">
|
||||||
|
<vue-tags-input
|
||||||
|
v-model="item.tags"
|
||||||
|
:maxlength="32"
|
||||||
|
:placeholder="'add parameter'"
|
||||||
|
:tags="item.source_labels"
|
||||||
|
@tags-changed="(newTags)=>{tagsChangeRelabel(newTags, index)}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :prop="'configs.0.config.relabel_config.' + index + '.action'" class="half-form-item" :label="'Action'">
|
||||||
|
<el-select v-model="item.action" :id="'action' + index " class="right-box__select " placeholder="" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" @change="actionChange(index)" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
|
<el-option v-for="item2 in actionList" :id="'module-action-'+item2.label" :key="item2.label" :label="item2.label" :value="item2.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :prop="'configs.0.config.relabel_config.' + index + '.target_label'" class="half-form-item" :label="'Target label'" :rules="[{ required: item.action === 'replace', message: $t('validate.required'), trigger: 'blur' },{ pattern: /[a-zA-Z_:][a-zA-Z0-9_:]*/, message: $t('validate.key') ,trigger: 'blur'}]">
|
||||||
|
<el-input id="module-box-input-target_label" v-model="item.target_label" placeholder='' size="small"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<!-- <span :id="'moduel-remove-label-'+index" class="param-box-row-symbol" @click="removeRelabel(index)"><i class="nz-icon nz-icon-shanchu1" style="color:#666;"></i></span>-->
|
||||||
|
<transition name="el-zoom-in-top">
|
||||||
|
<div v-show="item.showAllRelabelOption" >
|
||||||
|
<!--Regex-->
|
||||||
|
<el-form-item :label='"Regex"' class="half-form-item" :prop="'configs.0.config.relabel_config.' + index + '.regex'">
|
||||||
|
<el-input id="module-box-input-regex" v-model="item.regex" :placeholder="$t('overall.relabelConfigRegex')" size="small"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!--replacement-->
|
||||||
|
<el-form-item :label='"Replacement"' class="half-form-item" :prop="'configs.0.config.relabel_config.' + index + '.replacement'">
|
||||||
|
<el-input id="module-box-input-replacement" v-model="item.replacement" :placeholder="$t('overall.relabelConfigReplacement')" size="small"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<span class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" style="border: none" @click="item.showAllRelabelOption=!item.showAllRelabelOption">
|
||||||
|
{{$t('overall.moreOption')}}
|
||||||
|
<i :class="item.showAllRelabelOption?'is-active':''" class="nz-icon nz-icon-arrow-down need-rotate" ></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<span id="module-add-relabel" class="right-box-form-add module-add-label margin-t-10" type="button" @click="addRelabel">
|
||||||
|
<span><i class="nz-icon nz-icon-plus" style="font-size: 16px;"></i></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane v-if="editModule.configs[0].config.protocol !== 'snmp'" label="Auth" name="Auth">
|
<el-tab-pane v-if="editModule.configs[0].config.protocol !== 'snmp'" label="Auth" name="Auth">
|
||||||
<!--authtype-->
|
<!--authtype-->
|
||||||
<el-form-item :label='$t("project.endpoint.type")' prop="authtype">
|
<el-form-item :label='$t("project.endpoint.type")' prop="authtype">
|
||||||
@@ -224,16 +280,16 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!--authtype 1-->
|
<!--authtype 1-->
|
||||||
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.username")' class="half-form-item" prop="configs.0.config.basic_auth.username" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.username")' class="half-form-item" prop="configs.0.config.basic_auth.username" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<el-input id="module-box-input-uername" v-model="editModule.configs[0].config.basic_auth.username" placeholder='' size="small"></el-input>
|
<el-input id="module-box-input-uername" v-model="editModule.configs[0].config.basic_auth.username" placeholder='' size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item v-if="authType === 1" :label='$t("project.endpoint.pin")' class="half-form-item" prop="configs.0.config.basic_auth.pin" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<el-input id="module-box-input-password" v-model="editModule.configs[0].config.basic_auth.pin" type="password" autocomplete="new-password" placeholder='' size="small"></el-input>
|
<el-input id="module-box-input-password" v-model="editModule.configs[0].config.basic_auth.pin" type="password" autocomplete="new-password" placeholder='' size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!--authtype 2-->
|
<!--authtype 2-->
|
||||||
<el-form-item v-if="authType === 2" :label='$t("project.endpoint.bearer_token")' prop="configs.0.config.bearer_token" :rules="[{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]">
|
<el-form-item v-if="authType === 2" :label='$t("project.endpoint.bearer_token")' prop="configs.0.config.bearer_token" :rules="[{ required: true, message: $t('validate.required'), trigger: 'blur' }]">
|
||||||
<el-input id="module-box-input-bearer_token" v-model="editModule.configs[0].config.bearer_token" placeholder='' size="small"></el-input>
|
<el-input id="module-box-input-bearer_token" v-model="editModule.configs[0].config.bearer_token" placeholder='' size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -480,7 +536,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { noSpecialChar, port, nzNumber } from '../js/validate'
|
import { noSpecialChar, port, nzNumber , arrLength} from '../js/validate'
|
||||||
import selectWalk from '../popBox/selectWalk'
|
import selectWalk from '../popBox/selectWalk'
|
||||||
import editRigthBox from '../mixin/editRigthBox'
|
import editRigthBox from '../mixin/editRigthBox'
|
||||||
import pipelineSelect from './pipelineSelect'
|
import pipelineSelect from './pipelineSelect'
|
||||||
@@ -640,12 +696,32 @@ export default {
|
|||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
timestampList: ['ANSIC', 'UnixDate', 'RubyDate', 'RFC822', 'RFC822Z', 'RFC850', 'RFC1123', 'RFC1123Z', 'RFC3339', 'RFC3339Nano', 'Unix', 'UnixMs', 'UnixUs', 'UnixNs'],
|
timestampList: ['ANSIC', 'UnixDate', 'RubyDate', 'RFC822', 'RFC822Z', 'RFC850', 'RFC1123', 'RFC1123Z', 'RFC3339', 'RFC3339Nano', 'Unix', 'UnixMs', 'UnixUs', 'UnixNs'],
|
||||||
|
actionList: [{
|
||||||
|
value: 'replace',
|
||||||
|
label: 'Replace'
|
||||||
|
}, {
|
||||||
|
value: 'keep',
|
||||||
|
label: 'Keep'
|
||||||
|
}, {
|
||||||
|
value: 'drop',
|
||||||
|
label: 'Drop'
|
||||||
|
}, {
|
||||||
|
value: 'labelmap',
|
||||||
|
label: 'Labelmap'
|
||||||
|
}, {
|
||||||
|
value: 'labeldrop',
|
||||||
|
label: 'Labeldrop'
|
||||||
|
}, {
|
||||||
|
value: 'labelkeep',
|
||||||
|
label: 'Labelkeep'
|
||||||
|
}],
|
||||||
metricsShow: true,
|
metricsShow: true,
|
||||||
logsShow: true
|
logsShow: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
port: port,
|
port: port,
|
||||||
|
arrLength: arrLength,
|
||||||
selectWalk (walk) {
|
selectWalk (walk) {
|
||||||
if (this.editModule.configs[0].config.walk.indexOf(walk) != -1) {
|
if (this.editModule.configs[0].config.walk.indexOf(walk) != -1) {
|
||||||
this.editModule.configs[0].config.walk.splice(this.editModule.configs[0].config.walk.indexOf(walk), 1)
|
this.editModule.configs[0].config.walk.splice(this.editModule.configs[0].config.walk.indexOf(walk), 1)
|
||||||
@@ -787,6 +863,10 @@ export default {
|
|||||||
delete item.unit
|
delete item.unit
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
params.configs[0].config.relabel_config.relabel_config && params.configs[0].config.relabel_config.forEach(item => {
|
||||||
|
delete item.tags
|
||||||
|
delete item.showAllRelabelOption
|
||||||
|
})
|
||||||
params.configs = JSON.stringify(params.configs)
|
params.configs = JSON.stringify(params.configs)
|
||||||
this.$refs.moduleForm.validate((valid, errorKey) => {
|
this.$refs.moduleForm.validate((valid, errorKey) => {
|
||||||
let key = Object.keys(errorKey)
|
let key = Object.keys(errorKey)
|
||||||
@@ -796,8 +876,10 @@ export default {
|
|||||||
const keyArr = key.split('.')
|
const keyArr = key.split('.')
|
||||||
if (keyArr[3] === 'basic_auth' || keyArr[3] === 'bearer_token') {
|
if (keyArr[3] === 'basic_auth' || keyArr[3] === 'bearer_token') {
|
||||||
this.activeName = 'Auth'
|
this.activeName = 'Auth'
|
||||||
} else if (keyArr[3] === 'basic' || keyArr[3] === 'port') {
|
} else if (keyArr[3] === 'basic' || keyArr[3] === 'port' || keyArr[3] === 'host') {
|
||||||
this.activeName = 'Basic'
|
this.activeName = 'Basic'
|
||||||
|
} else {
|
||||||
|
this.activeName = 'Relabel'
|
||||||
}
|
}
|
||||||
} else if (key.indexOf('configs.1') !== -1) {
|
} else if (key.indexOf('configs.1') !== -1) {
|
||||||
const keyArr = key.split('.')
|
const keyArr = key.split('.')
|
||||||
@@ -917,9 +999,40 @@ export default {
|
|||||||
}
|
}
|
||||||
this.editModule.configs[1].config[logsIndex].labelModule.splice(i, 1)
|
this.editModule.configs[1].config[logsIndex].labelModule.splice(i, 1)
|
||||||
},
|
},
|
||||||
|
actionChange () {
|
||||||
|
this.$refs.moduleForm.clearValidate('configs.0.config.relabel_config.' + index + '.target_label')
|
||||||
|
},
|
||||||
|
addRelabel () {
|
||||||
|
this.editModule.configs[0].config.relabel_config.push({
|
||||||
|
source_labels: [],
|
||||||
|
target_label: '',
|
||||||
|
action: 'replace',
|
||||||
|
regex: '(.*)',
|
||||||
|
replacement: '$1',
|
||||||
|
showAllRelabelOption: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removeRelabel (index) {
|
||||||
|
// if (this.editModule.configs[0].config.relabel_config.length === 1) {
|
||||||
|
// this.editModule.configs[0].config.relabel_config = [{
|
||||||
|
// source_labels: [],
|
||||||
|
// target_label: '',
|
||||||
|
// action: '',
|
||||||
|
// regex: '',
|
||||||
|
// replacement: '',
|
||||||
|
// showAllRelabelOption: false
|
||||||
|
// }]
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
this.editModule.configs[0].config.relabel_config.splice(index, 1)
|
||||||
|
},
|
||||||
tagsChange (newTags, index) {
|
tagsChange (newTags, index) {
|
||||||
this.editModule.paramObj[index].value = newTags.map(item => item.text)
|
this.editModule.paramObj[index].value = newTags.map(item => item.text)
|
||||||
},
|
},
|
||||||
|
tagsChangeRelabel (newTags, index) {
|
||||||
|
this.editModule.configs[0].config.relabel_config[index].source_labels = newTags.map(item => item.text)
|
||||||
|
this.$refs.moduleForm.clearValidate('configs.0.config.relabel_config.' + index + '.source_labels')
|
||||||
|
},
|
||||||
// 将param转为json字符串格式
|
// 将param转为json字符串格式
|
||||||
paramToJson (param) {
|
paramToJson (param) {
|
||||||
const tempParam = {}
|
const tempParam = {}
|
||||||
@@ -1193,6 +1306,10 @@ export default {
|
|||||||
if (params[0].config.labels && !Object.keys(params[0].config.labels).length) {
|
if (params[0].config.labels && !Object.keys(params[0].config.labels).length) {
|
||||||
delete params[0].config.labels
|
delete params[0].config.labels
|
||||||
}
|
}
|
||||||
|
params[0].config.relabel_config && params[0].config.relabel_config.forEach(item => {
|
||||||
|
delete item.tags
|
||||||
|
delete item.showAllRelabelOption
|
||||||
|
})
|
||||||
params[1].config.forEach(item => {
|
params[1].config.forEach(item => {
|
||||||
if (item.labelModule) {
|
if (item.labelModule) {
|
||||||
item.labels = this.labelsToJson(item.labelModule)
|
item.labels = this.labelsToJson(item.labelModule)
|
||||||
@@ -1409,6 +1526,12 @@ export default {
|
|||||||
color: #FA901C;
|
color: #FA901C;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
#module-box-relabel /deep/ .vue-tags-input{
|
||||||
|
max-width: unset;
|
||||||
|
}
|
||||||
|
/deep/ .is-error .vue-tags-input{
|
||||||
|
border: 1px solid #F56C6C;
|
||||||
|
}
|
||||||
.pipeline-box{
|
.pipeline-box{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ export default {
|
|||||||
username: '',
|
username: '',
|
||||||
pin: ''
|
pin: ''
|
||||||
},
|
},
|
||||||
|
relabel_config: [],
|
||||||
bearer_token: ''
|
bearer_token: ''
|
||||||
},
|
},
|
||||||
enable: 1
|
enable: 1
|
||||||
@@ -324,6 +325,13 @@ export default {
|
|||||||
})
|
})
|
||||||
this.object.paramObj = []
|
this.object.paramObj = []
|
||||||
this.object.labelModule = []
|
this.object.labelModule = []
|
||||||
|
if (!this.object.configs[0].config.relabel_config) {
|
||||||
|
this.object.configs[0].config.relabel_config = []
|
||||||
|
}
|
||||||
|
this.object.configs[0].config.relabel_config && this.object.configs[0].config.relabel_config.forEach(item => {
|
||||||
|
item.showAllRelabelOption = false
|
||||||
|
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) {
|
||||||
|
|||||||
@@ -114,6 +114,16 @@ export default {
|
|||||||
scrape_timeout: '',
|
scrape_timeout: '',
|
||||||
params: '',
|
params: '',
|
||||||
labels: '',
|
labels: '',
|
||||||
|
relabel_config: [
|
||||||
|
// {
|
||||||
|
// source_labels: [],
|
||||||
|
// target_label: '',
|
||||||
|
// action: 'replace',
|
||||||
|
// regex: '',
|
||||||
|
// replacement: '',
|
||||||
|
// showAllRelabelOption: false
|
||||||
|
// }
|
||||||
|
],
|
||||||
basic_auth: {
|
basic_auth: {
|
||||||
username: '',
|
username: '',
|
||||||
pin: ''
|
pin: ''
|
||||||
@@ -199,6 +209,13 @@ export default {
|
|||||||
// this.object.port = this.object.configs.port ? JSON.parse(JSON.stringify(this.object.configs.port)) : ''
|
// this.object.port = this.object.configs.port ? JSON.parse(JSON.stringify(this.object.configs.port)) : ''
|
||||||
this.object.paramObj = []
|
this.object.paramObj = []
|
||||||
this.object.labelModule = []
|
this.object.labelModule = []
|
||||||
|
if (!this.object.configs[0].config.relabel_config) {
|
||||||
|
this.object.configs[0].config.relabel_config = []
|
||||||
|
}
|
||||||
|
this.object.configs[0].config.relabel_config && this.object.configs[0].config.relabel_config.forEach(item => {
|
||||||
|
item.showAllRelabelOption = false
|
||||||
|
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user