github.com/aminovpavel/nomad@v0.11.8/ui/app/components/allocation-status-bar.js (about)

     1  import { computed } from '@ember/object';
     2  import DistributionBar from './distribution-bar';
     3  
     4  export default DistributionBar.extend({
     5    layoutName: 'components/distribution-bar',
     6  
     7    allocationContainer: null,
     8  
     9    'data-test-allocation-status-bar': true,
    10  
    11    data: computed(
    12      'allocationContainer.{queuedAllocs,completeAllocs,failedAllocs,runningAllocs,startingAllocs}',
    13      function() {
    14        if (!this.allocationContainer) {
    15          return [];
    16        }
    17  
    18        const allocs = this.allocationContainer.getProperties(
    19          'queuedAllocs',
    20          'completeAllocs',
    21          'failedAllocs',
    22          'runningAllocs',
    23          'startingAllocs',
    24          'lostAllocs'
    25        );
    26        return [
    27          { label: 'Queued', value: allocs.queuedAllocs, className: 'queued' },
    28          {
    29            label: 'Starting',
    30            value: allocs.startingAllocs,
    31            className: 'starting',
    32            layers: 2,
    33          },
    34          { label: 'Running', value: allocs.runningAllocs, className: 'running' },
    35          {
    36            label: 'Complete',
    37            value: allocs.completeAllocs,
    38            className: 'complete',
    39          },
    40          { label: 'Failed', value: allocs.failedAllocs, className: 'failed' },
    41          { label: 'Lost', value: allocs.lostAllocs, className: 'lost' },
    42        ];
    43      }
    44    ),
    45  });