mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
Default主题fixbug (#421)
* default主题fixbug 1.补上误删的网页title 2.修复network页纵坐标数值显示不全 3.修复network,多个legend导致的遮挡主图表问题 * fix * fix * fix * fix * fix * fix
This commit is contained in:
parent
7f9f9a9129
commit
f78ba281fb
@ -15,13 +15,13 @@
|
|||||||
"purpose": "maskable"
|
"purpose": "maskable"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "//static/manifest-512x512.png",
|
"src": "/static/manifest-512x512.png",
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"purpose": "any"
|
"purpose": "any"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "//static/manifest-512x512.png",
|
"src": "/static/manifest-512x512.png",
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"purpose": "maskable"
|
"purpose": "maskable"
|
||||||
|
2
resource/template/theme-default/header.html
vendored
2
resource/template/theme-default/header.html
vendored
@ -3,11 +3,13 @@
|
|||||||
<html lang="{{.Conf.Language}}">
|
<html lang="{{.Conf.Language}}">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
<title>{{ .Title }}</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<meta content="telephone=no" name="format-detection">
|
<meta content="telephone=no" name="format-detection">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="mobile-web-app-capable" content="yes" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
{{ if eq .Conf.Language "zh-CN" }}
|
{{ if eq .Conf.Language "zh-CN" }}
|
||||||
<link rel="manifest" href="/static/manifest-zh-CN.json?v20240905" />
|
<link rel="manifest" href="/static/manifest-zh-CN.json?v20240905" />
|
||||||
|
33
resource/template/theme-default/network.html
vendored
33
resource/template/theme-default/network.html
vendored
@ -36,7 +36,11 @@
|
|||||||
defaultTemplate: {{.Conf.Site.Theme}},
|
defaultTemplate: {{.Conf.Site.Theme}},
|
||||||
templates: {{.Themes}},
|
templates: {{.Themes}},
|
||||||
servers: initData,
|
servers: initData,
|
||||||
option: {
|
option: {}
|
||||||
|
},
|
||||||
|
mixins: [mixinsVue],
|
||||||
|
created() {
|
||||||
|
this.option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
position: function (pt) {
|
position: function (pt) {
|
||||||
@ -69,15 +73,6 @@
|
|||||||
right: this.isMobile ? '8%' : '3.8%',
|
right: this.isMobile ? '8%' : '3.8%',
|
||||||
},
|
},
|
||||||
backgroundColor: '',
|
backgroundColor: '',
|
||||||
toolbox: {
|
|
||||||
feature: {
|
|
||||||
dataZoom: {
|
|
||||||
yAxisIndex: 'none'
|
|
||||||
},
|
|
||||||
restore: {},
|
|
||||||
saveAsImage: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dataZoom: [
|
dataZoom: [
|
||||||
{
|
{
|
||||||
type: 'slider',
|
type: 'slider',
|
||||||
@ -94,10 +89,8 @@
|
|||||||
boundaryGap: false
|
boundaryGap: false
|
||||||
},
|
},
|
||||||
series: [],
|
series: [],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
chartOnOff: true,
|
|
||||||
},
|
|
||||||
mixins: [mixinsVue],
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.renderChart();
|
this.renderChart();
|
||||||
this.parseMonitorInfo(monitorInfo);
|
this.parseMonitorInfo(monitorInfo);
|
||||||
@ -237,6 +230,20 @@
|
|||||||
this.option.title.text = monitorInfo.result[0].server_name;
|
this.option.title.text = monitorInfo.result[0].server_name;
|
||||||
this.option.series = tSeries;
|
this.option.series = tSeries;
|
||||||
this.option.legend.data = tLegendData;
|
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.clear();
|
||||||
this.myChart.setOption(this.option);
|
this.myChart.setOption(this.option);
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<meta content="telephone=no" name="format-detection">
|
<meta content="telephone=no" name="format-detection">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="mobile-web-app-capable" content="yes" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
{{if eq .Conf.Language "zh-CN"}}
|
{{if eq .Conf.Language "zh-CN"}}
|
||||||
<link rel="manifest" href="/static/manifest-zh-CN.json?v20240905" />
|
<link rel="manifest" href="/static/manifest-zh-CN.json?v20240905" />
|
||||||
|
Loading…
Reference in New Issue
Block a user