Hide / Show encrypted values in web ui

added a span element to hide encrypted values
This commit is contained in:
MrM 2024-03-10 15:09:46 +01:00 committed by GitHub
parent 28ec0b8ebb
commit 9359809b4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -410,12 +410,13 @@
</div>
<div class="col-md-6{{ (($field->format=='URL') && ($asset->{$field->db_column_name()}!='')) ? ' ellipsis': '' }}">
@if (($field->field_encrypted=='1') && ($asset->{$field->db_column_name()}!=''))
<i class="fas fa-lock" data-tooltip="true" data-placement="top" title="{{ trans('admin/custom_fields/general.value_encrypted') }}"></i>
<i class="fas fa-lock" data-tooltip="true" data-placement="top" title="{{ trans('admin/custom_fields/general.value_encrypted') }}" onclick="showHideEncValue(this)" id="text-{{ $field->id }}"></i>
@endif
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
@can('assets.view.encrypted_custom_fields')
<span class="js-copy-{{ $field->id }}">
<span id="text-{{ $field->id }}-to-hide">********</span>
<span class="js-copy-{{ $field->id }}" id="text-{{ $field->id }}-to-show" style="font-size: 0px;">
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
<a href="{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}" target="_new">{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}</a>
@elseif (($field->format=='DATE') && ($asset->{$field->db_column_name()}!=''))
@ -427,7 +428,7 @@
<i class="fa-regular fa-clipboard js-copy-link" data-clipboard-target=".js-copy-{{ $field->id }}" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}">
<span class="sr-only">{{ trans('general.copy_to_clipboard') }}</span>
</i>
@else
@else
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
@endcan