1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

feat(services): display clearer information about services

This commit is contained in:
Richard Goater 2017-03-12 13:24:41 -04:00 committed by Anthony Lapenna
parent 22c02a8fe9
commit 35e2cecee1
5 changed files with 44 additions and 16 deletions

View file

@ -1,4 +1,4 @@
function ServiceViewModel(data) {
function ServiceViewModel(data, runningTasks, nodes) {
this.Model = data;
this.Id = data.ID;
this.Name = data.Spec.Name;
@ -9,6 +9,12 @@ function ServiceViewModel(data) {
this.Replicas = data.Spec.Mode.Replicated.Replicas;
} else {
this.Mode = 'global';
if (nodes) {
this.Replicas = nodes.length;
}
}
if (runningTasks) {
this.Running = runningTasks.length;
}
this.Labels = data.Spec.Labels;
if (data.Spec.TaskTemplate.ContainerSpec) {