Files
nomad/ui/app/routes/clients.js
Phil Renaud 0324e781d4 [ui] Global token CRUD in the web UI (#23506)
* First pass at global token creation and regional awareness at token fetch time

* Reset and refetch token when you switch region but stay in place

* Ugly and functional global token save

* Tests and log cleanup
2024-07-11 14:54:39 -04:00

29 lines
734 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import RSVP from 'rsvp';
import WithForbiddenState from 'nomad-ui/mixins/with-forbidden-state';
import notifyForbidden from 'nomad-ui/utils/notify-forbidden';
import classic from 'ember-classic-decorator';
@classic
export default class ClientsRoute extends Route.extend(WithForbiddenState) {
@service store;
@service system;
beforeModel() {
return this.get('system.leader');
}
model() {
return RSVP.hash({
nodes: this.store.findAll('node'),
nodePools: this.store.findAll('node-pool'),
}).catch(notifyForbidden(this));
}
}