github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/serializers/node.js (about) 1 import { inject as service } from '@ember/service'; 2 import ApplicationSerializer from './application'; 3 4 export default class NodeSerializer extends ApplicationSerializer { 5 @service config; 6 7 attrs = { 8 isDraining: 'Drain', 9 httpAddr: 'HTTPAddr', 10 resources: 'NodeResources', 11 reserved: 'ReservedResources', 12 }; 13 14 mapToArray = ['Drivers', 'HostVolumes']; 15 16 extractRelationships(modelClass, hash) { 17 const { modelName } = modelClass; 18 const nodeURL = this.store 19 .adapterFor(modelName) 20 .buildURL(modelName, this.extractId(modelClass, hash), hash, 'findRecord'); 21 22 return { 23 allocations: { 24 links: { 25 related: `${nodeURL}/allocations`, 26 }, 27 }, 28 }; 29 } 30 }