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

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