Update network.html
This commit is contained in:
parent
0ea0c9ad8c
commit
5a2ab8a7ee
103
resource/template/theme-daynight/network.html
vendored
103
resource/template/theme-daynight/network.html
vendored
@ -113,14 +113,15 @@
|
|||||||
if (MaxTCPPingValue == null) {
|
if (MaxTCPPingValue == null) {
|
||||||
MaxTCPPingValue = 1000;
|
MaxTCPPingValue = 1000;
|
||||||
}
|
}
|
||||||
new Vue({
|
// 基于准备好的dom,初始化echarts实例
|
||||||
el: '#app',
|
var myChart = echarts.init(document.getElementById('monitor-info-container'));
|
||||||
|
// 使用刚指定的配置项和数据显示图表。
|
||||||
|
var statusCards = new Vue({
|
||||||
|
el: '#network',
|
||||||
delimiters: ['@#', '#@'],
|
delimiters: ['@#', '#@'],
|
||||||
data: {
|
data: {
|
||||||
page: 'network',
|
|
||||||
defaultTemplate: {{.Conf.Site.Theme}},
|
|
||||||
templates: {{.Themes}},
|
|
||||||
servers: initData,
|
servers: initData,
|
||||||
|
cache: [],
|
||||||
option: {
|
option: {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
@ -149,11 +150,6 @@
|
|||||||
fontSize: 14
|
fontSize: 14
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
grid: {
|
|
||||||
left: '8%',
|
|
||||||
right: '8%',
|
|
||||||
},
|
|
||||||
backgroundColor: 'rgba(255, 255, 255, 0.8)',
|
|
||||||
toolbox: {
|
toolbox: {
|
||||||
feature: {
|
feature: {
|
||||||
dataZoom: {
|
dataZoom: {
|
||||||
@ -165,7 +161,7 @@
|
|||||||
},
|
},
|
||||||
dataZoom: [
|
dataZoom: [
|
||||||
{
|
{
|
||||||
start: 0,
|
start: 94,
|
||||||
end: 100
|
end: 100
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -175,15 +171,13 @@
|
|||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
boundaryGap: false
|
boundaryGap: [0, '100%']
|
||||||
},
|
},
|
||||||
series: [],
|
series: [],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
chartOnOff: true,
|
|
||||||
},
|
|
||||||
mixins: [mixinsVue],
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.renderChart();
|
this.DarkMode();
|
||||||
this.parseMonitorInfo(monitorInfo);
|
this.parseMonitorInfo(monitorInfo);
|
||||||
window.addEventListener('resize', this.resizeHandle);
|
window.addEventListener('resize', this.resizeHandle);
|
||||||
},
|
},
|
||||||
@ -191,67 +185,18 @@
|
|||||||
window.removeEventListener('resize', this.resizeHandle)
|
window.removeEventListener('resize', this.resizeHandle)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getFontLogoClass(str) {
|
DarkMode() {
|
||||||
if (["almalinux",
|
const hour = new Date(Date.now()).getHours()
|
||||||
"alpine",
|
if (hour > 17 || hour < 4) {
|
||||||
"aosc",
|
document.querySelector("input[name=theme]").checked = true;
|
||||||
"apple",
|
document.getElementsByTagName("BODY")[0].setAttribute('data-theme', 'dark');
|
||||||
"archlinux",
|
document.getElementById("monitor-info-container").style.backgroundColor = "#1E1E1E";
|
||||||
"archlabs",
|
|
||||||
"artix",
|
|
||||||
"budgie",
|
|
||||||
"centos",
|
|
||||||
"coreos",
|
|
||||||
"debian",
|
|
||||||
"deepin",
|
|
||||||
"devuan",
|
|
||||||
"docker",
|
|
||||||
"elementary",
|
|
||||||
"fedora",
|
|
||||||
"ferris",
|
|
||||||
"flathub",
|
|
||||||
"freebsd",
|
|
||||||
"gentoo",
|
|
||||||
"gnu-guix",
|
|
||||||
"illumos",
|
|
||||||
"kali-linux",
|
|
||||||
"linuxmint",
|
|
||||||
"mageia",
|
|
||||||
"mandriva",
|
|
||||||
"manjaro",
|
|
||||||
"nixos",
|
|
||||||
"openbsd",
|
|
||||||
"opensuse",
|
|
||||||
"pop-os",
|
|
||||||
"raspberry-pi",
|
|
||||||
"redhat",
|
|
||||||
"rocky-linux",
|
|
||||||
"sabayon",
|
|
||||||
"slackware",
|
|
||||||
"snappy",
|
|
||||||
"solus",
|
|
||||||
"tux",
|
|
||||||
"ubuntu",
|
|
||||||
"void",
|
|
||||||
"zorin"].indexOf(str)
|
|
||||||
> -1) {
|
|
||||||
return str;
|
|
||||||
}
|
}
|
||||||
if (['openwrt', 'linux', "immortalwrt"].indexOf(str) > -1) {
|
|
||||||
return 'tux';
|
|
||||||
}
|
|
||||||
if (str == 'amazon') {
|
|
||||||
return 'redhat';
|
|
||||||
}
|
|
||||||
if (str == 'arch') {
|
|
||||||
return 'archlinux';
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
},
|
},
|
||||||
redirectNetwork(id) {
|
redirectNetwork(id) {
|
||||||
this.getMonitorHistory(id)
|
this.getMonitorHistory(id)
|
||||||
.then(function(monitorInfo) {
|
.then(function(monitorInfo) {
|
||||||
var vm = app.__vue__;
|
var vm = network.__vue__;
|
||||||
vm.parseMonitorInfo(monitorInfo);
|
vm.parseMonitorInfo(monitorInfo);
|
||||||
})
|
})
|
||||||
.catch(function(error){
|
.catch(function(error){
|
||||||
@ -324,21 +269,10 @@
|
|||||||
this.myChart.clear();
|
this.myChart.clear();
|
||||||
this.myChart.setOption(this.option);
|
this.myChart.setOption(this.option);
|
||||||
},
|
},
|
||||||
isWindowsPlatform(str) {
|
|
||||||
return str.includes('Windows')
|
|
||||||
},
|
|
||||||
renderChart() {
|
|
||||||
this.myChart = echarts.init(this.$refs.chartDom);
|
|
||||||
this.myChart.setOption(this.option);
|
|
||||||
},
|
|
||||||
resizeHandle () {
|
resizeHandle () {
|
||||||
this.myChart.resize();
|
this.myChart.resize();
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
beforeDestroy() {
|
|
||||||
this.myChart.dispose();
|
|
||||||
this.myChart = null;
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
@ -363,4 +297,3 @@
|
|||||||
|
|
||||||
</html>
|
</html>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user