Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Fix Docker host custom display name not persisting in UI (related to #662)

rcourtman8cea4334432a
diff --git a/internal/models/converters.go b/internal/models/converters.go
index b4a809eddb..8a8c81c6e5 100644
--- a/internal/models/converters.go
+++ b/internal/models/converters.go
@@ -197,26 +197,27 @@ func (c Container) ToFrontend() ContainerFrontend {
// ToFrontend converts a DockerHost to DockerHostFrontend
func (d DockerHost) ToFrontend() DockerHostFrontend {
h := DockerHostFrontend{
- ID: d.ID,
- AgentID: d.AgentID,
- Hostname: d.Hostname,
- DisplayName: d.DisplayName,
- MachineID: d.MachineID,
- OS: d.OS,
- KernelVersion: d.KernelVersion,
- Architecture: d.Architecture,
- Runtime: d.Runtime,
- RuntimeVersion: d.RuntimeVersion,
- DockerVersion: d.DockerVersion,
- CPUs: d.CPUs,
- TotalMemoryBytes: d.TotalMemoryBytes,
- UptimeSeconds: d.UptimeSeconds,
- CPUUsagePercent: d.CPUUsage,
- Status: d.Status,
- LastSeen: d.LastSeen.Unix() * 1000,
- IntervalSeconds: d.IntervalSeconds,
- AgentVersion: d.AgentVersion,
- Containers: make([]DockerContainerFrontend, len(d.Containers)),
+ ID: d.ID,
+ AgentID: d.AgentID,
+ Hostname: d.Hostname,
+ DisplayName: d.DisplayName,
+ CustomDisplayName: d.CustomDisplayName,
+ MachineID: d.MachineID,
+ OS: d.OS,
+ KernelVersion: d.KernelVersion,
+ Architecture: d.Architecture,
+ Runtime: d.Runtime,
+ RuntimeVersion: d.RuntimeVersion,
+ DockerVersion: d.DockerVersion,
+ CPUs: d.CPUs,
+ TotalMemoryBytes: d.TotalMemoryBytes,
+ UptimeSeconds: d.UptimeSeconds,
+ CPUUsagePercent: d.CPUUsage,
+ Status: d.Status,
+ LastSeen: d.LastSeen.Unix() * 1000,
+ IntervalSeconds: d.IntervalSeconds,
+ AgentVersion: d.AgentVersion,
+ Containers: make([]DockerContainerFrontend, len(d.Containers)),
}
if h.DisplayName == "" {
diff --git a/internal/models/models_frontend.go b/internal/models/models_frontend.go
index 0854459531..d22a4ece99 100644
--- a/internal/models/models_frontend.go
+++ b/internal/models/models_frontend.go
@@ -102,6 +102,7 @@ type DockerHostFrontend struct {
AgentID string `json:"agentId"`
Hostname string `json:"hostname"`
DisplayName string `json:"displayName"`
+ CustomDisplayName string `json:"customDisplayName,omitempty"`
MachineID string `json:"machineId,omitempty"`
OS string `json:"os,omitempty"`
KernelVersion string `json:"kernelVersion,omitempty"`