feat(terminal): add Terminal panel to Node Details with WebSocket
- Add 'Terminal' button to drawer header
- Implement TerminalPanel (bottom-up fade-in, ~1/3 viewport, left of drawer)
- Connect to ws(s)://{nodeIp}/ws; display incoming messages; input sends raw
- Wire Drawer to pass node IP and close terminal on drawer close
- Add styles/z-index and include script in index.html
This commit is contained in:
@@ -3298,6 +3298,23 @@ select.param-input:focus {
|
||||
.details-drawer-header .drawer-title {
|
||||
font-weight: 600;
|
||||
}
|
||||
.details-drawer-header .drawer-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.drawer-terminal-btn {
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-secondary);
|
||||
color: var(--text-secondary);
|
||||
border-radius: 8px;
|
||||
padding: 0.35rem 0.6rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.drawer-terminal-btn:hover {
|
||||
background: var(--bg-hover);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.drawer-close {
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-secondary);
|
||||
@@ -3323,6 +3340,108 @@ select.param-input:focus {
|
||||
.details-drawer-backdrop { display: none; }
|
||||
}
|
||||
|
||||
/* Terminal Panel - bottom up, left of drawer, 1/3 viewport height */
|
||||
.terminal-panel-container {
|
||||
position: fixed;
|
||||
inset: auto 0 0 auto; /* bottom-right anchored; right adjusted dynamically */
|
||||
right: 0; /* updated at runtime to drawer width */
|
||||
width: clamp(33.333vw, 600px, 90vw); /* match drawer width by default */
|
||||
z-index: 1001; /* above drawer (1000) and backdrop (999) */
|
||||
pointer-events: none; /* allow clicks only on panel */
|
||||
}
|
||||
|
||||
.terminal-panel {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 33vh; /* 1/3 of viewport height */
|
||||
max-height: 40vh;
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
border-left: 1px solid var(--border-primary);
|
||||
box-shadow: 0 -8px 20px rgba(0,0,0,0.25);
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
transition: transform 0.25s ease, opacity 0.25s ease;
|
||||
border-top-left-radius: 10px;
|
||||
pointer-events: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.terminal-panel.visible {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
.terminal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-bottom: 1px solid var(--border-secondary);
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
.terminal-title {
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
.terminal-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.terminal-actions button {
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-secondary);
|
||||
color: var(--text-secondary);
|
||||
border-radius: 6px;
|
||||
padding: 0.25rem 0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.terminal-actions button:hover {
|
||||
background: var(--bg-hover);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.terminal-body {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
.terminal-log {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
font-family: "Courier New", monospace;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.terminal-input-row {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
border-top: 1px solid var(--border-secondary);
|
||||
padding: 0.5rem;
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
.terminal-input {
|
||||
flex: 1;
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-secondary);
|
||||
border-radius: 6px;
|
||||
padding: 0.4rem 0.6rem;
|
||||
}
|
||||
.terminal-send-btn {
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
padding: 0.4rem 0.6rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.terminal-send-btn:hover {
|
||||
filter: brightness(1.05);
|
||||
}
|
||||
|
||||
/* Topology hover tooltip for labels */
|
||||
.topology-tooltip {
|
||||
position: fixed;
|
||||
|
||||
Reference in New Issue
Block a user