github.com/thomasobenaus/nomad@v0.11.1/ui/app/serializers/job-plan.js (about)

     1  import { assign } from '@ember/polyfills';
     2  import ApplicationSerializer from './application';
     3  import { get } from '@ember/object';
     4  
     5  export default ApplicationSerializer.extend({
     6    normalize(typeHash, hash) {
     7      const failures = hash.FailedTGAllocs || {};
     8      hash.FailedTGAllocs = Object.keys(failures).map(key => {
     9        return assign({ Name: key }, failures[key] || {});
    10      });
    11      hash.PreemptionIDs = (get(hash, 'Annotations.PreemptedAllocs') || []).mapBy('ID');
    12      return this._super(...arguments);
    13    },
    14  });