- 新增 /api/agents/:agentName/conversations API,按 sessionKey 分组汇总 - 新增 /api/agents/:agentName/conversations/:sessionKey/timeline API - 前端新增「对话汇总」Tab,展示对话级别的统计信息 - 支持展开查看对话下的所有 session 阶段 - 修复 session 文件不存在时返回 404 的问题 功能: - 显示每个对话的总消息数、Token 数、压缩次数、时长 - 标注原始 session 和压缩后的 session - 显示对话时间跨度
548 lines
11 KiB
CSS
548 lines
11 KiB
CSS
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
|
color: #e0e0e0;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1800px;
|
|
margin: 0 auto;
|
|
padding: 15px;
|
|
}
|
|
|
|
header {
|
|
text-align: center;
|
|
margin-bottom: 20px;
|
|
padding-bottom: 15px;
|
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
}
|
|
|
|
header h1 {
|
|
font-size: 2rem;
|
|
background: linear-gradient(90deg, #00d4ff, #7b2cbf);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
header .subtitle {
|
|
color: #888;
|
|
margin-top: 5px;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
main {
|
|
display: grid;
|
|
grid-template-columns: 180px 280px 280px 1fr;
|
|
gap: 15px;
|
|
height: calc(100vh - 120px);
|
|
}
|
|
|
|
/* 面板通用样式 */
|
|
.agents-panel, .sessions-panel, .messages-panel, .detail-panel {
|
|
background: rgba(255,255,255,0.05);
|
|
border-radius: 10px;
|
|
padding: 15px;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.agents-panel h2, .sessions-panel h2, .messages-panel h2, .detail-panel h2 {
|
|
font-size: 1rem;
|
|
margin-bottom: 12px;
|
|
padding-bottom: 8px;
|
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
color: #fff;
|
|
}
|
|
|
|
.agents-panel h2 span, .sessions-panel h2 span, .messages-panel h2 span {
|
|
font-size: 0.8rem;
|
|
color: #888;
|
|
margin-left: 8px;
|
|
}
|
|
|
|
/* 列表容器 */
|
|
.agents-list, .sessions-list, .messages-list, .detail-list {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* 智能体项 */
|
|
.agent-item {
|
|
padding: 10px 12px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
margin-bottom: 6px;
|
|
background: rgba(255,255,255,0.03);
|
|
border: 1px solid transparent;
|
|
}
|
|
|
|
.agent-item:hover {
|
|
background: rgba(255,255,255,0.08);
|
|
border-color: rgba(0,212,255,0.3);
|
|
}
|
|
|
|
.agent-item.active {
|
|
background: rgba(0,212,255,0.15);
|
|
border-color: rgba(0,212,255,0.5);
|
|
}
|
|
|
|
.agent-item .name {
|
|
font-weight: 600;
|
|
color: #fff;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.agent-item .meta {
|
|
font-size: 0.75rem;
|
|
color: #888;
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
/* 会话项 */
|
|
.session-item {
|
|
padding: 12px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
margin-bottom: 8px;
|
|
background: rgba(255,255,255,0.03);
|
|
border: 1px solid transparent;
|
|
}
|
|
|
|
.session-item:hover {
|
|
background: rgba(255,255,255,0.08);
|
|
border-color: rgba(0,212,255,0.3);
|
|
}
|
|
|
|
.session-item.active {
|
|
background: rgba(0,212,255,0.15);
|
|
border-color: rgba(0,212,255,0.5);
|
|
}
|
|
|
|
.session-item .session-header {
|
|
display: flex;
|
|
gap: 6px;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.session-item .channel {
|
|
display: inline-block;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
font-size: 0.7rem;
|
|
}
|
|
|
|
.session-item .channel.matrix { background: #0dbd8b; color: #fff; }
|
|
.session-item .channel.discord { background: #5865F2; color: #fff; }
|
|
.session-item .channel.telegram { background: #0088cc; color: #fff; }
|
|
.session-item .channel.cli { background: #4a4a4a; color: #fff; }
|
|
.session-item .channel.main { background: #7b2cbf; color: #fff; }
|
|
|
|
.session-item .status {
|
|
display: inline-block;
|
|
padding: 2px 6px;
|
|
border-radius: 4px;
|
|
font-size: 0.65rem;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.session-item .status.done { background: #2e7d32; color: #fff; }
|
|
.session-item .status.running { background: #ed6c02; color: #fff; }
|
|
.session-item .status.error { background: #c62828; color: #fff; }
|
|
|
|
.session-item .meta {
|
|
font-size: 0.75rem;
|
|
color: #888;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.session-item .model {
|
|
color: #00d4ff;
|
|
}
|
|
|
|
.session-item .target {
|
|
font-size: 0.7rem;
|
|
color: #aaa;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.session-item .tokens {
|
|
font-size: 0.7rem;
|
|
color: #666;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
/* 消息概览项 */
|
|
.message-summary {
|
|
padding: 10px 12px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
margin-bottom: 6px;
|
|
background: rgba(255,255,255,0.03);
|
|
border: 1px solid transparent;
|
|
border-left: 3px solid #666;
|
|
}
|
|
|
|
.message-summary.user {
|
|
border-left-color: #00d4ff;
|
|
}
|
|
|
|
.message-summary.assistant {
|
|
border-left-color: #7b2cbf;
|
|
}
|
|
|
|
.message-summary.toolResult {
|
|
border-left-color: #ed6c02;
|
|
}
|
|
|
|
.message-summary:hover {
|
|
background: rgba(255,255,255,0.08);
|
|
border-color: rgba(0,212,255,0.2);
|
|
}
|
|
|
|
.message-summary.active {
|
|
background: rgba(0,212,255,0.15);
|
|
border-color: rgba(0,212,255,0.5);
|
|
}
|
|
|
|
.message-summary .summary-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.message-summary .role-badge {
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.message-summary .role-badge.user { color: #00d4ff; }
|
|
.message-summary .role-badge.assistant { color: #7b2cbf; }
|
|
.message-summary .role-badge.toolResult { color: #ed6c02; }
|
|
|
|
.message-summary .time {
|
|
font-size: 0.7rem;
|
|
color: #666;
|
|
}
|
|
|
|
.message-summary .summary-text {
|
|
font-size: 0.85rem;
|
|
color: #ccc;
|
|
line-height: 1.4;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.message-summary .summary-meta {
|
|
font-size: 0.7rem;
|
|
color: #888;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.message-summary .more-indicator {
|
|
color: #00d4ff;
|
|
}
|
|
|
|
/* 消息详情 */
|
|
.message-detail-content {
|
|
padding: 15px;
|
|
border-radius: 8px;
|
|
background: rgba(255,255,255,0.05);
|
|
border-left: 4px solid #666;
|
|
}
|
|
|
|
.message-detail-content.user {
|
|
border-left-color: #00d4ff;
|
|
}
|
|
|
|
.message-detail-content.assistant {
|
|
border-left-color: #7b2cbf;
|
|
}
|
|
|
|
.message-detail-content.toolResult {
|
|
border-left-color: #ed6c02;
|
|
}
|
|
|
|
.detail-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 12px;
|
|
padding-bottom: 10px;
|
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
}
|
|
|
|
.role-badge.large {
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.role-badge.large.user { color: #00d4ff; }
|
|
.role-badge.large.assistant { color: #7b2cbf; }
|
|
.role-badge.large.toolResult { color: #ed6c02; }
|
|
|
|
.detail-header .time {
|
|
font-size: 0.8rem;
|
|
color: #888;
|
|
}
|
|
|
|
.detail-body {
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.content-text {
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
font-family: 'Fira Code', 'Consolas', monospace;
|
|
font-size: 0.85rem;
|
|
line-height: 1.5;
|
|
color: #ddd;
|
|
background: rgba(0,0,0,0.2);
|
|
padding: 10px;
|
|
border-radius: 4px;
|
|
max-height: calc(100vh - 250px);
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* 加载和占位 */
|
|
.loading, .placeholder {
|
|
text-align: center;
|
|
padding: 30px 15px;
|
|
color: #666;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
.loading::after {
|
|
content: '';
|
|
display: inline-block;
|
|
width: 16px;
|
|
height: 16px;
|
|
border: 2px solid #333;
|
|
border-top-color: #00d4ff;
|
|
border-radius: 50%;
|
|
animation: spin 1s linear infinite;
|
|
margin-left: 8px;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
@keyframes spin {
|
|
to { transform: rotate(360deg); }
|
|
}
|
|
|
|
/* 滚动条样式 */
|
|
.agents-list::-webkit-scrollbar,
|
|
.sessions-list::-webkit-scrollbar,
|
|
.messages-list::-webkit-scrollbar,
|
|
.detail-list::-webkit-scrollbar,
|
|
.content-text::-webkit-scrollbar {
|
|
width: 5px;
|
|
}
|
|
|
|
.agents-list::-webkit-scrollbar-track,
|
|
.sessions-list::-webkit-scrollbar-track,
|
|
.messages-list::-webkit-scrollbar-track,
|
|
.detail-list::-webkit-scrollbar-track,
|
|
.content-text::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
|
|
.agents-list::-webkit-scrollbar-thumb,
|
|
.sessions-list::-webkit-scrollbar-thumb,
|
|
.messages-list::-webkit-scrollbar-thumb,
|
|
.detail-list::-webkit-scrollbar-thumb,
|
|
.content-text::-webkit-scrollbar-thumb {
|
|
background: rgba(255,255,255,0.2);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.agents-list::-webkit-scrollbar-thumb:hover,
|
|
.sessions-list::-webkit-scrollbar-thumb:hover,
|
|
.messages-list::-webkit-scrollbar-thumb:hover,
|
|
.detail-list::-webkit-scrollbar-thumb:hover,
|
|
.content-text::-webkit-scrollbar-thumb:hover {
|
|
background: rgba(255,255,255,0.3);
|
|
}
|
|
|
|
/* Tab 切换样式 */
|
|
.view-tabs {
|
|
display: flex;
|
|
gap: 4px;
|
|
margin-bottom: 12px;
|
|
padding-bottom: 8px;
|
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
}
|
|
|
|
.tab-btn {
|
|
flex: 1;
|
|
padding: 6px 10px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: rgba(255,255,255,0.05);
|
|
color: #888;
|
|
font-size: 0.75rem;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.tab-btn:hover {
|
|
background: rgba(255,255,255,0.1);
|
|
color: #fff;
|
|
}
|
|
|
|
.tab-btn.active {
|
|
background: rgba(0,212,255,0.2);
|
|
color: #00d4ff;
|
|
}
|
|
|
|
.view-content {
|
|
display: none;
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.view-content.active {
|
|
display: block;
|
|
}
|
|
|
|
/* 对话汇总项 */
|
|
.conversation-item {
|
|
padding: 12px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
margin-bottom: 8px;
|
|
background: rgba(255,255,255,0.03);
|
|
border: 1px solid transparent;
|
|
}
|
|
|
|
.conversation-item:hover {
|
|
background: rgba(255,255,255,0.08);
|
|
border-color: rgba(123,44,191,0.3);
|
|
}
|
|
|
|
.conversation-item.active {
|
|
background: rgba(123,44,191,0.15);
|
|
border-color: rgba(123,44,191,0.5);
|
|
}
|
|
|
|
.conversation-item .conv-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.conversation-item .conv-title {
|
|
font-weight: 600;
|
|
color: #fff;
|
|
font-size: 0.85rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.conversation-item .conv-badge {
|
|
display: inline-block;
|
|
padding: 2px 6px;
|
|
border-radius: 4px;
|
|
font-size: 0.65rem;
|
|
background: rgba(123,44,191,0.3);
|
|
color: #c77dff;
|
|
}
|
|
|
|
.conversation-item .conv-stats {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 4px;
|
|
font-size: 0.7rem;
|
|
color: #888;
|
|
margin-top: 6px;
|
|
}
|
|
|
|
.conversation-item .conv-stats .stat {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.conversation-item .conv-stats .stat-value {
|
|
color: #00d4ff;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.conversation-item .conv-target {
|
|
font-size: 0.7rem;
|
|
color: #aaa;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.conversation-item .conv-time {
|
|
font-size: 0.65rem;
|
|
color: #666;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
/* 对话详情 - session 列表 */
|
|
.conv-sessions-header {
|
|
padding: 8px 12px;
|
|
background: rgba(123,44,191,0.1);
|
|
border-radius: 6px;
|
|
margin-bottom: 8px;
|
|
font-size: 0.8rem;
|
|
color: #c77dff;
|
|
}
|
|
|
|
.conv-sessions-header .back-btn {
|
|
cursor: pointer;
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.conv-sessions-header .back-btn:hover {
|
|
color: #fff;
|
|
}
|
|
|
|
/* 响应式 */
|
|
@media (max-width: 1400px) {
|
|
main {
|
|
grid-template-columns: 160px 250px 250px 1fr;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 1100px) {
|
|
main {
|
|
grid-template-columns: 150px 220px 220px 1fr;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 900px) {
|
|
main {
|
|
grid-template-columns: 1fr;
|
|
grid-template-rows: 200px 200px 200px 1fr;
|
|
}
|
|
|
|
.agents-panel, .sessions-panel, .messages-panel {
|
|
max-height: 200px;
|
|
}
|
|
} |