github.com/hernad/nomad@v1.6.112/ui/app/components/children-status-bar.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import { computed } from '@ember/object';
     7  import DistributionBar from './distribution-bar';
     8  import classic from 'ember-classic-decorator';
     9  import { attributeBindings } from '@ember-decorators/component';
    10  
    11  @classic
    12  @attributeBindings('data-test-children-status-bar')
    13  export default class ChildrenStatusBar extends DistributionBar {
    14    layoutName = 'components/distribution-bar';
    15  
    16    job = null;
    17  
    18    'data-test-children-status-bar' = true;
    19  
    20    @computed('job.{pendingChildren,runningChildren,deadChildren}')
    21    get data() {
    22      if (!this.job) {
    23        return [];
    24      }
    25  
    26      const children = this.job.getProperties(
    27        'pendingChildren',
    28        'runningChildren',
    29        'deadChildren'
    30      );
    31      return [
    32        {
    33          label: 'Pending',
    34          value: children.pendingChildren,
    35          className: 'queued',
    36        },
    37        {
    38          label: 'Running',
    39          value: children.runningChildren,
    40          className: 'running',
    41        },
    42        { label: 'Dead', value: children.deadChildren, className: 'complete' },
    43      ];
    44    }
    45  }