github.com/hernad/nomad@v1.6.112/ui/app/components/keyboard-shortcuts-modal.hbs (about)

     1  {{!
     2    Copyright (c) HashiCorp, Inc.
     3    SPDX-License-Identifier: MPL-2.0
     4  ~}}
     5  
     6  {{#if this.keyboard.shortcutsVisible}}
     7    {{keyboard-commands (array this.escapeCommand)}}
     8    <div class="keyboard-shortcuts"
     9        {{on-click-outside
    10          (toggle "keyboard.shortcutsVisible" this)
    11        }}
    12    >
    13      <header>
    14        <button
    15          {{autofocus}}
    16          class="button is-borderless dismiss"
    17          type="button"
    18          {{on "click" (toggle "keyboard.shortcutsVisible" this)}}
    19          aria-label="Dismiss"
    20        >
    21          {{x-icon "cancel"}}
    22        </button>
    23        <h2>Keyboard Shortcuts</h2>
    24        <p>Click a key pattern to re-bind it to a shortcut of your choosing.</p>
    25      </header>
    26      <ul class="commands-list">
    27        {{#each this.commands as |command|}}
    28          <li data-test-command-label={{command.label}}>
    29            <strong>{{command.label}}</strong>
    30              <span class="keys">
    31                {{#if command.recording}}
    32                  <span class="recording">Recording; ESC to cancel.</span>
    33                {{else}}
    34                  {{#if command.custom}}
    35                    <button type="button" class="reset-to-default" {{on "click" (action this.keyboard.resetCommandToDefault command)}}>reset to default</button>
    36                  {{/if}}
    37                {{/if}}
    38  
    39                <button data-test-rebinder disabled={{or (not command.rebindable) command.recording}} type="button" {{on "click" (action this.keyboard.rebindCommand command)}}>
    40                  {{#each command.pattern as |key|}}
    41                    <span>{{clean-keycommand key}}</span>
    42                  {{/each}}
    43                </button>
    44              </span>
    45          </li>
    46        {{/each}}
    47      </ul>
    48      <footer>
    49        <strong>Keyboard shortcuts {{#if this.keyboard.enabled}}enabled{{else}}disabled{{/if}}</strong>
    50        <Toggle
    51          data-test-enable-shortcuts-toggle
    52          @isActive={{this.keyboard.enabled}}
    53          @onToggle={{this.toggleListener}}
    54          title="{{if this.keyboard.enabled "enable" "disable"}} keyboard shortcuts"
    55        />
    56      </footer>
    57    </div>
    58  {{/if}}
    59  
    60  {{#if (and this.keyboard.enabled this.keyboard.displayHints)}}
    61    {{#each this.hints as |hint|}}
    62      <span
    63        {{did-insert (fn this.tetherToElement hint.element hint)}}
    64        {{will-destroy (fn this.untetherFromElement hint)}}
    65        data-test-keyboard-hint
    66        data-shortcut={{hint.pattern}}
    67        class="{{if hint.menuLevel "menu-level"}}"
    68        aria-hidden="true"
    69      >
    70        {{#each hint.pattern as |key|}}
    71          <span>{{key}}</span>
    72        {{/each}}
    73      </span>
    74    {{/each}}
    75  {{/if}}