open-nomad/ui/app/routes/clients/client.js
2023-04-10 15:36:59 +00:00

24 lines
568 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import notifyError from 'nomad-ui/utils/notify-error';
export default class ClientRoute extends Route {
@service store;
model() {
return super.model(...arguments).catch(notifyError(this));
}
afterModel(model) {
if (model && model.get('isPartial')) {
return model.reload().then((node) => node.get('allocations'));
}
return model && model.get('allocations');
}
}