- Implemented context menu styles in components.css. - Added SFTP transfer progress queue and related styles in sftp.css. - Enhanced app.js to handle SFTP transfer progress events. - Updated sftp.js to manage transfer progress and render the transfer queue. - Modified terminal.js to include context menu shortcuts. - Adjusted manager.go to emit SFTP transfer progress events with direction. - Updated sshclient.go to modify terminal modes for better performance.
493 lines
11 KiB
CSS
493 lines
11 KiB
CSS
/* ==========================================================================
|
|
Nexus Terminal — SFTP File Browser
|
|
Right-side panel for browsing remote files alongside the terminal.
|
|
========================================================================== */
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Panel wrapper — overlays the terminal from the right side
|
|
----------------------------------------------------------------------- */
|
|
.sftp-panel {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
width: 300px;
|
|
min-width: 220px;
|
|
max-width: 50vw;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--bg-surface);
|
|
border-left: 1px solid var(--border-subtle);
|
|
overflow: hidden;
|
|
z-index: var(--z-dropdown, 50);
|
|
box-shadow: -4px 0 16px rgba(0, 0, 0, 0.25);
|
|
}
|
|
|
|
/* Resize handle — positioned at the left edge of the SFTP panel */
|
|
.sftp-resize-handle {
|
|
position: absolute;
|
|
top: 0;
|
|
left: -3px;
|
|
bottom: 0;
|
|
width: 6px;
|
|
cursor: col-resize;
|
|
background: transparent;
|
|
z-index: var(--z-dropdown, 50);
|
|
transition: background var(--transition-fast);
|
|
}
|
|
|
|
.sftp-resize-handle:hover,
|
|
.sftp-resize-handle.is-dragging {
|
|
background: var(--accent);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Toolbar (top bar with path breadcrumb + action buttons)
|
|
----------------------------------------------------------------------- */
|
|
.sftp-toolbar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-1);
|
|
padding: var(--space-1) var(--space-2);
|
|
border-bottom: 1px solid var(--border-subtle);
|
|
background: var(--bg-elevated);
|
|
flex-shrink: 0;
|
|
min-height: 34px;
|
|
}
|
|
|
|
.sftp-toolbar-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 2px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.sftp-toolbar-btn {
|
|
width: 26px;
|
|
height: 26px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border: none;
|
|
background: none;
|
|
color: var(--text-tertiary);
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
font-size: var(--text-sm);
|
|
transition:
|
|
background var(--transition-fast),
|
|
color var(--transition-fast);
|
|
flex-shrink: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.sftp-toolbar-btn:hover {
|
|
background: var(--bg-hover);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.sftp-toolbar-btn.is-accent:hover {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.sftp-toolbar-btn.is-close:hover {
|
|
color: var(--error);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Breadcrumb path
|
|
----------------------------------------------------------------------- */
|
|
.sftp-breadcrumb {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
font-size: var(--text-xs);
|
|
color: var(--text-tertiary);
|
|
gap: 1px;
|
|
}
|
|
|
|
.sftp-breadcrumb-segment {
|
|
background: none;
|
|
border: none;
|
|
color: var(--text-secondary);
|
|
font-size: var(--text-xs);
|
|
cursor: pointer;
|
|
padding: 2px 4px;
|
|
border-radius: var(--radius-sm);
|
|
white-space: nowrap;
|
|
transition:
|
|
background var(--transition-fast),
|
|
color var(--transition-fast);
|
|
max-width: 100px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.sftp-breadcrumb-segment:hover {
|
|
background: var(--bg-hover);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.sftp-breadcrumb-segment:last-child {
|
|
color: var(--text-primary);
|
|
font-weight: var(--weight-medium);
|
|
}
|
|
|
|
.sftp-breadcrumb-sep {
|
|
color: var(--text-disabled);
|
|
font-size: 10px;
|
|
flex-shrink: 0;
|
|
user-select: none;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
File list
|
|
----------------------------------------------------------------------- */
|
|
.sftp-file-list {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
/* Scrollbar styling */
|
|
.sftp-file-list::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
.sftp-file-list::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
.sftp-file-list::-webkit-scrollbar-thumb {
|
|
background: var(--border-strong, var(--bg-active));
|
|
border-radius: 3px;
|
|
}
|
|
.sftp-file-list::-webkit-scrollbar-thumb:hover {
|
|
background: var(--text-tertiary);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
File row
|
|
----------------------------------------------------------------------- */
|
|
.sftp-file-row {
|
|
display: grid;
|
|
grid-template-columns: 20px 1fr auto;
|
|
align-items: center;
|
|
gap: var(--space-1);
|
|
padding: var(--space-1) var(--space-2);
|
|
cursor: pointer;
|
|
transition: background var(--transition-fast);
|
|
user-select: none;
|
|
min-height: 30px;
|
|
}
|
|
|
|
.sftp-file-row:hover {
|
|
background: var(--bg-hover);
|
|
}
|
|
|
|
.sftp-file-row.is-selected {
|
|
background: var(--accent-muted);
|
|
}
|
|
|
|
.sftp-file-row.is-selected:hover {
|
|
background: var(--accent-strong);
|
|
}
|
|
|
|
.sftp-file-row.is-readonly .sftp-file-meta {
|
|
color: var(--warning);
|
|
font-weight: var(--weight-semibold);
|
|
}
|
|
|
|
.sftp-file-row.is-unreadable {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.sftp-file-row.is-unreadable .sftp-file-name {
|
|
text-decoration: line-through;
|
|
}
|
|
|
|
.sftp-file-icon {
|
|
font-size: 13px;
|
|
text-align: center;
|
|
line-height: 1;
|
|
flex-shrink: 0;
|
|
color: var(--text-tertiary);
|
|
}
|
|
|
|
.sftp-file-icon.is-dir {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.sftp-file-name {
|
|
font-size: var(--text-sm);
|
|
color: var(--text-primary);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
min-width: 0;
|
|
}
|
|
|
|
.sftp-file-meta {
|
|
font-size: var(--text-xs);
|
|
color: var(--text-tertiary);
|
|
white-space: nowrap;
|
|
text-align: right;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Parent directory row (..)
|
|
----------------------------------------------------------------------- */
|
|
.sftp-file-row.is-parent .sftp-file-name {
|
|
color: var(--text-secondary);
|
|
font-style: italic;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Context actions bar (shown below file list when a file is selected)
|
|
----------------------------------------------------------------------- */
|
|
.sftp-context-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-1);
|
|
padding: var(--space-1) var(--space-2);
|
|
border-top: 1px solid var(--border-subtle);
|
|
background: var(--bg-elevated);
|
|
flex-shrink: 0;
|
|
min-height: 32px;
|
|
}
|
|
|
|
.sftp-context-bar .sftp-ctx-label {
|
|
flex: 1;
|
|
font-size: var(--text-xs);
|
|
color: var(--text-secondary);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
min-width: 0;
|
|
}
|
|
|
|
.sftp-context-bar .sftp-ctx-btn {
|
|
height: 24px;
|
|
padding: 0 var(--space-2);
|
|
font-size: var(--text-xs);
|
|
font-weight: var(--weight-medium);
|
|
border: none;
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
background: transparent;
|
|
color: var(--text-secondary);
|
|
transition:
|
|
background var(--transition-fast),
|
|
color var(--transition-fast);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.sftp-context-bar .sftp-ctx-btn:hover {
|
|
background: var(--bg-hover);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.sftp-context-bar .sftp-ctx-btn.is-danger:hover {
|
|
background: rgba(239, 83, 80, 0.12);
|
|
color: var(--error);
|
|
}
|
|
|
|
.sftp-context-bar .sftp-ctx-btn.is-accent:hover {
|
|
color: var(--accent);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
States: loading, empty, error
|
|
----------------------------------------------------------------------- */
|
|
.sftp-state {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: var(--space-6) var(--space-4);
|
|
text-align: center;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.sftp-state-icon {
|
|
font-size: 28px;
|
|
color: var(--text-disabled);
|
|
}
|
|
|
|
.sftp-state-msg {
|
|
font-size: var(--text-sm);
|
|
color: var(--text-tertiary);
|
|
line-height: var(--leading-relaxed);
|
|
max-width: 200px;
|
|
}
|
|
|
|
.sftp-state-retry {
|
|
margin-top: var(--space-1);
|
|
}
|
|
|
|
/* Loading spinner (pure CSS) */
|
|
.sftp-spinner {
|
|
width: 20px;
|
|
height: 20px;
|
|
border: 2px solid var(--border-subtle);
|
|
border-top-color: var(--accent);
|
|
border-radius: 50%;
|
|
animation: sftp-spin 0.6s linear infinite;
|
|
}
|
|
|
|
@keyframes sftp-spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Inline input (for rename / mkdir)
|
|
----------------------------------------------------------------------- */
|
|
.sftp-inline-input {
|
|
width: 100%;
|
|
height: 26px;
|
|
padding: 0 var(--space-2);
|
|
font-size: var(--text-sm);
|
|
font-family: inherit;
|
|
color: var(--text-primary);
|
|
background: var(--bg-input);
|
|
border: 1px solid var(--accent);
|
|
border-radius: var(--radius-sm);
|
|
outline: none;
|
|
box-shadow: 0 0 0 2px var(--accent-muted);
|
|
}
|
|
|
|
/* Picker-specific input in the toolbar */
|
|
.sftp-picker-filter {
|
|
width: 160px;
|
|
height: 26px;
|
|
padding: 0 var(--space-2);
|
|
font-size: var(--text-xs);
|
|
border: 1px solid var(--border-default);
|
|
border-radius: var(--radius-sm);
|
|
background: var(--bg-input);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.sftp-picker-filter:focus {
|
|
border-color: var(--accent);
|
|
box-shadow: 0 0 0 2px var(--accent-muted);
|
|
outline: none;
|
|
}
|
|
|
|
.sftp-picker-status {
|
|
font-size: var(--text-xs);
|
|
color: var(--text-tertiary);
|
|
margin-right: var(--space-2);
|
|
}
|
|
|
|
.sftp-picker-badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 18px;
|
|
padding: 0 var(--space-2);
|
|
border-radius: var(--radius-sm);
|
|
font-size: 10px;
|
|
font-weight: var(--weight-semibold);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
border: 1px solid var(--border-default);
|
|
background: var(--bg-surface);
|
|
color: var(--text-tertiary);
|
|
}
|
|
|
|
.sftp-picker-badge.is-readonly {
|
|
border-color: rgba(255, 167, 38, 0.35);
|
|
color: var(--warning);
|
|
background: rgba(255, 167, 38, 0.12);
|
|
}
|
|
|
|
.sftp-picker-badge.is-noread {
|
|
border-color: rgba(239, 83, 80, 0.35);
|
|
color: var(--error);
|
|
background: rgba(239, 83, 80, 0.12);
|
|
}
|
|
|
|
.sftp-picker-legend {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: var(--space-1);
|
|
font-size: 10px;
|
|
color: var(--text-tertiary);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Transfer progress queue
|
|
----------------------------------------------------------------------- */
|
|
.sftp-transfer-queue {
|
|
flex-shrink: 0;
|
|
border-bottom: 1px solid var(--border-subtle);
|
|
background: var(--bg-elevated);
|
|
max-height: 140px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.sftp-transfer-header {
|
|
font-size: 10px;
|
|
font-weight: var(--weight-semibold);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
color: var(--text-tertiary);
|
|
padding: var(--space-1) var(--space-2) 0;
|
|
}
|
|
|
|
.sftp-transfer-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-1);
|
|
padding: 4px var(--space-2);
|
|
}
|
|
|
|
.sftp-transfer-icon {
|
|
font-size: var(--text-sm);
|
|
font-weight: var(--weight-semibold);
|
|
color: var(--accent);
|
|
flex-shrink: 0;
|
|
width: 16px;
|
|
text-align: center;
|
|
}
|
|
|
|
.sftp-transfer-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
}
|
|
|
|
.sftp-transfer-name {
|
|
font-size: var(--text-xs);
|
|
color: var(--text-primary);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.sftp-transfer-progress {
|
|
height: 3px;
|
|
background: var(--border-subtle);
|
|
border-radius: 2px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.sftp-transfer-bar {
|
|
height: 100%;
|
|
background: var(--accent);
|
|
border-radius: 2px;
|
|
transition: width 0.15s ease-out;
|
|
}
|
|
|
|
.sftp-transfer-meta {
|
|
font-size: 10px;
|
|
color: var(--text-tertiary);
|
|
}
|