Files
nomad/ui/app/components/region-switcher.hbs
2025-08-20 13:01:22 -07:00

31 lines
905 B
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
{{keyboard-commands this.keyCommands}}
{{#if this.system.shouldShowRegions}}
<span data-test-region-switcher-parent>
<PowerSelect
data-test-region-switcher
@ariaLabel="label-region-switcher"
@ariaLabelledBy="label-region-switcher"
@tagName="div"
@triggerClass={{this.decoration}}
@options={{this.sortedRegions}}
@selected={{or this.system.activeRegion 'Select a Region'}}
@searchEnabled={{false}}
@onChange={{action this.gotoRegion}} as |region|>
{{#if this.system.activeRegion}}
<span class="ember-power-select-prefix">Region: </span>
{{/if}}
{{region}}
</PowerSelect>
</span>
{{else if this.system.hasNonDefaultRegion}}
<div class="navbar-item single-region">
<span>Region: </span>{{this.system.activeRegion}}
</div>
{{/if}}