github.com/outbrain/consul@v1.4.5/ui-v2/app/templates/dc/kv/index.hbs (about) 1 {{#app-view class="kv list" loading=isLoading}} 2 {{#block-slot 'notification' as |status type|}} 3 {{partial 'dc/kv/notifications'}} 4 {{/block-slot}} 5 {{#block-slot 'breadcrumbs'}} 6 <ol> 7 {{#if (not-eq parent.Key '/') }} 8 <li><a href={{href-to 'dc.kv'}}>Key / Values</a></li> 9 {{/if}} 10 {{#each (slice 0 -2 (split parent.Key '/')) as |breadcrumb index|}} 11 <li><a href={{href-to 'dc.kv.folder' (join '/' (append (slice 0 (add index 1) (split parent.Key '/')) ''))}}>{{breadcrumb}}</a></li> 12 {{/each}} 13 </ol> 14 {{/block-slot}} 15 {{#block-slot 'header'}} 16 <h1> 17 {{#if (eq parent.Key '/') }} 18 Key / Value 19 {{else}} 20 {{ take 1 (drop 1 (reverse (split parent.Key '/'))) }} 21 {{/if}} 22 </h1> 23 <label for="toolbar-toggle"></label> 24 {{/block-slot}} 25 {{#block-slot 'toolbar'}} 26 {{#if (gt items.length 0) }} 27 <form class="filter-bar"> 28 {{freetext-filter onchange=(action 'filter') value=filter.s placeholder="Search by name"}} 29 </form> 30 {{/if}} 31 {{/block-slot}} 32 {{#block-slot 'actions'}} 33 {{#if (not-eq parent.Key '/') }} 34 <a data-test-create href="{{href-to 'dc.kv.create' parent.Key}}" class="type-create">Create</a> 35 {{else}} 36 <a data-test-create href="{{href-to 'dc.kv.root-create'}}" class="type-create">Create</a> 37 {{/if}} 38 {{/block-slot}} 39 {{#block-slot 'content'}} 40 {{#if (gt filtered.length 0)}} 41 {{#tabular-collection 42 items=(sort-by 'isFolder:desc' 'Key:asc' filtered) as |item index| 43 }} 44 {{#block-slot 'header'}} 45 <th>Name</th> 46 {{/block-slot}} 47 {{#block-slot 'row'}} 48 <td data-test-kv="{{item.Key}}" class={{if item.isFolder 'folder' 'file' }}> 49 <a href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key }}>{{right-trim (left-trim item.Key parent.Key) '/'}}</a> 50 </td> 51 {{/block-slot}} 52 {{#block-slot 'actions' as |index change checked|}} 53 {{#confirmation-dialog confirming=false index=index message='Are you sure you want to delete this key?'}} 54 {{#block-slot 'action' as |confirm|}} 55 {{#action-group index=index onchange=(action change) checked=(if (eq checked index) 'checked')}} 56 <ul> 57 <li> 58 <a data-test-edit href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key}}>{{if item.isFolder 'View' 'Edit'}}</a> 59 </li> 60 <li> 61 <a data-test-delete onclick={{action confirm 'delete' item}}>Delete</a> 62 </li> 63 </ul> 64 {{/action-group}} 65 {{/block-slot}} 66 {{#block-slot 'dialog' as |execute cancel message|}} 67 {{delete-confirmation message=message execute=execute cancel=cancel}} 68 {{/block-slot}} 69 {{/confirmation-dialog}} 70 {{/block-slot}} 71 {{/tabular-collection}} 72 {{else}} 73 <p>There are no Key / Value pairs.</p> 74 {{/if}} 75 {{/block-slot}} 76 {{/app-view}}