From 21f102980576762f79886b8e8e96efe8ffdf0f25 Mon Sep 17 00:00:00 2001 From: 0x1d Date: Thu, 23 Oct 2025 13:59:41 +0200 Subject: [PATCH] feat: harmonize add-label --- .../components/FirmwareFormComponent.js | 2 +- .../components/NodeDetailsComponent.js | 80 +++++++--------- public/styles/main.css | 96 +++---------------- 3 files changed, 44 insertions(+), 134 deletions(-) diff --git a/public/scripts/components/FirmwareFormComponent.js b/public/scripts/components/FirmwareFormComponent.js index c6ac878..5d5d2b1 100644 --- a/public/scripts/components/FirmwareFormComponent.js +++ b/public/scripts/components/FirmwareFormComponent.js @@ -150,7 +150,7 @@ class FirmwareFormComponent extends Component {
- : + = +
+ `).join(''); + let html = `
-

Node Labels

Manage custom labels for this node. Labels help organize and identify nodes in your cluster.

-
- `; - - if (labelsArray.length === 0) { - html += ` -
-
No labels configured
-
Add labels to organize and identify this node
-
- `; - } else { - labelsArray.forEach(([key, value]) => { - html += ` -
-
- ${this.escapeHtml(key)} - = - ${this.escapeHtml(value)} -
- -
- `; - }); - } - - html += ` +
+ + = + +
-
-
-
- - +
+ ${labelsArray.length === 0 ? ` +
+
No labels configured
+
Add labels to organize and identify this node
-
- - -
- -
+ ` : labelsHTML}
@@ -1004,7 +989,6 @@ class NodeDetailsComponent extends Component { const summaryHTML = summary ? `
-
${window.icon('file', { width: 16, height: 16 })}
Tasks Overview
System task management and monitoring
diff --git a/public/styles/main.css b/public/styles/main.css index 00bd59b..e97f6b0 100644 --- a/public/styles/main.css +++ b/public/styles/main.css @@ -6805,7 +6805,13 @@ html { margin: 0; } +/* Node labels section - add-label-controls positioned at top */ +.labels-section .add-label-controls { + margin-bottom: 1rem; +} + .labels-list { + display: block; margin-bottom: 1.5rem; } @@ -6886,88 +6892,8 @@ html { stroke-width: 2; } -.add-label-section { - margin-bottom: 1.5rem; -} - -.add-label-form { - display: flex; - align-items: end; - gap: 0.5rem; - padding: 0.75rem; - background: var(--bg-tertiary); - border: 1px solid var(--border-primary); - border-radius: 8px; -} - -.add-label-form .form-group { - display: flex; - flex-direction: column; - gap: 0.25rem; - flex: 1; - min-width: 120px; -} - -.add-label-form .form-group label { - font-size: 0.85rem; - font-weight: 500; - color: var(--text-secondary); -} - -.add-label-form .form-group input { - background: var(--bg-secondary); - border: 1px solid var(--border-secondary); - border-radius: 6px; - padding: 0.5rem 0.75rem; - color: var(--text-primary); - font-size: 0.9rem; - transition: all 0.2s ease; -} - -.add-label-form .form-group input:focus { - outline: none; - border-color: #60a5fa; - box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2); -} - -.add-label-form .form-group input::placeholder { - color: var(--text-tertiary); -} - -.add-label-form .add-label-btn { - background: rgba(255, 255, 255, 0.1); - border: 1px solid var(--border-secondary); - color: var(--text-secondary); - border-radius: 8px; - padding: 0.5rem 1rem; - cursor: pointer; - font-size: 0.9rem; - font-weight: 500; - display: flex; - align-items: center; - gap: 0.5rem; - transition: all 0.2s ease; - height: fit-content; - margin-bottom: 1rem; -} - -.add-label-form .add-label-btn:hover:not(:disabled) { - background: rgba(255, 255, 255, 0.15); - border-color: rgba(255, 255, 255, 0.25); - color: var(--text-primary); -} - -.add-label-form .add-label-btn:disabled { - opacity: 0.5; - cursor: not-allowed; -} - -.add-label-form .add-label-btn svg { - width: 16px; - height: 16px; - stroke: currentColor; - stroke-width: 2; -} +/* Old add-label-section and add-label-form styles removed - now using add-label-controls */ +/* Node labels use the same compact add-label-controls as firmware form */ /* Add label button and save labels button inherit from base button styles */ .add-label-btn { @@ -7040,13 +6966,13 @@ html { /* Responsive adjustments for labels editor */ @media (max-width: 768px) { - .add-label-form { + .add-label-controls { flex-direction: column; align-items: stretch; } - .form-group { - min-width: unset; + .add-label-controls .label-separator { + display: none; } .labels-actions {