github.com/outbrain/consul@v1.4.5/ui-v2/app/templates/dc/acls/tokens/index.hbs (about)

     1  {{#app-view class=(concat 'token ' (if (and isEnabled (not isAuthorized)) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}}
     2      {{#block-slot 'notification' as |status type subject|}}
     3        {{partial 'dc/acls/tokens/notifications'}}
     4      {{/block-slot}}
     5      {{#block-slot 'header'}}
     6        <h1>
     7          Access Controls
     8        </h1>
     9        {{#if isAuthorized }}
    10          {{partial 'dc/acls/nav'}}
    11        {{/if}}
    12      {{/block-slot}}
    13      {{#block-slot 'disabled'}}
    14        {{partial 'dc/acls/disabled'}}
    15      {{/block-slot}}
    16      {{#block-slot 'authorization'}}
    17        {{partial 'dc/acls/authorization'}}
    18      {{/block-slot}}
    19      {{#block-slot 'actions'}}
    20          <a data-test-create href="{{href-to 'dc.acls.tokens.create'}}" class="type-create">Create</a>
    21      {{/block-slot}}
    22      {{#block-slot 'content'}}
    23  {{#if (gt items.length 0) }}
    24          <form class="filter-bar">
    25              {{freetext-filter onchange=(action 'filter') value=filter.s placeholder="Search"}}
    26          </form>
    27  {{/if}}
    28          {{#if (token/is-legacy items)}}
    29              <p data-test-notification-update class="notice info"><strong>Update.</strong> We have upgraded our ACL System to allow the creation of reusable policies that can be applied to tokens. Read more about the changes and how to upgrade legacy tokens in our <a href="{{env 'CONSUL_DOCUMENTATION_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p>
    30          {{/if}}
    31  {{#if (gt filtered.length 0)}}
    32          {{#tabular-collection
    33              items=(sort-by 'CreateTime:desc' filtered) as |item index|
    34          }}
    35              {{#block-slot 'header'}}
    36                  <th>Accessor ID</th>
    37                  <th>Scope</th>
    38                  <th>Description</th>
    39                  <th>Policies</th>
    40                  <th>&nbsp;</th>
    41              {{/block-slot}}
    42              {{#block-slot 'row'}}
    43                  <td data-test-token="{{item.AccessorID}}" class={{if (eq item.AccessorID token.AccessorID) 'me' }}>
    44                      <a href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>{{truncate item.AccessorID 8 false}}</a>
    45                  </td>
    46                  <td>
    47                    {{if item.Local 'local' 'global' }}
    48                  </td>
    49                  <td>
    50                    {{default item.Description item.Name}}
    51                  </td>
    52                  <td colspan={{if (not-eq item.AccessorID token.AccessorID) '2' }}>
    53    {{#if (token/is-legacy item) }}
    54                      Legacy tokens have embedded policies.
    55    {{ else }}
    56                      {{#each item.Policies as |item|}}
    57                        <strong class={{if (policy/is-management item) 'policy-management' }}>{{item.Name}}</strong>
    58                      {{/each}}
    59    {{/if}}
    60                  </td>
    61    {{#if (eq item.AccessorID token.AccessorID)}}
    62                  <td>Your token</td>
    63    {{/if}}
    64              {{/block-slot}}
    65              {{#block-slot 'actions' as |index change checked|}}
    66                  {{#confirmation-dialog confirming=false index=index message="Are you sure you want to delete this Token?"}}
    67                      {{#block-slot 'action' as |confirm|}}
    68                          {{#action-group index=index onchange=(action change) checked=(if (eq checked index) 'checked')}}
    69                              <ul>
    70                                {{#if false}}
    71                                  <li>
    72                                    {{#copy-button-feedback title="Copy AccessorID to the clipboard" copy=item.AccessorID name="AccessorID"}}Copy AccessorID{{/copy-button-feedback}}
    73                                  </li>
    74                                {{/if}}
    75                                  <li>
    76                                      <a data-test-edit href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>Edit</a>
    77                                  </li>
    78  {{#if (not (token/is-legacy item))}}
    79                                  <li>
    80                                      <a data-test-clone onclick={{action 'sendClone' item}}>Duplicate</a>
    81                                  </li>
    82  {{/if}}
    83  {{#if (eq item.AccessorID token.AccessorID) }}
    84                                  <li>
    85                                      <a data-test-logout onclick={{queue (action confirm 'logout' item) (action change)}}>Stop using</a>
    86                                  </li>
    87  {{else}}
    88  
    89                                  <li>
    90                                      <a data-test-use onclick={{queue (action confirm 'use' item) (action change)}}>Use</a>
    91                                  </li>
    92  {{/if}}
    93  {{#unless (or (token/is-anonymous item) (eq item.AccessorID token.AccessorID)) }}
    94                                  <li>
    95                                      <a data-test-delete onclick={{action confirm 'delete' item}}>Delete</a>
    96                                  </li>
    97  {{/unless}}
    98                              </ul>
    99                          {{/action-group}}
   100                      {{/block-slot}}
   101                      {{#block-slot 'dialog' as |execute cancel message name|}}
   102                          <p>
   103                              {{#if (eq name 'delete')}}
   104                                {{message}}
   105                              {{else if (eq name 'logout')}}
   106                                  Are you sure you want to stop using this ACL token? This will log you out.
   107                              {{else if (eq name 'use')}}
   108                                  Are you sure you want to use this ACL token?
   109                              {{/if}}
   110                          </p>
   111                          <button type="button" class="type-delete" {{action execute}}>
   112                              {{#if (eq name 'delete')}}
   113                                  Confirm Delete
   114                              {{else if (eq name 'logout')}}
   115                                  Confirm Logout
   116                              {{ else if (eq name 'use')}}
   117                                  Confirm Use
   118                              {{/if}}
   119                          </button>
   120                          <button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
   121                      {{/block-slot}}
   122                  {{/confirmation-dialog}}
   123              {{/block-slot}}
   124          {{/tabular-collection}}
   125  {{else}}
   126          <p>
   127              There are no Tokens.
   128          </p>
   129  {{/if}}
   130      {{/block-slot}}
   131  {{/app-view}}