Default主题fixbug (#421)

* default主题fixbug
1.补上误删的网页title
2.修复network页纵坐标数值显示不全
3.修复network,多个legend导致的遮挡主图表问题

* fix

* fix

* fix

* fix

* fix

* fix
This commit is contained in:
nap0o
2024-09-07 02:44:30 -04:00
committed by GitHub
parent 7f9f9a9129
commit f78ba281fb
5 changed files with 26 additions and 16 deletions

View File

@@ -36,7 +36,11 @@
defaultTemplate: {{.Conf.Site.Theme}},
templates: {{.Themes}},
servers: initData,
option: {
option: {}
},
mixins: [mixinsVue],
created() {
this.option = {
tooltip: {
trigger: 'axis',
position: function (pt) {
@@ -69,15 +73,6 @@
right: this.isMobile ? '8%' : '3.8%',
},
backgroundColor: '',
toolbox: {
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
dataZoom: [
{
type: 'slider',
@@ -94,10 +89,8 @@
boundaryGap: false
},
series: [],
},
chartOnOff: true,
}
},
mixins: [mixinsVue],
mounted() {
this.renderChart();
this.parseMonitorInfo(monitorInfo);
@@ -237,6 +230,20 @@
this.option.title.text = monitorInfo.result[0].server_name;
this.option.series = tSeries;
this.option.legend.data = tLegendData;
const maxLegendsPerRowMobile = localStorage.getItem("maxLegendsPerRowMobile") ? localStorage.getItem("maxLegendsPerRowMobile") : 2;
const maxLegendsPerRowPc = localStorage.getItem("maxLegendsPerRowPc") ? localStorage.getItem("maxLegendsPerRowPc") : 6;
const autoIncrement = Math.floor((tLegendData.length - 1) / (this.isMobile ? maxLegendsPerRowMobile : maxLegendsPerRowPc)) * (this.isMobile ? 28 : 34);
const height = 520 + autoIncrement;
const gridTop = 60 + autoIncrement;
this.option.grid = {
left: this.isMobile ? '8%' : '3.8%',
right: this.isMobile ? '8%' : '3.8%',
top: gridTop
};
this.myChart.resize({
width: 'auto',
height: height
});
this.myChart.clear();
this.myChart.setOption(this.option);
},