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:
parent
22c02a8fe9
commit
35e2cecee1
5 changed files with 44 additions and 16 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue