mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-05 21:20:06 +00:00
server-status和default主题:feat & improve & fix (#420)
* feat & improve & fix 1. 增加WebAppManifest文件,实现把哪吒监控网页伪装成app放在移动端桌面 2. vps地图分布图增加数据异步加载loading效果 3. 修复echart图表纵坐标轴因数值过大显示不全bug * 刷新CDN缓存 * fix footer * 4.提升service页echarts图表相关体验 5.用设置基准1vh的方法解决footer页脚位置在移动端各种浏览器显示不一致的问题 6.修复section标签的使用位置 * 刷新CDN缓存
This commit is contained in:
31
resource/template/theme-server-status/home.html
vendored
31
resource/template/theme-server-status/home.html
vendored
@@ -3,15 +3,15 @@
|
||||
{{template "theme-server-status/menu" .}}
|
||||
<!-- showGroup true -->
|
||||
<template v-if="showGroup">
|
||||
<section class="container-fluid table-responsive content" v-for="group in nodesTag">
|
||||
<div class="container-fluid table-responsive content" v-for="group in nodesTag">
|
||||
{{template "theme-server-status/home-group-true" .}}
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
<!-- showGroup false -->
|
||||
<template v-else>
|
||||
<section class="container-fluid table-responsive content">
|
||||
<div class="container-fluid table-responsive content">
|
||||
{{template "theme-server-status/home-group-false" .}}
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
<div class="modal fade" id="mapChartBox" tabindex="-1" role="dialog" aria-labelledby="mapChartTitle" aria-hidden="true" style="padding-left:0">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered">
|
||||
@@ -162,7 +162,10 @@
|
||||
const tooltipBackgroundColor = this.theme == "dark" ? "#ffffff" : '#ffffff';
|
||||
const tooltipBorderColor = this.theme == "dark" ? "#ffffff" : "#ffffff";
|
||||
const fontSize = this.isMobile ? 10 : 12;
|
||||
const fontColor = this.theme == "dark" ? "#000000" : "#000000";
|
||||
const fontColor = this.theme == "dark" ? "#000000" : "#000000";
|
||||
const showLoadingMaskColor = this.theme == "dark" ? 'rgba(28, 29, 38, 1)' : 'rgba(249, 249, 249, 1)';
|
||||
const showLoadingTextColor = this.theme == "dark" ? 'rgba(241, 241, 241, 1)' : 'rgba(0, 0, 0, 1)';
|
||||
const showLoadingColor = inRangeColor;
|
||||
const chartContainer = document.getElementById('mapChart');
|
||||
const mapChart = echarts.init(chartContainer, '', { // init图表
|
||||
renderer: 'canvas',
|
||||
@@ -170,6 +173,13 @@
|
||||
width: width,
|
||||
height: height,
|
||||
});
|
||||
mapChart.showLoading({
|
||||
text: 'loading',
|
||||
textColor: showLoadingTextColor,
|
||||
color: showLoadingColor,
|
||||
maskColor: showLoadingMaskColor,
|
||||
zlevel: 2
|
||||
});
|
||||
fetch(this.staticUrl + '/maps/' + this.countryMapGeoFile)
|
||||
.then(response => response.json())
|
||||
.then(worldMap => {
|
||||
@@ -224,7 +234,10 @@
|
||||
}
|
||||
]
|
||||
};
|
||||
mapChart.setOption(option);
|
||||
setTimeout(() => {
|
||||
mapChart.hideLoading();
|
||||
mapChart.setOption(option);
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
isWindowsPlatform(str) {
|
||||
@@ -510,15 +523,15 @@
|
||||
// 定义图表参数值
|
||||
const MaxTCPPingValue = {{.Conf.MaxTCPPingValue}} ? {{.Conf.MaxTCPPingValue}} : 300;
|
||||
const fontSize = this.isMobile ? 10 : 14;
|
||||
const gridLeft = this.isMobile ? 25 : 36;
|
||||
const gridLeft = (MaxTCPPingValue > 500) ? (this.isMobile ? 30 : 40) : (this.isMobile ? 25 : 36);
|
||||
const gridRight = this.isMobile ? 5 : 20;
|
||||
const legendLeft = this.isMobile ? 'center' : 'center';
|
||||
const legendTop = this.isMobile ? 5 : 5;
|
||||
const legendPadding= this.isMobile ? [5,0,5,0] : [5,0,5,0];
|
||||
const systemDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
const theme = localStorage.getItem("theme") ? localStorage.getItem("theme") : systemDarkMode;
|
||||
const chartTheme = theme == "dark" ? "dark" : "default";
|
||||
const fontColor = theme == "dark" ? "#f1f1f1" : "#000000";
|
||||
const chartTheme = this.theme == "dark" ? "dark" : "default";
|
||||
const fontColor = this.theme == "dark" ? "#f1f1f1" : "#000000";
|
||||
const backgroundColor = theme == "dark" ? '' : '';
|
||||
const tooltipBackgroundColor = this.theme == "dark" ? (this.semiTransparent ? "rgba(28,29,38,0.85)" : "rgba(28,29,38,1)") : (this.semiTransparent ? "rgba(255,255,255,0.85)" : "rgba(255,255,255,1)");
|
||||
const tooltipBorderColor = this.theme == "dark" ? (this.semiTransparent ? "rgba(28,29,38,0.9)" : "rgba(28,29,38,1)") : (this.semiTransparent ? "rgba(255,255,255,0.9)" : "rgba(255,255,255,1)");
|
||||
|
||||
Reference in New Issue
Block a user