README shows the dashboard and the IPFS swarm's map

Both are drawn from the layout tests' sample data by shots.sh users,
like users.png, so they need no server; the map's shot adds nodes
across Iran to the host-map sample.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vvvomitandClaude Opus 5.5 committed 2026-10-30 21:29:31 +03:30
1 parent 008f4537a1
commit 9ea05b0a89
6 files changed
+63 -25

No files matched your search

+6
View File
@@ -58,6 +58,12 @@ interzone servers over IPFS.
<td width="50%" valign="top"><p align="center"><a href="docs/screenshots/users.png"><img src="docs/screenshots/users.png" alt="Managing the server's users" width="400"></a></p>
<b>Users:</b> totals, a card per person, search, filter and sort.</td>
</tr>
<tr>
<td width="50%" valign="top"><p align="center"><a href="docs/screenshots/dashboard.png"><img src="docs/screenshots/dashboard.png" alt="The server's dashboard" width="400"></a></p>
<b>Dashboard:</b> CPU, memory, disk, containers and certificates, live.</td>
<td width="50%" valign="top"><p align="center"><a href="docs/screenshots/host-map.png"><img src="docs/screenshots/host-map.png" alt="The IPFS swarm's map of Iran" width="400"></a></p>
<b>IPFS swarm:</b> every node sharing the mirror, placed on a map of Iran, with what each sends and receives.</td>
</tr>
</table>
## Community
Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

+24 -22
View File
@@ -114,28 +114,7 @@ func TestLayout(t *testing.T) {
PublishedParts: []deploy.HostPart{{Name: "packages", Size: 3 << 30, Pinned: false}, {Name: "oci", Size: 15 << 30, Pinned: false}, {Name: "git", Size: 200 << 20, Pinned: true}, {Name: "bin", Size: 300 << 20, Pinned: true}},
Last: "fetching bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"}
}},
{"host-map", func(a *App) {
localMirror.Store(true) // shootAll clears it
a.jump(a.index("Host"))
hs := a.cur().(*hostScreen)
hs.statsFor, hs.phase = targetKey(hs.target()), 1.3
ip := netip.MustParseAddr
hs.stats = &deploy.HostStats{Installed: true, Active: true, Mirror: "ipfs", Parts: []string{"oci", "packages", "git", "bin"}, Peers: 4,
RepoSize: 19 << 30, DiskFree: 80 << 30, RateIn: 2e5, RateOut: 3e6, TotalIn: 6 << 30, TotalOut: 40 << 30,
DataSent: 38 << 30, DataReceived: 1 << 30, Published: "2026-10-29T03:00:00Z",
PublishedParts: []deploy.HostPart{{Name: "oci", Pinned: true}, {Name: "packages", Pinned: true}, {Name: "git", Pinned: true}, {Name: "bin", Pinned: true}},
Self: []netip.Addr{ip("2.176.0.1")}, PeerList: []deploy.Peer{
{ID: "a", Addr: ip("5.160.0.1"), Sent: 9 << 30, Latency: 41 * time.Millisecond, Inbound: true},
{ID: "b", Addr: ip("81.169.145.1"), Sent: 2 << 30, Latency: 120 * time.Millisecond},
{ID: "c", Addr: ip("10.0.0.1"), Recv: 1 << 20},
{ID: "d", Addr: ip("2.176.200.1"), Latency: 18 * time.Millisecond}}}
hs.in, hs.out = []float64{0, 1e5, 2e5}, []float64{1e6, 4e6, 3e6}
hs.rates = map[string]peerRate{"a": {out: 2e6}, "b": {out: 1e6}}
hs.peerHist = map[string][]float64{"a": {1e6, 3e6, 2e6}, "b": {0, 1e6, 1e6}}
at := time.Date(2026, 10, 29, 14, 5, 0, 0, time.UTC)
hs.comings = []hostComing{{at, hs.stats.PeerList[3], true}, {at.Add(time.Minute), deploy.Peer{Addr: ip("8.8.8.8")}, false}}
hs.ripples = []ripple{{addr: ip("2.176.200.1"), start: 0.5, join: true}}
}},
{"host-map", openHostMap},
{"maintenance", func(a *App) { deliver(a, maintainMsg("vacuum")) }},
{"users-bridge", func(a *App) {
openUsers(a)
@@ -157,6 +136,29 @@ func TestLayoutWide(t *testing.T) {
}{{"dashboard", openDashboard}, {"mirrors", openMirrors}, {"users", openUsers}})
}
func openHostMap(a *App) {
localMirror.Store(true) // shootAll clears it
a.jump(a.index("Host"))
hs := a.cur().(*hostScreen)
hs.statsFor, hs.phase = targetKey(hs.target()), 1.3
ip := netip.MustParseAddr
hs.stats = &deploy.HostStats{Installed: true, Active: true, Mirror: "ipfs", Parts: []string{"oci", "packages", "git", "bin"}, Peers: 4,
RepoSize: 19 << 30, DiskFree: 80 << 30, RateIn: 2e5, RateOut: 3e6, TotalIn: 6 << 30, TotalOut: 40 << 30,
DataSent: 38 << 30, DataReceived: 1 << 30, Published: "2026-10-29T03:00:00Z",
PublishedParts: []deploy.HostPart{{Name: "oci", Pinned: true}, {Name: "packages", Pinned: true}, {Name: "git", Pinned: true}, {Name: "bin", Pinned: true}},
Self: []netip.Addr{ip("2.176.0.1")}, PeerList: []deploy.Peer{
{ID: "a", Addr: ip("5.160.0.1"), Sent: 9 << 30, Latency: 41 * time.Millisecond, Inbound: true},
{ID: "b", Addr: ip("81.169.145.1"), Sent: 2 << 30, Latency: 120 * time.Millisecond},
{ID: "c", Addr: ip("10.0.0.1"), Recv: 1 << 20},
{ID: "d", Addr: ip("2.176.200.1"), Latency: 18 * time.Millisecond}}}
hs.in, hs.out = []float64{0, 1e5, 2e5}, []float64{1e6, 4e6, 3e6}
hs.rates = map[string]peerRate{"a": {out: 2e6}, "b": {out: 1e6}}
hs.peerHist = map[string][]float64{"a": {1e6, 3e6, 2e6}, "b": {0, 1e6, 1e6}}
at := time.Date(2026, 10, 29, 14, 5, 0, 0, time.UTC)
hs.comings = []hostComing{{at, hs.stats.PeerList[3], true}, {at.Add(time.Minute), deploy.Peer{Addr: ip("8.8.8.8")}, false}}
hs.ripples = []ripple{{addr: ip("2.176.200.1"), start: 0.5, join: true}}
}
func openDashboard(a *App) {
a.jump(a.index("Dashboard"))
ds := a.cur().(*dashboardScreen)
+28
View File
@@ -1,6 +1,7 @@
package ui
import (
"net/netip"
"os"
"path/filepath"
"strings"
@@ -28,6 +29,32 @@ func TestShot(t *testing.T) {
open func(*App)
}{
{"users", openUsers},
{"dashboard", openDashboard},
// The README's map: the sample swarm with more nodes across Iran.
{"host-map", func(a *App) {
openHostMap(a)
hs := a.cur().(*hostScreen)
ip := netip.MustParseAddr
for i, p := range []struct {
addr string
ms time.Duration
sent, in, out float64
}{
{"2.180.0.1", 62, 7e9, 0, 4e6}, {"2.182.32.1", 55, 5e9, 0, 2e6}, {"2.182.214.1", 48, 4e9, 3e5, 1e6},
{"2.182.169.1", 30, 3e9, 0, 0}, {"2.183.156.1", 70, 2e9, 2e6, 0}, {"2.183.80.1", 38, 2e9, 0, 5e5},
{"2.184.160.1", 90, 1e9, 0, 0}, {"2.181.112.1", 110, 8e8, 1e6, 0}, {"2.183.131.1", 75, 6e8, 0, 0},
{"2.187.32.1", 66, 4e8, 0, 3e5}, {"2.183.0.1", 58, 3e8, 0, 0},
} {
id := string(rune('e' + i))
hs.stats.PeerList = append(hs.stats.PeerList, deploy.Peer{ID: id, Addr: ip(p.addr), Sent: int64(p.sent), Latency: p.ms * time.Millisecond, Inbound: i%3 == 0})
if p.in+p.out > 0 {
hs.rates[id] = peerRate{in: p.in, out: p.out}
hs.peerHist[id] = []float64{p.out / 2, p.in + p.out, (p.in + p.out) * 0.8}
}
}
hs.stats.Peers = len(hs.stats.PeerList)
hs.ripples = append(hs.ripples, ripple{addr: ip("2.183.80.1"), start: 0.2, join: true})
}},
// The wiki's guide, on the Friends & family preset.
{"wiki-confirm", func(a *App) {
a.cfg.Target = config.Target{Mode: "ssh", Host: "192.0.2.1", User: "root"}
@@ -124,6 +151,7 @@ func TestShot(t *testing.T) {
}
}
lipgloss.SetColorProfile(termenv.Ascii)
localMirror.Store(false)
}
// fakeDeploy shows a first install part way through, or finished, without
+5 -3
View File
@@ -10,8 +10,8 @@
# scripts/screenshots/shots.sh grab NAME [WIDTH] save the session's screen as NAME.png
# (1400 px wide; phone shots: WIDTH 0)
# scripts/screenshots/shots.sh phone A B C join three phone shots into phone.png
# scripts/screenshots/shots.sh users draw users.png from the layout tests'
# sample people (no server needed)
# scripts/screenshots/shots.sh users draw users.png, dashboard.png and host-map.png
# from the layout tests' sample data (no server needed)
# scripts/screenshots/shots.sh stop
#
# Drive the session between grabs with tmux send-keys or tmux attach -t shot.
@@ -77,7 +77,9 @@ phone() {
users() {
mkdir -p "$work/raw"
(cd "$repo" && INTERZONE_SHOT="$work/raw" go test ./internal/ui -run '^TestShot$' -count=1 >/dev/null)
python3 "$repo/scripts/screenshots/render.py" "$work/raw/users.ans" "$out/users.png" 1400
for n in users dashboard host-map; do
python3 "$repo/scripts/screenshots/render.py" "$work/raw/$n.ans" "$out/$n.png" 1400
done
}
stop() {