feat(web): cluster page shows token ring — ring topology/leader/load, pending tasks, active forward topology with owner, incremental log sync view (e2e verified)

This commit is contained in:
2026-08-18 09:13:20 +08:00
parent 6959025219
commit bf602016b4
9 changed files with 217 additions and 138 deletions

View File

@ -29,19 +29,19 @@ const (
// LogEntry is one immutable, append-only cluster operation.
type LogEntry struct {
Seq int64 `json:"seq"`
Node string `json:"node"`
Kind string `json:"kind"`
Data json.RawMessage `json:"data,omitempty"`
At int64 `json:"at"`
Seq int64 `json:"seq"`
Node string `json:"node"`
Kind string `json:"kind"`
Data json.RawMessage `json:"data,omitempty"`
At int64 `json:"at"`
}
// ClusterLog is a node's local operation log with a sync watermark.
type ClusterLog struct {
mu sync.Mutex
Seq int64 // highest local seq issued
Log []LogEntry // append-only
Synced int64 // watermark: entries <= this are known to remote nodes
mu sync.Mutex
Seq int64 // highest local seq issued
Log []LogEntry // append-only
Synced int64 // watermark: entries <= this are known to remote nodes
}
// NewClusterLog creates an empty log with initial sequence.