@@ -12,25 +12,23 @@ <h3 class="box-title">系统状态</h3>
12
12
< tbody >
13
13
< tr >
14
14
< td class ="pull-right "> < strong > Nginx 版本</ strong > </ td >
15
- < td > {{ sysinfo.nginx }} < span id ="sp_nginx_status "> </ span > < span id ="sp_nginx_config_status "> </ span > < span id ="sp_uptime "> </ span > </ td >
15
+ < td > < span id =" sp_info_nginx " > </ span > < span id ="sp_nginx_status "> </ span > < span id ="sp_nginx_config_status "> </ span > < span id ="sp_uptime "> </ span > </ td >
16
16
</ tr >
17
17
< tr >
18
18
< td class ="pull-right "> < strong > 主机名</ strong > </ td >
19
- < td > {{ sysinfo.platform.node }} </ td >
19
+ < td > < span id =" sp_info_node " > </ span > </ td >
20
20
</ tr >
21
21
< tr >
22
22
< td class ="pull-right "> < strong > 操作系统</ strong > </ td >
23
- < td > {{ sysinfo.platform.system }} {{ sysinfo.platform.release }} </ td >
23
+ < td > < span id =" sp_info_system " > </ span > < span id =" sp_info_release " > </ span > </ td >
24
24
</ tr >
25
25
< tr >
26
26
< td class ="pull-right "> < strong > 系统架构</ strong > </ td >
27
- < td > {{ sysinfo.platform.processor }} </ td >
27
+ < td > < spam id =" sp_info_processor " > </ span > </ td >
28
28
</ tr >
29
29
< tr >
30
30
< td class ="pull-right "> < strong > 网络信息</ strong > </ td >
31
- < td >
32
- {% for nic in sysinfo.nic %}
33
- < small > {{ nic.nic }}</ small > {{ nic.address }} {% endfor %}
31
+ < td id ="td_info_nic ">
34
32
</ td >
35
33
</ tr >
36
34
</ tbody >
@@ -292,8 +290,8 @@ <h3 class="box-title">请求统计</h3>
292
290
}
293
291
}
294
292
295
- function get_uptime ( ) {
296
- var uptime_ms = { { sysinfo . platform . uptime } } ;
293
+ function get_uptime ( uptime_ms ) {
294
+ var uptime_ms = uptime_ms ;
297
295
if ( uptime_ms != 0 ) {
298
296
var seconds = Math . floor ( uptime_ms / 1000 ) ;
299
297
var minutes = Math . floor ( seconds / 60 ) ;
@@ -342,6 +340,17 @@ <h3 class="box-title">请求统计</h3>
342
340
$ ( '#sp_nginx_status' ) . text ( '已停止' )
343
341
}
344
342
343
+ get_uptime ( p . context . sysinfo . platform . uptime )
344
+
345
+ $ ( '#sp_info_nginx' ) . text ( p . context . sysinfo . nginx )
346
+ $ ( '#sp_info_node' ) . text ( p . context . sysinfo . platform . node )
347
+ $ ( '#sp_info_system' ) . text ( p . context . sysinfo . platform . system )
348
+ $ ( '#sp_info_release' ) . text ( p . context . sysinfo . platform . release )
349
+ $ ( '#sp_info_processor' ) . text ( p . context . sysinfo . platform . processor )
350
+ $ ( '#td_info_nic' ) . empty ( )
351
+ for ( var f in p . context . sysinfo . nic ) {
352
+ $ ( '#td_info_nic' ) . append ( "<small>" + p . context . sysinfo . nic [ f ] . nic + "</small> " + p . context . sysinfo . nic [ f ] . address + " " )
353
+ }
345
354
346
355
if ( ! p . context . sysstatus . nginx_config_status ) {
347
356
$ ( '#sp_nginx_config_status' ) . removeClass ( )
@@ -394,7 +403,6 @@ <h3 class="box-title">请求统计</h3>
394
403
add_data ( true , 0 , 0 , 0 ) ;
395
404
}
396
405
get_status_info ( )
397
- get_uptime ( )
398
- window . setInterval ( get_status_info , 10000 ) ;
406
+ window . setInterval ( get_status_info , 5000 ) ;
399
407
</ script >
400
408
{% endblock %}
0 commit comments