diff --git a/api/docker/snapshot.go b/api/docker/snapshot.go index f9ead6d3e..f3e96ff7e 100644 --- a/api/docker/snapshot.go +++ b/api/docker/snapshot.go @@ -118,6 +118,7 @@ func snapshotNodes(snapshot *portainer.DockerSnapshot, cli *client.Client) error } snapshot.TotalCPU = int(nanoCpus / 1e9) snapshot.TotalMemory = totalMem + snapshot.NodeCount = len(nodes) return nil } diff --git a/api/portainer.go b/api/portainer.go index e81da59c4..bc21cb56e 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -119,6 +119,7 @@ type ( ImageCount int `json:"ImageCount"` ServiceCount int `json:"ServiceCount"` StackCount int `json:"StackCount"` + NodeCount int `json:"NodeCount"` SnapshotRaw DockerSnapshotRaw `json:"DockerSnapshotRaw"` } diff --git a/app/portainer/components/endpoint-list/endpoint-item/endpointItem.html b/app/portainer/components/endpoint-list/endpoint-item/endpointItem.html index 2b952f126..d10ded05b 100644 --- a/app/portainer/components/endpoint-list/endpoint-item/endpointItem.html +++ b/app/portainer/components/endpoint-list/endpoint-item/endpointItem.html @@ -84,6 +84,10 @@ {{ $ctrl.model.Snapshots[0].Swarm ? 'Swarm' : 'Standalone' }} {{ $ctrl.model.Snapshots[0].DockerVersion }} + Agent + + {{ $ctrl.model.Snapshots[0].NodeCount }} + {{ $ctrl.model.Snapshots[0].NodeCount === 1 ? 'node' : 'nodes' }} +