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