open-nomad/ui/app/routes/clients/client.js

19 lines
490 B
JavaScript
Raw Normal View History

import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
2017-09-28 17:06:24 +00:00
import notifyError from 'nomad-ui/utils/notify-error';
2017-09-19 14:47:10 +00:00
2020-06-13 03:59:33 +00:00
export default class ClientRoute extends Route {
@service store;
2017-09-19 14:47:10 +00:00
2017-09-28 17:06:24 +00:00
model() {
return super.model(...arguments).catch(notifyError(this));
}
2017-09-28 17:06:24 +00:00
2017-09-19 14:47:10 +00:00
afterModel(model) {
2017-09-28 17:06:24 +00:00
if (model && model.get('isPartial')) {
2021-12-28 14:45:20 +00:00
return model.reload().then((node) => node.get('allocations'));
2017-09-19 14:47:10 +00:00
}
2017-09-28 17:06:24 +00:00
return model && model.get('allocations');
}
}