github.com/hernad/nomad@v1.6.112/ui/app/models/node-driver.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import classic from 'ember-classic-decorator';
     7  import Fragment from 'ember-data-model-fragments/fragment';
     8  import { get, computed } from '@ember/object';
     9  import { attr } from '@ember-data/model';
    10  import { fragmentOwner } from 'ember-data-model-fragments/attributes';
    11  import { fragment } from 'ember-data-model-fragments/attributes';
    12  
    13  @classic
    14  export default class NodeDriver extends Fragment {
    15    @fragmentOwner() node;
    16  
    17    @fragment('structured-attributes') attributes;
    18  
    19    @computed('name', 'attributes.structured')
    20    get attributesShort() {
    21      const attributes = this.get('attributes.structured');
    22      return get(attributes, `driver.${this.name}`);
    23    }
    24  
    25    @attr('string') name;
    26    @attr('boolean', { defaultValue: false }) detected;
    27    @attr('boolean', { defaultValue: false }) healthy;
    28    @attr('string') healthDescription;
    29    @attr('date') updateTime;
    30  
    31    @computed('healthy')
    32    get healthClass() {
    33      return this.healthy ? 'running' : 'failed';
    34    }
    35  }