|
9 | 9 | color: #e2e8f0; |
10 | 10 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
11 | 11 | } |
| 12 | + .token { |
| 13 | + word-break: break-all; |
| 14 | + } |
12 | 15 | .container { |
13 | 16 | max-width: 800px; |
14 | 17 | margin: 0 auto; |
@@ -275,14 +278,28 @@ <h2 class="text-3xl font-bold mb-4"><i class="fa-solid fa-plus"></i> Add New Net |
275 | 278 | <h2 class="text-3xl font-bold mb-4 mt-4">Available Clusters in this network</h2> |
276 | 279 | <template x-for="cluster in network.Clusters" :key="cluster.NetworkID + cluster.Type"> |
277 | 280 | <div class="cluster"> |
278 | | - |
279 | 281 | <div class="cluster-title"></div> |
280 | 282 | <span class="inline-block bg-orange-500 text-white py-1 px-3 rounded-full text-xs" x-text="'Cluster Type: ' + cluster.Type"> |
281 | 283 | </span> |
| 284 | + |
282 | 285 | <span class="inline-block bg-orange-500 text-white py-1 px-3 rounded-full text-xs" x-show="cluster.NetworkID" x-text="'Network ID: ' + (cluster.NetworkID || 'N/A')"> |
283 | 286 | </span> |
284 | 287 | <span class="inline-block bg-blue-500 text-white py-1 px-3 rounded-full text-xs" x-text="'Number of Workers: ' + cluster.Workers.length"> |
285 | 288 | </span> |
| 289 | + <!-- Give commands and instructions to join the network --> |
| 290 | + <span class="inline-block token-box text-white py-1 px-3 text-xs" x-show="cluster.Type == 'federated'" > |
| 291 | + <p class="text-lg font-bold mb-4 mt-1"> |
| 292 | + <i class="fa-solid fa-copy copy-icon float-right"></i> |
| 293 | + Command to connect (click to copy): |
| 294 | + </p> |
| 295 | + <code class="block bg-gray-700 text-yellow-300 p-4 rounded-lg break-words" @click="copyToken($el.textContent)" > |
| 296 | + docker run -d --restart=always -e ADDRESS=":80" -e LOCALAI_P2P_NETWORK_ID=<span class="token" x-text="cluster.NetworkID"></span> -e LOCALAI_P2P_LOGLEVEL=debug --name local-ai -e TOKEN="<span class="token" x-text="network.token"></span>" --net host -ti localai/localai:master-ffmpeg-core federated --debug |
| 297 | + </code> |
| 298 | + or via CLI: |
| 299 | + <code class="block bg-gray-700 text-yellow-300 p-4 rounded-lg break-words" @click="copyToken($el.textContent)" > |
| 300 | + ADDRESS=":80" LOCALAI_P2P_NETWORK_ID=<span class="token" x-text="cluster.NetworkID"></span> LOCALAI_P2P_LOGLEVEL=debug TOKEN="<span class="token" x-text="network.token"></span>" local-ai federated --debug |
| 301 | + </code> |
| 302 | + </span> |
286 | 303 | </div> |
287 | 304 | </template> |
288 | 305 | </div> |
@@ -361,8 +378,8 @@ <h2 class="text-3xl font-bold mb-4 mt-4">Available Clusters in this network</h2> |
361 | 378 | copyToken(token) { |
362 | 379 | navigator.clipboard.writeText(token) |
363 | 380 | .then(() => { |
364 | | - console.log('Token copied to clipboard:', token); |
365 | | - alert('Token copied to clipboard!'); |
| 381 | + console.log('Text copied to clipboard:', token); |
| 382 | + alert('Text copied to clipboard!'); |
366 | 383 | }) |
367 | 384 | .catch(err => { |
368 | 385 | console.error('Failed to copy token:', err); |
|
0 commit comments