Port Forwarding (new): - Add PortForward model with local/remote direction, bind/dest addresses - Implement ForwardManager in sshclient/portforward.go with full bidirectional tunnel support for both local and remote forwarding - Integrate ForwardManager into SSH client lifecycle (auto-start on connect, clean shutdown on close) - Add session manager methods: ListPortForwards, StartPortForward, StopPortForward with event emission - Add API surface: ListPortForwards, StartPortForward, StopPortForward - Add validation for port-forward rules in ValidateSSHConfig - Add port forwarding section to profile editor with direction, bind/dest host/port, label, and enable toggle - Add frontend event handling for forward:started/stopped/error - Style port-forward rows with charcoal card design matching jump hosts Jump Host UI improvements: - Add private key path field to jump host editor rows - Collect privateKeyPath in form value collection - Restyle jump host rows as two-line cards with clear field grouping
574 lines
14 KiB
CSS
574 lines
14 KiB
CSS
/* ==========================================================================
|
|
Nexus Terminal — Profile Editor & Form Polish
|
|
Section headers, grouped fields, protocol-specific visibility,
|
|
inline validation, tag input, jump host list, key file selector.
|
|
========================================================================== */
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Form panel (profile editor container)
|
|
----------------------------------------------------------------------- */
|
|
.form-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.form-panel-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-3);
|
|
padding: var(--space-3) var(--space-4);
|
|
border-bottom: 1px solid var(--border-subtle);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.form-panel-title {
|
|
font-size: var(--text-md);
|
|
font-weight: var(--weight-semibold);
|
|
color: var(--text-primary);
|
|
flex: 1;
|
|
}
|
|
|
|
.form-panel-body {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: var(--space-4);
|
|
}
|
|
|
|
.form-panel-footer {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
gap: var(--space-2);
|
|
padding: var(--space-3) var(--space-4);
|
|
border-top: 1px solid var(--border-subtle);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Form sections (disclosure-based grouping)
|
|
----------------------------------------------------------------------- */
|
|
.form-section {
|
|
border: 1px solid var(--border-subtle);
|
|
border-radius: var(--radius-lg);
|
|
margin-bottom: var(--space-4);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.form-section-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
width: 100%;
|
|
padding: var(--space-3) var(--space-4);
|
|
font-size: var(--text-sm);
|
|
font-weight: var(--weight-semibold);
|
|
color: var(--text-primary);
|
|
cursor: pointer;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
background: var(--bg-elevated);
|
|
border: none;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
text-align: left;
|
|
transition: background var(--transition-fast);
|
|
}
|
|
|
|
.form-section-header:hover {
|
|
background: var(--bg-hover);
|
|
}
|
|
|
|
.form-section-chevron {
|
|
width: 14px;
|
|
height: 14px;
|
|
color: var(--text-tertiary);
|
|
transition: transform var(--transition-normal);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.form-section.is-open .form-section-chevron {
|
|
transform: rotate(90deg);
|
|
}
|
|
|
|
.form-section-icon {
|
|
width: 16px;
|
|
text-align: center;
|
|
flex-shrink: 0;
|
|
font-size: var(--text-sm);
|
|
color: var(--text-tertiary);
|
|
}
|
|
|
|
.form-section-body,
|
|
.form-section-content {
|
|
padding: var(--space-4);
|
|
display: none;
|
|
}
|
|
|
|
.form-section.is-open .form-section-body,
|
|
.form-section.is-open .form-section-content {
|
|
display: block;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Field grid (two-column layout for compact forms)
|
|
----------------------------------------------------------------------- */
|
|
.form-fields {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
.form-row {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
/* Single-column override */
|
|
.form-row.full-width {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
/* Three-column for port + protocol combos */
|
|
.form-row.triple {
|
|
grid-template-columns: 1fr 100px 120px;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Protocol-specific field visibility
|
|
Fields are hidden unless their protocol class is active.
|
|
----------------------------------------------------------------------- */
|
|
.proto-only-ssh,
|
|
.proto-only-telnet,
|
|
.proto-only-raw {
|
|
display: none;
|
|
}
|
|
|
|
.protocol-ssh .proto-only-ssh,
|
|
.protocol-telnet .proto-only-telnet,
|
|
.protocol-raw .proto-only-raw,
|
|
.protocol-github .proto-only-github {
|
|
display: flex;
|
|
}
|
|
|
|
/* For block-level protocol fields */
|
|
.protocol-ssh .proto-only-ssh.form-section,
|
|
.protocol-telnet .proto-only-telnet.form-section,
|
|
.protocol-raw .proto-only-raw.form-section,
|
|
.protocol-github .proto-only-github.form-section {
|
|
display: block;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Tag input
|
|
----------------------------------------------------------------------- */
|
|
.tag-input-wrapper {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: var(--space-1);
|
|
min-height: 30px;
|
|
padding: var(--space-1) var(--space-2);
|
|
background: var(--bg-input);
|
|
border: 1px solid var(--border-default);
|
|
border-radius: var(--radius-md);
|
|
cursor: text;
|
|
transition: border-color var(--transition-fast);
|
|
}
|
|
|
|
.tag-input-wrapper:hover {
|
|
border-color: var(--border-strong);
|
|
}
|
|
|
|
.tag-input-wrapper:focus-within {
|
|
border-color: var(--accent);
|
|
box-shadow: 0 0 0 2px var(--accent-muted);
|
|
}
|
|
|
|
.tag-item {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 3px;
|
|
height: 20px;
|
|
padding: 0 var(--space-2);
|
|
font-size: var(--text-xs);
|
|
color: var(--accent);
|
|
background: var(--accent-muted);
|
|
border-radius: var(--radius-sm);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.tag-item-remove {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 12px;
|
|
height: 12px;
|
|
font-size: 10px;
|
|
cursor: pointer;
|
|
border-radius: 50%;
|
|
color: var(--accent);
|
|
transition: background var(--transition-fast);
|
|
}
|
|
|
|
.tag-item-remove:hover {
|
|
background: var(--accent-strong);
|
|
}
|
|
|
|
.tag-input {
|
|
flex: 1;
|
|
min-width: 60px;
|
|
border: none;
|
|
background: transparent;
|
|
font-size: var(--text-sm);
|
|
color: var(--text-primary);
|
|
outline: none;
|
|
height: 22px;
|
|
}
|
|
|
|
.tag-input::placeholder {
|
|
color: var(--text-disabled);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Jump host / proxy list
|
|
----------------------------------------------------------------------- */
|
|
.jump-host-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.jump-host-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
padding: var(--space-2) var(--space-3);
|
|
background: var(--bg-input);
|
|
border: 1px solid var(--border-subtle);
|
|
border-radius: var(--radius-md);
|
|
font-size: var(--text-sm);
|
|
}
|
|
|
|
.jump-host-item .jump-host-order {
|
|
font-size: var(--text-xs);
|
|
color: var(--text-disabled);
|
|
min-width: 16px;
|
|
text-align: center;
|
|
}
|
|
|
|
.jump-host-item .jump-host-value {
|
|
flex: 1;
|
|
font-family: var(--font-mono);
|
|
color: var(--text-secondary);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.jump-host-item .jump-host-actions {
|
|
display: flex;
|
|
gap: var(--space-1);
|
|
opacity: 0;
|
|
transition: opacity var(--transition-fast);
|
|
}
|
|
|
|
.jump-host-item:hover .jump-host-actions {
|
|
opacity: 1;
|
|
}
|
|
|
|
.jump-host-add {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
padding: var(--space-2);
|
|
font-size: var(--text-sm);
|
|
color: var(--text-tertiary);
|
|
border: 1px dashed var(--border-default);
|
|
border-radius: var(--radius-md);
|
|
cursor: pointer;
|
|
transition: border-color var(--transition-fast), color var(--transition-fast);
|
|
}
|
|
|
|
.jump-host-add:hover {
|
|
border-color: var(--accent);
|
|
color: var(--accent);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Key file selector row
|
|
----------------------------------------------------------------------- */
|
|
.file-selector {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.file-selector .form-input {
|
|
flex: 1;
|
|
}
|
|
|
|
.file-selector .btn {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* File path display */
|
|
.file-path {
|
|
font-family: var(--font-mono);
|
|
font-size: var(--text-xs);
|
|
color: var(--text-tertiary);
|
|
background: var(--bg-input);
|
|
padding: var(--space-1) var(--space-2);
|
|
border-radius: var(--radius-sm);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Inline validation
|
|
----------------------------------------------------------------------- */
|
|
.form-group.is-valid .form-input {
|
|
border-color: var(--success);
|
|
}
|
|
|
|
.form-group.is-valid .form-input:focus {
|
|
box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.20);
|
|
}
|
|
|
|
.form-group.is-invalid .form-input {
|
|
border-color: var(--error);
|
|
}
|
|
|
|
.form-group.is-invalid .form-input:focus {
|
|
box-shadow: 0 0 0 2px rgba(239, 83, 80, 0.20);
|
|
}
|
|
|
|
.form-validation-icon {
|
|
position: absolute;
|
|
right: var(--space-3);
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
font-size: var(--text-sm);
|
|
}
|
|
|
|
.form-group.is-valid .form-validation-icon { color: var(--success); }
|
|
.form-group.is-invalid .form-validation-icon { color: var(--error); }
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Help text under sections
|
|
----------------------------------------------------------------------- */
|
|
.form-section-help {
|
|
font-size: var(--text-xs);
|
|
color: var(--text-tertiary);
|
|
padding: 0 var(--space-4) var(--space-3);
|
|
line-height: var(--leading-relaxed);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Colour preview (for terminal colour settings)
|
|
----------------------------------------------------------------------- */
|
|
.colour-preview {
|
|
display: inline-block;
|
|
width: 18px;
|
|
height: 18px;
|
|
border-radius: var(--radius-sm);
|
|
border: 1px solid var(--border-default);
|
|
vertical-align: middle;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Number input with stepper
|
|
----------------------------------------------------------------------- */
|
|
.form-number {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.form-number .form-input {
|
|
border-radius: var(--radius-md) 0 0 var(--radius-md);
|
|
text-align: center;
|
|
width: 60px;
|
|
/* Hide browser spinners */
|
|
-moz-appearance: textfield;
|
|
}
|
|
.form-number .form-input::-webkit-inner-spin-button,
|
|
.form-number .form-input::-webkit-outer-spin-button {
|
|
appearance: none;
|
|
}
|
|
|
|
.form-number-btn {
|
|
width: 24px;
|
|
height: 30px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: var(--text-sm);
|
|
color: var(--text-secondary);
|
|
background: var(--bg-input);
|
|
border: 1px solid var(--border-default);
|
|
border-left: none;
|
|
cursor: pointer;
|
|
transition: background var(--transition-fast), color var(--transition-fast);
|
|
}
|
|
|
|
.form-number-btn:last-child {
|
|
border-radius: 0 var(--radius-md) var(--radius-md) 0;
|
|
}
|
|
|
|
.form-number-btn:hover {
|
|
background: var(--bg-hover);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Form action row (test connection, etc.)
|
|
----------------------------------------------------------------------- */
|
|
.form-actions-inline {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
padding-top: var(--space-3);
|
|
border-top: 1px solid var(--border-subtle);
|
|
margin-top: var(--space-3);
|
|
}
|
|
|
|
.form-actions-inline .btn {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.form-actions-inline .form-actions-status {
|
|
font-size: var(--text-xs);
|
|
color: var(--text-tertiary);
|
|
flex: 1;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Form hint — inline help text below fields
|
|
----------------------------------------------------------------------- */
|
|
.form-hint {
|
|
font-size: var(--text-xs);
|
|
color: var(--text-tertiary);
|
|
margin-top: var(--space-1);
|
|
line-height: var(--leading-relaxed);
|
|
}
|
|
|
|
.form-hint.secret-error {
|
|
color: var(--danger);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Toggle wrapper — label + toggle switch in a row
|
|
----------------------------------------------------------------------- */
|
|
.form-toggle-wrapper {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: var(--space-3);
|
|
padding: var(--space-1) 0;
|
|
}
|
|
|
|
.form-toggle-label {
|
|
font-size: var(--text-sm);
|
|
color: var(--text-secondary);
|
|
flex: 1;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Jump host rows
|
|
----------------------------------------------------------------------- */
|
|
.jump-hosts-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.jump-host-row {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-1);
|
|
padding: var(--space-2);
|
|
background: var(--surface-2);
|
|
border-radius: var(--radius-sm);
|
|
border: 1px solid var(--border);
|
|
}
|
|
|
|
.jump-host-fields {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
align-items: center;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Port-forwarding rows
|
|
----------------------------------------------------------------------- */
|
|
.port-forwards-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.port-forward-row {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-1);
|
|
padding: var(--space-2);
|
|
background: var(--surface-2);
|
|
border-radius: var(--radius-sm);
|
|
border: 1px solid var(--border);
|
|
}
|
|
|
|
.port-forward-fields {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
align-items: center;
|
|
}
|
|
|
|
.port-forward-arrow {
|
|
color: var(--text-muted);
|
|
font-size: var(--text-sm);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.port-forward-enabled-label {
|
|
display: flex;
|
|
gap: var(--space-1);
|
|
align-items: center;
|
|
font-size: var(--text-xs);
|
|
color: var(--text-secondary);
|
|
white-space: nowrap;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.port-forward-enabled-label input[type="checkbox"] {
|
|
accent-color: var(--accent);
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Payload preset rows
|
|
----------------------------------------------------------------------- */
|
|
.payload-presets-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.preset-row {
|
|
display: grid;
|
|
grid-template-columns: 120px 1fr 100px auto;
|
|
gap: var(--space-2);
|
|
align-items: center;
|
|
}
|
|
|
|
/* -----------------------------------------------------------------------
|
|
Small / compact form controls — used inside repeater rows
|
|
----------------------------------------------------------------------- */
|
|
.form-input-sm,
|
|
.form-select-sm {
|
|
font-size: var(--text-xs);
|
|
padding: var(--space-1) var(--space-2);
|
|
height: 30px;
|
|
}
|