Skip to content

Commit 8ed0e7d

Browse files
author
rick
committed
fix :some bug
1 parent 1f501a9 commit 8ed0e7d

File tree

1 file changed

+17
-31
lines changed

1 file changed

+17
-31
lines changed

index.html

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="zh-CN">
33
<head>
44
<meta charset="UTF-8">
55
<title>API CHECKER</title>
@@ -219,16 +219,17 @@
219219
.copyright a:hover {
220220
text-decoration: underline;
221221
}
222-
.verify-btn-group {
223-
display: line-block;
224-
}
222+
/*.verify-btn-group {*/
223+
/* display: line-block;*/
224+
/*}*/
225225
.verify-btn {
226226
padding: 3px 8px;
227227
margin-left: 8px;
228228
cursor: pointer;
229229
border: none;
230230
border-radius: 3px;
231231
color: white;
232+
background-color: #28a745;
232233
display: inline-block;
233234
font-size: 14px;
234235
line-height: 1.5;
@@ -240,34 +241,15 @@
240241
.verify-btn.blue:hover {
241242
background-color: #2980b9;
242243
}
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+
257245
.verify-btn.cyan {
258246
background-color: #1abc9c;
259247
color: white;
260248
}
261249
.verify-btn.cyan:hover {
262250
background-color: #16a085;
263251
}
264-
.verify-btn.pink {
265-
background-color: #e91e63;
266-
color: white;
267-
}
268-
.verify-btn.pink:hover {
269-
background-color: #c2185b;
270-
}
252+
271253
.verify-btn::after {
272254
content: attr(data-tooltip); /* 获取 data-tooltip 属性的值作为提示文本 */
273255
visibility: hidden;
@@ -748,7 +730,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
748730

749731
if (response.ok) {
750732
const data = await response.json();
751-
const returnedModel = data.model;
733+
const returnedModel = data.model || "no returned model by rick"; // 确保 returnedModel 有效
752734
if (returnedModel === model) {
753735
results.valid.push({model, responseTime});
754736
if (/^(gpt-|chatgpt-|o1-)/.test(model)) {
@@ -775,7 +757,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
775757
response_text = '无法解析响应内容';
776758
}
777759
}
778-
results.invalid.push({model, response_text})
760+
results.invalid.push({model, response_text});
779761
console.log(`测试 API 节点:${apiUrl} 测试模型:${model} 模型不可用,响应:${response.status} ${response.statusText} ${response_text}`);
780762
}
781763
} catch (error) {
@@ -792,7 +774,11 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
792774
}
793775

794776
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+
);
796782
await Promise.all(promises);
797783
}
798784

@@ -842,7 +828,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
842828
'<div className="submit-container">' +
843829
'<button class="check-quota copy-btn" onclick="copyConsistentModels()">复制一致模型</button>' +
844830
'<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>' +
846832
'</div>' +
847833
'</div>' +
848834
'<table>' +
@@ -996,11 +982,11 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
996982
let hitReferenceCount = 0;
997983
let color;
998984
for (let i = 0; i < 4; i++) {
999-
if (responses[i] == referenceValue) {
985+
if (responses[i] === referenceValue) {
1000986
hitReferenceCount++;
1001987
color = "green";
1002988
}
1003-
else if (responses[i] == "该次调用响应失败"){
989+
else if (responses[i] === "该次调用响应失败"){
1004990
color = "red"
1005991
}
1006992
else{

0 commit comments

Comments
 (0)