github.com/hernad/nomad@v1.6.112/ui/app/serializers/job-plan.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import ApplicationSerializer from './application';
     7  import { get } from '@ember/object';
     8  import classic from 'ember-classic-decorator';
     9  
    10  @classic
    11  export default class JobPlan extends ApplicationSerializer {
    12    mapToArray = ['FailedTGAllocs'];
    13  
    14    normalize(typeHash, hash) {
    15      hash.PreemptionIDs = (get(hash, 'Annotations.PreemptedAllocs') || []).mapBy(
    16        'ID'
    17      );
    18      return super.normalize(...arguments);
    19    }
    20  }