Merge branch 'dev-3.10' of git.mesalab.cn:nezha/nezha-fronted into dev-3.11
This commit is contained in:
@@ -174,9 +174,11 @@ export default {
|
|||||||
let charts = this.$lodash.cloneDeep(this.$refs.notebookList.copyDataList)
|
let charts = this.$lodash.cloneDeep(this.$refs.notebookList.copyDataList)
|
||||||
charts = charts.filter(item => item.name !== 'groupTemp')
|
charts = charts.filter(item => item.name !== 'groupTemp')
|
||||||
charts.forEach(item => {
|
charts.forEach(item => {
|
||||||
|
if (item.datasource == 'metrics' || item.datasource == 'log') {
|
||||||
item.elements.forEach((subItem, subIndex) => {
|
item.elements.forEach((subItem, subIndex) => {
|
||||||
subItem.expression = item.oldElements[subIndex].expression
|
subItem.expression = item.oldElements[subIndex].expression
|
||||||
})
|
})
|
||||||
|
}
|
||||||
delete item.x
|
delete item.x
|
||||||
delete item.y
|
delete item.y
|
||||||
delete item.modifiedName
|
delete item.modifiedName
|
||||||
@@ -251,14 +253,10 @@ export default {
|
|||||||
this.chart.position = { position: 'after', id: data.id }
|
this.chart.position = { position: 'after', id: data.id }
|
||||||
this.chart.panelName = this.showPanel.name
|
this.chart.panelName = this.showPanel.name
|
||||||
this.chart.id = ''
|
this.chart.id = ''
|
||||||
|
if (this.chart.datasource == 'metrics' || this.chart.datasource == 'log') {
|
||||||
this.chart.elements.forEach((item, index) => {
|
this.chart.elements.forEach((item, index) => {
|
||||||
item.expression = this.chart.oldElements[index].expression
|
item.expression = this.chart.oldElements[index].expression
|
||||||
item.id = ''
|
|
||||||
item.chartId = ''
|
|
||||||
delete item.seq
|
|
||||||
})
|
})
|
||||||
if (this.chart.datasource !== 'metrics' && this.chart.datasource !== 'log') {
|
|
||||||
delete this.chart.elements
|
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addChartModal.isStable = 'stable'
|
this.$refs.addChartModal.isStable = 'stable'
|
||||||
@@ -266,9 +264,11 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.chart = JSON.parse(JSON.stringify(data))
|
this.chart = JSON.parse(JSON.stringify(data))
|
||||||
this.chart.panelName = this.showPanel.name
|
this.chart.panelName = this.showPanel.name
|
||||||
|
if (this.chart.datasource == 'metrics' || this.chart.datasource == 'log') {
|
||||||
this.chart.elements.forEach((item, index) => {
|
this.chart.elements.forEach((item, index) => {
|
||||||
item.expression = this.chart.oldElements[index].expression
|
item.expression = this.chart.oldElements[index].expression
|
||||||
})
|
})
|
||||||
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addChartModal.isStable = 'stable'
|
this.$refs.addChartModal.isStable = 'stable'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user