Skip to content

Commit 399f4de

Browse files
committed
Style
1 parent c6ee2e2 commit 399f4de

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

core/http/views/p2p.html

+32-10
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,48 @@
88
{{template "views/partials/navbar" .}}
99
<div class="container mx-auto px-4 flex-grow">
1010

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>
1614

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 }}
1818
{{ 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 }}
2222
{{ 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>
2333
</div>
2434

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>
2642
</div>
2743
</div>
2844

2945
{{template "views/partials/footer" .}}
3046
</div>
3147

48+
<style>
49+
.token {
50+
word-break: break-all;
51+
}
52+
</style>
53+
3254
</body>
3355
</html>

core/http/views/partials/navbar.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<a href="/tts/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-music pr-2"></i> TTS </a>
2323
<a href="/talk/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-phone pr-2"></i> Talk </a>
2424
{{ if .IsP2PEnabled }}
25-
<a href="/p2p/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-phone pr-2"></i> P2P </a>
25+
<a href="/p2p/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-network-wired"></i> P2P </a>
2626
{{ end }}
2727
<a href="/swagger/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fas fa-code pr-2"></i> API</a>
2828
</div>
@@ -38,7 +38,7 @@
3838
<a href="/tts/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-music pr-2"></i> TTS </a>
3939
<a href="/talk/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-phone pr-2"></i> Talk </a>
4040
{{ if .IsP2PEnabled }}
41-
<a href="/p2p/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-phone pr-2"></i> P2P </a>
41+
<a href="/p2p/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-network-wired"></i> P2P </a>
4242
{{ end }}
4343
<a href="/swagger/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fas fa-code pr-2"></i> API</a>
4444
</div>

0 commit comments

Comments
 (0)