|
8 | 8 | {{template "views/partials/navbar" .}}
|
9 | 9 | <div class="container mx-auto px-4 flex-grow">
|
10 | 10 |
|
11 |
| - <div class="models mt-12"> |
12 |
| - <h2 class="text-center text-3xl font-semibold text-gray-100"> |
13 |
| - P2P</h2> |
14 |
| - Token: {{.P2PToken}} |
15 |
| - |
| 11 | + <div class="models mt-12 text-center"> |
| 12 | + <h2 class="text-3xl font-semibold text-gray-100 mb-8"> |
| 13 | + <i class="fa-solid fa-network-wired"></i> P2P Network</h2> |
16 | 14 |
|
17 |
| - <div class="text-center text-xs font-semibold text-gray-100"> |
| 15 | + <div class="bg-gray-800 p-6 rounded-lg shadow-lg mb-8 inline-block"> |
| 16 | + <p class="text-xl font-semibold text-gray-200">Total Workers Detected: {{ len .Nodes}}</p> |
| 17 | + {{ $online:=0 }} |
18 | 18 | {{ range .Nodes }}
|
19 |
| - <button hx-post="/browse/search/models" class="text-blue-500" hx-target="#search-results" |
20 |
| - hx-vals='{"search": "{{.ID}}"}' |
21 |
| - hx-indicator=".htmx-indicator" >{{.ID}} (Online {{.IsOnline}})</button> |
| 19 | + {{ if .IsOnline }} |
| 20 | + {{ $online = add $online 1 }} |
| 21 | + {{ end }} |
22 | 22 | {{ end }}
|
| 23 | + <p class="text-xl font-semibold text-gray-200">Total Online Workers: {{$online}}</p> |
| 24 | + </div> |
| 25 | + |
| 26 | + <div class="bg-gray-800 p-6 rounded-lg shadow-lg mb-8 inline-block text-left"> |
| 27 | + <h3 class="text-2xl font-semibold text-gray-100 mb-4">Start a New Worker</h3> |
| 28 | + <p class="mb-2">To start a new worker, run the following command:</p> |
| 29 | + <code class="block bg-gray-700 text-yellow-300 p-4 rounded-lg break-words"> |
| 30 | + export TOKEN="<span class="token">{{.P2PToken}}</span>"<br> |
| 31 | + local-ai worker p2p-llama-cpp-rpc |
| 32 | + </code> |
23 | 33 | </div>
|
24 | 34 |
|
25 |
| - |
| 35 | + <div class="text-center text-xs font-semibold text-gray-100"> |
| 36 | + {{ range .Nodes }} |
| 37 | + <button hx-post="/browse/search/models" class="text-blue-500 hover:text-blue-300" |
| 38 | + hx-target="#search-results" hx-vals='{"search": "{{.ID}}"}' |
| 39 | + hx-indicator=".htmx-indicator" >{{.ID}} (Online: {{.IsOnline}})</button> |
| 40 | + {{ end }} |
| 41 | + </div> |
26 | 42 | </div>
|
27 | 43 | </div>
|
28 | 44 |
|
29 | 45 | {{template "views/partials/footer" .}}
|
30 | 46 | </div>
|
31 | 47 |
|
| 48 | +<style> |
| 49 | + .token { |
| 50 | + word-break: break-all; |
| 51 | + } |
| 52 | +</style> |
| 53 | + |
32 | 54 | </body>
|
33 | 55 | </html>
|
0 commit comments