+
@@ -127,12 +127,6 @@ export default {
this.isInit && setChart(this.chartId, myChart) // 缓存;不使用vue的data是为避免整个chart被监听导致卡顿
if (this.isInit && (this.dataLink.length || this.chartInfo.datasource === 'metrics' || this.chartInfo.datasource === 'logs')) {
myChart.on('click', this.chartClick)
- myChart.on('mousedown', (params) => {
- if (this.tooltip.dataLinkShow && params.dataIndex) {
- const e = params.event.event
- e.stopPropagation()
- }
- })
}
this.isInit = false
}, 200)
@@ -201,57 +195,46 @@ export default {
`
},
- datalinkPosition (e) {
+ toolboxPosition (e) {
const windowWidth = window.innerWidth// 窗口宽度
const windowHeight = window.innerHeight// 窗口高度
this.$nextTick(() => {
- const box = document.getElementById(`chart-canvas-tooltip-${this.chartId}`)
+ const box = document.getElementById(`chart-toolbox-${this.chartId}`)
const left = e.pageX - this.$refs['treemap-chart-box'].getBoundingClientRect().left
const top = e.pageY - this.$refs['treemap-chart-box'].getBoundingClientRect().top
if (box) {
const boxWidth = box.offsetWidth
const boxHeight = box.offsetHeight
if (e.pageX < (windowWidth / 2)) { // 说明鼠标在左边放不下提示框
- this.tooltip.x = left + 15
+ this.toolbox.x = left + 15
} else {
- this.tooltip.x = left - boxWidth - 15
+ this.toolbox.x = left - boxWidth - 15
}
if (e.pageY + 50 + boxHeight < windowHeight) { // 说明鼠标上面放不下提示框
- this.tooltip.y = top + 15
+ this.toolbox.y = top + 15
} else {
- this.tooltip.y = top - boxHeight - 10
+ this.toolbox.y = top - boxHeight - 10
}
}
})
},
chartClick (params) {
if (!params.dataIndex) { return } // 点击父节点(空白间隙)
- const option = {
- tooltip: {
- extraCssText: 'z-index:99999999;visibility:hidden;transition:none;'
- }
- }
- getChart(this.chartId).setOption(option)
- this.tooltip.title = params.data.alias
- this.tooltip.value = params.data.mapping && params.data.mapping.display ? this.handleDisplay(params.data.mapping.display, { ...params.data.labels, value: params.data.showValue }) : params.data.showValue
- this.tooltip.mapping = params.data.mapping
- this.tooltip.show = true
- this.tooltip.dataLinkShow = true
- this.tooltip.metric.labels = params.data.labels
- this.tooltip.metric.expressionIndex = params.data.expressionIndex
+ getChart(this.chartId).dispatchAction({
+ type: 'hideTip'
+ })
+ this.toolbox.title = params.data.alias
+ this.toolbox.value = params.data.mapping && params.data.mapping.display ? this.handleDisplay(params.data.mapping.display, { ...params.data.labels, value: params.data.showValue }) : params.data.showValue
+ this.toolbox.mapping = params.data.mapping
+ this.toolbox.show = true
+ this.toolbox.metric.labels = params.data.labels
+ this.toolbox.metric.expressionIndex = params.data.expressionIndex
const e = params.event.event
- this.datalinkPosition(e)
+ this.toolboxPosition(e)
},
clickout () {
- if ((this.dataLink.length || this.chartInfo.datasource === 'metrics' || this.chartInfo.datasource === 'logs') && this.tooltip.dataLinkShow) {
- this.tooltip.show = false
- this.tooltip.dataLinkShow = false
- const option = {
- tooltip: {
- extraCssText: 'z-index:99999999;visibility:visible;'
- }
- }
- getChart(this.chartId).setOption(option)
+ if ((this.dataLink.length || this.chartInfo.datasource === 'metrics' || this.chartInfo.datasource === 'logs') && this.toolbox.show) {
+ this.toolbox.show = false
}
}
},
diff --git a/nezha-fronted/src/components/chart/chart/options/chartBar.js b/nezha-fronted/src/components/chart/chart/options/chartBar.js
index 3898e0fcd..64a9553a2 100644
--- a/nezha-fronted/src/components/chart/chart/options/chartBar.js
+++ b/nezha-fronted/src/components/chart/chart/options/chartBar.js
@@ -7,7 +7,8 @@ const chartBarOption = {
z: 9,
animation: false,
appendToBody: true,
- className: 'chart-bar'
+ className: 'chart-bar',
+ hideDelay: 0
},
legend: {
show: false
diff --git a/nezha-fronted/src/components/chart/chart/options/chartGauge.js b/nezha-fronted/src/components/chart/chart/options/chartGauge.js
index 9089b7c2f..a6ee55528 100644
--- a/nezha-fronted/src/components/chart/chart/options/chartGauge.js
+++ b/nezha-fronted/src/components/chart/chart/options/chartGauge.js
@@ -7,7 +7,8 @@ const chartGaugeOption = {
z: 9,
animation: false,
appendToBody: true,
- className: 'chart-gauge'
+ className: 'chart-gauge',
+ hideDelay: 0
},
legend: {
show: false
diff --git a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js
index 6435982da..25c7940aa 100644
--- a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js
+++ b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js
@@ -46,7 +46,8 @@ export const chartTimeSeriesLineOption = {
label: {
show: false
}
- }
+ },
+ hideDelay: 0
},
dataZoom: [
{
diff --git a/nezha-fronted/src/components/chart/chart/options/chartTreemap.js b/nezha-fronted/src/components/chart/chart/options/chartTreemap.js
index 10842331a..fa3d72742 100644
--- a/nezha-fronted/src/components/chart/chart/options/chartTreemap.js
+++ b/nezha-fronted/src/components/chart/chart/options/chartTreemap.js
@@ -21,7 +21,8 @@ const chartTreemapOption = {
formatUtil.encodeHTML(treePath.join('/')) +
'
'
].join('')
- }
+ },
+ hideDelay: 0
},
series: [
{
diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js
index 34d0d55c9..7386b6a5a 100644
--- a/nezha-fronted/src/components/chart/chartMixin.js
+++ b/nezha-fronted/src/components/chart/chartMixin.js
@@ -26,13 +26,20 @@ export default {
series: [],
dataLink: [],
tooltip: {
+ x: 0,
+ y: 0,
+ title: 0,
+ value: 0,
+ mapping: {},
+ show: false
+ },
+ toolbox: {
x: 0,
y: 0,
title: 0,
value: 0,
mapping: {},
show: false,
- dataLinkShow: '',
metric: {}
}
}
@@ -219,7 +226,6 @@ export default {
if (chartInfo.elements) {
if (chartInfo.elements[expressionIndex]) {
alias = alias + this.handleLegendAlias(legend, chartInfo.elements[expressionIndex].legend, tagKeysArr)
- console.log(alias, this.handleLegendAlias(legend, chartInfo.elements[expressionIndex].legend, tagKeysArr), legend, chartInfo.elements[expressionIndex].legend, tagKeysArr)
}
if (!alias) {
alias = chartInfo.elements[expressionIndex].expression || ''
@@ -466,10 +472,10 @@ export default {
linkClick (data) {
const url = data.url.replace(/(\{\{.+?\}\})/g, (match) => {
const label = match.substr(match.indexOf('{{') + 2, match.indexOf('}}') - match.indexOf('{{') - 2)
- if (this.tooltip.metric.labels[label]) {
- return this.tooltip.metric.labels[label]
+ if (this.toolbox.metric.labels[label]) {
+ return this.toolbox.metric.labels[label]
} else {
- return this.chartInfo.elements[this.tooltip.metric.expressionIndex].expression || ''
+ return this.chartInfo.elements[this.toolbox.metric.expressionIndex].expression || ''
}
})
if (data.openIn === 'newTab') {
@@ -480,7 +486,7 @@ export default {
this.clickout()
},
copyExpr () {
- const expr = this.chartInfo.elements[this.tooltip.metric.expressionIndex].expression || ''
+ const expr = this.chartInfo.elements[this.toolbox.metric.expressionIndex].expression || ''
this.$copyText(expr).then(() => {
this.$message.success({ message: this.$t('overall.copySuccess') })
this.clickout()
diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue
index e6c701e71..34c48a6d9 100644
--- a/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue
+++ b/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue
@@ -176,6 +176,10 @@ export default {
let charts = this.$lodash.cloneDeep(this.$refs.notebookList.copyDataList)
charts = charts.filter(item => item.name !== 'groupTemp')
charts.forEach(item => {
+ delete item.x
+ delete item.y
+ delete item.modifiedName
+ delete item.oldElements
if (item.type === 'text') {
delete item.param.isEdit
delete item.param.oldText
diff --git a/nezha-fronted/src/components/page/config/about.vue b/nezha-fronted/src/components/page/config/about.vue
index ba3afc542..d2b301400 100644
--- a/nezha-fronted/src/components/page/config/about.vue
+++ b/nezha-fronted/src/components/page/config/about.vue
@@ -54,6 +54,27 @@ export default {
},
activities: [
{
+ timestamp: 'Release 23.10 - Oct 2023',
+ content: [{
+ chinese: '[FEATURE] 笔记本功能允许您将多种图表组合起来,以构建可共享的、数据丰富的文档。使用笔记本,您可以对事件进行故障排除,创建事后分析,并构建运行手册',
+ english: '[FEATURE] The notebook feature allows you to combine multiple charts to build shareable, data-rich documents. Using notebooks, you can troubleshoot incidents, create postmortems, and build runbooks'
+ }, {
+ chinese: '[FEATURE] 系统备份功能允许您将系统的配置保存到磁盘,以便在需要的时候恢复数据',
+ english: '[FEATURE] The backup feature allows you to save the system configuration to disk so you can recover the configuration when needed'
+ }, {
+ chinese: '[FEATURE] 通过软件资产管理功能可以集中管理软件资产,统计软件的使用情况',
+ english: '[FEATURE] The software asset management feature can centrally manage software assets and count software usage'
+ }, {
+ chinese: '[ENHANCEMENT] 告警消息详情页面增加显示相关资产仪表板并支持快照导出',
+ english: '[ENHANCEMENT] The alarm message details page now displays the related asset dashboard and supports snapshot export'
+ }, {
+ chinese: '[ENHANCEMENT] 时序图表优化用户体验',
+ english: '[ENHANCEMENT] Time series charts optimize user experience'
+ }, {
+ chinese: '[ENHANCEMENT] 探索日志数据支持查看上下文',
+ english: '[ENHANCEMENT] Exploring log data supports viewing context'
+ }]
+ }, {
timestamp: 'Release 23.07 - Jul 2023',
content: [{
chinese: '[FEATURE] 新增资产发现功能',
diff --git a/nezha-fronted/src/components/page/dashboard/overview/chart.vue b/nezha-fronted/src/components/page/dashboard/overview/chart.vue
index 4913de8c8..ce840a534 100644
--- a/nezha-fronted/src/components/page/dashboard/overview/chart.vue
+++ b/nezha-fronted/src/components/page/dashboard/overview/chart.vue
@@ -23,9 +23,9 @@