/
database-list-item.hbs
83 lines (83 loc) · 3.07 KB
/
database-list-item.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{{#linked-block
"vault.cluster.secrets.backend.show"
(if this.keyTypeValue (concat 'role/' @item.id) @item.id)
class="list-item-row"
data-test-secret-link=@item.id
encode=true
queryParams=(secret-query-params @backendType @item.type)
}}
<div class="columns is-mobile">
<div class="column is-10">
<LinkTo
@route={{concat "vault.cluster.secrets.backend.show" }}
@model={{if this.keyTypeValue (concat 'role/' @item.id) @item.id}}
@query={{secret-query-params @backendType @item.type}}
class="has-text-black has-text-weight-semibold"
>
<Icon
@glyph="user-square-outline"
class="has-text-grey-light is-pulled-left"
/>
<div class="role-item-details">
<span class="is-underline">{{if (eq @item.id ' ') '(self)' (or @item.keyWithoutParent @item.id)}}</span>
<span class="tag has-text-grey-dark">{{this.keyTypeValue}}</span>
</div>
</LinkTo>
</div>
<div class="column has-text-right">
<PopupMenu name="secret-menu">
<nav class="menu">
<ul class="menu-list">
{{#if @item.canEdit}}
<li class="action">
<SecretLink
@mode="show"
@secret={{@item.id}}
@class="has-text-black has-text-weight-semibold">
Edit connection
</SecretLink>
</li>
{{/if}}
{{#if @item.canEditRole}}
<li class="action">
<SecretLink
@mode="edit"
@secret={{concat 'role/' @item.id}}
@class="has-text-black has-text-weight-semibold">
Edit Role
</SecretLink>
</li>
{{/if}}
{{#if @item.canReset}}
<li class="action">
<button type="button" class="link" {{on "click" (fn this.resetConnection @item.id)}}>
Reset connection
</button>
</li>
{{/if}}
{{#if (and (eq @item.type "dynamic") @item.canGenerateCredentials)}}
<li class="action">
<LinkTo @route="vault.cluster.secrets.backend.credentials" @model={{@item.id}} @query={{hash roleType=this.keyTypeValue}}>
Generate credentials
</LinkTo>
</li>
{{else if (and (eq @item.type "static") @item.canGetCredentials)}}
<li class="action">
<LinkTo @route="vault.cluster.secrets.backend.credentials" @model={{@item.id}} @query={{hash roleType=this.keyTypeValue}}>
Get credentials
</LinkTo>
</li>
{{/if}}
{{#if @item.canRotateRoot}}
<li class="action">
<button type="button" class="link" {{on "click" (fn this.rotateRootCred @item.id)}}>
Rotate root credentials
</button>
</li>
{{/if}}
</ul>
</nav>
</PopupMenu>
</div>
</div>
{{/linked-block}}