feat: Supports masking tokens in super admin (#6491)
Supports masking/unmasking sensitive data such as API Tokens in the super admin dashboard. ref: #6322 Co-authored-by: raph941 <45232708+raph941@users.noreply.github.com> Co-authored-by: phunguyenmurcul <51897872+phunguyenmurcul@users.noreply.github.com>
This commit is contained in:
17
app/views/fields/secret_field/_index.html.erb
Normal file
17
app/views/fields/secret_field/_index.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<%#
|
||||
# SecretField Index Partial
|
||||
%>
|
||||
<%= javascript_include_tag "secretField" %>
|
||||
<div data-secret-text="<%= field.data %>" class="cell-data__secret-field">
|
||||
<span data-secret-masked="true">••••••••••</span>
|
||||
<button onclick="toggleSecretField(event)" data-secret-toggler>
|
||||
<svg width="20" height="20">
|
||||
<use xlink:href="#eye-show" />
|
||||
</svg>
|
||||
</button>
|
||||
<button onclick="copySecretField(event)" data-secret-copier>
|
||||
<svg width="20" height="20">
|
||||
<use xlink:href="#icon-copy" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
18
app/views/fields/secret_field/_show.html.erb
Normal file
18
app/views/fields/secret_field/_show.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<%#
|
||||
# SecretField Show Partial
|
||||
%>
|
||||
<%= javascript_include_tag "secretField" %>
|
||||
|
||||
<div data-secret-text="<%= field.data %>" class="cell-data__secret-field">
|
||||
<span data-secret-masked="true">••••••••••</span>
|
||||
<button onclick="toggleSecretField(event)" data-secret-toggler>
|
||||
<svg width="20" height="20">
|
||||
<use xlink:href="#eye-show" />
|
||||
</svg>
|
||||
</button>
|
||||
<button onclick="copySecretField(event)" data-secret-copier>
|
||||
<svg width="20" height="20">
|
||||
<use xlink:href="#icon-copy" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user