1
1
<!DOCTYPE html>
2
- < html >
2
+ < html lang =" zh-CN " >
3
3
< head >
4
4
< meta charset ="UTF-8 ">
5
5
< title > API CHECKER</ title >
219
219
.copyright a : hover {
220
220
text-decoration : underline;
221
221
}
222
- .verify-btn-group {
223
- display : line-block;
224
- }
222
+ /* .verify-btn-group {*/
223
+ /* display: line-block;*/
224
+ /*}*/
225
225
.verify-btn {
226
226
padding : 3px 8px ;
227
227
margin-left : 8px ;
228
228
cursor : pointer;
229
229
border : none;
230
230
border-radius : 3px ;
231
231
color : white;
232
+ background-color : # 28a745 ;
232
233
display : inline-block;
233
234
font-size : 14px ;
234
235
line-height : 1.5 ;
240
241
.verify-btn .blue : hover {
241
242
background-color : # 2980b9 ;
242
243
}
243
- .verify-btn .green {
244
- background-color : # 28a745 ;
245
- color : white;
246
- }
247
- .verify-btn .green : hover {
248
- background-color : # 218838 ;
249
- }
250
- .verify-btn .yellow {
251
- background-color : # ffc107 ;
252
- color : white;
253
- }
254
- .verify-btn .yellow : hover {
255
- background-color : # e0a800 ;
256
- }
244
+
257
245
.verify-btn .cyan {
258
246
background-color : # 1abc9c ;
259
247
color : white;
260
248
}
261
249
.verify-btn .cyan : hover {
262
250
background-color : # 16a085 ;
263
251
}
264
- .verify-btn .pink {
265
- background-color : # e91e63 ;
266
- color : white;
267
- }
268
- .verify-btn .pink : hover {
269
- background-color : # c2185b ;
270
- }
252
+
271
253
.verify-btn ::after {
272
254
content : attr (data-tooltip); /* 获取 data-tooltip 属性的值作为提示文本 */
273
255
visibility : hidden;
@@ -748,7 +730,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
748
730
749
731
if ( response . ok ) {
750
732
const data = await response . json ( ) ;
751
- const returnedModel = data . model ;
733
+ const returnedModel = data . model || "no returned model by rick" ; // 确保 returnedModel 有效
752
734
if ( returnedModel === model ) {
753
735
results . valid . push ( { model, responseTime} ) ;
754
736
if ( / ^ ( g p t - | c h a t g p t - | o 1 - ) / . test ( model ) ) {
@@ -775,7 +757,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
775
757
response_text = '无法解析响应内容' ;
776
758
}
777
759
}
778
- results . invalid . push ( { model, response_text} )
760
+ results . invalid . push ( { model, response_text} ) ;
779
761
console . log ( `测试 API 节点:${ apiUrl } 测试模型:${ model } 模型不可用,响应:${ response . status } ${ response . statusText } ${ response_text } ` ) ;
780
762
}
781
763
} catch ( error ) {
@@ -792,7 +774,11 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
792
774
}
793
775
794
776
async function runBatch ( models ) {
795
- const promises = models . map ( model => testModel ( model ) ) ;
777
+ const promises = models . map ( model =>
778
+ testModel ( model ) . catch ( error => {
779
+ console . error ( `测试模型 ${ model } 时发生错误:${ error . message } ` ) ;
780
+ } )
781
+ ) ;
796
782
await Promise . all ( promises ) ;
797
783
}
798
784
@@ -842,7 +828,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
842
828
'<div className="submit-container">' +
843
829
'<button class="check-quota copy-btn" onclick="copyConsistentModels()">复制一致模型</button>' +
844
830
'<button class="check-quota copy-btn" onclick="copyConsistentAndInconsistentModels()">复制所有可用模型</button>' +
845
- '<button class="check-quota copy-btn"onclick="copyConsistentAndInconsistentReturedModels()">复制可用原始模型</button>' +
831
+ '<button class="check-quota copy-btn" onclick="copyConsistentAndInconsistentReturedModels()">复制可用原始模型</button>' +
846
832
'</div>' +
847
833
'</div>' +
848
834
'<table>' +
@@ -996,11 +982,11 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
996
982
let hitReferenceCount = 0 ;
997
983
let color ;
998
984
for ( let i = 0 ; i < 4 ; i ++ ) {
999
- if ( responses [ i ] == referenceValue ) {
985
+ if ( responses [ i ] === referenceValue ) {
1000
986
hitReferenceCount ++ ;
1001
987
color = "green" ;
1002
988
}
1003
- else if ( responses [ i ] == "该次调用响应失败" ) {
989
+ else if ( responses [ i ] === "该次调用响应失败" ) {
1004
990
color = "red"
1005
991
}
1006
992
else {
0 commit comments