@@ -2079,6 +2079,12 @@ $I18N.addLangs("zh_cn", {
20792079 "dashboard.pro.download" : "下载数" ,
20802080 "dashboard.pro.distincts" : "独立访问" ,
20812081 "dashboard.pro.download_size" : "下载量" ,
2082+ "dashboard.history.cpu" : "1 分钟 CPU 负载" ,
2083+ "dashboard.history.memory" : "1 分钟 内存使用情况" ,
2084+ "dashboard.history.connections" : "1 分钟 连接数" ,
2085+ "dashboard.cpu" : "CPU 负载" ,
2086+ "dashboard.memory" : "内存使用" ,
2087+ "dashboard.connections" : "连接数" ,
20822088 "menu.dashboard" : "数据统计" ,
20832089 "menu.master" : "主控面板" ,
20842090 "menu.master.rank" : "排行榜" ,
@@ -2963,15 +2969,15 @@ app.$Menu.add("dashboard", new class {
29632969 app . createFlex ( true ) . class ( "panel" ) . minWidth ( 640 ) . child ( 3 ) . append (
29642970 app . createElement ( "div" ) . append (
29652971 app . createElement ( "p" ) . class ( "title" ) . setI18N ( "dashboard.pro.download" ) ,
2966- app . createElement ( "p" ) . class ( "value" ) . setText ( "dashboard.storages" ) ,
2972+ app . createElement ( "p" ) . class ( "value" ) ,
29672973 ) ,
29682974 app . createElement ( "div" ) . append (
29692975 app . createElement ( "p" ) . class ( "title" ) . setI18N ( "dashboard.pro.download_size" ) ,
2970- app . createElement ( "p" ) . class ( "value" ) . setText ( "dashboard.storages" ) ,
2976+ app . createElement ( "p" ) . class ( "value" ) ,
29712977 ) ,
29722978 app . createElement ( "div" ) . append (
29732979 app . createElement ( "p" ) . class ( "title" ) . setI18N ( "dashboard.pro.distincts" ) ,
2974- app . createElement ( "p" ) . class ( "value" ) . setText ( "dashboard.storages" ) ,
2980+ app . createElement ( "p" ) . class ( "value" ) ,
29752981 )
29762982 ) ,
29772983 app . createFlex ( true ) . minWidth ( 1280 ) . childWidths ( 70 , 30 ) . append (
@@ -3031,15 +3037,24 @@ app.$Menu.add("dashboard", new class {
30313037 ) ,
30323038 app . createFlex ( true ) . minWidth ( 1280 ) . childWidths ( 1 / 3 * 100.0 , 1 / 3 * 100.0 , 1 / 3 * 100.0 ) . append (
30333039 app . createElement ( "div" ) . class ( "panel" ) . append (
3034- app . createElement ( "p" ) . class ( "title" ) . setText ( "dashboard.history.cpu" ) ,
3040+ app . createElement ( "div" ) . class ( "title" , "flex-space-between" ) . append (
3041+ app . createElement ( "p" ) . class ( "title-color" ) . setI18N ( "dashboard.history.cpu" ) ,
3042+ app . createElement ( "p" ) . class ( "title-color" ) . setI18N ( "dashboard.peer" )
3043+ ) ,
30353044 this . _e_cpu
30363045 ) ,
30373046 app . createElement ( "div" ) . class ( "panel" ) . append (
3038- app . createElement ( "p" ) . class ( "title" ) . setText ( "dashboard.history.memory" ) ,
3047+ app . createElement ( "div" ) . class ( "title" , "flex-space-between" ) . append (
3048+ app . createElement ( "p" ) . class ( "title-color" ) . setI18N ( "dashboard.history.memory" ) ,
3049+ app . createElement ( "p" ) . class ( "title-color" ) . setI18N ( "dashboard.peer" )
3050+ ) ,
30393051 this . _e_memory
30403052 ) ,
30413053 app . createElement ( "div" ) . class ( "panel" ) . append (
3042- app . createElement ( "p" ) . class ( "title" ) . setText ( "dashboard.history.connection" ) ,
3054+ app . createElement ( "div" ) . class ( "title" , "flex-space-between" ) . append (
3055+ app . createElement ( "p" ) . class ( "title-color" ) . setI18N ( "dashboard.history.connections" ) ,
3056+ app . createElement ( "p" ) . class ( "title-color" ) . setI18N ( "dashboard.peer" )
3057+ ) ,
30433058 this . _e_connection
30443059 )
30453060 ) . addResize ( ( ) => {
@@ -3417,9 +3432,10 @@ app.$Menu.add("dashboard", new class {
34173432 top : 15 ,
34183433 bottom : 10 ,
34193434 right : 0 ,
3435+ left : 10 ,
34203436 show : false ,
34213437 z : 0 ,
3422- containLabel : false ,
3438+ containLabel : true ,
34233439 backgroundColor : "rgba(0,0,0,0)" ,
34243440 borderWidth : 1 ,
34253441 borderColor : "#ccc"
@@ -3460,12 +3476,12 @@ app.$Menu.add("dashboard", new class {
34603476 this . drawGEO ( )
34613477 } )
34623478 } , 0 , 360000 )
3463- /* this.detailSystemTimer = app.runTaskRepeat(() => {
3479+ this . detailSystemTimer = app . runTaskRepeat ( ( ) => {
34643480 $MainSocket . send ( "system_details" ) . then ( ( data ) => {
34653481 this . detail_system = data
34663482 this . drawDetailSystem ( )
34673483 } )
3468- }, 0, 1000)*/
3484+ } , 0 , 5000 )
34693485 }
34703486 clearPro ( ) {
34713487 this . globalTimer ?. block ( )
@@ -3896,6 +3912,10 @@ app.$Menu.add("dashboard", new class {
38963912 }
38973913 ]
38983914 } )
3915+ console . log ( this . pro [ 2 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 1 ] )
3916+ this . pro [ 3 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 1 ] . t18n ( { peer : Math . max ( ...Object . values ( this . detail_system . cpu ) , 0 ) . toFixed ( 2 ) + "%" } )
3917+ this . pro [ 3 ] . getChildren ( ) [ 1 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 1 ] . t18n ( { peer : this . _format_bytes ( Math . max ( ...Object . values ( this . detail_system . memory ) , 0 ) ) } )
3918+ this . pro [ 3 ] . getChildren ( ) [ 2 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 1 ] . t18n ( { peer : Math . max ( ...Object . values ( this . detail_system . connections ) , 0 ) } )
38993919 }
39003920 drawGlobals ( ) {
39013921 var visits = ( this . data_day_option <= 1 ? fillDateTimes ( this . pro_stats . distinct_ip , this . data_day_option == 1 ? 7 : 1 ) : fillDates ( this . pro_stats . distinct_ip ) )
0 commit comments