github.com/hernad/nomad@v1.6.112/ui/app/templates/csi/volumes/index.hbs (about)

     1  {{!
     2    Copyright (c) HashiCorp, Inc.
     3    SPDX-License-Identifier: MPL-2.0
     4  ~}}
     5  
     6  {{page-title "CSI Volumes"}}
     7  <StorageSubnav />
     8  <section class="section">
     9    <div class="toolbar">
    10      <div class="toolbar-item">
    11        {{#if this.visibleVolumes.length}}
    12          <SearchBox
    13            data-test-volumes-search
    14            @searchTerm={{mut this.searchTerm}}
    15            @onChange={{action this.resetPagination}}
    16            @placeholder="Search volumes..."
    17          />
    18        {{/if}}
    19      </div>
    20      {{#if this.system.shouldShowNamespaces}}
    21        <div class="toolbar-item is-right-aligned is-mobile-full-width">
    22          <div class="button-bar">
    23            <SingleSelectDropdown
    24              data-test-namespace-facet
    25              @label="Namespace"
    26              @options={{this.optionsNamespaces}}
    27              @selection={{this.qpNamespace}}
    28              @onSelect={{action this.setFacetQueryParam "qpNamespace"}}
    29            />
    30          </div>
    31        </div>
    32      {{/if}}
    33    </div>
    34    {{#if this.isForbidden}}
    35      <ForbiddenMessage />
    36    {{else if this.sortedVolumes}}
    37      <ListPagination
    38        @source={{this.sortedVolumes}}
    39        @size={{this.pageSize}}
    40        @page={{this.currentPage}} as |p|
    41      >
    42        <ListTable
    43          @source={{p.list}}
    44          @sortProperty={{this.sortProperty}}
    45          @sortDescending={{this.sortDescending}}
    46          @class="with-foot" as |t|
    47        >
    48          <t.head>
    49            <t.sort-by @prop="name">
    50              Name
    51            </t.sort-by>
    52            {{#if this.system.shouldShowNamespaces}}
    53              <t.sort-by @prop="namespace.name">
    54                Namespace
    55              </t.sort-by>
    56            {{/if}}
    57            <t.sort-by @prop="schedulable">
    58              Volume Health
    59            </t.sort-by>
    60            <t.sort-by @prop="controllersHealthyProportion">
    61              Controller Health
    62            </t.sort-by>
    63            <t.sort-by @prop="nodesHealthyProportion">
    64              Node Health
    65            </t.sort-by>
    66            <t.sort-by @prop="provider">
    67              Provider
    68            </t.sort-by>
    69            <th>
    70              # Allocs
    71            </th>
    72          </t.head>
    73          <t.body @key="model.name" as |row|>
    74            <tr
    75              class="is-interactive"
    76              data-test-volume-row
    77              {{on "click" (action "gotoVolume" row.model)}}
    78            >
    79              <td data-test-volume-name
    80                {{keyboard-shortcut 
    81                  enumerated=true
    82                  action=(action "gotoVolume" row.model)
    83                }}
    84              >
    85                <Tooltip @text={{row.model.plainId}}>
    86                  <LinkTo
    87                    @route="csi.volumes.volume"
    88                    @model={{row.model.idWithNamespace}}
    89                    class="is-primary"
    90                  >
    91                    {{row.model.name}}
    92                  </LinkTo>
    93                </Tooltip>
    94              </td>
    95              {{#if this.system.shouldShowNamespaces}}
    96                <td data-test-volume-namespace>
    97                  {{row.model.namespace.name}}
    98                </td>
    99              {{/if}}
   100              <td data-test-volume-schedulable>
   101                {{if row.model.schedulable "Schedulable" "Unschedulable"}}
   102              </td>
   103              <td data-test-volume-controller-health>
   104                {{#if row.model.controllerRequired}}
   105                  {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}}
   106                  (
   107                  {{row.model.controllersHealthy}}
   108                  /
   109                  {{row.model.controllersExpected}}
   110                  )
   111                {{else if (gt row.model.controllersExpected 0)}}
   112                  {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}}
   113                  (
   114                  {{row.model.controllersHealthy}}
   115                  /
   116                  {{row.model.controllersExpected}}
   117                  )
   118                {{else}}
   119                  <em class="is-faded">
   120                    Node Only
   121                  </em>
   122                {{/if}}
   123              </td>
   124              <td data-test-volume-node-health>
   125                {{if (gt row.model.nodesHealthy 0) "Healthy" "Unhealthy"}}
   126                (
   127                {{row.model.nodesHealthy}}
   128                /
   129                {{row.model.nodesExpected}}
   130                )
   131              </td>
   132              <td data-test-volume-provider>
   133                {{row.model.provider}}
   134              </td>
   135              <td data-test-volume-allocations>
   136                {{row.model.allocationCount}}
   137              </td>
   138            </tr>
   139          </t.body>
   140        </ListTable>
   141        <div class="table-foot">
   142          <PageSizeSelect @onChange={{action this.resetPagination}} />
   143          <nav class="pagination">
   144            <div class="pagination-numbers">
   145              {{p.startsAt}}
   146              –
   147              {{p.endsAt}}
   148              of
   149              {{this.sortedVolumes.length}}
   150            </div>
   151            <p.prev @class="pagination-previous">
   152              {{x-icon "chevron-left"}}
   153            </p.prev>
   154            <p.next @class="pagination-next">
   155              {{x-icon "chevron-right"}}
   156            </p.next>
   157            <ul class="pagination-list"></ul>
   158          </nav>
   159        </div>
   160      </ListPagination>
   161    {{else}}
   162      <div data-test-empty-volumes-list class="empty-message">
   163        {{#if (eq this.visibleVolumes.length 0)}}
   164          <h3 data-test-empty-volumes-list-headline class="empty-message-headline">
   165            No Volumes
   166          </h3>
   167          <p class="empty-message-body">
   168            This namespace currently has no CSI Volumes.
   169          </p>
   170        {{else if this.searchTerm}}
   171          <h3 data-test-empty-volumes-list-headline class="empty-message-headline">
   172            No Matches
   173          </h3>
   174          <p class="empty-message-body">
   175            No volumes match the term
   176            <strong>
   177              {{this.searchTerm}}
   178            </strong>
   179          </p>
   180        {{/if}}
   181      </div>
   182    {{/if}}
   183  </section>