feat: daemon health panel, brand-rail status chips, user timezone selector
Build / build (push) Successful in 10m35s

- Health API now surfaces Docker /info + /version (version, platform,
  kernel, container/image counts, storage driver, memory, latency) and
  NPM aggregates (proxy host total, managed-by-Tinyforge count, access
  lists, certificates, endpoint URL).
- Docker/NPM indicators moved out of the sidebar footer and into a
  compact mono-styled rail directly under the Tinyforge brand title,
  with pulse/fault animations and click-to-expand error hints.
- New SystemDaemonsCard on the dashboard: two terminal-styled panels
  (Docker Engine + Proxy) with a running/paused/stopped stacked bar,
  key-value diagnostics, and a total-vs-managed proportion meter on
  the proxy-hosts tile.
- Shared health store so the sidebar and dashboard share a single
  30 s poll instead of duplicating traffic.
- User-facing timezone preference with auto-detect fallback; all
  dates across projects, sites, stacks, settings, backup, event log
  and stale containers now render through \$fmt.date / \$fmt.datetime.
- en/ru translations for both features.
This commit is contained in:
2026-04-23 14:32:30 +03:00
parent a182a93950
commit 90e6e59d9e
24 changed files with 2267 additions and 177 deletions
+64
View File
@@ -48,3 +48,67 @@ func (c *Client) Ping(ctx context.Context) error {
}
return nil
}
// DaemonInfo captures the subset of Docker daemon info surfaced in the UI.
// Fields map directly to /info and /version; JSON tags match the wire format
// consumed by the frontend's DockerHealth type.
type DaemonInfo struct {
Version string `json:"version,omitempty"`
APIVersion string `json:"api_version,omitempty"`
OS string `json:"os,omitempty"`
Arch string `json:"arch,omitempty"`
Kernel string `json:"kernel,omitempty"`
OperatingSystem string `json:"operating_system,omitempty"`
StorageDriver string `json:"storage_driver,omitempty"`
RootDir string `json:"root_dir,omitempty"`
Name string `json:"name,omitempty"`
NCPU int `json:"ncpu,omitempty"`
MemoryTotal int64 `json:"memory_total,omitempty"`
Containers int `json:"containers,omitempty"`
Running int `json:"running,omitempty"`
Paused int `json:"paused,omitempty"`
Stopped int `json:"stopped,omitempty"`
Images int `json:"images,omitempty"`
}
// Info returns a compact snapshot of daemon health data. Missing pieces
// (e.g. if ServerVersion fails but Info succeeds) are returned as zero
// values rather than bubbling up — the endpoint should degrade gracefully.
func (c *Client) Info(ctx context.Context) (DaemonInfo, error) {
info, err := c.api.Info(ctx, client.InfoOptions{})
if err != nil {
return DaemonInfo{}, fmt.Errorf("docker info: %w", err)
}
out := DaemonInfo{
OperatingSystem: info.Info.OperatingSystem,
Kernel: info.Info.KernelVersion,
Arch: info.Info.Architecture,
OS: info.Info.OSType,
StorageDriver: info.Info.Driver,
RootDir: info.Info.DockerRootDir,
Name: info.Info.Name,
NCPU: info.Info.NCPU,
MemoryTotal: info.Info.MemTotal,
Containers: info.Info.Containers,
Running: info.Info.ContainersRunning,
Paused: info.Info.ContainersPaused,
Stopped: info.Info.ContainersStopped,
Images: info.Info.Images,
Version: info.Info.ServerVersion,
}
if ver, verr := c.api.ServerVersion(ctx, client.ServerVersionOptions{}); verr == nil {
if ver.Version != "" {
out.Version = ver.Version
}
out.APIVersion = ver.APIVersion
if out.Arch == "" {
out.Arch = ver.Arch
}
if out.OS == "" {
out.OS = ver.Os
}
}
return out, nil
}