mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
Fetch regions and namespaces in the application route
This commit is contained in:
@@ -2,11 +2,18 @@ import { inject as service } from '@ember/service';
|
||||
import Route from '@ember/routing/route';
|
||||
import { next } from '@ember/runloop';
|
||||
import { AbortError } from 'ember-data/adapters/errors';
|
||||
import RSVP from 'rsvp';
|
||||
|
||||
export default Route.extend({
|
||||
config: service(),
|
||||
system: service(),
|
||||
|
||||
queryParams: {
|
||||
region: {
|
||||
refreshModel: true,
|
||||
},
|
||||
},
|
||||
|
||||
resetController(controller, isExiting) {
|
||||
if (isExiting) {
|
||||
controller.set('error', null);
|
||||
@@ -14,7 +21,7 @@ export default Route.extend({
|
||||
},
|
||||
|
||||
beforeModel() {
|
||||
return this.get('system.regions');
|
||||
return RSVP.all([this.get('system.regions'), this.get('system.namespaces')]);
|
||||
},
|
||||
|
||||
syncToController(controller) {
|
||||
|
||||
@@ -15,10 +15,6 @@ export default Route.extend(WithForbiddenState, {
|
||||
},
|
||||
],
|
||||
|
||||
beforeModel() {
|
||||
return this.get('system.namespaces');
|
||||
},
|
||||
|
||||
model() {
|
||||
return this.get('store')
|
||||
.findAll('job', { reload: true })
|
||||
|
||||
Reference in New Issue
Block a user