File tree Expand file tree Collapse file tree 7 files changed +9
-8
lines changed Expand file tree Collapse file tree 7 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ <h3>@#server.Name#@</h3>
109
109
< script >
110
110
const monitorInfo = JSON . parse ( '{{.MonitorInfos}}' ) ;
111
111
const initData = JSON . parse ( '{{.Servers}}' ) . servers ;
112
- let MaxTCPPingValue = { { . MaxTCPPingValue} } ;
112
+ let MaxTCPPingValue = { { . Conf . MaxTCPPingValue } } ;
113
113
if ( MaxTCPPingValue == null ) {
114
114
MaxTCPPingValue = 300 ;
115
115
}
Original file line number Diff line number Diff line change 11
11
< script >
12
12
function showSwitchTemplate ( list , currentBackendTheme ) {
13
13
console . log ( list , currentBackendTheme ) ;
14
+ console . log ( "currentBackendTheme:" , currentBackendTheme ) ;
14
15
}
15
16
showSwitchTemplate ( { { . Themes } } , { { . Conf . Site . Theme } } )
16
17
</ script >
Original file line number Diff line number Diff line change 185
185
} ,
186
186
renderCharts ( id ) {
187
187
if ( ! this . chartDataList [ id - 1 ] ) return ;
188
- const MaxTCPPingValue = { { . MaxTCPPingValue} } ? { { . MaxTCPPingValue } } : 300 ;
188
+ const MaxTCPPingValue = { { . Conf . MaxTCPPingValue} } ? { { . Conf . MaxTCPPingValue } } : 300 ;
189
189
const isMobile = this . checkIsMobile ( ) ;
190
190
const fontSize = isMobile ? 10 : 9 ;
191
191
const itemGap = isMobile ? 6 : 6 ;
208
208
const seriesData = chartData . map ( item => {
209
209
let loss = 0 ;
210
210
const data = item . avg_delay . map ( ( avgDelay , index ) => {
211
- if ( avgDelay > 0 ) {
211
+ if ( avgDelay > 0 && avgDelay < MaxTCPPingValue ) {
212
212
loss += avgDelay > 0.9 * MaxTCPPingValue ? 1 : 0 ;
213
213
return [ item . created_at [ index ] , avgDelay ] ;
214
214
} else {
Original file line number Diff line number Diff line change 27
27
< script >
28
28
const monitorInfo = JSON . parse ( '{{.MonitorInfos}}' ) ;
29
29
const initData = JSON . parse ( '{{.Servers}}' ) . servers ;
30
- let MaxTCPPingValue = { { . MaxTCPPingValue} } ;
30
+ let MaxTCPPingValue = { { . Conf . MaxTCPPingValue } } ;
31
31
if ( MaxTCPPingValue == null ) {
32
32
MaxTCPPingValue = 1000 ;
33
33
}
Original file line number Diff line number Diff line change 54
54
< script >
55
55
const monitorInfo = JSON . parse ( '{{.MonitorInfos}}' ) ;
56
56
const initData = JSON . parse ( '{{.Servers}}' ) . servers ;
57
- let MaxTCPPingValue = { { . MaxTCPPingValue} } ;
57
+ let MaxTCPPingValue = { { . Conf . MaxTCPPingValue } } ;
58
58
if ( MaxTCPPingValue == null ) {
59
59
MaxTCPPingValue = 1000 ;
60
60
}
Original file line number Diff line number Diff line change 280
280
if ( chartboxShow === '0' ) return ;
281
281
}
282
282
// 定义图表参数值
283
- const MaxTCPPingValue = { { . MaxTCPPingValue} } ? { { . MaxTCPPingValue } } : 300 ;
283
+ const MaxTCPPingValue = { { . Conf . MaxTCPPingValue} } ? { { . Conf . MaxTCPPingValue } } : 300 ;
284
284
const isMobile = this . checkIsMobile ( ) ;
285
285
const fontSize = isMobile ? 10 : 14 ;
286
286
const gridLeft = isMobile ? 25 : 36 ;
306
306
const seriesData = chartData . map ( item => {
307
307
let loss = 0 ;
308
308
const data = item . avg_delay . map ( ( avgDelay , index ) => {
309
- if ( avgDelay > 0 ) {
309
+ if ( avgDelay > 0 && avgDelay < MaxTCPPingValue ) {
310
310
loss += avgDelay > 0.9 * MaxTCPPingValue ? 1 : 0 ;
311
311
return [ item . created_at [ index ] , avgDelay ] ;
312
312
} else {
Original file line number Diff line number Diff line change 21
21
< script >
22
22
const monitorInfo = JSON . parse ( '{{.MonitorInfos}}' ) ;
23
23
const initData = JSON . parse ( '{{.Servers}}' ) . servers ;
24
- let MaxTCPPingValue = { { . MaxTCPPingValue} } ;
24
+ let MaxTCPPingValue = { { . Conf . MaxTCPPingValue } } ;
25
25
if ( MaxTCPPingValue == null ) {
26
26
MaxTCPPingValue = 1000 ;
27
27
}
You can’t perform that action at this time.
0 commit comments