Skip to content

[pull] master from Ehco1996:master#315

Merged
pull[bot] merged 2 commits into
Kiterepo:masterfrom
Ehco1996:master
May 4, 2026
Merged

[pull] master from Ehco1996:master#315
pull[bot] merged 2 commits into
Kiterepo:masterfrom
Ehco1996:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 4, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Ehco1996 and others added 2 commits May 4, 2026 21:09
* fix(webui): track busy state on grouped kill-user button

* feat(update): self-update from CLI + dashboard

Move update logic from cli/update.go into a single internal/updater
package usable by both `ehco update` and the new /api/v1/update/* HTTP
endpoints. The /updates page lets the operator pick a channel, check
GitHub releases, and trigger an in-place upgrade with a step indicator.

Why:
- CLI-only updates require ssh-ing into every relay; a dashboard button
  is much faster for the personal fleet.
- Sharing the implementation avoids two divergent download/replace flows.

Job state is process-local (atomic.Pointer[JobStatus]); after a successful
restart the SPA polls /version and lands on done when the new binary
boots.

* feat(metrics): 5s node sampler + dashboard Node page

Single ticker at 5s; sample /metrics/ on every tick, push accumulated
traffic stats to the control plane every SyncInterval/5 ticks. Adds a
/node dashboard page that finally renders disk usage and network
throughput in real time.

Why:
- Previously sampling and control-plane sync were welded into one
  60s-default loop; the dashboard was minute-resolution at best, and
  disk usage was never persisted unless control-plane sync ran.
- Splitting sample/push lets local persistence be fast (5s) without
  spamming the control plane.

Drops the unused `refresh` parameter from QueryNodeMetrics /
QueryRuleMetrics — the background sampler keeps the store warm so
on-demand reads can just read the store.
* web: admin revamp — operator's terminal direction + IA shuffle + bucketed metrics

Visual: replace Inter with JetBrains Mono everywhere; sharper geometry
(rounded-md, 1px borders); rate-first home strip with ↓/↑ as the page's
anchor; full-width host throughput chart; lowercase page titles; hover-
only conn kill; logs zebra rows.

IA: flatten the 8-page / 2-group sidebar to 6 flat items. Home subsumes
the old standalone Node page (host charts embedded). Settings owns the
Updates flow as an embedded panel. /xray/users → /users, /xray/conns →
/conns. Legacy paths redirect.

Metrics store: query API now accepts a `step` (seconds) param. Node
metrics are bucket-averaged via GROUP BY (timestamp/step)*step; rule
metrics keep the last sample per (label,remote,bucket) so the SPA's
delta-on-consecutive-points trend math stays correct. Frontend picks a
step per window so 30d windows return ≤360 points.

New /api/v1/overview aggregate. XrayServer satisfies a new
glue.XrayStatus interface and is wired post-construction so web/
doesn't need to import pkg/xray. Saves the home page three RTs per
poll tick.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* web: fix y-axis truncation, enable metric_reader on darwin, simplify pass

Visual fix: chart y-axis was clipping "12 MB/s" to "2 MB/s" because the
default uPlot gutter is too narrow for 7-char byte labels. New
bytesShort() helper renders compact "12M/s" / "830K/s" form for axes;
keep verbose bytes() for tabular contexts.

Darwin metric_reader: node_darwin.go was a no-op since 2025-11-08 with a
stale "node_exporter has compatibility issues on macOS" comment. v1.10.2
ships working darwin collectors for cpu / meminfo / loadavg / filesystem
/ netdev — verified all the metrics ParseNodeMetrics expects are
emitted. Wire the same NewNodeCollector path as linux, with
--no-collector.thermal to silence "no CPU power status has been
recorded" log noise.

Simplify pass over the PR diff:
- Extract zapLevelToSlogLevel to internal/metrics/log_level.go (was
  duplicated verbatim across node_linux.go and node_darwin.go).
- QueryRuleMetric: deduplicate the column list and WHERE filters
  between bucketed and raw branches; share whereSQL/whereArgs.
- OverviewResp: drop redundant NetRateIn/NetRateOut — they duplicated
  host.network_in/out. SPA reads host() directly.
- Home page: memoize series() (was re-sorting + re-allocating every
  read across 3 charts); precompute topUsers scoring (was running
  recentBytes(u) O(n log n) times inside sort comparator); extract
  <ChartCard> + <ListHeader> components for the three near-identical
  card wrappers; delete section-divider comments and dead `void poll`.
- Settings + UpdatesPanel: lowercase CardHeader titles for consistency
  with the rest of the revamped pages.
- handler_api.go::Overview: hoist time.Now() to a local.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators May 4, 2026
@pull pull Bot added the ⤵️ pull label May 4, 2026
@pull pull Bot merged commit c3ba8fb into Kiterepo:master May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant