Skip to content

Commit 264a6fb

Browse files
authored
修复MaxTCPPingValue取值错误
1 parent d7cdc6f commit 264a6fb

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

resource/template/theme-daynight/network.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h3>@#server.Name#@</h3>
109109
<script>
110110
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
111111
const initData = JSON.parse('{{.Servers}}').servers;
112-
let MaxTCPPingValue = {{.MaxTCPPingValue}};
112+
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
113113
if (MaxTCPPingValue == null) {
114114
MaxTCPPingValue = 300;
115115
}

resource/template/theme-default/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<script>
1212
function showSwitchTemplate(list, currentBackendTheme) {
1313
console.log(list, currentBackendTheme);
14+
console.log("currentBackendTheme:",currentBackendTheme);
1415
}
1516
showSwitchTemplate({{ .Themes }}, {{ .Conf.Site.Theme }})
1617
</script>

resource/template/theme-default/home.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
},
186186
renderCharts(id) {
187187
if (!this.chartDataList[id - 1]) return;
188-
const MaxTCPPingValue = {{.MaxTCPPingValue}} ? {{.MaxTCPPingValue}} : 300;
188+
const MaxTCPPingValue = {{.Conf.MaxTCPPingValue}} ? {{.Conf.MaxTCPPingValue}} : 300;
189189
const isMobile = this.checkIsMobile();
190190
const fontSize = isMobile ? 10 : 9;
191191
const itemGap = isMobile ? 6 : 6;
@@ -208,7 +208,7 @@
208208
const seriesData = chartData.map(item => {
209209
let loss = 0;
210210
const data = item.avg_delay.map((avgDelay, index) => {
211-
if(avgDelay>0){
211+
if(avgDelay > 0 && avgDelay < MaxTCPPingValue){
212212
loss += avgDelay > 0.9 * MaxTCPPingValue ? 1 : 0;
213213
return [item.created_at[index], avgDelay];
214214
}else{

resource/template/theme-default/network.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<script>
2828
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
2929
const initData = JSON.parse('{{.Servers}}').servers;
30-
let MaxTCPPingValue = {{.MaxTCPPingValue}};
30+
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
3131
if (MaxTCPPingValue == null) {
3232
MaxTCPPingValue = 1000;
3333
}

resource/template/theme-mdui/network.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<script>
5555
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
5656
const initData = JSON.parse('{{.Servers}}').servers;
57-
let MaxTCPPingValue = {{.MaxTCPPingValue}};
57+
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
5858
if (MaxTCPPingValue == null) {
5959
MaxTCPPingValue = 1000;
6060
}

resource/template/theme-server-status/home.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
if ( chartboxShow === '0' ) return;
281281
}
282282
// 定义图表参数值
283-
const MaxTCPPingValue = {{.MaxTCPPingValue}} ? {{.MaxTCPPingValue}} : 300;
283+
const MaxTCPPingValue = {{.Conf.MaxTCPPingValue}} ? {{.Conf.MaxTCPPingValue}} : 300;
284284
const isMobile = this.checkIsMobile();
285285
const fontSize = isMobile ? 10 : 14;
286286
const gridLeft = isMobile ? 25 : 36;
@@ -306,7 +306,7 @@
306306
const seriesData = chartData.map(item => {
307307
let loss = 0;
308308
const data = item.avg_delay.map((avgDelay, index) => {
309-
if(avgDelay>0){
309+
if(avgDelay > 0 && avgDelay < MaxTCPPingValue){
310310
loss += avgDelay > 0.9 * MaxTCPPingValue ? 1 : 0;
311311
return [item.created_at[index], avgDelay];
312312
}else{

resource/template/theme-server-status/network.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<script>
2222
const monitorInfo = JSON.parse('{{.MonitorInfos}}');
2323
const initData = JSON.parse('{{.Servers}}').servers;
24-
let MaxTCPPingValue = {{.MaxTCPPingValue}};
24+
let MaxTCPPingValue = {{.Conf.MaxTCPPingValue}};
2525
if (MaxTCPPingValue == null) {
2626
MaxTCPPingValue = 1000;
2727
}

0 commit comments

Comments
 (0)