-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
952863b
commit 8713dc6
Showing
4 changed files
with
118 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,104 @@ | ||
<div class="text-center"> | ||
<%= @secret.title %> | ||
</div> | ||
<div class="border rounded-xl px-6 py-8"> | ||
<div class="text-center text-xl mb-4"> | ||
Showing Secret: "<i><%= @secret.title %></i>" | ||
</div> | ||
|
||
<%= if @decrypted_text do %> | ||
<div class="mt-2"> | ||
<.label for="decrypted_secret">Decrypted Secret</.label> | ||
<%= if @decrypted_text do %> | ||
<div class="mt-2"> | ||
<.label for="decrypted_secret">Decrypted Secret</.label> | ||
|
||
<.input type="textarea" name="key" value={@decrypted_text} readonly /> | ||
</div> | ||
<% else %> | ||
<%= if @decryption_error do %> | ||
<% end %> | ||
<.input type="textarea" name="key" value={@decrypted_text} readonly /> | ||
</div> | ||
<% else %> | ||
<div class="mt-2"> | ||
<.form for={%{}} phx-submit="decrypt"> | ||
<%= if @secret.encryption_algo == :rsa do %> | ||
<div x-data="{ show: false }"> | ||
<div class="grid grid-cols-4"> | ||
<div class="mt-0.5"> | ||
<.label for="decryption_key">RSA Private Key PEM</.label> | ||
</div> | ||
|
||
<div class="mt-2"> | ||
<.form for={%{}} phx-submit="decrypt"> | ||
<div x-data="{ show: false }"> | ||
<div class="grid grid-cols-4"> | ||
<div class="mt-0.5"> | ||
<.label for="decryption_key">Decryption Key</.label> | ||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="!show" | ||
@click="show = true" | ||
> | ||
<.icon name="hero-eye" class="h-5 w-5" /> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="show" | ||
@click="show = false" | ||
style="display: none;" | ||
> | ||
<.icon name="hero-eye-slash" class="h-5 w-5" /> | ||
</div> | ||
</div> | ||
|
||
<.input | ||
type="textarea" | ||
autocomplete="off" | ||
name="key" | ||
spellcheck="false" | ||
value="" | ||
style="color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);" | ||
x-bind:style="!show && 'color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);'" | ||
/> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="!show" | ||
@click="show = true" | ||
> | ||
<.icon name="hero-eye" class="h-5 w-5" /> | ||
<br /> | ||
<% end %> | ||
|
||
<%= if @secret.encryption_algo == :aes_gcm do %> | ||
<div x-data="{ show: false }"> | ||
<div class="grid grid-cols-4"> | ||
<div class="mt-0.5"> | ||
<.label for="decryption_key">Password</.label> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="!show" | ||
@click="show = true" | ||
> | ||
<.icon name="hero-eye" class="h-5 w-5" /> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="show" | ||
@click="show = false" | ||
style="display: none;" | ||
> | ||
<.icon name="hero-eye-slash" class="h-5 w-5" /> | ||
</div> | ||
</div> | ||
|
||
<.input | ||
autocomplete="off" | ||
name="key" | ||
spellcheck="false" | ||
value="" | ||
style="color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);" | ||
x-bind:style="!show && 'color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);'" | ||
/> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="show" | ||
@click="show = false" | ||
style="display: none;" | ||
> | ||
<.icon name="hero-eye-slash" class="h-5 w-5" /> | ||
<br /> | ||
<% end %> | ||
|
||
<%= if @secret.encryption_algo == :plaintext do %> | ||
<div class="hidden"> | ||
<.input name="key" value="plaintext" /> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<.input | ||
type="textarea" | ||
autocomplete="off" | ||
name="key" | ||
spellcheck="false" | ||
value="" | ||
style="color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);" | ||
x-bind:style="!show && 'color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);'" | ||
/> | ||
</div> | ||
|
||
<br /> | ||
|
||
<.button>Reveal Secret</.button> | ||
</.form> | ||
</div> | ||
<% end %> | ||
<div class="text-center"> | ||
<.button>Reveal Secret</.button> | ||
</div> | ||
</.form> | ||
</div> | ||
<% end %> | ||
</div> |