1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 13:55:21 +02:00

fix(services): Fix invalid replica count for global services (#1353)

This commit is contained in:
Thomas Krzero 2017-11-06 15:50:59 +01:00 committed by Anthony Lapenna
parent 407f0f5807
commit b9e535d7a5
2 changed files with 9 additions and 6 deletions

View file

@ -1,4 +1,4 @@
function ServiceViewModel(data, runningTasks, nodes) {
function ServiceViewModel(data, runningTasks, allTasks, nodes) {
this.Model = data;
this.Id = data.ID;
this.Tasks = [];
@ -12,8 +12,8 @@ function ServiceViewModel(data, runningTasks, nodes) {
this.Replicas = data.Spec.Mode.Replicated.Replicas;
} else {
this.Mode = 'global';
if (nodes) {
this.Replicas = nodes.length;
if (allTasks) {
this.Replicas = allTasks.length;
}
}
if (runningTasks) {