feat(home): add node count to endpoint list. (#4793)

* feat(home): add node count to endpoint list.

* feat(home): add node count beside docker version
pull/4484/head
aravind-korada 2021-03-04 21:12:47 +05:30 committed by GitHub
parent 36fcbb9e18
commit 52d4296c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -118,6 +118,7 @@ func snapshotNodes(snapshot *portainer.DockerSnapshot, cli *client.Client) error
} }
snapshot.TotalCPU = int(nanoCpus / 1e9) snapshot.TotalCPU = int(nanoCpus / 1e9)
snapshot.TotalMemory = totalMem snapshot.TotalMemory = totalMem
snapshot.NodeCount = len(nodes)
return nil return nil
} }

View File

@ -119,6 +119,7 @@ type (
ImageCount int `json:"ImageCount"` ImageCount int `json:"ImageCount"`
ServiceCount int `json:"ServiceCount"` ServiceCount int `json:"ServiceCount"`
StackCount int `json:"StackCount"` StackCount int `json:"StackCount"`
NodeCount int `json:"NodeCount"`
SnapshotRaw DockerSnapshotRaw `json:"DockerSnapshotRaw"` SnapshotRaw DockerSnapshotRaw `json:"DockerSnapshotRaw"`
} }

View File

@ -84,6 +84,10 @@
<span class="small text-muted"> <span class="small text-muted">
{{ $ctrl.model.Snapshots[0].Swarm ? 'Swarm' : 'Standalone' }} {{ $ctrl.model.Snapshots[0].DockerVersion }} {{ $ctrl.model.Snapshots[0].Swarm ? 'Swarm' : 'Standalone' }} {{ $ctrl.model.Snapshots[0].DockerVersion }}
<span ng-if="$ctrl.model.Type === 2">+ <i class="fa fa-bolt" aria-hidden="true"></i> Agent</span> <span ng-if="$ctrl.model.Type === 2">+ <i class="fa fa-bolt" aria-hidden="true"></i> Agent</span>
<span style="padding: 0 7px 0 0;" ng-if="$ctrl.model.Snapshots[0].Swarm">
<i class="fa fa-hdd space-left space-right" aria-hidden="true"></i>{{ $ctrl.model.Snapshots[0].NodeCount }}
{{ $ctrl.model.Snapshots[0].NodeCount === 1 ? 'node' : 'nodes' }}
</span>
</span> </span>
</div> </div>