Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
studyweb_Prototype
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
yujiejie
studyweb_Prototype
Commits
595f4b11
提交
595f4b11
authored
8月 20, 2026
作者:
yujiejie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
导师端第一次修改
上级
7a5bd910
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
1819 行增加
和
1 行删除
+1819
-1
Acceptance.html
Acceptance.html
+1093
-0
0820导师端部署验收台与学生验收结果设计方案.md
docs/0820导师端部署验收台与学生验收结果设计方案.md
+712
-0
pages-mentor.js
pages-mentor.js
+14
-1
没有找到文件。
Acceptance.html
0 → 100644
浏览文件 @
595f4b11
<!DOCTYPE html>
<html
lang=
"zh-CN"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
AutoDL 模型部署验证
</title>
<link
rel=
"preconnect"
href=
"https://fonts.googleapis.com"
>
<link
rel=
"preconnect"
href=
"https://fonts.gstatic.com"
crossorigin
>
<link
href=
"https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600&display=swap"
rel=
"stylesheet"
>
<style>
*
{
box-sizing
:
border-box
;
margin
:
0
;
padding
:
0
;
}
:root
{
--bg
:
#ffffff
;
--bg-secondary
:
#f7f7f8
;
--bg-tertiary
:
#ececf1
;
--border
:
#d1d5db
;
--border-light
:
#e5e5e5
;
--text
:
#1a1a1a
;
--text-secondary
:
#666666
;
--text-muted
:
#999999
;
--accent
:
#10a37f
;
--accent-hover
:
#0d8a68
;
--accent-light
:
rgba
(
16
,
163
,
127
,
0.1
);
--error
:
#ef4444
;
--warning
:
#f59e0b
;
}
html
,
body
{
height
:
100%
;
font-family
:
'Noto Sans SC'
,
-apple-system
,
BlinkMacSystemFont
,
'Segoe UI'
,
sans-serif
;
background
:
var
(
--bg
);
color
:
var
(
--text
);
line-height
:
1.5
;
}
/* Layout */
.app
{
display
:
flex
;
flex-direction
:
column
;
height
:
100vh
;
}
/* Header */
.header
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
12px
24px
;
border-bottom
:
1px
solid
var
(
--border-light
);
background
:
var
(
--bg
);
}
.logo
{
display
:
flex
;
align-items
:
center
;
gap
:
12px
;
font-weight
:
600
;
font-size
:
18px
;
}
.logo-icon
{
width
:
36px
;
height
:
36px
;
background
:
var
(
--accent
);
border-radius
:
8px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
white
;
font-size
:
20px
;
}
/* Tab Bar */
.tab-bar
{
display
:
flex
;
gap
:
4px
;
padding
:
4px
;
background
:
var
(
--bg-secondary
);
border-radius
:
8px
;
}
.tab
{
padding
:
10px
20px
;
border-radius
:
6px
;
font-size
:
14px
;
font-weight
:
500
;
cursor
:
pointer
;
border
:
none
;
background
:
transparent
;
color
:
var
(
--text-secondary
);
transition
:
all
0.2s
;
}
.tab
:hover
{
background
:
var
(
--bg-tertiary
);
}
.tab.active
{
background
:
var
(
--bg
);
color
:
var
(
--text
);
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
);
}
}
.tab
{
padding
:
10px
20px
;
border-radius
:
6px
;
font-size
:
14px
;
font-weight
:
500
;
cursor
:
pointer
;
border
:
none
;
background
:
transparent
;
color
:
var
(
--text-secondary
);
transition
:
all
0.2s
;
}
.tab
:hover
{
background
:
var
(
--bg-tertiary
);
}
.tab.active
{
background
:
var
(
--bg
);
color
:
var
(
--text
);
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
);
}
/* Main */
.main
{
flex
:
1
;
display
:
flex
;
overflow
:
hidden
;
}
/* Sidebar */
.sidebar
{
width
:
280px
;
border-right
:
1px
solid
var
(
--border-light
);
padding
:
16px
;
overflow-y
:
auto
;
background
:
var
(
--bg-secondary
);
}
.sidebar-section
{
margin-bottom
:
20px
;
}
.sidebar-title
{
font-size
:
12px
;
font-weight
:
600
;
color
:
var
(
--text-muted
);
text-transform
:
uppercase
;
letter-spacing
:
0.5px
;
margin-bottom
:
12px
;
}
/* Form */
.form-group
{
margin-bottom
:
16px
;
}
.form-label
{
display
:
block
;
font-size
:
14px
;
font-weight
:
500
;
color
:
var
(
--text
);
margin-bottom
:
6px
;
}
.form-label
.required
{
color
:
var
(
--error
);
margin-right
:
4px
;
}
input
,
select
,
textarea
{
width
:
100%
;
padding
:
10px
12px
;
border
:
1px
solid
var
(
--border
);
border-radius
:
6px
;
font-size
:
14px
;
font-family
:
inherit
;
background
:
var
(
--bg
);
color
:
var
(
--text
);
transition
:
border-color
0.2s
;
}
input
:focus
,
textarea
:focus
,
select
:focus
{
outline
:
none
;
border-color
:
var
(
--accent
);
}
textarea
{
resize
:
vertical
;
min-height
:
80px
;
}
.form-hint
{
font-size
:
12px
;
color
:
var
(
--text-muted
);
margin-top
:
4px
;
}
.form-warning
{
font-size
:
12px
;
color
:
var
(
--warning
);
margin-top
:
4px
;
}
/* Buttons */
.btn
{
display
:
inline-flex
;
align-items
:
center
;
justify-content
:
center
;
gap
:
8px
;
padding
:
10px
16px
;
border-radius
:
6px
;
font-size
:
14px
;
font-weight
:
500
;
cursor
:
pointer
;
border
:
none
;
transition
:
all
0.2s
;
font-family
:
inherit
;
}
.btn-primary
{
background
:
var
(
--accent
);
color
:
white
;
}
.btn-primary
:hover
{
background
:
var
(
--accent-hover
);
}
.btn-primary
:disabled
{
opacity
:
0.6
;
cursor
:
not-allowed
;
}
.btn-secondary
{
background
:
var
(
--bg
);
color
:
var
(
--text
);
border
:
1px
solid
var
(
--border
);
}
.btn-secondary
:hover
{
background
:
var
(
--bg-secondary
);
}
.btn-block
{
width
:
100%
;
}
.btn-group
{
display
:
flex
;
gap
:
8px
;
margin-top
:
12px
;
}
/* Content */
.content
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
overflow
:
hidden
;
}
/* Chat Area */
.chat-area
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
padding
:
20px
;
overflow-y
:
auto
;
}
.chat-messages
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
gap
:
16px
;
}
.message
{
display
:
flex
;
gap
:
12px
;
max-width
:
800px
;
}
.message.user
{
margin-left
:
auto
;
flex-direction
:
row-reverse
;
}
.message-avatar
{
width
:
32px
;
height
:
32px
;
border-radius
:
4px
;
background
:
var
(
--bg-secondary
);
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
flex-shrink
:
0
;
font-size
:
16px
;
}
.message.user
.message-avatar
{
background
:
var
(
--accent-light
);
}
.message-content
{
padding
:
12px
16px
;
border-radius
:
12px
;
background
:
var
(
--bg-secondary
);
font-size
:
14px
;
line-height
:
1.6
;
white-space
:
pre-wrap
;
}
.message.user
.message-content
{
background
:
var
(
--accent
);
color
:
white
;
}
.message-placeholder
{
color
:
var
(
--text-muted
);
text-align
:
center
;
padding
:
40px
;
font-size
:
14px
;
}
/* Input Area */
.input-area
{
padding
:
16px
20px
;
border-top
:
1px
solid
var
(
--border-light
);
background
:
var
(
--bg
);
}
.input-wrapper
{
max-width
:
800px
;
margin
:
0
auto
;
}
.input-box
{
position
:
relative
;
}
.input-box
textarea
{
min-height
:
48px
;
max-height
:
200px
;
padding
:
12px
100px
12px
16px
;
border-radius
:
12px
;
resize
:
none
;
}
.input-actions
{
position
:
absolute
;
right
:
8px
;
bottom
:
8px
;
display
:
flex
;
gap
:
8px
;
}
.send-btn
{
width
:
36px
;
height
:
36px
;
border-radius
:
6px
;
background
:
var
(
--accent
);
color
:
white
;
border
:
none
;
cursor
:
pointer
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
transition
:
background
0.2s
;
}
.send-btn
:hover
{
background
:
var
(
--accent-hover
);
}
.send-btn
:disabled
{
opacity
:
0.5
;
cursor
:
not-allowed
;
}
/* Response Panel */
.response-panel
{
width
:
400px
;
border-left
:
1px
solid
var
(
--border-light
);
background
:
var
(
--bg
);
display
:
flex
;
flex-direction
:
column
;
}
.panel-header
{
padding
:
12px
16px
;
border-bottom
:
1px
solid
var
(
--border-light
);
font-weight
:
500
;
font-size
:
14px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.panel-body
{
flex
:
1
;
overflow-y
:
auto
;
padding
:
16px
;
}
.status-bar
{
display
:
flex
;
gap
:
12px
;
margin-bottom
:
16px
;
}
.status-item
{
flex
:
1
;
padding
:
12px
;
background
:
var
(
--bg-secondary
);
border-radius
:
8px
;
text-align
:
center
;
}
.status-label
{
font-size
:
11px
;
color
:
var
(
--text-muted
);
margin-bottom
:
4px
;
}
.status-value
{
font-size
:
14px
;
font-weight
:
600
;
font-family
:
'SF Mono'
,
Monaco
,
monospace
;
}
.status-value.success
{
color
:
var
(
--accent
);
}
.status-value.error
{
color
:
var
(
--error
);
}
.response-code
{
background
:
#1a1a1a
;
color
:
#d4d4d4
;
padding
:
16px
;
border-radius
:
8px
;
font-family
:
'SF Mono'
,
Monaco
,
'Courier New'
,
monospace
;
font-size
:
12px
;
line-height
:
1.6
;
overflow-x
:
auto
;
white-space
:
pre-wrap
;
word-break
:
break-all
;
}
/* Task Status */
.task-status
{
padding
:
16px
;
background
:
var
(
--bg-secondary
);
border-radius
:
8px
;
margin-bottom
:
16px
;
}
.task-header
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-bottom
:
12px
;
}
.task-badge
{
padding
:
4px
10px
;
border-radius
:
12px
;
font-size
:
12px
;
font-weight
:
500
;
}
.task-badge.queued
{
background
:
#fef3c7
;
color
:
#92400e
;
}
.task-badge.running
{
background
:
#dbeafe
;
color
:
#1e40af
;
}
.task-badge.succeeded
{
background
:
#d1fae5
;
color
:
#065f46
;
}
.task-badge.failed
{
background
:
#fee2e2
;
color
:
#991b1b
;
}
.task-info
{
display
:
grid
;
grid-template-columns
:
1
fr
1
fr
;
gap
:
8px
;
font-size
:
13px
;
}
.task-info-item
{
display
:
flex
;
gap
:
8px
;
}
.task-info-label
{
color
:
var
(
--text-muted
);
}
.task-info-value
{
font-weight
:
500
;
}
.task-actions
{
display
:
flex
;
gap
:
8px
;
margin-top
:
12px
;
}
/* Image Grid */
.image-grid
{
display
:
grid
;
grid-template-columns
:
repeat
(
auto-fill
,
minmax
(
200px
,
1
fr
));
gap
:
16px
;
}
.image-card
{
border
:
1px
solid
var
(
--border-light
);
border-radius
:
8px
;
overflow
:
hidden
;
}
.image-card
img
{
width
:
100%
;
height
:
auto
;
display
:
block
;
}
.image-card-footer
{
padding
:
8px
12px
;
background
:
var
(
--bg-secondary
);
font-size
:
12px
;
color
:
var
(
--text-muted
);
display
:
flex
;
justify-content
:
space-between
;
}
/* Toast */
.toast
{
position
:
fixed
;
bottom
:
24px
;
left
:
50%
;
transform
:
translateX
(
-50%
)
translateY
(
100px
);
padding
:
12px
24px
;
background
:
#1a1a1a
;
color
:
white
;
border-radius
:
8px
;
font-size
:
14px
;
opacity
:
0
;
transition
:
all
0.3s
;
z-index
:
1000
;
}
.toast.show
{
transform
:
translateX
(
-50%
)
translateY
(
0
);
opacity
:
1
;
}
.toast.success
{
background
:
var
(
--accent
);
}
.toast.error
{
background
:
var
(
--error
);
}
/* Hidden */
.hidden
{
display
:
none
!important
;
}
/* Responsive */
@media
(
max-width
:
1024px
)
{
.sidebar
{
width
:
240px
;
}
.response-panel
{
width
:
320px
;
}
}
@media
(
max-width
:
768px
)
{
.sidebar
{
display
:
none
;
}
.response-panel
{
display
:
none
;
}
}
</style>
</head>
<body>
<div
class=
"app"
>
<!-- Header -->
<header
class=
"header"
>
<div
class=
"logo"
>
<div
class=
"logo-icon"
>
🤖
</div>
<span>
AutoDL 模型部署验证
</span>
</div>
<div
class=
"tab-bar"
>
<button
class=
"tab active"
onclick=
"switchTab('chat')"
>
💬 文本对话
</button>
<button
class=
"tab"
onclick=
"switchTab('image')"
>
🎨 图像生成
</button>
</div>
</header>
<!-- Main -->
<main
class=
"main"
>
<!-- Sidebar -->
<aside
class=
"sidebar"
>
<!-- Tab Switcher -->
<div
class=
"tab-bar"
>
<button
class=
"tab active"
onclick=
"switchTab('chat')"
>
💬 对话
</button>
<button
class=
"tab"
onclick=
"switchTab('image')"
>
🎨 图像
</button>
</div>
<!-- Chat Settings -->
<div
id=
"settings-chat"
class=
"sidebar-section"
style=
"margin-top: 20px;"
>
<div
class=
"sidebar-title"
>
接口配置
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
><span
class=
"required"
>
*
</span>
API 地址
</label>
<input
type=
"text"
id=
"api-base-url"
placeholder=
"http://IP:端口/v1"
>
<p
class=
"form-warning"
>
⚠️ 必填,任务一 API 地址
</p>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
API Key
</label>
<input
type=
"password"
id=
"api-key"
placeholder=
"可选"
>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
><span
class=
"required"
>
*
</span>
模型名称
</label>
<input
type=
"text"
id=
"chat-model"
value=
"qwen3.5-4b"
>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
Max Tokens
</label>
<input
type=
"number"
id=
"chat-max-tokens"
value=
"2048"
>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
Temperature
</label>
<input
type=
"number"
id=
"chat-temperature"
value=
"1.0"
step=
"0.1"
>
</div>
<button
class=
"btn btn-secondary btn-block"
onclick=
"testChatConnection()"
>
🔗 测试连接
</button>
</div>
<!-- Image Settings -->
<div
id=
"settings-image"
class=
"sidebar-section hidden"
style=
"margin-top: 20px;"
>
<div
class=
"sidebar-title"
>
接口配置
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
><span
class=
"required"
>
*
</span>
API 地址
</label>
<input
type=
"text"
id=
"image-api-base-url"
placeholder=
"https://地址"
>
<p
class=
"form-warning"
>
⚠️ 必填,任务二 API 地址
</p>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
API Key
</label>
<input
type=
"password"
id=
"image-api-key"
placeholder=
"可选"
>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
模型名称
</label>
<input
type=
"text"
id=
"image-model"
value=
"qwen-image-2.0"
>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
输出尺寸
</label>
<select
id=
"image-size"
>
<option
value=
"1024x1024"
>
1024 × 1024
</option>
<option
value=
"1664x928"
selected
>
1664 × 928
</option>
<option
value=
"928x1664"
>
928 × 1664
</option>
</select>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
随机种子
</label>
<input
type=
"number"
id=
"image-seed"
placeholder=
"可选"
>
</div>
<button
class=
"btn btn-secondary btn-block"
onclick=
"testImageConnection()"
>
🔗 测试连接
</button>
</div>
</aside>
<!-- Content -->
<div
class=
"content"
>
<!-- Chat Panel -->
<div
id=
"panel-chat"
class=
"chat-area"
>
<div
class=
"chat-messages"
id=
"chat-messages"
>
<div
class=
"message-placeholder"
>
对话内容将显示在这里
<br>
<small
style=
"color: var(--text-muted);"
>
请先在左侧配置 API 地址
</small>
</div>
</div>
<div
class=
"input-area"
>
<div
class=
"input-wrapper"
>
<div
class=
"input-box"
>
<textarea
id=
"chat-input"
placeholder=
"输入消息... (Enter 发送,Shift+Enter 换行)"
></textarea>
<div
class=
"input-actions"
>
<button
class=
"send-btn"
onclick=
"sendChat()"
id=
"send-btn"
>
↑
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Image Panel -->
<div
id=
"panel-image"
class=
"chat-area hidden"
>
<div
id=
"image-task-area"
>
<div
class=
"form-group"
>
<label
class=
"form-label"
><span
class=
"required"
>
*
</span>
生成描述
</label>
<textarea
id=
"image-prompt"
rows=
"3"
placeholder=
"描述你想要生成的图片..."
></textarea>
</div>
<button
class=
"btn btn-primary btn-block"
onclick=
"submitImageTask()"
id=
"image-submit-btn"
style=
"margin-top: 12px;"
>
🎨 提交生成任务
</button>
<!-- Task Status -->
<div
id=
"image-task-status"
class=
"task-status hidden"
>
<div
class=
"task-header"
>
<span>
任务状态
</span>
<span
class=
"task-badge queued"
id=
"task-badge"
>
排队中
</span>
</div>
<div
class=
"task-info"
>
<div
class=
"task-info-item"
>
<span
class=
"task-info-label"
>
ID:
</span>
<span
class=
"task-info-value"
id=
"task-id"
>
-
</span>
</div>
<div
class=
"task-info-item"
>
<span
class=
"task-info-label"
>
进度:
</span>
<span
class=
"task-info-value"
id=
"task-progress"
>
0%
</span>
</div>
<div
class=
"task-info-item"
>
<span
class=
"task-info-label"
>
状态:
</span>
<span
class=
"task-info-value"
id=
"task-status"
>
queued
</span>
</div>
</div>
<div
class=
"task-actions"
>
<button
class=
"btn btn-secondary"
onclick=
"pollStatus()"
>
🔄 刷新
</button>
<button
class=
"btn btn-secondary"
onclick=
"stopPoll()"
>
⏹ 停止
</button>
</div>
</div>
</div>
<!-- Image Results -->
<div
id=
"image-results"
class=
"hidden"
style=
"margin-top: 20px;"
>
<div
class=
"sidebar-title"
>
生成结果
</div>
<div
class=
"image-grid"
id=
"image-grid"
></div>
</div>
<div
class=
"input-area"
style=
"margin-top: auto;"
>
<button
class=
"btn btn-secondary btn-block"
onclick=
"clearImage()"
>
🗑️ 清空
</button>
</div>
</div>
</div>
<!-- Response Panel -->
<aside
class=
"response-panel"
>
<div
class=
"panel-header"
>
<span>
📊 响应详情
</span>
<span
id=
"response-time"
style=
"font-weight: 400; font-size: 12px;"
>
-
</span>
</div>
<div
class=
"panel-body"
>
<div
class=
"status-bar"
>
<div
class=
"status-item"
>
<div
class=
"status-label"
>
状态码
</div>
<div
class=
"status-value"
id=
"status-code"
>
-
</div>
</div>
<div
class=
"status-item"
>
<div
class=
"status-label"
>
耗时
</div>
<div
class=
"status-value"
id=
"response-ms"
>
-
</div>
</div>
</div>
<div
class=
"sidebar-title"
>
响应内容
</div>
<pre
class=
"response-code"
id=
"response-raw"
>
等待请求...
</pre>
</div>
</aside>
</main>
</div>
<!-- Toast -->
<div
class=
"toast"
id=
"toast"
></div>
<script>
// Config
const
config
=
{
apiBaseUrl
:
''
,
apiKey
:
''
,
chatModel
:
'qwen3.5-4b'
,
chatMaxTokens
:
2048
,
chatTemperature
:
1.0
,
imageApiBaseUrl
:
''
,
imageApiKey
:
''
,
imageModel
:
'qwen-image-2.0'
};
let
chatMessages
=
[];
let
pollInterval
=
null
;
let
currentTaskId
=
null
;
// Load/Save
function
loadConfig
()
{
const
saved
=
localStorage
.
getItem
(
'autodl-config'
);
if
(
saved
)
{
try
{
const
parsed
=
JSON
.
parse
(
saved
);
Object
.
assign
(
config
,
parsed
);
}
catch
(
e
)
{}
}
applyConfig
();
}
function
saveConfig
()
{
localStorage
.
setItem
(
'autodl-config'
,
JSON
.
stringify
(
config
));
}
function
applyConfig
()
{
document
.
getElementById
(
'api-base-url'
).
value
=
config
.
apiBaseUrl
||
''
;
document
.
getElementById
(
'api-key'
).
value
=
config
.
apiKey
||
''
;
document
.
getElementById
(
'chat-model'
).
value
=
config
.
chatModel
||
'qwen3.5-4b'
;
document
.
getElementById
(
'chat-max-tokens'
).
value
=
config
.
chatMaxTokens
||
2048
;
document
.
getElementById
(
'chat-temperature'
).
value
=
config
.
chatTemperature
||
1.0
;
document
.
getElementById
(
'image-api-base-url'
).
value
=
config
.
imageApiBaseUrl
||
''
;
document
.
getElementById
(
'image-api-key'
).
value
=
config
.
imageApiKey
||
''
;
document
.
getElementById
(
'image-model'
).
value
=
config
.
imageModel
||
'qwen-image-2.0'
;
}
function
readConfig
()
{
config
.
apiBaseUrl
=
document
.
getElementById
(
'api-base-url'
).
value
.
trim
();
config
.
apiKey
=
document
.
getElementById
(
'api-key'
).
value
.
trim
();
config
.
chatModel
=
document
.
getElementById
(
'chat-model'
).
value
.
trim
();
config
.
chatMaxTokens
=
parseInt
(
document
.
getElementById
(
'chat-max-tokens'
).
value
)
||
2048
;
config
.
chatTemperature
=
parseFloat
(
document
.
getElementById
(
'chat-temperature'
).
value
)
||
1.0
;
config
.
imageApiBaseUrl
=
document
.
getElementById
(
'image-api-base-url'
).
value
.
trim
();
config
.
imageApiKey
=
document
.
getElementById
(
'image-api-key'
).
value
.
trim
();
config
.
imageModel
=
document
.
getElementById
(
'image-model'
).
value
.
trim
()
||
'qwen-image-2.0'
;
saveConfig
();
}
// Toast
function
toast
(
msg
,
type
=
''
)
{
const
t
=
document
.
getElementById
(
'toast'
);
t
.
textContent
=
msg
;
t
.
className
=
'toast '
+
type
;
setTimeout
(()
=>
t
.
classList
.
add
(
'show'
),
10
);
setTimeout
(()
=>
t
.
classList
.
remove
(
'show'
),
3000
);
}
// Tab
function
switchTab
(
tab
)
{
document
.
querySelectorAll
(
'.tab'
).
forEach
((
t
,
i
)
=>
{
t
.
classList
.
toggle
(
'active'
,
(
tab
===
'chat'
&&
i
===
0
)
||
(
tab
===
'image'
&&
i
===
1
));
});
document
.
getElementById
(
'panel-chat'
).
classList
.
toggle
(
'hidden'
,
tab
!==
'chat'
);
document
.
getElementById
(
'panel-image'
).
classList
.
toggle
(
'hidden'
,
tab
!==
'image'
);
document
.
getElementById
(
'settings-chat'
).
classList
.
toggle
(
'hidden'
,
tab
!==
'chat'
);
document
.
getElementById
(
'settings-image'
).
classList
.
toggle
(
'hidden'
,
tab
!==
'image'
);
}
// Response
function
showResponse
(
status
,
ms
,
data
)
{
const
codeEl
=
document
.
getElementById
(
'status-code'
);
codeEl
.
textContent
=
status
;
codeEl
.
className
=
'status-value '
+
(
status
>=
200
&&
status
<
300
?
'success'
:
'error'
);
document
.
getElementById
(
'response-ms'
).
textContent
=
ms
?
ms
+
'ms'
:
'-'
;
document
.
getElementById
(
'response-time'
).
textContent
=
ms
?
`
${
ms
}
ms`
:
''
;
document
.
getElementById
(
'response-raw'
).
textContent
=
JSON
.
stringify
(
data
,
null
,
2
);
}
// Chat
function
renderMessages
()
{
const
container
=
document
.
getElementById
(
'chat-messages'
);
if
(
chatMessages
.
length
===
0
)
{
container
.
innerHTML
=
`<div class="message-placeholder">对话内容将显示在这里<br><small style="color: var(--text-muted);">请先在左侧配置 API 地址</small></div>`
;
return
;
}
container
.
innerHTML
=
chatMessages
.
map
(
m
=>
`
<div class="message
${
m
.
role
}
">
<div class="message-avatar">
${
m
.
role
===
'user'
?
'👤'
:
'🤖'
}
</div>
<div class="message-content">
${
escapeHtml
(
m
.
content
)}
</div>
</div>
`
).
join
(
''
);
container
.
scrollTop
=
container
.
scrollHeight
;
}
function
escapeHtml
(
text
)
{
const
div
=
document
.
createElement
(
'div'
);
div
.
textContent
=
text
;
return
div
.
innerHTML
;
}
async
function
sendChat
()
{
const
input
=
document
.
getElementById
(
'chat-input'
);
const
msg
=
input
.
value
.
trim
();
if
(
!
msg
)
return
;
readConfig
();
if
(
!
config
.
apiBaseUrl
)
{
toast
(
'请先配置 API 地址'
,
'error'
);
return
;
}
const
btn
=
document
.
getElementById
(
'send-btn'
);
btn
.
disabled
=
true
;
input
.
value
=
''
;
chatMessages
.
push
({
role
:
'user'
,
content
:
msg
});
renderMessages
();
try
{
const
headers
=
{
'Content-Type'
:
'application/json'
};
if
(
config
.
apiKey
)
headers
[
'Authorization'
]
=
`Bearer
${
config
.
apiKey
}
`
;
const
start
=
Date
.
now
();
const
res
=
await
fetch
(
`
${
config
.
apiBaseUrl
}
/chat/completions`
,
{
method
:
'POST'
,
headers
,
body
:
JSON
.
stringify
({
model
:
config
.
chatModel
,
messages
:
chatMessages
,
max_tokens
:
config
.
chatMaxTokens
,
temperature
:
config
.
chatTemperature
})
});
const
ms
=
Date
.
now
()
-
start
;
const
data
=
await
res
.
json
();
showResponse
(
res
.
status
,
ms
,
data
);
if
(
res
.
ok
)
{
const
reply
=
data
.
choices
?.[
0
]?.
message
?.
content
||
''
;
chatMessages
.
push
({
role
:
'assistant'
,
content
:
reply
});
}
else
{
chatMessages
.
push
({
role
:
'assistant'
,
content
:
`错误:
${
data
.
error
?.
message
||
res
.
statusText
}
` });
toast('请求失败', 'error');
}
} catch (e) {
showResponse(0, 0, { error: e.message });
chatMessages.push({ role: 'assistant', content: `
网络错误
:
$
{
e
.
message
}
`
});
toast
(
'网络错误'
,
'error'
);
}
btn
.
disabled
=
false
;
renderMessages
();
}
async
function
testChatConnection
()
{
readConfig
();
if
(
!
config
.
apiBaseUrl
)
{
toast
(
'请输入 API 地址'
,
'error'
);
return
;
}
try
{
const
headers
=
{
'Content-Type'
:
'application/json'
};
if
(
config
.
apiKey
)
headers
[
'Authorization'
]
=
`Bearer
${
config
.
apiKey
}
`
;
const
start
=
Date
.
now
();
const
res
=
await
fetch
(
`
${
config
.
apiBaseUrl
}
/models`
,
{
headers
});
const
ms
=
Date
.
now
()
-
start
;
const
data
=
await
res
.
json
();
showResponse
(
res
.
status
,
ms
,
data
);
if
(
res
.
ok
)
toast
(
'连接成功'
,
'success'
);
else
toast
(
'连接失败'
,
'error'
);
}
catch
(
e
)
{
showResponse
(
0
,
0
,
{
error
:
e
.
message
});
toast
(
'连接失败'
,
'error'
);
}
}
// Image
async
function
submitImageTask
()
{
const
prompt
=
document
.
getElementById
(
'image-prompt'
).
value
.
trim
();
if
(
!
prompt
)
{
toast
(
'请输入生成描述'
,
'error'
);
return
;
}
readConfig
();
if
(
!
config
.
imageApiBaseUrl
)
{
toast
(
'请先配置 API 地址'
,
'error'
);
return
;
}
const
btn
=
document
.
getElementById
(
'image-submit-btn'
);
btn
.
disabled
=
true
;
btn
.
textContent
=
'⏳ 提交中...'
;
try
{
const
headers
=
{
'Content-Type'
:
'application/json'
};
if
(
config
.
imageApiKey
)
headers
[
'Authorization'
]
=
`Bearer
${
config
.
imageApiKey
}
`
;
const
body
=
{
model
:
config
.
imageModel
,
modality
:
'image'
,
prompt
,
inputs
:
[],
options
:
{
size
:
document
.
getElementById
(
'image-size'
).
value
}
};
const
seed
=
document
.
getElementById
(
'image-seed'
).
value
;
if
(
seed
)
body
.
options
.
seed
=
parseInt
(
seed
);
const
start
=
Date
.
now
();
const
res
=
await
fetch
(
`
${
config
.
imageApiBaseUrl
}
/v1/generations`
,
{
method
:
'POST'
,
headers
,
body
:
JSON
.
stringify
(
body
)
});
const
ms
=
Date
.
now
()
-
start
;
const
data
=
await
res
.
json
();
showResponse
(
res
.
status
,
ms
,
data
);
if
(
res
.
status
===
202
||
res
.
ok
)
{
currentTaskId
=
data
.
id
;
document
.
getElementById
(
'image-task-status'
).
classList
.
remove
(
'hidden'
);
document
.
getElementById
(
'task-id'
).
textContent
=
data
.
id
;
updateTaskBadge
(
'queued'
);
startPoll
();
toast
(
'任务已提交'
,
'success'
);
}
else
{
toast
(
'提交失败'
,
'error'
);
}
}
catch
(
e
)
{
showResponse
(
0
,
0
,
{
error
:
e
.
message
});
toast
(
'网络错误'
,
'error'
);
}
btn
.
disabled
=
false
;
btn
.
textContent
=
'🎨 提交生成任务'
;
}
function
updateTaskBadge
(
status
)
{
const
badge
=
document
.
getElementById
(
'task-badge'
);
badge
.
className
=
'task-badge '
+
status
;
const
texts
=
{
queued
:
'排队中'
,
running
:
'生成中'
,
succeeded
:
'已完成'
,
failed
:
'失败'
};
badge
.
textContent
=
texts
[
status
]
||
status
;
document
.
getElementById
(
'task-status'
).
textContent
=
status
;
}
async
function
pollStatus
()
{
if
(
!
currentTaskId
)
return
;
readConfig
();
try
{
const
headers
=
{
'Content-Type'
:
'application/json'
};
if
(
config
.
imageApiKey
)
headers
[
'Authorization'
]
=
`Bearer
${
config
.
imageApiKey
}
`
;
const
res
=
await
fetch
(
`
${
config
.
imageApiBaseUrl
}
/v1/generations/
${
currentTaskId
}
`
,
{
headers
});
const
data
=
await
res
.
json
();
showResponse
(
res
.
status
,
0
,
data
);
if
(
res
.
ok
)
{
const
status
=
data
.
status
;
document
.
getElementById
(
'task-progress'
).
textContent
=
(
data
.
progress
||
0
)
+
'%'
;
updateTaskBadge
(
status
);
if
(
status
===
'succeeded'
)
{
showImages
(
data
.
outputs
||
[]);
stopPoll
();
toast
(
'生成成功'
,
'success'
);
}
else
if
(
status
===
'failed'
)
{
toast
(
'生成失败'
,
'error'
);
stopPoll
();
}
}
}
catch
(
e
)
{
toast
(
'查询失败'
,
'error'
);
}
}
function
startPoll
()
{
stopPoll
();
pollInterval
=
setInterval
(
pollStatus
,
3000
);
pollStatus
();
}
function
stopPoll
()
{
if
(
pollInterval
)
{
clearInterval
(
pollInterval
);
pollInterval
=
null
;
}
}
function
showImages
(
outputs
)
{
const
container
=
document
.
getElementById
(
'image-grid'
);
document
.
getElementById
(
'image-results'
).
classList
.
remove
(
'hidden'
);
container
.
innerHTML
=
outputs
.
map
((
img
,
i
)
=>
`
<div class="image-card">
<img src="
${
img
.
url
}
" alt="Generated">
<div class="image-card-footer">
<span>
${
img
.
width
||
''
}
×
${
img
.
height
||
''
}
</span>
<a href="
${
img
.
url
}
" target="_blank" style="color: var(--accent);">下载</a>
</div>
</div>
`
).
join
(
''
);
}
async
function
testImageConnection
()
{
readConfig
();
if
(
!
config
.
imageApiBaseUrl
)
{
toast
(
'请输入 API 地址'
,
'error'
);
return
;
}
try
{
const
headers
=
{
'Content-Type'
:
'application/json'
};
if
(
config
.
imageApiKey
)
headers
[
'Authorization'
]
=
`Bearer
${
config
.
imageApiKey
}
`
;
const
start
=
Date
.
now
();
const
res
=
await
fetch
(
`
${
config
.
imageApiBaseUrl
}
/v1/models`
,
{
headers
});
const
ms
=
Date
.
now
()
-
start
;
const
data
=
await
res
.
json
();
showResponse
(
res
.
status
,
ms
,
data
);
if
(
res
.
ok
)
toast
(
'连接成功'
,
'success'
);
else
toast
(
'连接失败'
,
'error'
);
}
catch
(
e
)
{
showResponse
(
0
,
0
,
{
error
:
e
.
message
});
toast
(
'连接失败'
,
'error'
);
}
}
function
clearImage
()
{
stopPoll
();
currentTaskId
=
null
;
document
.
getElementById
(
'image-prompt'
).
value
=
''
;
document
.
getElementById
(
'image-task-status'
).
classList
.
add
(
'hidden'
);
document
.
getElementById
(
'image-results'
).
classList
.
add
(
'hidden'
);
toast
(
'已清空'
);
}
// Events
document
.
addEventListener
(
'DOMContentLoaded'
,
()
=>
{
loadConfig
();
document
.
getElementById
(
'chat-input'
).
addEventListener
(
'keydown'
,
e
=>
{
if
(
e
.
key
===
'Enter'
&&
!
e
.
shiftKey
)
{
e
.
preventDefault
();
sendChat
();
}
});
[
'api-base-url'
,
'api-key'
,
'chat-model'
,
'chat-max-tokens'
,
'chat-temperature'
,
'image-api-base-url'
,
'image-api-key'
,
'image-model'
].
forEach
(
id
=>
{
document
.
getElementById
(
id
).
addEventListener
(
'change'
,
readConfig
);
});
});
</script>
</body>
</html>
docs/0820导师端部署验收台与学生验收结果设计方案.md
0 → 100644
浏览文件 @
595f4b11
# 0820 导师端部署验收台与学生验收结果设计方案
> 文档用途:记录阶段二“AutoDL 部署实操”中,导师验收端、学生验收结果页与通知机制的产品设计方案。
>
> 参考来源:`Acceptance.html` 的 API 验收核心能力、当前实训平台的导师端工作台与学生端阶段二流程。
>
> 当前状态:设计方案,待导师端具体验收页面要求确认后实施。
---
## 1. 设计目标
本方案用于把
`Acceptance.html`
中独立的 AutoDL 模型 API 验收能力,整合为符合当前实训平台视觉和业务流程的导师端部署验收台,并与学生端状态形成闭环。
需要覆盖以下能力:
-
导师查看自己负责的全部学生
-
选择一个学生查看该学生的本次部署提交
-
同时查看部署产物、实操日志和实操报告
-
对学生提交的 API 进行实际探测
-
对文本模型和图像生成任务使用不同的验收项目
-
导师给出通过、驳回或要求补充材料的结论
-
验收结果通知学生
-
同步更新
`student-deploy-result`
的状态和操作入口
设计原则:
1.
复用当前平台的 Arco Design Pro 风格、蓝白色卡片和状态标签。
2.
学生提交的原始内容只读展示,导师的验收参数允许临时调整,但不覆盖学生原始提交。
3.
验收过程和验收结论分离,测试结果作为结论依据保留在验收记录中。
4.
状态必须在导师端、学生通知和学生结果页保持一致。
5.
对“部分提交”和“全部提交”进行清晰区分,避免导师验收不完整材料。
---
## 2. `Acceptance.html` 的核心能力提取
`Acceptance.html`
的价值不在于它的独立页面样式,而在于提供了实际 API 验收所需的操作模型。
### 2.1 文本模型验收
-
配置 API 基础地址
-
配置 API Key
-
配置模型名称
-
调用
`GET /v1/models`
-
调用
`POST /v1/chat/completions`
-
查看 HTTP 状态码
-
查看响应耗时
-
查看原始响应 JSON
-
查看模型返回内容
### 2.2 图像生成验收
-
配置图像 API 地址
-
配置 API Key
-
配置图像模型名称
-
调用
`GET /v1/models`
-
调用
`POST /v1/generations`
-
保存异步任务 ID
-
查询
`GET /v1/generations/{id}`
-
查看任务状态、进度和图像结果
-
查看原始响应内容
### 2.3 可迁移的验收数据
无论任务类型如何,验收台都应沉淀以下数据:
-
请求地址
-
请求方法
-
请求路径
-
请求时间
-
HTTP 状态码
-
响应耗时
-
请求参数摘要
-
响应结果摘要
-
原始响应内容
-
验收项是否通过
-
测试失败时的错误信息
---
## 3. 导师端页面总体布局
导师端部署验收页面建议采用“三栏工作台”结构。
```
text
┌──────────────────────────────────────────────────────────────┐
│ 页面标题 / 任务筛选 / 待验收数量 │
├──────────────┬──────────────────────────────┬───────────────┤
│ 我的学生列表 │ 学生提交内容 │ 验收台 │
│ │ 产物 / 日志 / 报告 │ API 测试 / 结论 │
│ │ │ │
└──────────────┴──────────────────────────────┴───────────────┘
```
### 3.1 页面头部
页面标题:
`部署任务验收`
头部信息包括:
-
当前任务名称,例如“任务一 · 文本模型部署验收”
-
当前任务类型:文本模型 / 图像生成
-
我的待验收数量
-
最近一次验收时间
-
学生搜索框
-
状态筛选器
状态筛选选项:
-
全部
-
待验收
-
验收中
-
已通过
-
已驳回
-
待补充
---
## 4. 左侧:我的学生列表
左侧只显示当前导师负责的学生,不显示其他导师学生。
### 4.1 学生列表卡片
每个学生卡片展示:
-
学生姓名
-
学生头像或首字母
-
当前任务名称
-
最近提交时间
-
当前验收状态
-
提交完整度
-
新提交标记
提交完整度示例:
-
`产物未提交 · 报告未提交`
-
`产物已提交 · 报告未提交`
-
`产物已提交 · 报告已提交`
### 4.2 列表交互
-
点击学生卡片后,中间内容区和右侧验收台切换到该学生
-
当前选中的学生使用蓝色边框或浅蓝背景突出
-
有新提交的学生显示“新提交”标签
-
已通过学生仍可查看历史验收记录,但默认不进入待验收列表
-
驳回或待补充学生显示导师上次评语摘要
### 4.3 空状态
当没有待验收学生时,显示:
> 当前没有等待验收的部署提交。
同时允许切换到“全部学生”查看历史记录。
---
## 5. 中间:学生提交内容区
选择学生后,中间区域展示学生本次提交的三个内容模块。所有学生原始提交内容均为只读。
### 5.1 部署产物卡片
展示:
-
任务名称
-
模型名称
-
API 地址
-
请求路径
-
API Key 状态
-
服务端口
-
日志包文件名
-
提交时间
-
提交版本
API Key 只显示脱敏状态,例如:
```
text
已配置 · sk-••••••••
```
不在导师页面直接显示完整密钥。
### 5.2 AutoDL 实例信息卡片
如果学生登记了当前 AutoDL 实例,展示:
-
平台名称
-
实例名称
-
公网地址
-
SSH 端口
-
用户名
-
GPU 型号
-
CPU / 内存
-
镜像信息
-
数据盘路径
-
当前实例是否为学生当前使用实例
SSH 密码不展示。必要时只展示连接目标和实例状态。
### 5.3 实操日志卡片
展示:
-
日志文件名
-
日志提交时间
-
日志内容摘要
-
服务启动记录
-
模型加载记录
-
监听地址和端口
-
健康检查记录
-
错误或异常摘要
默认展示摘要,提供“展开完整日志”操作。完整日志应使用等宽字体和深色代码块展示,避免影响主信息浏览。
### 5.4 实操报告卡片
展示学生填写的原始报告:
-
本次任务目标
-
部署过程
-
问题与解决
-
自测结果
-
总结反思
报告内容只读。导师的验收意见不直接写入学生报告原文,而是单独记录在验收结论区。
### 5.5 提交完整度提示
如果材料不完整,中间区域顶部显示提示:
-
缺少部署产物
-
缺少实操日志
-
缺少实操报告
-
API 地址未填写
-
关键接口信息不完整
材料不完整时,右侧验收台不能提交“通过”,只能选择“驳回”或“要求补充材料”。
---
## 6. 右侧:验收台
验收台是导师实际进行 API 测试和提交验收结论的区域。
### 6.1 验收参数区
自动带入学生提交的信息:
-
API 地址
-
API Key
-
模型名称
-
请求路径
-
任务类型
验收参数允许导师临时调整,但必须明确标注:
> 以下调整仅用于本次验收,不会修改学生原始提交内容。
建议提供“恢复学生提交值”按钮。
### 6.2 文本模型验收项
#### 验收项一:模型列表
请求:
```
text
GET /v1/models
```
展示:
-
测试按钮
-
HTTP 状态码
-
响应耗时
-
模型列表
-
是否包含学生声明的模型名称
-
原始响应 JSON
-
验收项状态:未测试 / 通过 / 失败
#### 验收项二:聊天补全
请求:
```
text
POST /v1/chat/completions
```
测试参数:
-
测试提示词
-
模型名称
-
Max Tokens
-
Temperature
默认测试提示词:
```
text
请用一句话介绍你自己。
```
通过条件:
-
HTTP 状态码为 200
-
返回
`choices[0].message.content`
-
返回内容非空
-
返回模型名称与提交模型基本一致
展示:
-
HTTP 状态码
-
响应耗时
-
返回内容
-
原始响应 JSON
-
验收项状态
### 6.3 图像生成验收项
#### 验收项一:图像模型列表
请求:
```
text
GET /v1/models
```
通过条件:
-
HTTP 状态码正常
-
返回可用图像模型
-
模型 ID 与学生提交内容一致或符合任务要求
#### 验收项二:提交生成任务
请求:
```
text
POST /v1/generations
```
测试参数:
-
Prompt
-
模型名称
-
图片尺寸
-
可选随机种子
通过条件:
-
HTTP 状态码为 202 或任务接口约定的成功状态
-
返回任务 ID
#### 验收项三:查询生成任务
请求:
```
text
GET /v1/generations/{id}
```
展示:
-
任务 ID
-
当前状态
-
进度
-
最终图片
-
下载地址
-
错误信息
通过条件:
-
最终状态为
`succeeded`
-
返回有效图像下载地址
### 6.4 测试记录
每个测试项都保留最近一次结果:
-
测试时间
-
测试请求
-
响应状态
-
响应耗时
-
通过 / 失败
-
错误信息
导师可以重新测试,但重新测试不覆盖历史验收记录,至少保留本次验收的最终结果和最近一次测试结果。
---
## 7. 验收结论区
验收台底部提供最终处理区。
### 7.1 验收结果
导师可选择:
-
通过
-
驳回
-
要求补充材料
结果说明:
| 结果 | 含义 | 学生后续操作 |
|---|---|---|
| 通过 | 产物、日志、报告和 API 验收均满足要求 | 查看结果,进入后续流程 |
| 驳回 | 存在关键问题,需要重新修改提交 | 返回提交页修改并重新提交 |
| 要求补充材料 | 主体基本可验收,但缺少材料或说明 | 补交指定内容后重新提交 |
### 7.2 评分项
建议先采用总分和分项评分结合:
-
API 可用性:40 分
-
部署规范性:20 分
-
实操日志完整度:15 分
-
实操报告质量:15 分
-
问题排查与总结:10 分
总分为 100 分。通过分数线可以由平台配置,原型阶段建议默认 60 分,同时要求关键 API 验收项不能失败。
### 7.3 导师评语
提供多行文本框,要求导师填写:
-
验收结论
-
发现的问题
-
修改建议
-
补充材料要求
-
后续学习建议
通过时也建议填写评语,不能只提交空结论。
### 7.4 操作按钮
-
`保存验收草稿`
-
`通过并通知学生`
-
`驳回并通知学生`
-
`要求补充材料并通知学生`
规则:
-
通过前必须完成关键 API 测试
-
驳回必须填写原因
-
要求补充材料必须明确指出缺少的内容
-
提交结论后,该次验收记录进入只读状态
-
如果需要再次验收,学生重新提交后生成新的验收轮次
---
## 8. 学生端通知设计
导师提交验收结论后,在学生端生成通知。
### 8.1 通知数据
建议包含:
-
通知 ID
-
学生 ID
-
任务 ID
-
导师 ID
-
通知类型
-
验收结果
-
导师评语
-
评分
-
创建时间
-
是否已读
-
关联页面:
`student-deploy-result`
### 8.2 通过通知
标题:
> 部署任务已通过验收
内容:
> 你的部署产物、实操日志和实操报告已通过导师验收。
按钮:
-
查看验收详情
-
进入下一步
### 8.3 驳回通知
标题:
> 部署任务需要修改
内容:
> 导师已完成验收,请根据验收意见修改后重新提交。
按钮:
-
查看导师评语
-
返回提交页修改
### 8.4 补充材料通知
标题:
> 部署任务需要补充材料
内容:
> 导师要求补充部署产物、实操日志或实操报告,请查看具体要求。
按钮:
-
查看补充要求
-
返回提交页补充
---
## 9. `student-deploy-result` 状态设计
学生端结果页需要和导师验收状态同步。
### 9.1 待验收
展示:
-
产物:已提交
-
日志:已提交
-
报告:已提交
-
当前状态:待导师验收
-
提交时间
操作:
-
查看提交内容
-
返回 AutoDL
### 9.2 验收中
展示:
-
导师已开始验收
-
最近测试时间
-
当前验收轮次
操作:
-
查看提交内容
-
暂时不能重新提交
### 9.3 已通过
展示:
-
通过标签
-
API 测试摘要
-
分项评分和总分
-
导师评语
-
验收时间
操作:
-
查看完整验收记录
-
进入后续任务或阶段
### 9.4 已驳回
展示:
-
驳回原因
-
导师评语
-
失败的 API 验收项
-
需要修改的材料
操作:
-
返回提交页修改
-
重新保存并提交
### 9.5 待补充
展示:
-
缺少的材料
-
导师具体要求
-
已提交的内容状态
操作:
-
返回提交页补充
-
重新提交指定内容
### 9.6 学生提交页的只读规则
-
产物和报告都提交后,学生仍可返回原提交表单查看自己的内容
-
双提交后表单控件全部只读,不跳转到独立锁定页
-
只提交一部分时,学生可以继续编辑尚未最终提交的内容
-
导师驳回或要求补充材料后,学生提交页重新开放对应内容
---
## 10. 状态流转
```
text
学生编辑
↓
分别保存产物 / 报告
↓
分别提交产物 / 报告
├── 只提交一个 → 学生可继续编辑和提交另一个
└── 两个都提交 → 待导师验收
↓
验收中
┌─────┼─────┐
↓ ↓ ↓
通过 驳回 待补充
↓ ↓ ↓
后续流程 重新提交 补充后重新提交
```
建议状态字段:
-
`deployArtifactSaved`
-
`deployArtifactSubmitted`
-
`deployReportSaved`
-
`deployReportSubmitted`
-
`deployReviewStatus`
-
`deployReviewRound`
-
`deployReviewScore`
-
`deployReviewComment`
-
`deployReviewItems`
-
`deployReviewUpdatedAt`
-
`deployReviewNotifiedAt`
建议
`deployReviewStatus`
枚举:
-
`待验收`
-
`验收中`
-
`已通过`
-
`已驳回`
-
`待补充`
---
## 11. 验收记录建议结构
原型阶段可以使用内存状态模拟,结构建议如下:
```
javascript
{
id
:
'deploy-review-001'
,
studentId
:
'student-001'
,
mentorId
:
'mentor-001'
,
taskId
:
'text-model'
,
round
:
1
,
status
:
'待验收'
,
artifactSnapshot
:
{},
reportSnapshot
:
{},
logSnapshot
:
{},
tests
:
{
models
:
{
status
:
'passed'
,
httpStatus
:
200
,
latency
:
128
,
testedAt
:
''
},
chatCompletions
:
{
status
:
'passed'
,
httpStatus
:
200
,
latency
:
1280
,
responseText
:
''
,
testedAt
:
''
}
},
score
:
{
api
:
40
,
deployment
:
18
,
logs
:
14
,
report
:
13
,
reflection
:
8
,
total
:
93
},
comment
:
''
,
supplementRequest
:
''
,
reviewedAt
:
''
,
notifiedAt
:
''
}
```
提交验收结论时,应保存提交快照,避免学生后续修改草稿影响历史验收记录。
---
## 12. 页面和文件接入计划
待具体页面要求确认后,建议按以下顺序实施:
1.
在导师端定位现有“部署验收页面”和“验收台”区域。
2.
扩展导师负责学生列表和筛选状态。
3.
增加选中学生的产物、日志、报告只读展示。
4.
将
`Acceptance.html`
的 API 测试能力改写为平台风格组件。
5.
增加文本模型和图像生成两类验收台。
6.
增加验收草稿、通过、驳回、待补充动作。
7.
增加导师验收记录状态。
8.
增加学生通知数据和通知展示。
9.
更新
`student-deploy-result`
的状态渲染。
10.
更新学生提交页在驳回、待补充后的重新编辑规则。
11.
完成导师端、学生端和通知状态的联调检查。
本设计文档只记录方案,不在导师端具体页面要求确认前直接实施代码改动。
pages-mentor.js
浏览文件 @
595f4b11
...
@@ -72,6 +72,7 @@ var mentorState = {
...
@@ -72,6 +72,7 @@ var mentorState = {
defenseReviews
:
[]
defenseReviews
:
[]
}
}
],
],
deployReviewStudentId
:
1
,
pendingTasks
:
[
pendingTasks
:
[
{
type
:
'practice'
,
studentId
:
2
,
project
:
'CRM 客户管理'
,
submittedAt
:
'2026-07-21 10:30'
,
urgent
:
true
},
{
type
:
'practice'
,
studentId
:
2
,
project
:
'CRM 客户管理'
,
submittedAt
:
'2026-07-21 10:30'
,
urgent
:
true
},
{
type
:
'defense'
,
studentId
:
1
,
project
:
'react-admin-dashboard'
,
submittedAt
:
'2026-07-21 09:15'
,
urgent
:
false
},
{
type
:
'defense'
,
studentId
:
1
,
project
:
'react-admin-dashboard'
,
submittedAt
:
'2026-07-21 09:15'
,
urgent
:
false
},
...
@@ -1272,6 +1273,11 @@ function issueMentorAutodl() {
...
@@ -1272,6 +1273,11 @@ function issueMentorAutodl() {
showStudentFlowModal
(
'已下发 AutoDL'
,
name
+
' 可在学生端只读页立即看到这套配置,并测连通、复制 ssh。密码不会展示给学生。'
);
showStudentFlowModal
(
'已下发 AutoDL'
,
name
+
' 可在学生端只读页立即看到这套配置,并测连通、复制 ssh。密码不会展示给学生。'
);
}
}
function
selectMentorDeployReviewStudent
(
id
)
{
mentorState
.
deployReviewStudentId
=
Number
(
id
);
renderContent
();
}
function
reviewDeployArtifact
(
passed
)
{
function
reviewDeployArtifact
(
passed
)
{
var
comment
=
document
.
getElementById
(
'deployReviewComment'
);
var
comment
=
document
.
getElementById
(
'deployReviewComment'
);
var
text
=
comment
?
comment
.
value
.
trim
()
:
''
;
var
text
=
comment
?
comment
.
value
.
trim
()
:
''
;
...
@@ -1290,11 +1296,18 @@ function reviewDeployArtifact(passed) {
...
@@ -1290,11 +1296,18 @@ function reviewDeployArtifact(passed) {
}
}
pageRenderers
[
"mentor-deploy-review"
]
=
function
()
{
pageRenderers
[
"mentor-deploy-review"
]
=
function
()
{
var
students
=
mentorState
.
students
||
[];
var
selectedId
=
Number
(
mentorState
.
deployReviewStudentId
||
(
students
[
0
]
&&
students
[
0
].
id
));
var
selected
=
students
.
filter
(
function
(
s
)
{
return
Number
(
s
.
id
)
===
selectedId
;
})[
0
]
||
null
;
var
submitted
=
!!
studentState
.
deploySubmitted
||
!!
studentState
.
deployReviewed
;
var
submitted
=
!!
studentState
.
deploySubmitted
||
!!
studentState
.
deployReviewed
;
var
a
=
studentState
.
deployArtifact
||
{};
var
a
=
studentState
.
deployArtifact
||
{};
var
status
=
studentState
.
deployReviewStatus
||
(
submitted
?
'待验收'
:
'未提交'
);
var
status
=
studentState
.
deployReviewStatus
||
(
submitted
?
'待验收'
:
'未提交'
);
var
statusClass
=
status
===
'通过'
?
'bg-emerald-100 text-emerald-700'
:
(
status
===
'驳回'
?
'bg-rose-100 text-rose-700'
:
'bg-amber-100 text-amber-700'
);
var
statusClass
=
status
===
'通过'
?
'bg-emerald-100 text-emerald-700'
:
(
status
===
'驳回'
?
'bg-rose-100 text-rose-700'
:
'bg-amber-100 text-amber-700'
);
return
'<div class="max-w-7xl mx-auto"><div class="flex items-center justify-between mb-6"><div><h1 class="text-2xl font-bold text-[#1D2129]">部署验收</h1><p class="text-sm text-[#86909C] mt-1">仅验收模型部署产物,原实操评审保持独立</p></div><span class="px-3 py-1.5 rounded-lg text-sm font-medium '
+
statusClass
+
'">'
+
status
+
'</span></div><div class="grid grid-cols-3 gap-5 mb-6"><div class="feature-card p-5"><div class="text-xs text-[#86909C]">待验收</div><div class="text-2xl font-bold mt-1">'
+
(
status
===
'待验收'
?
1
:
0
)
+
'</div></div><div class="feature-card p-5"><div class="text-xs text-[#86909C]">探测状态</div><div class="text-lg font-bold text-emerald-600 mt-1">'
+
(
submitted
?
'服务可达'
:
'待提交'
)
+
'</div></div><div class="feature-card p-5"><div class="text-xs text-[#86909C]">当前学员</div><div class="text-lg font-bold mt-1">张三</div></div></div><div class="grid grid-cols-3 gap-6"><div class="bg-white rounded-lg border border-[#E5E6EB] p-5"><h3 class="font-semibold mb-4">部署任务列表</h3><div class="p-4 rounded-lg border border-[#165DFF] bg-[#E8F3FF]"><div class="flex justify-between"><b>张三</b><span class="text-xs">'
+
status
+
'</span></div><p class="text-xs text-[#86909C] mt-2">Qwen2.5-7B 推理服务部署</p></div></div><div class="col-span-2 bg-white rounded-lg border border-[#E5E6EB] p-6">'
+
(
submitted
?
'<div class="flex items-center justify-between mb-5"><h3 class="font-semibold">产物详情与探测</h3><span class="text-sm text-emerald-600">HTTP 200 · 1.2s</span></div><div class="grid grid-cols-2 gap-4 mb-5"><div class="p-4 bg-[#F7F8FA] rounded-lg"><div class="text-xs text-[#86909C]">日志包</div><div class="font-medium mt-1">'
+
(
a
.
fileName
||
'qwen-deploy.log'
)
+
'</div></div><div class="p-4 bg-[#F7F8FA] rounded-lg"><div class="text-xs text-[#86909C]">API / 端口</div><div class="font-medium mt-1">'
+
(
a
.
apiUrl
||
a
.
apiPath
||
'—'
)
+
' : '
+
(
a
.
port
||
'—'
)
+
'</div></div></div><pre class="bg-[#1D2129] text-emerald-300 rounded-lg p-4 text-xs mb-5 overflow-auto">INFO model loaded
\
nINFO server started
\
nINFO POST /v1/chat/completions 200</pre><textarea id="deployReviewComment" class="input-field mb-4" rows="3" placeholder="通过可选填;驳回时必须填写原因">'
+
(
studentState
.
deployReviewComment
||
''
)
+
'</textarea><div class="flex gap-3"><button class="btn-primary flex-1 py-3" onclick="reviewDeployArtifact(true)">通过验收</button><button class="btn-outline flex-1 py-3 border-rose-300 text-rose-600" onclick="reviewDeployArtifact(false)">驳回重提</button></div>'
:
'<div class="py-16 text-center text-[#86909C]"><svg class="w-10 h-10 mx-auto mb-3" data-lucide="inbox"></svg>学生尚未提交部署产物</div>'
)
+
'</div></div></div>'
;
var
listHtml
=
students
.
map
(
function
(
s
)
{
var
active
=
Number
(
s
.
id
)
===
selectedId
;
return
'<button type="button" class="w-full text-left p-4 rounded-lg border mb-2 transition-all '
+
(
active
?
'border-[#165DFF] bg-[#E8F3FF]'
:
'border-[#E5E6EB] bg-white hover:border-[#165DFF]'
)
+
'" onclick="selectMentorDeployReviewStudent('
+
s
.
id
+
')"><div class="flex items-center justify-between"><span class="font-medium text-[#1D2129]">'
+
s
.
name
+
'</span><span class="text-xs px-2 py-0.5 rounded '
+
(
active
&&
submitted
?
'bg-amber-100 text-amber-700'
:
'bg-[#F2F3F5] text-[#86909C]'
)
+
'">'
+
(
active
?
status
:
'待查看'
)
+
'</span></div><div class="text-xs text-[#86909C] mt-1">'
+
(
s
.
businessLine
||
'—'
)
+
' · 阶段二部署验收</div></button>'
;
}).
join
(
''
);
return
'<div class="max-w-7xl mx-auto"><div class="flex items-center justify-between mb-6"><div><h1 class="text-2xl font-bold text-[#1D2129]">部署验收</h1><p class="text-sm text-[#86909C] mt-1">选择负责学生,查看部署产物、实操日志与实操报告</p></div><span class="px-3 py-1.5 rounded-lg text-sm font-medium '
+
statusClass
+
'">'
+
status
+
'</span></div><div class="grid grid-cols-3 gap-5 mb-6"><div class="feature-card p-5"><div class="text-xs text-[#86909C]">负责学生</div><div class="text-2xl font-bold mt-1">'
+
students
.
length
+
'</div></div><div class="feature-card p-5"><div class="text-xs text-[#86909C]">待验收提交</div><div class="text-2xl font-bold mt-1">'
+
(
students
.
length
&&
submitted
?
1
:
0
)
+
'</div></div><div class="feature-card p-5"><div class="text-xs text-[#86909C]">当前学生</div><div class="text-lg font-bold mt-1">'
+
(
selected
?
selected
.
name
:
'—'
)
+
'</div></div></div><div class="grid grid-cols-3 gap-6"><div class="bg-white rounded-lg border border-[#E5E6EB] p-5"><h3 class="font-semibold mb-4">我的学生</h3>'
+
(
listHtml
||
'<div class="py-10 text-center text-sm text-[#86909C]">暂无负责学生</div>'
)
+
'</div><div class="col-span-2 bg-white rounded-lg border border-[#E5E6EB] p-6">'
+
(
selected
?
'<div class="flex items-center justify-between mb-5"><div><h3 class="font-semibold">'
+
selected
.
name
+
' · 部署提交</h3><p class="text-xs text-[#86909C] mt-1">当前仅完成学生选择,验收内容将在下一步接入</p></div><span class="text-sm '
+
(
submitted
?
'text-amber-600'
:
'text-[#86909C]'
)
+
'">'
+
status
+
'</span></div><div class="p-8 text-center rounded-lg bg-[#F7F8FA] text-sm text-[#86909C]"><svg class="w-10 h-10 mx-auto mb-3 text-[#C9CDD4]" data-lucide="clipboard-check"></svg>请选择学生后查看验收内容</div>'
:
'<div class="py-16 text-center text-[#86909C]">请先从左侧选择学生</div>'
)
+
'</div></div></div>'
;
};
};
pageRenderers
[
"mentor-autodl"
]
=
function
()
{
pageRenderers
[
"mentor-autodl"
]
=
function
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论