fix:修复 projectTopo metrics 删除会删除节点的问题
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="tag-search__add cursor-pointer" @click="addCondition()">{{$t('project.topology.add')}}</div>
|
||||
<div class="tag-search__add cursor-pointer" @click="addCondition()">{{$t('buttons.add')}}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
},
|
||||
{
|
||||
route: '/agent',
|
||||
title: this.$t('config.agent.agent.agent'),
|
||||
title: this.$t('guide.agent'),
|
||||
icon: 'nz-icon nz-icon-agent',
|
||||
tip: this.$t('guide.agentTip'),
|
||||
permissionCode: 'agent_view'
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
:ref="'promql-'+'-1'"
|
||||
:expression-list="selection.pen.data.expressArr"
|
||||
:index="index"
|
||||
type="metric"
|
||||
:plugins="['metric-selector', 'metric-input', 'remove']"
|
||||
:showRemove="false"
|
||||
:styleType="2"
|
||||
@@ -1500,43 +1501,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryMetrics () {
|
||||
this.metricOptions = []
|
||||
this.$get('prom/api/v1/label/__name__/values').then(response => {
|
||||
if (response.status == 'success') {
|
||||
const metrics = response.data.sort()
|
||||
const metricMap = new Map()
|
||||
metrics.forEach((item) => {
|
||||
let key = ''
|
||||
if (/^[a-zA-Z]+?_[a-zA-Z]*/.test(item)) {
|
||||
key = item.split('_')[0]
|
||||
} else if (/^_\w*/.test(item)) {
|
||||
key = ' '
|
||||
} else {
|
||||
key = item
|
||||
}
|
||||
if (metricMap.get(key)) {
|
||||
const values = metricMap.get(key)
|
||||
values.push({ label: item, value: item })
|
||||
} else {
|
||||
const values = [{ label: item, value: item }]
|
||||
metricMap.set(key, values)
|
||||
}
|
||||
// this.metricStore.push({label:item,value:item,insertText:item})
|
||||
})
|
||||
for (const key of metricMap.keys()) {
|
||||
const option = {
|
||||
label: key,
|
||||
value: key
|
||||
}
|
||||
if (metricMap.get(key) && metricMap.get(key).length > 1) {
|
||||
option.children = metricMap.get(key)
|
||||
}
|
||||
this.metricOptions.push(option)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tabClick (n) {
|
||||
},
|
||||
moduleIdChange (n) {
|
||||
|
||||
@@ -373,7 +373,10 @@ const canvasOptions = {
|
||||
disableEmptyLine: true,
|
||||
autoExpandDistance: 0,
|
||||
minScale: 0.2,
|
||||
scaleKey: -1
|
||||
scaleKey: -1,
|
||||
keyCode: {
|
||||
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'topologyL5',
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<el-input :disabled="true" v-model="dc.name" id="traffic-setting-name"></el-input>
|
||||
</el-form-item>
|
||||
<traffic-setting-tab ref="trafficSetting" :post-asset-list="assetList" v-for="(item,index) in traffic.setting" :index="index" :asset-setting="item" :key="uuids[index]" :id="uuids[index]" @delSelf="delAssetSetting" :validate-repeat-func="valiateRepeatFunc"></traffic-setting-tab>
|
||||
<button @click="addAssetSetting" class="nz-btn nz-btn-size-normal nz-btn-style-light" id="traffic-setting-add" style="margin:15px 1px 15px 15px" type="button">{{$t('project.topology.add')}}</button>
|
||||
<button @click="addAssetSetting" class="nz-btn nz-btn-size-normal nz-btn-style-light" id="traffic-setting-add" style="margin:15px 1px 15px 15px" type="button">{{$t('buttons.add')}}</button>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ const searchSelectInfo = { // value: 传给后台的值;label:显示给用
|
||||
operation: [
|
||||
{
|
||||
value: 'add',
|
||||
label: i18n.t('config.operationlog.operations.add')
|
||||
label: i18n.t('buttons.add')
|
||||
},
|
||||
{
|
||||
value: 'update',
|
||||
|
||||
Reference in New Issue
Block a user