Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
studyweb_Prototype
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
yujiejie
studyweb_Prototype
Commits
807688ef
提交
807688ef
authored
8月 23, 2026
作者:
yujiejie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
821步骤十完成
上级
664f16f3
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
31 行增加
和
13 行删除
+31
-13
pages-mentor.js
pages-mentor.js
+31
-13
没有找到文件。
pages-mentor.js
浏览文件 @
807688ef
...
@@ -1851,9 +1851,9 @@ function getMentorDeployRequestHeaders() {
...
@@ -1851,9 +1851,9 @@ function getMentorDeployRequestHeaders() {
return
headers
;
return
headers
;
}
}
function
runMentorDeployModelsTest
()
{
function
runMentorDeployModelsTest
(
taskKey
)
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
'text-model'
;
var
tk
=
taskKey
||
getMentorDeployTaskKey
(
sid
)
;
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
base
=
getMentorDeployBaseUrl
();
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
if
(
!
base
)
{
...
@@ -1919,7 +1919,7 @@ function runMentorDeployModelsTest() {
...
@@ -1919,7 +1919,7 @@ function runMentorDeployModelsTest() {
function
runMentorDeployChatTest
()
{
function
runMentorDeployChatTest
()
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
getMentorDeployTaskKey
(
sid
)
;
var
tk
=
'text-model'
;
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
base
=
getMentorDeployBaseUrl
();
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
if
(
!
base
)
{
...
@@ -2025,7 +2025,7 @@ function mentorDeployPickTaskInfo(data) {
...
@@ -2025,7 +2025,7 @@ function mentorDeployPickTaskInfo(data) {
function
runMentorDeployGenSubmitTest
()
{
function
runMentorDeployGenSubmitTest
()
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
getMentorDeployTaskKey
(
sid
)
;
var
tk
=
'image-gen'
;
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
base
=
getMentorDeployBaseUrl
();
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
if
(
!
base
)
{
...
@@ -2098,7 +2098,7 @@ function runMentorDeployGenSubmitTest() {
...
@@ -2098,7 +2098,7 @@ function runMentorDeployGenSubmitTest() {
function
runMentorDeployGenStatusTest
()
{
function
runMentorDeployGenStatusTest
()
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
tk
=
getMentorDeployTaskKey
(
sid
)
;
var
tk
=
'image-gen'
;
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
p
=
getMentorDeployReviewParams
(
sid
,
tk
);
var
base
=
getMentorDeployBaseUrl
();
var
base
=
getMentorDeployBaseUrl
();
if
(
!
base
)
{
if
(
!
base
)
{
...
@@ -2321,7 +2321,7 @@ function buildMentorDeployTextModelItems(sid) {
...
@@ -2321,7 +2321,7 @@ function buildMentorDeployTextModelItems(sid) {
:
''
)
+
:
''
)
+
buildMentorDeployTestError
(
modelsResult
)
+
buildMentorDeployTestError
(
modelsResult
)
+
(
modelsResult
&&
modelsResult
.
raw
!=
null
?
'<pre class="mt-2 bg-[#1D2129] text-emerald-300 rounded p-3 text-[10px] overflow-auto max-h-32 leading-relaxed">'
+
mentorDeployReviewEsc
(
modelsResult
.
raw
)
+
'</pre>'
:
''
)
+
(
modelsResult
&&
modelsResult
.
raw
!=
null
?
'<pre class="mt-2 bg-[#1D2129] text-emerald-300 rounded p-3 text-[10px] overflow-auto max-h-32 leading-relaxed">'
+
mentorDeployReviewEsc
(
modelsResult
.
raw
)
+
'</pre>'
:
''
)
+
'<button class="btn-outline w-full mt-3 py-2 text-sm" onclick="runMentorDeployModelsTest()"'
+
(
modelsLoading
?
' disabled'
:
''
)
+
'>'
+
(
modelsLoading
?
'测试中…'
:
'测试'
)
+
'</button>'
+
'<button class="btn-outline w-full mt-3 py-2 text-sm" onclick="runMentorDeployModelsTest(
\'
text-model
\'
)"'
+
(
modelsLoading
?
' disabled'
:
''
)
+
'>'
+
(
modelsLoading
?
'测试中…'
:
'测试'
)
+
'</button>'
+
'</div>'
+
'</div>'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA]">'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA]">'
+
buildMentorDeployTestItemHeader
(
'POST'
,
taskDef
.
mainPath
||
'/v1/chat/completions'
,
'聊天补全'
,
chatResult
)
+
buildMentorDeployTestItemHeader
(
'POST'
,
taskDef
.
mainPath
||
'/v1/chat/completions'
,
'聊天补全'
,
chatResult
)
+
...
@@ -2353,9 +2353,21 @@ function getMentorDeploySizeOptions(current) {
...
@@ -2353,9 +2353,21 @@ function getMentorDeploySizeOptions(current) {
}).
join
(
''
);
}).
join
(
''
);
}
}
function
resetMentorDeployImageGenParams
()
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
map
=
getMentorDeployReviewNode
(
'params'
,
sid
,
'image-gen'
);
if
(
!
map
[
sid
])
map
[
sid
]
=
{};
delete
map
[
sid
].
imagePrompt
;
delete
map
[
sid
].
size
;
delete
map
[
sid
].
seed
;
renderContent
();
}
function
buildMentorDeployImageGenItems
(
sid
)
{
function
buildMentorDeployImageGenItems
(
sid
)
{
var
p
=
getMentorDeployReviewParams
(
sid
);
var
taskKey
=
'image-gen'
;
var
tests
=
getMentorDeployReviewNode
(
'tests'
,
sid
)[
sid
]
||
{};
var
taskDef
=
MENTOR_DEPLOY_TASKS
[
taskKey
]
||
{};
var
p
=
getMentorDeployReviewParams
(
sid
,
taskKey
);
var
tests
=
getMentorDeployReviewNode
(
'tests'
,
sid
,
taskKey
)[
sid
]
||
{};
var
modelsResult
=
tests
.
models
||
null
;
var
modelsResult
=
tests
.
models
||
null
;
var
genResult
=
tests
.
genSubmit
||
null
;
var
genResult
=
tests
.
genSubmit
||
null
;
var
statusResult
=
tests
.
genStatus
||
null
;
var
statusResult
=
tests
.
genStatus
||
null
;
...
@@ -2363,29 +2375,35 @@ function buildMentorDeployImageGenItems(sid) {
...
@@ -2363,29 +2375,35 @@ function buildMentorDeployImageGenItems(sid) {
var
genLoading
=
!!
(
genResult
&&
genResult
.
status
===
'loading'
);
var
genLoading
=
!!
(
genResult
&&
genResult
.
status
===
'loading'
);
var
statusLoading
=
!!
(
statusResult
&&
statusResult
.
status
===
'loading'
);
var
statusLoading
=
!!
(
statusResult
&&
statusResult
.
status
===
'loading'
);
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">'
+
buildMentorDeployTaskIntro
(
taskKey
)
+
'<div class="flex items-center justify-between mb-3"><h3 class="font-semibold text-[#1D2129]">图像生成验收项</h3><span class="text-xs px-2 py-1 rounded bg-[#F2F3F5] text-[#86909C]">'
+
buildMentorDeployTestSummary
(
tests
,
[
'models'
,
'genSubmit'
,
'genStatus'
])
+
'</span></div>'
+
'<div class="flex items-center justify-between mb-3"><h3 class="font-semibold text-[#1D2129]">图像生成验收项</h3><span class="text-xs px-2 py-1 rounded bg-[#F2F3F5] text-[#86909C]">'
+
buildMentorDeployTestSummary
(
tests
,
[
'models'
,
'genSubmit'
,
'genStatus'
])
+
'</span></div>'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA] mb-3">'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA] mb-3">'
+
buildMentorDeployTestItemHeader
(
'GET'
,
'/v1/models'
,
'图像模型列表'
,
modelsResult
)
+
buildMentorDeployTestItemHeader
(
'GET'
,
taskDef
.
modelsPath
||
'/v1/models'
,
'图像模型列表'
,
modelsResult
)
+
'<div class="mt-2 text-xs font-mono text-[#4E5969] bg-white border border-[#E5E6EB] rounded p-2 break-all">'
+
mentorDeployReviewEsc
(
getMentorDeployModelsUrl
())
+
'</div>'
+
'<div class="mt-2 text-xs font-mono text-[#4E5969] bg-white border border-[#E5E6EB] rounded p-2 break-all">'
+
mentorDeployReviewEsc
(
getMentorDeployModelsUrl
())
+
'</div>'
+
buildMentorDeployTestMeta
(
modelsResult
)
+
buildMentorDeployTestMeta
(
modelsResult
)
+
buildMentorDeployTestError
(
modelsResult
)
+
buildMentorDeployTestError
(
modelsResult
)
+
'<button class="btn-outline w-full mt-3 py-2 text-sm" onclick="runMentorDeployModelsTest()" '
+
(
modelsLoading
?
' disabled'
:
''
)
+
'>'
+
(
modelsLoading
?
'测试中…'
:
'测试'
)
+
'</button>'
+
'<button class="btn-outline w-full mt-3 py-2 text-sm" onclick="runMentorDeployModelsTest(
\'
image-gen
\'
)" '
+
(
modelsLoading
?
' disabled'
:
''
)
+
'>'
+
(
modelsLoading
?
'测试中…'
:
'测试'
)
+
'</button>'
+
'</div>'
+
'</div>'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA] mb-3">'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA] mb-3">'
+
buildMentorDeployTestItemHeader
(
'POST'
,
'/v1/generations'
,
'提交生成任务'
,
genResult
)
+
buildMentorDeployTestItemHeader
(
'POST'
,
taskDef
.
mainPath
||
'/v1/generations'
,
'提交生成任务'
,
genResult
)
+
'<div class="mt-2 text-xs font-mono text-[#4E5969] bg-white border border-[#E5E6EB] rounded p-2 break-all">'
+
mentorDeployReviewEsc
(
getMentorDeployGenSubmitUrl
())
+
'</div>'
+
'<div class="mt-2 text-xs font-mono text-[#4E5969] bg-white border border-[#E5E6EB] rounded p-2 break-all">'
+
mentorDeployReviewEsc
(
getMentorDeployGenSubmitUrl
())
+
'</div>'
+
'<div class="mt-2"><label class="text-xs font-medium text-[#4E5969] block mb-1">生成描述</label><textarea class="input-field text-sm min-h-[64px] resize-none" oninput="setMentorDeployReviewParam(
\'
imagePrompt
\'
, this.value)">'
+
mentorDeployReviewEsc
(
p
.
imagePrompt
)
+
'</textarea></div>'
+
'<div class="mt-2 flex items-center justify-between gap-2">'
+
'<label class="text-xs font-medium text-[#4E5969] block">生成描述</label>'
+
'<button class="text-xs px-2 py-1 rounded bg-[#F2F3F5] text-[#4E5969] hover:bg-[#E8F3FF] hover:text-[#165DFF]" type="button" onclick="resetMentorDeployImageGenParams()">恢复任务默认值</button>'
+
'</div>'
+
'<textarea class="input-field text-sm min-h-[64px] resize-none mt-1" oninput="setMentorDeployReviewParam(
\'
imagePrompt
\'
, this.value)">'
+
mentorDeployReviewEsc
(
p
.
imagePrompt
)
+
'</textarea>'
+
'<div class="grid grid-cols-2 gap-2 mt-2">'
+
'<div class="grid grid-cols-2 gap-2 mt-2">'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">图片尺寸</label><select class="input-field text-sm" onchange="setMentorDeployReviewParam(
\'
size
\'
, this.value)">'
+
getMentorDeploySizeOptions
(
p
.
size
)
+
'</select></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">图片尺寸</label><select class="input-field text-sm" onchange="setMentorDeployReviewParam(
\'
size
\'
, this.value)">'
+
getMentorDeploySizeOptions
(
p
.
size
)
+
'</select></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">随机种子</label><input class="input-field text-sm" placeholder="可选" value="'
+
mentorDeployReviewEsc
(
p
.
seed
)
+
'" oninput="setMentorDeployReviewParam(
\'
seed
\'
, this.value)"></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">随机种子</label><input class="input-field text-sm" placeholder="可选" value="'
+
mentorDeployReviewEsc
(
p
.
seed
)
+
'" oninput="setMentorDeployReviewParam(
\'
seed
\'
, this.value)"></div>'
+
'</div>'
+
'</div>'
+
'<div class="mt-2 text-xs text-[#86909C]">默认值:描述「'
+
mentorDeployReviewEsc
(
taskDef
.
defaultImagePrompt
||
''
)
+
'」,尺寸 '
+
mentorDeployReviewEsc
(
taskDef
.
defaultSize
||
''
)
+
'</div>'
+
buildMentorDeployTestMeta
(
genResult
)
+
buildMentorDeployTestMeta
(
genResult
)
+
(
genResult
&&
genResult
.
taskId
?
'<div class="mt-1.5 text-xs text-[#4E5969]">任务 ID:<b class="font-mono">'
+
mentorDeployReviewEsc
(
genResult
.
taskId
)
+
'</b></div>'
:
''
)
+
(
genResult
&&
genResult
.
taskId
?
'<div class="mt-1.5 text-xs text-[#4E5969]">任务 ID:<b class="font-mono">'
+
mentorDeployReviewEsc
(
genResult
.
taskId
)
+
'</b></div>'
:
''
)
+
buildMentorDeployTestError
(
genResult
)
+
buildMentorDeployTestError
(
genResult
)
+
'<button class="btn-primary w-full mt-3 py-2 text-sm" onclick="runMentorDeployGenSubmitTest()" '
+
(
genLoading
?
' disabled'
:
''
)
+
'>'
+
(
genLoading
?
'提交中…'
:
'提交生成任务'
)
+
'</button>'
+
'<button class="btn-primary w-full mt-3 py-2 text-sm" onclick="runMentorDeployGenSubmitTest()" '
+
(
genLoading
?
' disabled'
:
''
)
+
'>'
+
(
genLoading
?
'提交中…'
:
'提交生成任务'
)
+
'</button>'
+
'</div>'
+
'</div>'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA]">'
+
'<div class="p-3 rounded-lg bg-[#F7F8FA]">'
+
buildMentorDeployTestItemHeader
(
'GET'
,
'/v1/generations/{id}'
,
'查询生成任务'
,
statusResult
)
+
buildMentorDeployTestItemHeader
(
'GET'
,
taskDef
.
statusPath
||
'/v1/generations/{id}'
,
'查询生成任务'
,
statusResult
)
+
'<div class="mt-2 text-xs font-mono text-[#4E5969] bg-white border border-[#E5E6EB] rounded p-2 break-all">'
+
mentorDeployReviewEsc
(
getMentorDeployGenStatusUrl
())
+
'</div>'
+
'<div class="mt-2 text-xs font-mono text-[#4E5969] bg-white border border-[#E5E6EB] rounded p-2 break-all">'
+
mentorDeployReviewEsc
(
getMentorDeployGenStatusUrl
())
+
'</div>'
+
buildMentorDeployTestMeta
(
statusResult
)
+
buildMentorDeployTestMeta
(
statusResult
)
+
(
statusResult
&&
statusResult
.
taskStatus
(
statusResult
&&
statusResult
.
taskStatus
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论