File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1775,6 +1775,7 @@ <h4 style="margin-top: 0; margin-bottom: 10px;">批量操作</h4>
17751775 < label for ="errorCodeFilter " style ="margin-left: 20px; "> 错误码:</ label >
17761776 < select id ="errorCodeFilter " class ="filter-select " onchange ="applyStatusFilter() ">
17771777 < option value ="all "> 全部</ option >
1778+ < option value ="none "> 无错误</ option >
17781779 < option value ="400 "> 400</ option >
17791780 < option value ="403 "> 403</ option >
17801781 < option value ="429 "> 429</ option >
@@ -1931,6 +1932,7 @@ <h4 style="margin-top: 0; margin-bottom: 10px;">批量操作</h4>
19311932 < select id ="antigravityErrorCodeFilter " class ="filter-select "
19321933 onchange ="applyAntigravityStatusFilter() ">
19331934 < option value ="all "> 全部</ option >
1935+ < option value ="none "> 无错误</ option >
19341936 < option value ="400 "> 400</ option >
19351937 < option value ="403 "> 403</ option >
19361938 < option value ="429 "> 429</ option >
Original file line number Diff line number Diff line change @@ -1442,6 +1442,7 @@ <h4 style="margin-top: 0; margin-bottom: 10px; font-size: 16px;">批量操作</h
14421442 < label for ="errorCodeFilter "> 错误码筛选:</ label >
14431443 < select id ="errorCodeFilter " onchange ="applyStatusFilter() ">
14441444 < option value ="all "> 全部</ option >
1445+ < option value ="none "> 无错误</ option >
14451446 < option value ="400 "> 400</ option >
14461447 < option value ="403 "> 403</ option >
14471448 < option value ="429 "> 429</ option >
@@ -1632,6 +1633,7 @@ <h4 style="margin-top: 0; margin-bottom: 10px; font-size: 16px;">批量操作</h
16321633 < label for ="antigravityErrorCodeFilter "> 错误码筛选:</ label >
16331634 < select id ="antigravityErrorCodeFilter " onchange ="applyAntigravityStatusFilter() ">
16341635 < option value ="all "> 全部</ option >
1636+ < option value ="none "> 无错误</ option >
16351637 < option value ="400 "> 400</ option >
16361638 < option value ="403 "> 403</ option >
16371639 < option value ="429 "> 429</ option >
Original file line number Diff line number Diff line change @@ -1061,13 +1061,22 @@ async def get_credentials_summary(
10611061
10621062 # 错误码筛选 - 兼容存储为数字或字符串的情况
10631063 if error_code_filter and str (error_code_filter ).strip ().lower () != "all" :
1064- filter_value = str (error_code_filter ).strip ()
1065- query_values = [filter_value ]
1066- try :
1067- query_values .append (int (filter_value ))
1068- except ValueError :
1069- pass
1070- query ["error_codes" ] = {"$in" : query_values }
1064+ if str (error_code_filter ).strip ().lower () == "none" :
1065+ # 筛选无错误的凭证:error_codes 为空数组、不存在、或为 null
1066+ query ["$or" ] = [
1067+ {"error_codes" : {"$exists" : False }},
1068+ {"error_codes" : None },
1069+ {"error_codes" : []},
1070+ {"error_codes" : "[]" },
1071+ ]
1072+ else :
1073+ filter_value = str (error_code_filter ).strip ()
1074+ query_values = [filter_value ]
1075+ try :
1076+ query_values .append (int (filter_value ))
1077+ except ValueError :
1078+ pass
1079+ query ["error_codes" ] = {"$in" : query_values }
10711080
10721081 # 计算全局统计数据(不受筛选条件影响)
10731082 global_stats = {"total" : 0 , "normal" : 0 , "disabled" : 0 }
Original file line number Diff line number Diff line change @@ -674,12 +674,16 @@ async def get_credentials_summary(
674674 # 错误码筛选
675675 filter_value = None
676676 filter_int = None
677+ filter_none = False
677678 if error_code_filter and str (error_code_filter ).strip ().lower () != "all" :
678- filter_value = str (error_code_filter ).strip ()
679- try :
680- filter_int = int (filter_value )
681- except ValueError :
682- filter_int = None
679+ if str (error_code_filter ).strip ().lower () == "none" :
680+ filter_none = True
681+ else :
682+ filter_value = str (error_code_filter ).strip ()
683+ try :
684+ filter_int = int (filter_value )
685+ except ValueError :
686+ filter_int = None
683687
684688 all_summaries = []
685689 for row in all_rows :
@@ -688,6 +692,11 @@ async def get_credentials_summary(
688692 active_cooldowns = {k : v for k , v in model_cooldowns .items () if v > current_time }
689693 error_codes = json .loads (error_codes_json )
690694
695+ # 筛选无错误的凭证
696+ if filter_none :
697+ if error_codes :
698+ continue
699+
691700 if filter_value :
692701 match = False
693702 for code in error_codes :
Original file line number Diff line number Diff line change @@ -896,12 +896,16 @@ async def get_credentials_summary(
896896
897897 filter_value = None
898898 filter_int = None
899+ filter_none = False
899900 if error_code_filter and str (error_code_filter ).strip ().lower () != "all" :
900- filter_value = str (error_code_filter ).strip ()
901- try :
902- filter_int = int (filter_value )
903- except ValueError :
904- filter_int = None
901+ if str (error_code_filter ).strip ().lower () == "none" :
902+ filter_none = True
903+ else :
904+ filter_value = str (error_code_filter ).strip ()
905+ try :
906+ filter_int = int (filter_value )
907+ except ValueError :
908+ filter_int = None
905909
906910 # 构建WHERE子句
907911 where_clause = ""
@@ -947,6 +951,12 @@ async def get_credentials_summary(
947951 }
948952
949953 error_codes = json .loads (error_codes_json )
954+
955+ # 筛选无错误的凭证
956+ if filter_none :
957+ if error_codes :
958+ continue
959+
950960 if filter_value :
951961 match = False
952962 for code in error_codes :
You can’t perform that action at this time.
0 commit comments