feat: add labels

This commit is contained in:
2025-09-15 21:36:23 +02:00
parent 2dbba87098
commit 41be660d94
2 changed files with 107 additions and 2 deletions

View File

@@ -86,8 +86,17 @@ class NodeDetailsComponent extends Component {
// Use persisted active tab from the view model, default to 'status'
const activeTab = (this.viewModel && typeof this.viewModel.get === 'function' && this.viewModel.get('activeTab')) || 'status';
logger.debug('NodeDetailsComponent: Rendering with activeTab:', activeTab);
// Build labels bar (above tabs)
const labelsObj = (nodeStatus && nodeStatus.labels) ? nodeStatus.labels : null;
const labelsBar = (labelsObj && Object.keys(labelsObj).length)
? `<div class="member-labels" style="margin: 0 0 12px 0;">${Object.entries(labelsObj)
.map(([k, v]) => `<span class=\"label-chip\">${this.escapeHtml(String(k))}: ${this.escapeHtml(String(v))}</span>`)
.join('')}</div>`
: '';
const html = `
${labelsBar}
<div class="tabs-container">
<div class="tabs-header">
<button class="tab-button ${activeTab === 'status' ? 'active' : ''}" data-tab="status">Status</button>