open-nomad/ui/app/components/region-switcher.js
2022-01-20 09:46:45 -05:00

23 lines
528 B
JavaScript

import Component from '@ember/component';
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import classic from 'ember-classic-decorator';
@classic
export default class RegionSwitcher extends Component {
@service system;
@service router;
@service store;
@computed('system.regions')
get sortedRegions() {
return this.get('system.regions').toArray().sort();
}
gotoRegion(region) {
this.router.transitionTo('jobs', {
queryParams: { region },
});
}
}