feat: live reading during the speed test, and a 15 s limit that keeps what was measured

This commit is contained in:
redtea committed 2026-10-13 23:06:56 +03:00
1 parent 6441b4329d
commit ab8751d436
4 files changed
+305 -32

No files matched your search

+2
View File
@@ -55,6 +55,7 @@ type Server struct {
stats statCache // last load sample per agent, for the status page
relays speedRelays // speed tests that run through the browser
meters speedMeters // byte counts of the speed tests under way
}
// New builds the server, parsing embedded templates.
@@ -234,6 +235,7 @@ func (s *Server) Handler() http.Handler {
mux.Handle("GET /api/panel/agents/presence", s.requireAdmin(s.handlePresence))
mux.Handle("GET /api/panel/agents/{id}/stat", s.requireAdmin(s.handleAgentStat))
mux.Handle("POST /api/panel/agents/{id}/speed", s.requireAdmin(s.handleAgentSpeed))
mux.Handle("GET /api/panel/agents/{id}/speed/progress", s.requireAdmin(s.handleSpeedProgress))
mux.Handle("GET /api/panel/ping", s.requireAdmin(s.handlePanelPing))
mux.Handle("POST /api/panel/agents/{id}/speed/relay", s.requireAdmin(s.handleSpeedRelayOpen))
mux.Handle("POST /api/panel/agents/{id}/speed/down", s.requireAdmin(s.handleSpeedRelayFeed))