github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/templates/variables/index.hbs (about)

     1  {{page-title "Variables"}}
     2  <section class="section">
     3    <div class="toolbar">
     4      <div class="toolbar-item is-right-aligned is-mobile-full-width">
     5          {{#if this.namespaceOptions}}
     6            <SingleSelectDropdown
     7              data-test-variable-namespace-filter
     8              @label="Namespace"
     9              @options={{this.namespaceOptions}}
    10              @selection={{this.namespaceSelection}}
    11              @onSelect={{this.setNamespace}}
    12            />
    13          {{/if}}
    14        <div class="button-bar">
    15        {{#if (can "write variable" path="*" namespace=this.namespaceSelection)}}
    16          <LinkTo
    17            @route="variables.new"
    18            class="button is-primary"
    19            data-test-create-var
    20          >
    21            Create Variable
    22          </LinkTo>
    23        {{else}}
    24          <button
    25            class="button is-primary is-disabled tooltip is-right-aligned"
    26            aria-label="You don’t have sufficient permissions"
    27            disabled
    28            type="button"
    29            data-test-disabled-create-var
    30          >
    31            Create Variable
    32          </button>
    33        {{/if}}
    34  
    35        </div>
    36      </div>
    37    </div>
    38    {{#if this.isForbidden}}
    39      <ForbiddenMessage />
    40    {{else}}
    41      {{#if this.hasVariables}}
    42        <VariablePaths
    43          @branch={{this.root}}
    44        />
    45      {{else}}
    46        <div class="empty-message">
    47          {{#if (eq this.namespaceSelection "*")}}
    48            <h3 data-test-empty-variables-list-headline class="empty-message-headline">
    49              No Variables
    50            </h3>
    51            {{#if (can "write variable" path="*" namespace=this.namespaceSelection)}}
    52              <p class="empty-message-body">
    53                Get started by <LinkTo @route="variables.new">creating a new variable</LinkTo>
    54              </p>
    55            {{/if}}
    56          {{else}}
    57            <h3 data-test-no-matching-variables-list-headline class="empty-message-headline">
    58              No Matches
    59            </h3>
    60            <p class="empty-message-body">
    61              No paths or variables match the namespace
    62              <strong>
    63                {{this.namespaceSelection}}
    64              </strong>
    65            </p>
    66          {{/if}}
    67        </div>
    68      {{/if}}
    69    {{/if}}
    70  </section>