@@ -50,31 +50,13 @@ function showConfirm(title, content, callFn, extData) {
5050}
5151
5252function postJson ( url , data ) {
53- console . log ( 'postJson 调用:' , url , data ) ;
54- console . log ( '数据类型:' , typeof data ) ;
55- console . log ( '是否为数组:' , Array . isArray ( data ) ) ;
56- if ( Array . isArray ( data ) ) {
57- console . log ( '数组长度:' , data . length ) ;
58- console . log ( '数组内容:' , data ) ;
59- }
60-
6153 const jsonString = JSON . stringify ( data ) ;
62- console . log ( 'JSON序列化后:' , jsonString ) ;
63- console . log ( 'JSON字符串长度:' , jsonString . length ) ;
64- if ( jsonString . length > 0 ) {
65- console . log ( '首字符:' , jsonString . charAt ( 0 ) , '(ASCII:' , jsonString . charCodeAt ( 0 ) , ')' ) ;
66- if ( jsonString . length > 1 ) {
67- console . log ( '次字符:' , jsonString . charAt ( 1 ) , '(ASCII:' , jsonString . charCodeAt ( 1 ) , ')' ) ;
68- }
69- }
70-
7154 return $ . ajax ( {
7255 url : url ,
7356 type : "POST" ,
7457 contentType : "application/json" ,
7558 data : jsonString ,
7659 } ) . done ( ( resp ) => {
77- console . log ( 'postJson 响应:' , resp ) ;
7860 if ( resp . code == 200 ) {
7961 if ( resp . message ) {
8062 alert ( resp . message ) ;
@@ -88,8 +70,6 @@ function postJson(url, data) {
8870 }
8971 } )
9072 . fail ( ( err ) => {
91- console . error ( 'postJson 失败:' , err ) ;
92- console . error ( '响应文本:' , err . responseText ) ;
9373 alert ( "网络错误:" + err . responseText ) ;
9474 } ) ;
9575}
@@ -815,12 +795,9 @@ function initWebSocket() {
815795 const ws = new WebSocket ( wsUrl ) ;
816796
817797 ws . onopen = function ( ) {
818- console . log ( 'WebSocket连接已建立' ) ;
819- // 发送一个ping消息来测试连接
820798 try {
821799 ws . send ( JSON . stringify ( { type : 'ping' } ) ) ;
822800 } catch ( e ) {
823- console . error ( '发送ping消息失败:' , e ) ;
824801 }
825802 } ;
826803
@@ -843,23 +820,15 @@ function initWebSocket() {
843820 } else {
844821 window . extractTrafficData ( ) ;
845822 }
846- // 打印流量数据调试信息,只显示部分数据
847- if ( data . trafficData . length > 0 ) {
848- const sample = data . trafficData [ 0 ] ;
849- console . debug ( `流量数据更新: ${ data . trafficData . length } 个服务器, 示例(ID:${ sample . server_id } ): ${ sample . used_formatted } /${ sample . max_formatted } ` ) ;
850- }
851823 }
852824 } catch ( e ) {
853- console . error ( '处理WebSocket消息时出错:' , e ) ;
854825 }
855826 } ;
856827
857828 ws . onerror = function ( error ) {
858- console . error ( 'WebSocket错误:' , error ) ;
859829 } ;
860830
861831 ws . onclose = function ( event ) {
862- console . log ( 'WebSocket连接已关闭,5秒后重试...' ) ;
863832 setTimeout ( initWebSocket , 5000 ) ;
864833 } ;
865834
@@ -904,9 +873,6 @@ window.extractTrafficData = function() {
904873 maxBytes = item . max_bytes ;
905874 usedBytes = item . used_bytes ;
906875
907- // 记录调试信息
908- console . debug ( `服务器 ${ serverId } 流量数据更新: ${ usedBytes } /${ maxBytes } 字节` ) ;
909-
910876 // 从字节数据计算百分比
911877 if ( maxBytes > 0 ) {
912878 percent = ( usedBytes / maxBytes ) * 100 ;
@@ -963,10 +929,7 @@ window.extractTrafficData = function() {
963929 if ( window . statusCards && typeof window . statusCards . updateTrafficData === 'function' ) {
964930 window . statusCards . updateTrafficData ( ) ;
965931 }
966-
967- console . log ( `已更新 ${ updatedCount } 个服务器的流量数据 (WebSocket字节源数据)` ) ;
968932 } catch ( e ) {
969- console . error ( '处理流量数据时出错:' , e ) ;
970933 }
971934} ;
972935
@@ -994,7 +957,6 @@ window.parseTrafficToBytes = function(trafficStr) {
994957
995958 // 如果还是没匹配到,返回0
996959 if ( ! match ) {
997- console . warn ( '无法解析流量字符串:' , trafficStr ) ;
998960 return 0 ;
999961 }
1000962
@@ -1077,7 +1039,6 @@ class TrafficManager {
10771039 // Process raw traffic data
10781040 processTrafficData ( rawData ) {
10791041 if ( ! Array . isArray ( rawData ) || rawData . length === 0 ) {
1080- console . warn ( '没有可用的流量数据' ) ;
10811042 return ;
10821043 }
10831044
@@ -1097,9 +1058,6 @@ class TrafficManager {
10971058 maxBytes = item . max_bytes ;
10981059 usedBytes = item . used_bytes ;
10991060
1100- // 为调试输出完整信息
1101- console . debug ( `服务器${ serverId } : 收到流量字节数据 used=${ usedBytes } , max=${ maxBytes } ` ) ;
1102-
11031061 // 从字节数据计算百分比
11041062 if ( maxBytes > 0 ) {
11051063 percent = ( usedBytes / maxBytes ) * 100 ;
@@ -1157,7 +1115,6 @@ class TrafficManager {
11571115 window . serverTrafficData = newData ;
11581116 window . lastTrafficUpdateTime = this . lastUpdateTime ;
11591117
1160- console . log ( `已更新 ${ updatedCount } 个服务器的流量数据 (字节源数据)` ) ;
11611118 this . notifySubscribers ( ) ;
11621119 }
11631120
@@ -1205,7 +1162,6 @@ class TrafficManager {
12051162 try {
12061163 callback ( this . trafficData , this . dataVersion ) ;
12071164 } catch ( e ) {
1208- console . error ( 'Error in traffic data subscriber:' , e ) ;
12091165 }
12101166 } ) ;
12111167 }
@@ -1275,15 +1231,13 @@ function fetchServerTrafficData(serverId) {
12751231 if ( data && data . code === 200 ) {
12761232 return data . data ;
12771233 } else if ( data && data . code === 403 ) {
1278- console . warn ( '需要登录才能访问流量数据' ) ;
12791234 if ( window . location . pathname !== '/login' ) {
12801235 window . location . href = '/login' ;
12811236 }
12821237 }
12831238 return null ;
12841239 } ,
12851240 error : function ( err ) {
1286- console . error ( '获取服务器流量数据失败:' , err ) ;
12871241 return null ;
12881242 }
12891243 } ) ;
@@ -1370,7 +1324,6 @@ function updateServerNameMapping() {
13701324 }
13711325 } )
13721326 . fail ( function ( ) {
1373- console . warn ( '无法加载服务器名称映射' ) ;
13741327 } ) ;
13751328}
13761329
@@ -1394,7 +1347,6 @@ function updateDDNSNameMapping() {
13941347 }
13951348 } )
13961349 . fail ( function ( ) {
1397- console . warn ( '无法加载DDNS名称映射' ) ;
13981350 } ) ;
13991351}
14001352
@@ -1418,7 +1370,6 @@ function updateTaskNameMapping() {
14181370 }
14191371 } )
14201372 . fail ( function ( ) {
1421- console . warn ( '无法加载Task名称映射' ) ;
14221373 } ) ;
14231374}
14241375
0 commit comments