Merge pull request #2766 from zhayujie/feat-mulit-session

feat(web): add multi-session management for web console
This commit is contained in:
zhayujie
2026-04-13 18:51:07 +08:00
committed by GitHub
8 changed files with 1257 additions and 105 deletions

View File

@@ -17,6 +17,45 @@
.dark ::-webkit-scrollbar-thumb { background: #475569; }
.dark ::-webkit-scrollbar-thumb:hover { background: #64748b; }
/* Generic Tooltip (via data-tooltip attribute) */
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
left: 50%;
bottom: calc(100% + 8px);
transform: translateX(-50%);
padding: 5px 10px;
border-radius: 6px;
font-size: 12px;
font-weight: 400;
line-height: 1.4;
white-space: nowrap;
background: #1e293b;
color: #e2e8f0;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
opacity: 0;
pointer-events: none;
transition: opacity 0.15s ease;
z-index: 100;
}
[data-tooltip-pos="bottom"]::after {
bottom: auto;
top: calc(100% + 8px);
}
.dark [data-tooltip]::after {
background: #334155;
color: #f1f5f9;
}
[data-tooltip]:hover::after {
opacity: 1;
}
[data-tooltip=""]:hover::after {
display: none;
}
/* Sidebar */
.sidebar-item.active {
background: rgba(255, 255, 255, 0.08);
@@ -24,9 +63,300 @@
}
.sidebar-item.active .item-icon { color: #4ABE6E; }
/* Session Panel */
.session-panel {
width: 220px;
flex-shrink: 0;
display: flex;
flex-direction: column;
background: #fafafa;
border-right: 1px solid #e5e7eb;
height: 100vh;
overflow: hidden;
transition: width 0.2s ease;
}
.dark .session-panel {
background: #111111;
border-right-color: rgba(255, 255, 255, 0.08);
}
.session-panel.hidden { display: none; }
.session-panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid #e5e7eb;
flex-shrink: 0;
}
.dark .session-panel-header { border-bottom-color: rgba(255, 255, 255, 0.08); }
.session-panel-title {
font-size: 14px;
font-weight: 600;
color: #374151;
}
.dark .session-panel-title { color: #d1d5db; }
.session-panel-close {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
border: none;
background: none;
color: #9ca3af;
cursor: pointer;
transition: background 0.15s, color 0.15s;
font-size: 12px;
}
.session-panel-close:hover {
background: #f3f4f6;
color: #374151;
}
.dark .session-panel-close:hover {
background: rgba(255, 255, 255, 0.08);
color: #e5e5e5;
}
.session-panel-new {
display: flex;
align-items: center;
gap: 8px;
margin: 10px 12px;
padding: 8px 14px;
border-radius: 8px;
border: 1px dashed #d1d5db;
background: none;
color: #6b7280;
font-size: 13px;
cursor: pointer;
transition: border-color 0.15s, color 0.15s, background 0.15s;
flex-shrink: 0;
}
.session-panel-new:hover {
border-color: #9ca3af;
color: #374151;
background: #f9fafb;
}
.dark .session-panel-new {
border-color: rgba(255, 255, 255, 0.12);
color: #9ca3af;
}
.dark .session-panel-new:hover {
border-color: rgba(255, 255, 255, 0.25);
color: #e5e5e5;
background: rgba(255, 255, 255, 0.04);
}
/* Session List */
.session-list {
flex: 1;
overflow-y: auto;
padding: 4px 8px;
scrollbar-width: none;
}
.session-list:hover { scrollbar-width: thin; }
.session-list::-webkit-scrollbar { width: 4px; background: transparent; }
.session-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.session-list:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }
.dark .session-list:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
.session-group-label {
padding: 10px 8px 4px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #9ca3af;
}
.dark .session-group-label { color: #525252; }
.session-empty {
padding: 20px 12px;
text-align: center;
font-size: 13px;
color: #9ca3af;
}
.session-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 10px;
margin: 1px 0;
border-radius: 8px;
cursor: pointer;
transition: background 0.15s, color 0.15s;
color: #6b7280;
font-size: 13px;
position: relative;
}
.dark .session-item { color: #a3a3a3; }
.session-item:hover {
background: #f3f4f6;
color: #111827;
}
.dark .session-item:hover {
background: rgba(255, 255, 255, 0.05);
color: #e5e5e5;
}
.session-item.active {
background: #e5e7eb;
color: #111827;
}
.dark .session-item.active {
background: rgba(255, 255, 255, 0.1);
color: #ffffff;
}
.session-icon {
flex-shrink: 0;
font-size: 11px;
color: #9ca3af;
width: 16px;
text-align: center;
}
.dark .session-icon { color: #525252; }
.session-item.active .session-icon { color: #4ABE6E; }
.session-title {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.session-delete {
flex-shrink: 0;
width: 22px;
height: 22px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
font-size: 10px;
color: #9ca3af;
opacity: 0;
transition: opacity 0.15s, color 0.15s, background 0.15s;
cursor: pointer;
background: none;
border: none;
padding: 0;
}
.session-item:hover .session-delete { opacity: 1; }
.session-delete:hover {
color: #ef4444;
background: rgba(239, 68, 68, 0.1);
}
.dark .session-delete:hover { background: rgba(239, 68, 68, 0.15); }
/* Context Divider */
.context-divider {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 24px;
color: #9ca3af;
}
.context-divider::before, .context-divider::after {
content: '';
flex: 1;
height: 1px;
background: linear-gradient(to right, transparent, #d1d5db, transparent);
}
.dark .context-divider::before, .dark .context-divider::after {
background: linear-gradient(to right, transparent, rgba(255,255,255,0.12), transparent);
}
.context-divider span {
font-size: 12px;
white-space: nowrap;
color: #9ca3af;
}
/* Confirm Modal */
.confirm-overlay {
position: fixed;
inset: 0;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.4);
opacity: 0;
transition: opacity 0.2s ease;
}
.confirm-overlay.visible { opacity: 1; }
.confirm-modal {
background: #fff;
border-radius: 14px;
width: 380px;
max-width: 90vw;
padding: 28px 24px 20px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
transform: scale(0.92);
transition: transform 0.2s ease;
}
.confirm-overlay.visible .confirm-modal { transform: scale(1); }
.dark .confirm-modal {
background: #1e1e1e;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.confirm-title {
font-size: 16px;
font-weight: 600;
color: #1f2937;
margin-bottom: 8px;
}
.dark .confirm-title { color: #e5e7eb; }
.confirm-message {
font-size: 14px;
color: #6b7280;
line-height: 1.5;
margin-bottom: 24px;
}
.dark .confirm-message { color: #9ca3af; }
.confirm-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
}
.confirm-btn {
padding: 8px 20px;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
border: none;
transition: all 0.15s ease;
}
.confirm-btn-cancel {
background: #f3f4f6;
color: #374151;
}
.confirm-btn-cancel:hover { background: #e5e7eb; }
.dark .confirm-btn-cancel {
background: rgba(255, 255, 255, 0.08);
color: #d1d5db;
}
.dark .confirm-btn-cancel:hover { background: rgba(255, 255, 255, 0.14); }
.confirm-btn-ok {
background: #ef4444;
color: #fff;
}
.confirm-btn-ok:hover { background: #dc2626; }
/* Mobile: session panel as overlay */
@media (max-width: 768px) {
.session-panel {
position: fixed;
top: 0;
left: 0;
z-index: 45;
width: 220px;
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}
.dark .session-panel {
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}
}
/* Menu Groups */
.menu-group-items { max-height: 0; overflow: hidden; transition: max-height 0.25s ease-out; }
.menu-group.open .menu-group-items { max-height: 500px; transition: max-height 0.35s ease-in; }
.menu-group.open .menu-group-items { max-height: 2000px; transition: max-height 0.35s ease-in; }
.menu-group .chevron { transition: transform 0.25s ease; }
.menu-group.open .chevron { transform: rotate(90deg); }