open-nomad/ui/app/serializers/evaluation.js

21 lines
623 B
JavaScript
Raw Normal View History

import { inject as service } from '@ember/service';
import { get } from '@ember/object';
2017-11-29 01:21:56 +00:00
import ApplicationSerializer from './application';
import classic from 'ember-classic-decorator';
2017-11-29 01:21:56 +00:00
@classic
export default class Evaluation extends ApplicationSerializer {
@service system;
2017-11-29 01:21:56 +00:00
mapToArray = ['FailedTGAllocs'];
separateNanos = ['CreateTime', 'ModifyTime'];
2017-11-29 01:21:56 +00:00
normalize(typeHash, hash) {
2017-11-29 01:21:56 +00:00
hash.PlainJobId = hash.JobID;
hash.Namespace = hash.Namespace || get(hash, 'Job.Namespace') || 'default';
2017-11-29 01:21:56 +00:00
hash.JobID = JSON.stringify([hash.JobID, hash.Namespace]);
return super.normalize(typeHash, hash);
}
}