Phase 1: Fix RHS panel to fetch existing sessions on mount - Add initial API fetch in useAllStatusUpdates() hook - Allow GET /sessions endpoint without shared secret auth - RHS panel now shows sessions after page refresh Phase 2: Floating widget component (registerRootComponent) - New floating_widget.tsx with auto-show/hide behavior - Draggable, collapsible to pulsing dot with session count - Shows last 5 lines of most recent active session - Position persisted to localStorage - CSS styles using Mattermost theme variables Phase 3: Session cleanup and KV optimization - Add LastUpdateMs field to SessionData for staleness tracking - Set LastUpdateMs on session create and update - Add periodic cleanup goroutine (every 5 min) - Stale active sessions (>30 min no update) marked interrupted - Expired non-active sessions (>1 hr) deleted from KV - Add ListAllSessions and keep ListActiveSessions as helper - Add debug logging to daemon file polling Closes #5
446 lines
8.7 KiB
CSS
446 lines
8.7 KiB
CSS
/* OpenClaw Live Status — Post Type Styles */
|
|
|
|
.ls-post {
|
|
border-radius: 4px;
|
|
overflow: hidden;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
margin: 4px 0;
|
|
}
|
|
|
|
/* Header */
|
|
.ls-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 12px;
|
|
background: var(--center-channel-bg, #fff);
|
|
border-bottom: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
}
|
|
|
|
.ls-agent-badge {
|
|
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
padding: 2px 8px;
|
|
border-radius: 10px;
|
|
background: var(--button-bg, #166de0);
|
|
color: var(--button-color, #fff);
|
|
}
|
|
|
|
.ls-child-badge {
|
|
font-size: 11px;
|
|
background: var(--center-channel-color-24, rgba(0, 0, 0, 0.24));
|
|
}
|
|
|
|
.ls-status-badge {
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
padding: 2px 6px;
|
|
border-radius: 3px;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.ls-status-active .ls-status-badge {
|
|
background: #e8f5e9;
|
|
color: #2e7d32;
|
|
}
|
|
|
|
.ls-status-done .ls-status-badge {
|
|
background: #e3f2fd;
|
|
color: #1565c0;
|
|
}
|
|
|
|
.ls-status-error .ls-status-badge {
|
|
background: #fbe9e7;
|
|
color: #c62828;
|
|
}
|
|
|
|
.ls-status-interrupted .ls-status-badge {
|
|
background: #fff3e0;
|
|
color: #e65100;
|
|
}
|
|
|
|
.ls-elapsed {
|
|
font-size: 12px;
|
|
color: var(--center-channel-color-56, rgba(0, 0, 0, 0.56));
|
|
margin-left: auto;
|
|
font-family: 'SFMono-Regular', Consolas, monospace;
|
|
}
|
|
|
|
/* Live dot — pulsing green indicator */
|
|
.ls-live-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: #4caf50;
|
|
animation: ls-pulse 1.5s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes ls-pulse {
|
|
0%,
|
|
100% {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
50% {
|
|
opacity: 0.5;
|
|
transform: scale(0.8);
|
|
}
|
|
}
|
|
|
|
/* Terminal view */
|
|
.ls-terminal {
|
|
max-height: 400px;
|
|
overflow-y: auto;
|
|
padding: 8px 12px;
|
|
background: var(--center-channel-color-04, rgba(0, 0, 0, 0.04));
|
|
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
|
font-size: 12px;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
/* Status lines */
|
|
.ls-status-line {
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.ls-tool-call {
|
|
color: var(--center-channel-color, #3d3c40);
|
|
}
|
|
|
|
.ls-tool-name {
|
|
color: var(--link-color, #2389d7);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.ls-tool-args {
|
|
color: var(--center-channel-color-72, rgba(0, 0, 0, 0.72));
|
|
}
|
|
|
|
.ls-marker-ok {
|
|
color: #4caf50;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.ls-marker-err {
|
|
color: #f44336;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.ls-thinking {
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
}
|
|
|
|
.ls-thinking-prefix {
|
|
color: var(--center-channel-color-24, rgba(0, 0, 0, 0.24));
|
|
}
|
|
|
|
/* Children (sub-agents) */
|
|
.ls-children {
|
|
border-top: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.ls-child {
|
|
margin: 0 12px;
|
|
border-left: 2px solid var(--center-channel-color-16, rgba(0, 0, 0, 0.16));
|
|
padding-left: 8px;
|
|
}
|
|
|
|
.ls-child-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 4px 0;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.ls-expand-icon {
|
|
font-size: 10px;
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
width: 12px;
|
|
}
|
|
|
|
/* Footer */
|
|
.ls-footer {
|
|
padding: 4px 12px 8px;
|
|
font-size: 11px;
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
font-family: 'SFMono-Regular', Consolas, monospace;
|
|
}
|
|
|
|
/* Loading state */
|
|
.ls-loading {
|
|
padding: 12px;
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
font-style: italic;
|
|
}
|
|
|
|
/* Scrollbar styling */
|
|
.ls-terminal::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
|
|
.ls-terminal::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
|
|
.ls-terminal::-webkit-scrollbar-thumb {
|
|
background: var(--center-channel-color-16, rgba(0, 0, 0, 0.16));
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.ls-terminal::-webkit-scrollbar-thumb:hover {
|
|
background: var(--center-channel-color-32, rgba(0, 0, 0, 0.32));
|
|
}
|
|
|
|
/* ========= RHS Panel Styles ========= */
|
|
|
|
.ls-rhs-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
overflow-y: auto;
|
|
background: var(--center-channel-bg, #fff);
|
|
}
|
|
|
|
.ls-rhs-summary {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 12px 16px;
|
|
border-bottom: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--center-channel-color, #3d3c40);
|
|
}
|
|
|
|
.ls-rhs-count {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.ls-rhs-empty {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 48px 24px;
|
|
text-align: center;
|
|
}
|
|
|
|
.ls-rhs-empty-icon {
|
|
font-size: 32px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.ls-rhs-empty-text {
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
font-size: 13px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.ls-rhs-card {
|
|
margin: 8px 12px;
|
|
border: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
border-radius: 6px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.ls-rhs-card.ls-status-active {
|
|
border-color: rgba(76, 175, 80, 0.3);
|
|
}
|
|
|
|
.ls-rhs-card-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 10px;
|
|
background: var(--center-channel-color-04, rgba(0, 0, 0, 0.04));
|
|
border-bottom: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
}
|
|
|
|
.ls-rhs-card .ls-terminal {
|
|
max-height: 250px;
|
|
font-size: 11px;
|
|
padding: 6px 10px;
|
|
}
|
|
|
|
.ls-rhs-card-footer {
|
|
padding: 4px 10px 6px;
|
|
font-size: 11px;
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
font-family: 'SFMono-Regular', Consolas, monospace;
|
|
border-top: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
}
|
|
|
|
.ls-rhs-children {
|
|
padding: 4px 10px;
|
|
border-top: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
}
|
|
|
|
.ls-rhs-child {
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.ls-rhs-child-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 11px;
|
|
}
|
|
|
|
.ls-rhs-section {
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.ls-rhs-section-title {
|
|
padding: 8px 16px 4px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
}
|
|
|
|
/* ========= Floating Widget Styles ========= */
|
|
|
|
.ls-widget-collapsed {
|
|
position: fixed;
|
|
z-index: 9999;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 8px;
|
|
background: var(--center-channel-bg, #fff);
|
|
border: 1px solid var(--center-channel-color-16, rgba(0, 0, 0, 0.16));
|
|
border-radius: 50%;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
transition: transform 0.2s;
|
|
}
|
|
|
|
.ls-widget-collapsed:hover {
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
.ls-widget-collapsed .ls-live-dot {
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
.ls-widget-count {
|
|
position: absolute;
|
|
top: -4px;
|
|
right: -4px;
|
|
background: #f44336;
|
|
color: #fff;
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
width: 16px;
|
|
height: 16px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.ls-widget-expanded {
|
|
position: fixed;
|
|
z-index: 9999;
|
|
width: 320px;
|
|
max-height: 300px;
|
|
background: var(--center-channel-bg, #fff);
|
|
border: 1px solid var(--center-channel-color-16, rgba(0, 0, 0, 0.16));
|
|
border-radius: 8px;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
}
|
|
|
|
.ls-widget-header {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 8px 10px;
|
|
background: var(--center-channel-color-04, rgba(0, 0, 0, 0.04));
|
|
border-bottom: 1px solid var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
cursor: grab;
|
|
user-select: none;
|
|
}
|
|
|
|
.ls-widget-header:active {
|
|
cursor: grabbing;
|
|
}
|
|
|
|
.ls-widget-title {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
flex: 1;
|
|
}
|
|
|
|
.ls-widget-collapse-btn,
|
|
.ls-widget-close-btn {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-size: 14px;
|
|
color: var(--center-channel-color-56, rgba(0, 0, 0, 0.56));
|
|
padding: 2px 6px;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.ls-widget-collapse-btn:hover,
|
|
.ls-widget-close-btn:hover {
|
|
background: var(--center-channel-color-08, rgba(0, 0, 0, 0.08));
|
|
}
|
|
|
|
.ls-widget-body {
|
|
padding: 8px;
|
|
overflow-y: auto;
|
|
flex: 1;
|
|
}
|
|
|
|
.ls-widget-session {
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.ls-widget-session-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.ls-widget-lines {
|
|
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
|
font-size: 11px;
|
|
line-height: 1.5;
|
|
background: var(--center-channel-color-04, rgba(0, 0, 0, 0.04));
|
|
border-radius: 4px;
|
|
padding: 6px 8px;
|
|
max-height: 150px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.ls-widget-empty {
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
font-size: 12px;
|
|
text-align: center;
|
|
padding: 12px;
|
|
}
|
|
|
|
.ls-widget-more {
|
|
font-size: 11px;
|
|
color: var(--center-channel-color-48, rgba(0, 0, 0, 0.48));
|
|
text-align: center;
|
|
padding: 4px;
|
|
}
|