github.com/hernad/nomad@v1.6.112/ui/app/templates/policies/index.hbs (about) 1 {{! 2 Copyright (c) HashiCorp, Inc. 3 SPDX-License-Identifier: MPL-2.0 4 ~}} 5 6 {{page-title "Policies"}} 7 <section class="section"> 8 <div class="toolbar"> 9 <div class="toolbar-item is-right-aligned is-mobile-full-width"> 10 <div class="button-bar"> 11 {{#if (can "write policy")}} 12 <LinkTo 13 @route="policies.new" 14 class="button is-primary" 15 data-test-create-policy 16 > 17 Create Policy 18 </LinkTo> 19 {{else}} 20 <button 21 class="button is-primary is-disabled tooltip is-right-aligned" 22 aria-label="You don’t have sufficient permissions" 23 disabled 24 type="button" 25 data-test-disabled-create-policy 26 > 27 Create Policy 28 </button> 29 {{/if}} 30 31 </div> 32 </div> 33 </div> 34 {{#if this.policies.length}} 35 <ListTable 36 @source={{this.policies}} 37 @class="policies no-mobile-condense" as |t|> 38 <t.head> 39 <th>Policy Name</th> 40 {{#if (can "list token")}} 41 <th>Tokens</th> 42 {{/if}} 43 </t.head> 44 <t.body as |row|> 45 <tr data-test-policy-row {{on "click" (action "openPolicy" row.model)}} 46 {{keyboard-shortcut 47 enumerated=true 48 action=(action "openPolicy" row.model) 49 }}> 50 <td data-test-policy-name> 51 <LinkTo @route="policies.policy" @model={{row.model.name}}>{{row.model.name}}</LinkTo> 52 </td> 53 {{#if (can "list token")}} 54 <td data-test-policy-token-count> 55 <span> 56 <span data-test-policy-total-tokens>{{row.model.tokens.length}}</span> 57 {{#if (filter-by "isExpired" row.model.tokens)}} 58 <span data-test-policy-expired-tokens class="number-expired">({{get (filter-by "isExpired" row.model.tokens) "length"}} expired)</span> 59 {{/if}} 60 </span> 61 </td> 62 {{/if}} 63 </tr> 64 </t.body> 65 </ListTable> 66 {{else}} 67 <div class="empty-message"> 68 <h3 data-test-empty-policies-list-headline class="empty-message-headline"> 69 No Policies 70 </h3> 71 <p class="empty-message-body"> 72 Get started by <LinkTo @route="policies.new">creating a new policy</LinkTo> 73 </p> 74 </div> 75 {{/if}} 76 </section>