open-nomad/ui/app/components/region-switcher.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
606 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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() {
2021-12-28 14:45:20 +00:00
return this.get('system.regions').toArray().sort();
}
gotoRegion(region) {
2019-03-26 07:46:44 +00:00
this.router.transitionTo('jobs', {
queryParams: { region },
});
}
}