mirror of
https://github.com/exo-explore/exo.git
synced 2025-10-23 02:57:14 +03:00
show each node id in the tinychat topology viz
This commit is contained in:
@@ -843,4 +843,4 @@ main {
|
||||
font-size: 0.8em;
|
||||
color: var(--secondary-color-transparent);
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,6 +637,9 @@ document.addEventListener("alpine:init", () => {
|
||||
const vizElement = this.$refs.topologyViz;
|
||||
vizElement.innerHTML = ''; // Clear existing visualization
|
||||
|
||||
// Helper function to truncate node ID
|
||||
const truncateNodeId = (id) => id.substring(0, 8);
|
||||
|
||||
// Create nodes from object
|
||||
Object.entries(topologyData.nodes).forEach(([nodeId, node]) => {
|
||||
const nodeElement = document.createElement('div');
|
||||
@@ -647,14 +650,14 @@ document.addEventListener("alpine:init", () => {
|
||||
const peerConnectionsHtml = peerConnections.map(peer => `
|
||||
<div class="peer-connection">
|
||||
<i class="fas fa-arrow-right"></i>
|
||||
<span>To ${peer.to_id}: ${peer.description}</span>
|
||||
<span>To ${truncateNodeId(peer.to_id)}: ${peer.description}</span>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
nodeElement.innerHTML = `
|
||||
<div class="node-info">
|
||||
<span class="status ${nodeId === topologyData.active_node_id ? 'active' : 'inactive'}"></span>
|
||||
<span>${node.model}</span>
|
||||
<span>${node.model} [${truncateNodeId(nodeId)}]</span>
|
||||
</div>
|
||||
<div class="node-details">
|
||||
<span>${node.chip}</span>
|
||||
|
||||
Reference in New Issue
Block a user