feat: 实现会话管理功能

- 实现会话列表 API
- 实现会话详情 API
- 实现终止会话 API
- 添加会话管理页面 UI
- 添加会话管理样式
- 添加会话管理交互脚本
This commit is contained in:
小白
2026-03-12 20:56:13 +08:00
parent a9b35727ce
commit 2f620fa4d0
4 changed files with 511 additions and 11 deletions

View File

@@ -436,6 +436,229 @@ body {
color: var(--text-secondary);
}
/* 会话管理 */
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.btn-refresh {
padding: 8px 16px;
background: var(--primary-color);
color: white;
border: none;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
transition: opacity 0.3s;
}
.btn-refresh:hover {
opacity: 0.8;
}
.sessions-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.session-card {
background: var(--card-bg);
border-radius: 10px;
padding: 16px 20px;
border: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 15px;
transition: all 0.3s ease;
}
.session-card:hover {
transform: translateX(4px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.session-icon {
font-size: 28px;
}
.session-info {
flex: 1;
}
.session-name {
font-size: 15px;
font-weight: 500;
color: var(--text-primary);
margin-bottom: 4px;
}
.session-meta {
font-size: 13px;
color: var(--text-secondary);
}
.session-status {
padding: 4px 10px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
}
.session-status.active {
background: rgba(72, 187, 120, 0.2);
color: var(--success-color);
}
.session-actions {
display: flex;
gap: 8px;
}
.btn-view, .btn-kill {
padding: 6px 12px;
border: none;
border-radius: 6px;
font-size: 13px;
cursor: pointer;
transition: opacity 0.3s;
}
.btn-view {
background: var(--primary-color);
color: white;
}
.btn-kill {
background: var(--danger-color);
color: white;
}
.btn-view:hover, .btn-kill:hover {
opacity: 0.8;
}
/* 模态框 */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
align-items: center;
justify-content: center;
}
.modal.show {
display: flex;
}
.modal-content {
background: var(--card-bg);
border-radius: 12px;
width: 90%;
max-width: 600px;
max-height: 80vh;
overflow: hidden;
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
font-size: 18px;
font-weight: 600;
color: var(--text-primary);
}
.modal-close {
width: 32px;
height: 32px;
border: none;
background: none;
font-size: 24px;
cursor: pointer;
color: var(--text-secondary);
}
.modal-body {
padding: 20px;
max-height: 50vh;
overflow-y: auto;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 16px 20px;
border-top: 1px solid var(--border-color);
}
.btn-danger, .btn-secondary {
padding: 8px 16px;
border: none;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
transition: opacity 0.3s;
}
.btn-danger {
background: var(--danger-color);
color: white;
}
.btn-secondary {
background: var(--border-color);
color: var(--text-primary);
}
.btn-danger:hover, .btn-secondary:hover {
opacity: 0.8;
}
/* 详情列表 */
.detail-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.detail-item {
display: flex;
padding: 10px 0;
border-bottom: 1px solid var(--border-color);
}
.detail-item:last-child {
border-bottom: none;
}
.detail-label {
width: 120px;
color: var(--text-secondary);
font-size: 14px;
}
.detail-value {
flex: 1;
color: var(--text-primary);
font-size: 14px;
word-break: break-all;
}
/* 响应式 */
@media (max-width: 768px) {
.sidebar {