feat: add labels
This commit is contained in:
@@ -452,6 +452,11 @@ class ClusterMembersComponent extends Component {
|
|||||||
<span class="latency-label">Latency:</span>
|
<span class="latency-label">Latency:</span>
|
||||||
<span class="latency-value">${member.latency ? member.latency + 'ms' : 'N/A'}</span>
|
<span class="latency-value">${member.latency ? member.latency + 'ms' : 'N/A'}</span>
|
||||||
</div>
|
</div>
|
||||||
|
${member.labels && Object.keys(member.labels).length ? `
|
||||||
|
<div class="member-labels">
|
||||||
|
${Object.entries(member.labels).map(([key, value]) => `<span class=\"label-chip\">${key}: ${value}</span>`).join('')}
|
||||||
|
</div>
|
||||||
|
` : ''}
|
||||||
</div>
|
</div>
|
||||||
<div class="expand-icon">
|
<div class="expand-icon">
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
|||||||
@@ -147,7 +147,8 @@
|
|||||||
ip: `192.168.1.${100 + nodeCount}`,
|
ip: `192.168.1.${100 + nodeCount}`,
|
||||||
hostname: `TestNode${nodeCount}`,
|
hostname: `TestNode${nodeCount}`,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
latency: Math.floor(Math.random() * 50) + 10
|
latency: Math.floor(Math.random() * 50) + 10,
|
||||||
|
labels: nodeCount % 2 === 0 ? { app: 'demo', role: 'worker' } : { device: 'sensor', zone: `Z${nodeCount}` }
|
||||||
};
|
};
|
||||||
testNodes.push(newNode);
|
testNodes.push(newNode);
|
||||||
displayClusterMembers();
|
displayClusterMembers();
|
||||||
@@ -185,6 +186,7 @@
|
|||||||
${statusIcon} ${statusText}
|
${statusIcon} ${statusText}
|
||||||
</div>
|
</div>
|
||||||
<div class="member-latency">Latency: ${node.latency}ms</div>
|
<div class="member-latency">Latency: ${node.latency}ms</div>
|
||||||
|
${node.labels ? `<div class=\"member-labels\">${Object.entries(node.labels).map(([k,v]) => `<span class=\\\"label-chip\\\">${k}: ${v}</span>`).join('')}</div>` : ''}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|||||||
@@ -221,6 +221,26 @@ p {
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Labels */
|
||||||
|
.member-labels {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.35rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-chip {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
padding: 0.15rem 0.45rem;
|
||||||
|
border-radius: 9999px;
|
||||||
|
background: rgba(255, 255, 255, 0.08);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||||
|
color: rgba(255, 255, 255, 0.9);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.member-card::before {
|
.member-card::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -2042,4 +2062,49 @@ p {
|
|||||||
/* Preserve focus ring on active tab */
|
/* Preserve focus ring on active tab */
|
||||||
.tab-button.active:focus-visible {
|
.tab-button.active:focus-visible {
|
||||||
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
|
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive Capability Selector */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.capability-selector {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
#capability-select {
|
||||||
|
flex: 1 1 100%;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
#capability-select {
|
||||||
|
padding-right: 1.75rem;
|
||||||
|
background-position: right 0.5rem center;
|
||||||
|
background-size: 10px 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Capability header mobile wrapping */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.capability-header {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.cap-uri {
|
||||||
|
flex: 1 1 100%;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.cap-call-btn {
|
||||||
|
flex: 1 1 100%;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.cap-call-btn {
|
||||||
|
padding: 0.35rem 0.75rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -169,7 +169,8 @@
|
|||||||
ip: `192.168.1.${100 + nodeCount}`,
|
ip: `192.168.1.${100 + nodeCount}`,
|
||||||
hostname: `TestNode${nodeCount}`,
|
hostname: `TestNode${nodeCount}`,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
latency: Math.floor(Math.random() * 50) + 10
|
latency: Math.floor(Math.random() * 50) + 10,
|
||||||
|
labels: nodeCount % 2 === 0 ? { app: 'demo', role: 'worker' } : { device: 'sensor', zone: `Z${nodeCount}` }
|
||||||
};
|
};
|
||||||
testNodes.push(newNode);
|
testNodes.push(newNode);
|
||||||
displayClusterMembers();
|
displayClusterMembers();
|
||||||
@@ -205,6 +206,7 @@
|
|||||||
${statusIcon} ${statusText}
|
${statusIcon} ${statusText}
|
||||||
</div>
|
</div>
|
||||||
<div class="member-latency">Latency: ${node.latency}ms</div>
|
<div class="member-latency">Latency: ${node.latency}ms</div>
|
||||||
|
${node.labels ? `<div class=\"member-labels\">${Object.entries(node.labels).map(([k,v]) => `<span class=\\\"label-chip\\\">${k}: ${v}</span>`).join('')}</div>` : ''}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|||||||
Reference in New Issue
Block a user