Merge branch 'dev-2.1' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.1
# Conflicts: # nezha-fronted/src/components/common/ChartDiagram/diagram.vue # nezha-fronted/src/components/common/project/L5/CanvasProps.vue # nezha-fronted/src/components/layout/header.vue
This commit is contained in:
@@ -840,10 +840,10 @@ export default {
|
|||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
top: 30,
|
top: 30,
|
||||||
left: 0,
|
left: 30,
|
||||||
right: 30,
|
right: 30,
|
||||||
containLabel: true,
|
containLabel: true,
|
||||||
bottom: 20// 156
|
bottom: 30// 156
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'time',
|
type: 'time',
|
||||||
|
|||||||
@@ -1588,11 +1588,7 @@ export default {
|
|||||||
text: res.data.imageName,
|
text: res.data.imageName,
|
||||||
image: data.data,
|
image: data.data,
|
||||||
imageId: res.data.id,
|
imageId: res.data.id,
|
||||||
unit: this.uploadPic.unit,
|
unit: this.uploadPic.unit
|
||||||
rect: {
|
|
||||||
width: data.width,
|
|
||||||
height: data.height
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -1605,11 +1601,7 @@ export default {
|
|||||||
text: res.data.imageName,
|
text: res.data.imageName,
|
||||||
image: data.data,
|
image: data.data,
|
||||||
imageId: res.data.id,
|
imageId: res.data.id,
|
||||||
unit: this.uploadPic.unit,
|
unit: this.uploadPic.unit
|
||||||
rect: {
|
|
||||||
width: data.width,
|
|
||||||
height: data.height
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1507,6 +1507,43 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
tabClick (n) {
|
||||||
},
|
},
|
||||||
moduleIdChange (n) {
|
moduleIdChange (n) {
|
||||||
@@ -1742,6 +1779,12 @@ export default {
|
|||||||
const delObj = this.selection.pen ? this.selection.pen.id : this.selection.pens
|
const delObj = this.selection.pen ? this.selection.pen.id : this.selection.pens
|
||||||
this.$emit('del', delObj)
|
this.$emit('del', delObj)
|
||||||
},
|
},
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
getMetricOptions () {
|
||||||
|
return this.metricOptions
|
||||||
|
},
|
||||||
|
>>>>>>> 4b4994f59cfffd4aad8579464b56be2c5e523769
|
||||||
addExpression () {
|
addExpression () {
|
||||||
this.selection.pen.data.expressAllArr.push('')
|
this.selection.pen.data.expressAllArr.push('')
|
||||||
this.selection.pen.data.legendsAll.push('')
|
this.selection.pen.data.legendsAll.push('')
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ export default {
|
|||||||
if (this.editDc.id) {
|
if (this.editDc.id) {
|
||||||
const param = { ...this.editDc }
|
const param = { ...this.editDc }
|
||||||
const attr = this.$refs.latlngPicker.getAttribute()
|
const attr = this.$refs.latlngPicker.getAttribute()
|
||||||
|
console.log(attr)
|
||||||
param.latitude = attr.latitude
|
param.latitude = attr.latitude
|
||||||
param.longitude = attr.longitude
|
param.longitude = attr.longitude
|
||||||
this.$put('/dc', param).then(response => {
|
this.$put('/dc', param).then(response => {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="header-menu">
|
<div class="header-menu">
|
||||||
<el-dropdown>
|
<el-dropdown>
|
||||||
<div class="header-menu__item"><i class="nz-icon nz-icon-more-app"></i></div>
|
<div class="header-menu__item"><i class="nz-icon nz-icon-more-app"></i></div>
|
||||||
<el-dropdown-menu slot="dropdown" class="right-public-box-select-top right-public-box-dropdown-top">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-for="(item, index) in linkData" :key="index" :index="'0-' + index" v-if="linkData.length">
|
<el-dropdown-item v-for="(item, index) in linkData" :key="index" :index="'0-' + index" v-if="linkData.length">
|
||||||
<span class="link-title">
|
<span class="link-title">
|
||||||
<i class="nz-icon nz-icon-link"></i>
|
<i class="nz-icon nz-icon-link"></i>
|
||||||
|
|||||||
@@ -451,10 +451,10 @@ const overviewLine = {
|
|||||||
const noDataOption = {
|
const noDataOption = {
|
||||||
grid: {
|
grid: {
|
||||||
top: 30,
|
top: 30,
|
||||||
left: 0,
|
left: 20,
|
||||||
right: 30,
|
right: 30,
|
||||||
containLabel: true,
|
containLabel: true,
|
||||||
bottom: 20// 156
|
bottom: 0// 156
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
|
|||||||
Reference in New Issue
Block a user