feat: add labels
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user