Remove redundant code for MaxTCPPingValue initialization
This commit is contained in:
parent
5a2ab8a7ee
commit
6c718c4f38
33
resource/template/theme-daynight/network.html
vendored
33
resource/template/theme-daynight/network.html
vendored
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
<main>
|
<main>
|
||||||
<div id="network">
|
<div id="network">
|
||||||
<div class="server-info-container" v-for='server in servers' :id="server.ID" style="font-size: .6em">
|
<div class="server-info-container" v-for='server in servers' :id="server.ID">
|
||||||
<div class="info-body" @click="redirectNetwork(server.ID)">
|
<div class="info-body" @click="redirectNetwork(server.ID)">
|
||||||
<ul class="server-info-body-container">
|
<ul class="server-info-body-container">
|
||||||
<li>
|
<li>
|
||||||
@ -93,7 +93,8 @@
|
|||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<div class="footer-container">
|
<div class="footer-container">
|
||||||
<div><a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "NezhaMonitoring"}} · {{.Version}}</a>
|
<div><a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "NezhaMonitoring"}} ·
|
||||||
|
{{.Version}}</a>
|
||||||
<p>© <span id="copyright-date">
|
<p>© <span id="copyright-date">
|
||||||
<script>document.getElementById('copyright-date').appendChild(document.createTextNode(new Date().getFullYear()))</script>
|
<script>document.getElementById('copyright-date').appendChild(document.createTextNode(new Date().getFullYear()))</script>
|
||||||
</span> · <a href="https://blog.jackiesung.com" target="_blank">Theme designed by Jackie Sung</a>
|
</span> · <a href="https://blog.jackiesung.com" target="_blank">Theme designed by Jackie Sung</a>
|
||||||
@ -104,17 +105,16 @@
|
|||||||
|
|
||||||
<script src="/static/theme-daynight/js/main.js?v202102012266"></script>
|
<script src="/static/theme-daynight/js/main.js?v202102012266"></script>
|
||||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script>
|
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script>
|
||||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/limonte-sweetalert2/11.4.4/sweetalert2.all.min.js"></script>
|
<script
|
||||||
|
src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/limonte-sweetalert2/11.4.4/sweetalert2.all.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
||||||
const initData = JSON.parse('{{.Servers}}').servers;
|
const initData = JSON.parse('{{.Servers}}').servers;
|
||||||
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
||||||
if (MaxTCPPingValue == null) {
|
|
||||||
MaxTCPPingValue = 1000;
|
|
||||||
}
|
|
||||||
// 基于准备好的dom,初始化echarts实例
|
// 基于准备好的dom,初始化echarts实例
|
||||||
var myChart = echarts.init(document.getElementById('monitor-info-container'));
|
const myChart = echarts.init(document.getElementById('monitor-info-container'));
|
||||||
|
|
||||||
// 使用刚指定的配置项和数据显示图表。
|
// 使用刚指定的配置项和数据显示图表。
|
||||||
var statusCards = new Vue({
|
var statusCards = new Vue({
|
||||||
el: '#network',
|
el: '#network',
|
||||||
@ -266,11 +266,11 @@
|
|||||||
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;
|
||||||
this.myChart.clear();
|
myChart.clear();
|
||||||
this.myChart.setOption(this.option);
|
myChart.setOption(this.option);
|
||||||
},
|
},
|
||||||
resizeHandle() {
|
resizeHandle() {
|
||||||
this.myChart.resize();
|
myChart.resize();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -278,21 +278,22 @@
|
|||||||
</body>
|
</body>
|
||||||
<style>
|
<style>
|
||||||
#network {
|
#network {
|
||||||
display: grid;
|
|
||||||
/*grid-template-columns: repeat(5, 1fr);*/
|
|
||||||
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
|
||||||
grid-gap: 1em;
|
|
||||||
width: 100%;
|
|
||||||
width: calc(100vw - 6em);
|
width: calc(100vw - 6em);
|
||||||
max-width: 1400px;
|
max-width: 1400px;
|
||||||
margin: 1em auto;
|
margin: 1em auto;
|
||||||
align-content: start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#monitor-info-container {
|
#monitor-info-container {
|
||||||
margin: 0em auto;
|
margin: 0em auto;
|
||||||
align-content: start;
|
align-content: start;
|
||||||
background-color: #F1F1F2;
|
background-color: #F1F1F2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.server-info-container {
|
||||||
|
font-size: .6em;
|
||||||
|
width: fit-content;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
3
resource/template/theme-default/network.html
vendored
3
resource/template/theme-default/network.html
vendored
@ -28,9 +28,6 @@
|
|||||||
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
||||||
const initData = JSON.parse('{{.Servers}}').servers;
|
const initData = JSON.parse('{{.Servers}}').servers;
|
||||||
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
||||||
if (MaxTCPPingValue == null) {
|
|
||||||
MaxTCPPingValue = 1000;
|
|
||||||
}
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
delimiters: ['@#', '#@'],
|
delimiters: ['@#', '#@'],
|
||||||
|
3
resource/template/theme-mdui/network.html
vendored
3
resource/template/theme-mdui/network.html
vendored
@ -55,9 +55,6 @@
|
|||||||
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
||||||
const initData = JSON.parse('{{.Servers}}').servers;
|
const initData = JSON.parse('{{.Servers}}').servers;
|
||||||
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
||||||
if (MaxTCPPingValue == null) {
|
|
||||||
MaxTCPPingValue = 1000;
|
|
||||||
}
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
delimiters: ['@#', '#@'],
|
delimiters: ['@#', '#@'],
|
||||||
|
@ -22,9 +22,6 @@
|
|||||||
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
|
||||||
const initData = JSON.parse('{{.Servers}}').servers;
|
const initData = JSON.parse('{{.Servers}}').servers;
|
||||||
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
|
||||||
if (MaxTCPPingValue == null) {
|
|
||||||
MaxTCPPingValue = 1000;
|
|
||||||
}
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
delimiters: ['@#', '#@'],
|
delimiters: ['@#', '#@'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user