Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
studyweb_Prototype
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
yujiejie
studyweb_Prototype
Commits
7946cab5
提交
7946cab5
authored
8月 23, 2026
作者:
yujiejie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
821步骤八完成
上级
c411495d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
55 行增加
和
8 行删除
+55
-8
pages-mentor.js
pages-mentor.js
+55
-8
没有找到文件。
pages-mentor.js
浏览文件 @
7946cab5
...
...
@@ -1469,6 +1469,9 @@ function issueMentorAutodl() {
function
selectMentorDeployReviewStudent
(
id
)
{
mentorState
.
deployReviewStudentId
=
Number
(
id
);
// 切换学生时重置全局配置临时变量,避免上一学生输入残留
window
.
__mentorDeployTempApiUrl
=
null
;
window
.
__mentorDeployTempApiKey
=
null
;
renderContent
();
}
...
...
@@ -1776,9 +1779,12 @@ function getMentorDeployReviewParams(studentId, taskKey) {
var
a
=
(
sub
&&
sub
.
artifact
)
||
{};
var
saved
=
getMentorDeployReviewNode
(
'params'
,
sid
,
tk
)[
sid
]
||
{};
var
def
=
MENTOR_DEPLOY_TASKS
[
tk
]
||
{};
// 全局配置区临时变量优先于已应用状态与学生提交值
var
tempUrl
=
window
.
__mentorDeployTempApiUrl
;
var
tempKey
=
window
.
__mentorDeployTempApiKey
;
return
{
apiUrl
:
saved
.
apiUrl
!=
null
?
saved
.
apiUrl
:
(
a
.
apiUrl
||
''
),
apiKey
:
saved
.
apiKey
!=
null
?
saved
.
apiKey
:
(
a
.
apiKey
||
''
),
apiUrl
:
tempUrl
!=
null
?
tempUrl
:
(
saved
.
apiUrl
!=
null
?
saved
.
apiUrl
:
(
a
.
apiUrl
||
''
)
),
apiKey
:
tempKey
!=
null
?
tempKey
:
(
saved
.
apiKey
!=
null
?
saved
.
apiKey
:
(
a
.
apiKey
||
''
)
),
modelName
:
saved
.
modelName
!=
null
?
saved
.
modelName
:
(
a
.
modelName
||
''
),
apiPath
:
saved
.
apiPath
!=
null
?
saved
.
apiPath
:
(
a
.
apiPath
||
def
.
mainPath
||
'/v1/chat/completions'
),
prompt
:
saved
.
prompt
!=
null
?
saved
.
prompt
:
(
def
.
defaultPrompt
||
'请用一句话介绍你自己。'
),
...
...
@@ -2217,8 +2223,6 @@ function buildMentorDeployParamsPanel(sid) {
'<div class="flex items-center justify-between mb-2"><h3 class="font-semibold text-[#1D2129]">验收参数</h3>'
+
(
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>'
+
'<p class="text-xs text-[#86909C] mb-3">已带入学生提交值,以下调整仅用于本次验收,不会修改学生原始提交内容。</p>'
+
'<div class="space-y-2.5">'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">API 地址</label><input class="input-field text-sm font-mono'
+
readonlyClass
+
'" value="'
+
mentorDeployReviewEsc
(
p
.
apiUrl
)
+
'" placeholder="http://IP:端口"'
+
disabled
+
'></div>'
+
'<div><label class="text-xs font-medium text-[#4E5969] block mb-1">API Key</label>'
+
buildMentorDeployApiKeyCell
(
p
.
apiKey
)
+
'</div>'
+
'<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
)
+
'"'
+
disabled
+
'></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
)
+
'"'
+
disabled
+
'></div>'
+
...
...
@@ -2228,6 +2232,45 @@ function buildMentorDeployParamsPanel(sid) {
'</div>'
;
}
function
buildMentorDeployGlobalConfig
(
sid
)
{
var
p
=
getMentorDeployReviewParams
(
sid
);
var
tempUrl
=
window
.
__mentorDeployTempApiUrl
!=
null
?
window
.
__mentorDeployTempApiUrl
:
p
.
apiUrl
;
var
tempKey
=
window
.
__mentorDeployTempApiKey
!=
null
?
window
.
__mentorDeployTempApiKey
:
p
.
apiKey
;
return
'<div class="bg-white rounded-lg border border-[#E5E6EB] p-4 mb-4">'
+
'<div class="flex items-center justify-between mb-2"><h3 class="font-semibold text-[#1D2129]">全局配置</h3><span class="text-xs px-2 py-1 rounded bg-[#E8F3FF] text-[#165DFF]">所有测试项共用</span></div>'
+
'<p class="text-xs text-[#86909C] mb-3">API 地址与 Key 全局生效,默认带入学生提交值,可修改后点击「应用」。</p>'
+
'<div class="space-y-2.5">'
+
'<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 Key</label><input class="input-field text-sm font-mono" type="password" value="'
+
mentorDeployReviewEsc
(
tempKey
)
+
'" placeholder="sk-..." oninput="window.__mentorDeployTempApiKey=this.value"></div>'
+
'</div>'
+
'<div class="flex gap-2 mt-3">'
+
'<button class="btn-primary flex-1 py-2 text-sm" onclick="applyMentorDeployTempConfig()">应用</button>'
+
'<button class="btn-outline flex-1 py-2 text-sm" onclick="resetMentorDeployTempConfig()">恢复学生值</button>'
+
'</div>'
+
'</div>'
;
}
function
applyMentorDeployTempConfig
()
{
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
map
=
getMentorDeployReviewNode
(
'params'
,
sid
);
if
(
!
map
[
sid
])
map
[
sid
]
=
{};
map
[
sid
].
apiUrl
=
String
(
window
.
__mentorDeployTempApiUrl
==
null
?
''
:
window
.
__mentorDeployTempApiUrl
).
trim
();
map
[
sid
].
apiKey
=
String
(
window
.
__mentorDeployTempApiKey
==
null
?
''
:
window
.
__mentorDeployTempApiKey
).
trim
();
renderContent
();
}
function
resetMentorDeployTempConfig
()
{
window
.
__mentorDeployTempApiUrl
=
null
;
window
.
__mentorDeployTempApiKey
=
null
;
var
sid
=
Number
(
mentorState
.
deployReviewStudentId
);
var
map
=
getMentorDeployReviewNode
(
'params'
,
sid
);
if
(
map
[
sid
])
{
delete
map
[
sid
].
apiUrl
;
delete
map
[
sid
].
apiKey
;
}
renderContent
();
}
function
buildMentorDeployTextModelItems
(
sid
)
{
var
p
=
getMentorDeployReviewParams
(
sid
);
var
tests
=
getMentorDeployReviewNode
(
'tests'
,
sid
)[
sid
]
||
{};
...
...
@@ -2604,10 +2647,11 @@ function buildMentorDeployReviewPanel(student) {
var
locked
=
isMentorDeployReviewLocked
(
sid
);
var
leftHtml
=
buildMentorDeployReviewHistoryHtml
(
sid
)
+
buildMentorDeployParamsPanel
(
sid
)
+
itemsHtml
;
var
rightHtml
=
locked
?
buildMentorDeployLockedReviewPanel
(
sid
)
:
buildMentorDeployScoreCard
(
sid
)
+
buildMentorDeployConclusionPanel
(
sid
);
return
'<div class="grid grid-cols-12 gap-4 items-start">'
+
'<div class="col-span-7 min-w-0">'
+
leftHtml
+
'</div>'
+
'<div class="col-span-5 min-w-0">'
+
rightHtml
+
'</div>'
+
'</div>'
;
return
buildMentorDeployGlobalConfig
(
sid
)
+
'<div class="grid grid-cols-12 gap-4 items-start">'
+
'<div class="col-span-7 min-w-0">'
+
leftHtml
+
'</div>'
+
'<div class="col-span-5 min-w-0">'
+
rightHtml
+
'</div>'
+
'</div>'
;
}
function
getMentorDeployMissingApiTests
(
sid
)
{
...
...
@@ -2772,6 +2816,9 @@ function switchMentorDeployTask(taskKey) {
if
(
typeof
stopMentorDeployGenPolling
===
'function'
)
stopMentorDeployGenPolling
();
mentorDeployReviewState
.
activeTask
=
taskKey
;
mentorDeployReviewState
.
contentTab
=
'artifact'
;
// 切换任务时重置全局配置临时变量
window
.
__mentorDeployTempApiUrl
=
null
;
window
.
__mentorDeployTempApiKey
=
null
;
renderContent
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论