Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
studyweb_Prototype
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
yujiejie
studyweb_Prototype
Commits
bffb1045
提交
bffb1045
authored
8月 24, 2026
作者:
yujiejie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
导师端验收界面优化2.0
上级
19684a0c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
195 行增加
和
27 行删除
+195
-27
pages-mentor.js
pages-mentor.js
+195
-27
没有找到文件。
pages-mentor.js
浏览文件 @
bffb1045
...
@@ -1749,6 +1749,99 @@ function restoreMentorDeployReviewParams() {
...
@@ -1749,6 +1749,99 @@ function restoreMentorDeployReviewParams() {
// ===== 导师部署验收台:真实 API 测试(文本模型)=====
// ===== 导师部署验收台:真实 API 测试(文本模型)=====
// ===== 导师部署验收台:模拟返回数据(演示模式)=====
// 原型环境无真实后端服务,打开「模拟返回数据」开关后,点击测试将直接写入符合
// 规范结构的模拟通过结果,便于完整演示大模型回答内容与生成图片的前端展示。
function
isMentorDeployMockEnabled
()
{
return
!!
window
.
__mentorDeployMock
;
}
function
toggleMentorDeployMock
()
{
window
.
__mentorDeployMock
=
!
window
.
__mentorDeployMock
;
if
(
!
window
.
__mentorDeployMock
)
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
);
if
(
testsNode
[
sid
])
{
delete
testsNode
[
sid
].
models
;
delete
testsNode
[
sid
].
chat
;
delete
testsNode
[
sid
].
genSubmit
;
delete
testsNode
[
sid
].
genStatus
;
}
}
renderContent
();
}
function
getMentorDeployMockImageUrl
()
{
var
svg
=
"<svg xmlns='http://www.w3.org/2000/svg' width='768' height='768' viewBox='0 0 768 768'>"
+
"<defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'>"
+
"<stop offset='0%' stop-color='#6366f1'/><stop offset='100%' stop-color='#a855f7'/>"
+
"</linearGradient></defs>"
+
"<rect width='768' height='768' fill='url(#g)'/>"
+
"<circle cx='384' cy='320' r='128' fill='#fbbf24'/>"
+
"<circle cx='448' cy='296' r='40' fill='#f59e0b'/>"
+
"<ellipse cx='384' cy='620' rx='250' ry='78' fill='#1e1b4b' opacity='0.35'/>"
+
"<text x='384' y='110' text-anchor='middle' font-size='28' fill='#ffffff' font-family='sans-serif' font-weight='bold'>AI 图像生成(模拟返回)</text>"
+
"</svg>"
;
return
'data:image/svg+xml;charset=utf-8,'
+
encodeURIComponent
(
svg
);
}
function
buildMentorDeployMockModelsResult
(
taskKey
,
p
)
{
var
url
=
getMentorDeployBaseUrl
()
+
'/v1/models'
;
var
extra
=
taskKey
===
'image-gen'
?
[
'qwen-image-2.0'
,
'sd-xl-base-1.0'
]
:
[
'qwen2.5-7b-instruct'
,
'qwen2.5-1.5b-instruct'
];
var
ids
=
[];
if
(
p
.
modelName
)
ids
.
push
(
p
.
modelName
);
ids
=
ids
.
concat
(
extra
.
filter
(
function
(
id
)
{
return
ids
.
indexOf
(
id
)
<
0
;
}));
var
data
=
{
object
:
'list'
,
data
:
ids
.
map
(
function
(
id
,
i
)
{
return
{
id
:
id
,
object
:
'model'
,
created
:
1720000000
+
i
,
owned_by
:
'mock'
};
})
};
return
{
status
:
'pass'
,
httpStatus
:
200
,
latency
:
18
,
modelFound
:
!!
p
.
modelName
,
modelIds
:
ids
,
raw
:
JSON
.
stringify
(
data
,
null
,
2
),
error
:
''
,
testedAt
:
getMentorDeployNowTimestamp
(),
url
:
url
,
mock
:
true
};
}
function
buildMentorDeployMockChatResult
(
p
)
{
var
url
=
joinMentorDeployPath
(
getMentorDeployBaseUrl
(),
p
.
apiPath
||
'/v1/chat/completions'
);
var
content
=
'根据你的提问「'
+
(
p
.
prompt
||
'请用一句话介绍你自己。'
)
+
'」,模拟模型回答如下:
\
n
\
n'
+
'1. vLLM 通过 PagedAttention 与 Continuous Batching 大幅提升大模型的在线推理吞吐;
\
n'
+
'2. 部署时只需加载模型权重,并通过 OpenAI 兼容接口对外提供服务;
\
n'
+
'3. 本次请求已成功返回非空回答,说明你的文本模型服务已正常部署、可被导师验收。'
;
var
data
=
{
id
:
'chatcmpl-mock-0001'
,
object
:
'chat.completion'
,
model
:
p
.
modelName
||
'qwen2.5-7b-instruct'
,
choices
:
[{
index
:
0
,
message
:
{
role
:
'assistant'
,
content
:
content
},
finish_reason
:
'stop'
}],
usage
:
{
prompt_tokens
:
16
,
completion_tokens
:
92
,
total_tokens
:
108
}
};
return
{
status
:
'pass'
,
httpStatus
:
200
,
latency
:
86
,
responseText
:
content
,
returnedModel
:
data
.
model
,
raw
:
JSON
.
stringify
(
data
,
null
,
2
),
error
:
''
,
testedAt
:
getMentorDeployNowTimestamp
(),
url
:
url
,
mock
:
true
};
}
function
buildMentorDeployMockGenSubmitResult
(
p
)
{
var
url
=
getMentorDeployGenSubmitUrl
();
var
taskId
=
'gen-mock-'
+
Math
.
random
().
toString
(
36
).
slice
(
2
,
10
);
var
data
=
{
data
:
{
id
:
taskId
,
status
:
'running'
,
progress
:
5
,
outputs
:
[]
}
};
return
{
status
:
'pass'
,
httpStatus
:
200
,
latency
:
26
,
taskId
:
taskId
,
raw
:
JSON
.
stringify
(
data
,
null
,
2
),
error
:
''
,
testedAt
:
getMentorDeployNowTimestamp
(),
url
:
url
,
mock
:
true
};
}
function
buildMentorDeployMockGenStatusResult
(
prevTaskId
)
{
var
url
=
getMentorDeployBaseUrl
()
+
'/v1/generations/'
+
encodeURIComponent
(
prevTaskId
);
var
imgUrl
=
getMentorDeployMockImageUrl
();
var
outputs
=
[{
url
:
imgUrl
,
contentType
:
'image/png'
}];
var
data
=
{
data
:
{
id
:
prevTaskId
,
status
:
'succeeded'
,
progress
:
100
,
outputs
:
outputs
}
};
return
{
status
:
'pass'
,
httpStatus
:
200
,
latency
:
320
,
taskId
:
prevTaskId
,
taskStatus
:
'succeeded'
,
progress
:
100
,
outputs
:
outputs
,
raw
:
JSON
.
stringify
(
data
,
null
,
2
),
error
:
''
,
testedAt
:
getMentorDeployNowTimestamp
(),
url
:
url
,
mock
:
true
};
}
function
getMentorDeployBaseUrl
()
{
function
getMentorDeployBaseUrl
()
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
getMentorDeployTaskKey
(
sid
);
var
tk
=
getMentorDeployTaskKey
(
sid
);
...
@@ -1792,13 +1885,18 @@ function runMentorDeployModelsTest(taskKey) {
...
@@ -1792,13 +1885,18 @@ function runMentorDeployModelsTest(taskKey) {
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
taskKey
||
getMentorDeployTaskKey
(
sid
);
var
tk
=
taskKey
||
getMentorDeployTaskKey
(
sid
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
if
(
isMentorDeployMockEnabled
())
{
testsNode
[
sid
].
models
=
buildMentorDeployMockModelsResult
(
tk
,
p
);
if
(
currentPage
===
'mentor-deploy-review'
)
renderContent
();
return
;
}
var
base
=
getMentorDeployBaseUrl
();
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
if
(
!
base
)
{
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
return
;
return
;
}
}
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
var
url
=
base
+
'/v1/models'
;
var
url
=
base
+
'/v1/models'
;
var
startedAt
=
Date
.
now
();
var
startedAt
=
Date
.
now
();
testsNode
[
sid
].
models
=
{
status
:
'loading'
,
url
:
url
};
testsNode
[
sid
].
models
=
{
status
:
'loading'
,
url
:
url
};
...
@@ -1858,13 +1956,18 @@ function runMentorDeployChatTest() {
...
@@ -1858,13 +1956,18 @@ function runMentorDeployChatTest() {
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
'text-model'
;
var
tk
=
'text-model'
;
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
if
(
isMentorDeployMockEnabled
())
{
testsNode
[
sid
].
chat
=
buildMentorDeployMockChatResult
(
p
);
if
(
currentPage
===
'mentor-deploy-review'
)
renderContent
();
return
;
}
var
base
=
getMentorDeployBaseUrl
();
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
if
(
!
base
)
{
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
return
;
return
;
}
}
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
var
url
=
joinMentorDeployPath
(
base
,
p
.
apiPath
||
'/v1/chat/completions'
);
var
url
=
joinMentorDeployPath
(
base
,
p
.
apiPath
||
'/v1/chat/completions'
);
var
startedAt
=
Date
.
now
();
var
startedAt
=
Date
.
now
();
testsNode
[
sid
].
chat
=
{
status
:
'loading'
,
url
:
url
};
testsNode
[
sid
].
chat
=
{
status
:
'loading'
,
url
:
url
};
...
@@ -2037,13 +2140,21 @@ function runMentorDeployGenSubmitTest() {
...
@@ -2037,13 +2140,21 @@ function runMentorDeployGenSubmitTest() {
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
'image-gen'
;
var
tk
=
'image-gen'
;
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
if
(
isMentorDeployMockEnabled
())
{
testsNode
[
sid
].
genSubmit
=
buildMentorDeployMockGenSubmitResult
(
p
);
if
(
currentPage
===
'mentor-deploy-review'
)
{
runMentorDeployGenStatusTest
();
}
if
(
currentPage
===
'mentor-deploy-review'
)
renderContent
();
return
;
}
var
base
=
getMentorDeployBaseUrl
();
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
if
(
!
base
)
{
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
return
;
return
;
}
}
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
var
url
=
getMentorDeployGenSubmitUrl
();
var
url
=
getMentorDeployGenSubmitUrl
();
var
startedAt
=
Date
.
now
();
var
startedAt
=
Date
.
now
();
testsNode
[
sid
].
genSubmit
=
{
status
:
'loading'
,
url
:
url
};
testsNode
[
sid
].
genSubmit
=
{
status
:
'loading'
,
url
:
url
};
...
@@ -2116,11 +2227,6 @@ function runMentorDeployGenStatusTest() {
...
@@ -2116,11 +2227,6 @@ function runMentorDeployGenStatusTest() {
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
'image-gen'
;
var
tk
=
'image-gen'
;
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
return
;
}
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
var
testsNode
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
tk
);
var
prevTaskId
=
(
testsNode
[
sid
]
&&
testsNode
[
sid
].
genSubmit
&&
testsNode
[
sid
].
genSubmit
.
taskId
)
||
''
;
var
prevTaskId
=
(
testsNode
[
sid
]
&&
testsNode
[
sid
].
genSubmit
&&
testsNode
[
sid
].
genSubmit
.
taskId
)
||
''
;
if
(
!
prevTaskId
)
{
if
(
!
prevTaskId
)
{
...
@@ -2128,6 +2234,17 @@ function runMentorDeployGenStatusTest() {
...
@@ -2128,6 +2234,17 @@ function runMentorDeployGenStatusTest() {
return
;
return
;
}
}
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
if
(
!
testsNode
[
sid
])
testsNode
[
sid
]
=
{};
if
(
isMentorDeployMockEnabled
())
{
testsNode
[
sid
].
genStatus
=
buildMentorDeployMockGenStatusResult
(
prevTaskId
);
stopMentorDeployGenPolling
();
if
(
currentPage
===
'mentor-deploy-review'
)
renderContent
();
return
;
}
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
showStudentFlowModal
(
'缺少 API 地址'
,
'请在验收参数中填写 API 地址后再测试。'
);
return
;
}
var
url
=
base
+
'/v1/generations/'
+
encodeURIComponent
(
prevTaskId
);
var
url
=
base
+
'/v1/generations/'
+
encodeURIComponent
(
prevTaskId
);
var
startedAt
=
Date
.
now
();
var
startedAt
=
Date
.
now
();
testsNode
[
sid
].
genStatus
=
{
status
:
'loading'
,
url
:
url
,
taskId
:
prevTaskId
};
testsNode
[
sid
].
genStatus
=
{
status
:
'loading'
,
url
:
url
,
taskId
:
prevTaskId
};
...
@@ -2237,13 +2354,36 @@ function buildMentorDeployRequestUrlRow(url) {
...
@@ -2237,13 +2354,36 @@ function buildMentorDeployRequestUrlRow(url) {
}
}
function
buildMentorDeployTestResultBlock
(
result
,
opts
)
{
function
buildMentorDeployTestResultBlock
(
result
,
opts
)
{
if
(
!
result
||
result
.
status
===
'loading'
)
return
''
;
opts
=
opts
||
{};
opts
=
opts
||
{};
var
html
=
''
;
var
state
=
result
?
result
.
status
:
''
;
var
isPass
=
state
===
'pass'
;
var
isFail
=
state
===
'fail'
;
var
isLoading
=
state
===
'loading'
;
var
title
=
!
result
?
'等待测试结果'
:
(
isPass
?
'通过结果'
:
isFail
?
'不通过结果'
:
'测试中'
);
var
boxCls
=
!
result
?
'border-dashed border-[#D9D9D9] bg-[#FAFBFC]'
:
(
isPass
?
'border-emerald-200 bg-emerald-50/60'
:
isFail
?
'border-rose-200 bg-rose-50/60'
:
'border-amber-200 bg-amber-50/60'
);
var
badgeCls
=
!
result
?
'bg-[#F2F3F5] text-[#86909C]'
:
(
isPass
?
'bg-emerald-100 text-emerald-700'
:
isFail
?
'bg-rose-100 text-rose-700'
:
'bg-amber-100 text-amber-700'
);
var
badgeIcon
=
!
result
?
'minus'
:
(
isPass
?
'check-circle'
:
isFail
?
'x-circle'
:
'loader'
);
var
badgeText
=
!
result
?
'未测试'
:
(
isPass
?
'通过'
:
isFail
?
'失败'
:
'测试中'
);
var
html
=
'<div class="mt-3 rounded-lg border '
+
boxCls
+
' p-3">'
+
'<div class="flex items-center justify-between gap-2 mb-2">'
+
'<div class="flex items-center gap-2 min-w-0">'
+
'<span class="text-xs font-semibold text-[#1D2129]">返回结果</span>'
+
'<span class="inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded '
+
badgeCls
+
'"><svg class="w-3 h-3'
+
(
isLoading
?
' animate-spin'
:
''
)
+
'" data-lucide="'
+
badgeIcon
+
'"></svg>'
+
badgeText
+
'</span>'
+
'</div>'
+
(
result
&&
result
.
httpStatus
!=
null
?
'<span class="text-xs text-[#4E5969]">HTTP '
+
result
.
httpStatus
+
'</span>'
:
'<span class="text-xs text-[#86909C]">未发起请求</span>'
)
+
'</div>'
;
if
(
!
result
)
{
html
+=
'<div class="grid grid-cols-2 gap-2 text-xs text-[#86909C]">'
+
'<div class="rounded bg-white border border-[#E5E6EB] p-2">通过时会显示:HTTP 2xx + 绿色通过标签 + 原始 JSON 响应</div>'
+
'<div class="rounded bg-white border border-[#E5E6EB] p-2">不通过时会显示:HTTP 非 2xx / 任务失败 + 红色失败标签 + 错误原因</div>'
+
'</div>'
+
'<div class="mt-2 text-xs text-[#86909C]">点击下方「测试」后,这里会显示状态码、耗时、结论、错误信息与 JSON 原文。</div>'
+
'</div>'
;
return
html
;
}
if
(
opts
.
conclusion
)
{
if
(
opts
.
conclusion
)
{
var
ok
=
result
.
status
===
'pass'
;
html
+=
'<div class="flex items-start gap-1.5 text-xs font-medium mb-2 '
+
(
isPass
?
'text-emerald-600'
:
'text-rose-500'
)
+
'">'
+
html
+=
'<div class="flex items-start gap-1.5 text-xs font-medium mb-2 '
+
(
ok
?
'text-emerald-600'
:
'text-rose-500'
)
+
'">'
+
'<svg class="w-4 h-4 mt-0.5 flex-shrink-0" data-lucide="'
+
(
isPass
?
'check-circle'
:
'x-circle'
)
+
'"></svg>'
+
'<svg class="w-4 h-4 mt-0.5 flex-shrink-0" data-lucide="'
+
(
ok
?
'check-circle'
:
'x-circle'
)
+
'"></svg>'
+
'<span>'
+
mentorDeployReviewEsc
(
opts
.
conclusion
)
+
'</span>'
+
'<span>'
+
mentorDeployReviewEsc
(
opts
.
conclusion
)
+
'</span>'
+
'</div>'
;
'</div>'
;
}
}
...
@@ -2251,8 +2391,18 @@ function buildMentorDeployTestResultBlock(result, opts) {
...
@@ -2251,8 +2391,18 @@ function buildMentorDeployTestResultBlock(result, opts) {
if
(
opts
.
extra
)
html
+=
opts
.
extra
;
if
(
opts
.
extra
)
html
+=
opts
.
extra
;
html
+=
buildMentorDeployTestError
(
result
);
html
+=
buildMentorDeployTestError
(
result
);
if
(
result
.
raw
!=
null
)
{
if
(
result
.
raw
!=
null
)
{
html
+=
'<pre class="mt-2 bg-[#1D2129] text-emerald-300 rounded p-3 text-[10px] overflow-auto max-h-40 leading-relaxed">'
+
mentorDeployReviewEsc
(
result
.
raw
)
+
'</pre>'
;
html
+=
'<div class="mt-2 rounded bg-[#1D2129] border border-[#111827] overflow-hidden">'
+
'<div class="px-3 py-1.5 text-[11px] text-[#A3E635] border-b border-[#374151] flex items-center justify-between">'
+
'<span>原始响应 JSON</span>'
+
'<span class="text-[#9CA3AF]">'
+
(
isPass
?
'成功返回'
:
isFail
?
'失败返回'
:
'处理中'
)
+
'</span>'
+
'</div>'
+
'<pre class="p-3 text-[10px] text-emerald-300 overflow-auto max-h-44 leading-relaxed whitespace-pre-wrap break-words">'
+
mentorDeployReviewEsc
(
result
.
raw
)
+
'</pre>'
+
'</div>'
;
}
else
if
(
isFail
)
{
html
+=
'<div class="mt-2 rounded border border-rose-200 bg-white p-3 text-xs text-rose-600">本次请求未解析到有效 JSON,通常出现在网络失败、CORS 拦截或接口返回非 JSON 内容时。</div>'
+
'<div class="mt-2 rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-700">原型环境无法连接真实服务时,可开启「模拟返回数据」开关查看通过态效果。</div>'
;
}
}
html
+=
'</div>'
;
return
html
;
return
html
;
}
}
...
@@ -2297,17 +2447,15 @@ function buildMentorDeployParamsPanel(sid) {
...
@@ -2297,17 +2447,15 @@ function buildMentorDeployParamsPanel(sid) {
var
p
=
getMentorDeployReviewParams
(
sid
,
taskKey
);
var
p
=
getMentorDeployReviewParams
(
sid
,
taskKey
);
var
disabled
=
locked
?
' disabled'
:
''
;
var
disabled
=
locked
?
' disabled'
:
''
;
var
readonlyClass
=
locked
?
' bg-[#F7F8FA] text-[#86909C] cursor-not-allowed'
:
''
;
var
readonlyClass
=
locked
?
' bg-[#F7F8FA] text-[#86909C] cursor-not-allowed'
:
''
;
return
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4 mb-4">'
+
return
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4 mb-4
shadow-[0_1px_2px_rgba(0,0,0,0.03)]
">'
+
'<div class="flex items-center justify-between mb-2">'
+
'<div class="flex items-center justify-between mb-2">'
+
'<div class="flex items-center gap-2"><h3 class="font-semibold text-[#1D2129]">验收参数</h3><span class="px-1.5 py-0.5 rounded text-[11px] font-medium bg-[#E8F3FF] text-[#165DFF]">'
+
mentorDeployReviewEsc
(
taskDef
.
tabName
||
taskKey
)
+
'</span></div>'
+
'<div class="flex items-center gap-2"><h3 class="font-semibold text-[#1D2129]">验收参数</h3><span class="px-1.5 py-0.5 rounded text-[11px] font-medium bg-[#E8F3FF] text-[#165DFF]">'
+
mentorDeployReviewEsc
(
taskDef
.
tabName
||
taskKey
)
+
'</span></div>'
+
(
locked
?
'<span class="text-xs px-2 py-1 rounded bg-rose-100 text-rose-700">提交后只读</span>'
:
'<span class="text-xs px-2 py-1 rounded bg-[#E8F3FF] text-[#165DFF]">临时调整</span>'
)
+
(
locked
?
'<span class="text-xs px-2 py-1 rounded bg-rose-100 text-rose-700">提交后只读</span>'
:
'<span class="text-xs px-2 py-1 rounded bg-[#E8F3FF] text-[#165DFF]">临时调整</span>'
)
+
'</div>'
+
'</div>'
+
'<p class="text-xs text-[#86909C] mb-3">已带入学生提交值,以下调整仅用于本次验收,不会修改学生原始提交内容。API 地址与 Token 在「验收配置」中统一设置。</p>'
+
'<p class="text-xs text-[#86909C] mb-3">已带入学生提交值,以下调整仅用于本次验收,不会修改学生原始提交内容。API 地址与 Token 在「验收配置」中统一设置。</p>'
+
'<div class="space-y-2.5">'
+
'<div class="grid grid-cols-2 gap-2">'
+
'<div class="grid grid-cols-2 gap-2">'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">模型名称</label><input class="input-field text-sm font-mono'
+
readonlyClass
+
'" value="'
+
mentorDeployReviewEsc
(
p
.
modelName
)
+
'" placeholder="如 qwen3.5-4b"'
+
disabled
+
' oninput="setMentorDeployReviewParam(
\'
modelName
\'
, this.value)"></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">模型名称</label><input class="input-field text-sm font-mono'
+
readonlyClass
+
'" value="'
+
mentorDeployReviewEsc
(
p
.
modelName
)
+
'" placeholder="如 qwen3.5-4b"'
+
disabled
+
' oninput="setMentorDeployReviewParam(
\'
modelName
\'
, this.value)"></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">请求路径</label><input class="input-field text-sm font-mono'
+
readonlyClass
+
'" value="'
+
mentorDeployReviewEsc
(
p
.
apiPath
)
+
'" placeholder="'
+
mentorDeployReviewEsc
(
taskDef
.
mainPath
||
'/v1/chat/completions'
)
+
'"'
+
disabled
+
' oninput="setMentorDeployReviewParam(
\'
apiPath
\'
, this.value)"></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">请求路径</label><input class="input-field text-sm font-mono'
+
readonlyClass
+
'" value="'
+
mentorDeployReviewEsc
(
p
.
apiPath
)
+
'" placeholder="'
+
mentorDeployReviewEsc
(
taskDef
.
mainPath
||
'/v1/chat/completions'
)
+
'"'
+
disabled
+
' oninput="setMentorDeployReviewParam(
\'
apiPath
\'
, this.value)"></div>'
+
'</div>'
+
'</div>'
+
'</div>'
+
(
locked
?
''
:
'<button class="btn-outline w-full mt-3 py-2 text-sm" onclick="restoreMentorDeployReviewParams()">恢复学生提交值</button>'
)
+
(
locked
?
''
:
'<button class="btn-outline w-full mt-3 py-2 text-sm" onclick="restoreMentorDeployReviewParams()">恢复学生提交值</button>'
)
+
'</div>'
;
'</div>'
;
...
@@ -2320,7 +2468,7 @@ function buildMentorDeployGlobalConfig(sid) {
...
@@ -2320,7 +2468,7 @@ function buildMentorDeployGlobalConfig(sid) {
var
tempUrl
=
window
.
__mentorDeployTempApiUrl
!=
null
?
window
.
__mentorDeployTempApiUrl
:
studentUrl
;
var
tempUrl
=
window
.
__mentorDeployTempApiUrl
!=
null
?
window
.
__mentorDeployTempApiUrl
:
studentUrl
;
var
tempKey
=
window
.
__mentorDeployTempApiKey
!=
null
?
window
.
__mentorDeployTempApiKey
:
studentKey
;
var
tempKey
=
window
.
__mentorDeployTempApiKey
!=
null
?
window
.
__mentorDeployTempApiKey
:
studentKey
;
var
adjusted
=
window
.
__mentorDeployTempApiUrl
!=
null
||
window
.
__mentorDeployTempApiKey
!=
null
;
var
adjusted
=
window
.
__mentorDeployTempApiUrl
!=
null
||
window
.
__mentorDeployTempApiKey
!=
null
;
return
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4 mb-4">'
+
return
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4 mb-4
shadow-[0_1px_2px_rgba(0,0,0,0.03)]
">'
+
'<div class="flex items-center justify-between mb-2">'
+
'<div class="flex items-center justify-between mb-2">'
+
'<div class="flex items-center gap-2"><h3 class="font-semibold text-[#1D2129]">验收配置</h3><span class="text-xs px-2 py-1 rounded bg-[#E8F3FF] text-[#165DFF]">所有测试项共用</span></div>'
+
'<div class="flex items-center gap-2"><h3 class="font-semibold text-[#1D2129]">验收配置</h3><span class="text-xs px-2 py-1 rounded bg-[#E8F3FF] text-[#165DFF]">所有测试项共用</span></div>'
+
(
adjusted
?
'<span class="text-xs px-2 py-1 rounded bg-amber-100 text-amber-700">本次会话已调整</span>'
:
'<span class="text-xs px-2 py-1 rounded bg-emerald-100 text-emerald-700">已带入学生提交值</span>'
)
+
(
adjusted
?
'<span class="text-xs px-2 py-1 rounded bg-amber-100 text-amber-700">本次会话已调整</span>'
:
'<span class="text-xs px-2 py-1 rounded bg-emerald-100 text-emerald-700">已带入学生提交值</span>'
)
+
...
@@ -2330,9 +2478,20 @@ function buildMentorDeployGlobalConfig(sid) {
...
@@ -2330,9 +2478,20 @@ function buildMentorDeployGlobalConfig(sid) {
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">API 地址</label><input class="input-field text-sm font-mono" value="'
+
mentorDeployReviewEsc
(
tempUrl
)
+
'" placeholder="http://IP:端口" oninput="window.__mentorDeployTempApiUrl=this.value"></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">API 地址</label><input class="input-field text-sm font-mono" value="'
+
mentorDeployReviewEsc
(
tempUrl
)
+
'" placeholder="http://IP:端口" oninput="window.__mentorDeployTempApiUrl=this.value"></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">API Token</label><input class="input-field text-sm font-mono" type="password" value="'
+
mentorDeployReviewEsc
(
tempKey
)
+
'" placeholder="sk-..." oninput="window.__mentorDeployTempApiKey=this.value"></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">API Token</label><input class="input-field text-sm font-mono" type="password" value="'
+
mentorDeployReviewEsc
(
tempKey
)
+
'" placeholder="sk-..." oninput="window.__mentorDeployTempApiKey=this.value"></div>'
+
'</div>'
+
'</div>'
+
'<div class="flex gap-2 mt-3">'
+
'<div class="grid grid-cols-2 gap-2 mt-3">'
+
'<button class="btn-primary flex-1 py-2 text-sm" onclick="applyMentorDeployTempConfig()">应用</button>'
+
'<button class="btn-primary py-2 text-sm" onclick="applyMentorDeployTempConfig()">应用</button>'
+
'<button class="btn-outline flex-1 py-2 text-sm" onclick="resetMentorDeployTempConfig()">恢复学生值</button>'
+
'<button class="btn-outline py-2 text-sm" onclick="resetMentorDeployTempConfig()">恢复学生值</button>'
+
'</div>'
+
'<div class="mt-3 pt-3 border-t border-[#F2F3F5]">'
+
'<div class="flex items-center justify-between gap-2">'
+
'<div class="min-w-0">'
+
'<div class="flex items-center gap-1.5"><svg class="w-3.5 h-3.5 text-[#86909C]" data-lucide="flask-conical"></svg><span class="text-xs font-medium text-[#1D2129]">模拟返回数据</span></div>'
+
'<div class="text-[11px] text-[#86909C] mt-0.5">演示模式:点击测试直接返回模拟「通过」结果</div>'
+
'</div>'
+
'<button type="button" onclick="toggleMentorDeployMock()" class="relative w-10 h-5.5 rounded-full transition-all flex-shrink-0 '
+
(
isMentorDeployMockEnabled
()
?
'bg-[#165DFF]'
:
'bg-[#C9CDD4]'
)
+
'" style="height:22px">'
+
'<span class="absolute top-1 left-1 w-3.5 h-3.5 rounded-full bg-white shadow transition-all '
+
(
isMentorDeployMockEnabled
()
?
'translate-x-5'
:
''
)
+
'"></span>'
+
'</button>'
+
'</div>'
+
'</div>'
+
'</div>'
+
'</div>'
;
'</div>'
;
}
}
...
@@ -3145,6 +3304,15 @@ pageRenderers["mentor-deploy-acceptance"] = function() {
...
@@ -3145,6 +3304,15 @@ pageRenderers["mentor-deploy-acceptance"] = function() {
var
statusClass
=
getMentorDeployStatusBadge
(
status
);
var
statusClass
=
getMentorDeployStatusBadge
(
status
);
var
itemsHtml
=
taskKey
===
'image-gen'
?
buildMentorDeployImageGenItems
(
sid
)
:
buildMentorDeployTextModelItems
(
sid
);
var
itemsHtml
=
taskKey
===
'image-gen'
?
buildMentorDeployImageGenItems
(
sid
)
:
buildMentorDeployTextModelItems
(
sid
);
return
'<div class="max-w-[1400px] mx-auto">'
+
return
'<div class="max-w-[1400px] mx-auto">'
+
'<div class="rounded-xl border border-[#E5E5E5] bg-white px-5 py-4 mb-5 shadow-[0_1px_2px_rgba(0,0,0,0.04)]">'
+
'<div class="flex items-center justify-between gap-4">'
+
'<div class="flex items-center gap-3 min-w-0">'
+
'<div class="w-9 h-9 rounded-lg bg-[#10A37F] text-white flex items-center justify-center flex-shrink-0"><svg class="w-5 h-5" data-lucide="terminal"></svg></div>'
+
'<div class="min-w-0"><div class="font-semibold text-[#1D2129]">API 验收工作台</div><div class="text-xs text-[#86909C] mt-0.5">面向导师的模型服务连通性与返回结果验证</div></div>'
+
'</div>'
+
'<span class="text-xs text-[#86909C] flex-shrink-0">'
+
mentorDeployReviewEsc
(
selected
.
name
)
+
' · '
+
mentorDeployReviewEsc
(
taskKey
===
'image-gen'
?
'图像生成 API'
:
'文本模型 API'
)
+
'</span>'
+
'</div>'
+
'</div>'
+
'<div class="flex items-center justify-between gap-4 mb-6">'
+
'<div class="flex items-center justify-between gap-4 mb-6">'
+
'<div class="flex items-center gap-3 min-w-0">'
+
'<div class="flex items-center gap-3 min-w-0">'
+
'<button type="button" class="btn-outline px-3 py-2 text-sm flex-shrink-0" onclick="switchPage(
\'
mentor-deploy-review
\'
)"><span class="inline-flex items-center gap-1"><svg class="w-4 h-4" data-lucide="arrow-left"></svg>返回部署验收</span></button>'
+
'<button type="button" class="btn-outline px-3 py-2 text-sm flex-shrink-0" onclick="switchPage(
\'
mentor-deploy-review
\'
)"><span class="inline-flex items-center gap-1"><svg class="w-4 h-4" data-lucide="arrow-left"></svg>返回部署验收</span></button>'
+
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论