add: gui and tsdiag

This commit is contained in:
iceBear67
2026-07-26 09:39:17 +00:00
parent 5dc1759d80
commit 5b3a7e147c
41 changed files with 16451 additions and 8 deletions
+7 -2
View File
@@ -75,7 +75,9 @@ func LanDiscoverService(ctx context.Context, entryList []LanEntry, logger *slog.
}
}
func RunLanDiscoverService(ctx context.Context, rules map[string][]ConnectRule, logger *slog.Logger) {
// LanEntriesFromRules collects the advertisements implied by the connect
// rules. The GUI uses it to tell our own broadcasts apart from other servers'.
func LanEntriesFromRules(rules map[string][]ConnectRule) []LanEntry {
var lanEntries []LanEntry
for tag, rs := range rules {
for _, rule := range rs {
@@ -89,6 +91,9 @@ func RunLanDiscoverService(ctx context.Context, rules map[string][]ConnectRule,
})
}
}
return lanEntries
}
go LanDiscoverService(ctx, lanEntries, logger)
func RunLanDiscoverService(ctx context.Context, rules map[string][]ConnectRule, logger *slog.Logger) {
go LanDiscoverService(ctx, LanEntriesFromRules(rules), logger)
}