Random generation of xkcd-style passwords now functioning as expected, web interface now serves randomly generated xkcd-style passwords and provides a button to create a sharing link for them when a new generation is requested. Misc stylesheet updates. Generalized the hx-vals helper function in Core.Templates to be useful for arbitrary endpoints that will need to include specific JSON. Added configuration field for dbSalt which will be used as an encryption salt in the next commit when passwods are stored encrypted in the DB instead of in plaintext.
This commit is contained in:
@ -4,14 +4,18 @@
|
||||
@colorFour: #435F5D
|
||||
|
||||
html
|
||||
font-family: Courier
|
||||
background-color: #{colorTwo}
|
||||
color: #{colorOne}
|
||||
|
||||
body
|
||||
font-family: Courier
|
||||
font-size: 20px
|
||||
text-align: left
|
||||
|
||||
h2
|
||||
font-family: monaco, Consolas, monospace
|
||||
text-transform: uppercase
|
||||
|
||||
p
|
||||
margin: 0.4em 0 0.4em 0
|
||||
|
||||
@ -38,6 +42,7 @@ a
|
||||
height: 1%
|
||||
|
||||
.mainButton
|
||||
margin: 0 0 0.25em 0
|
||||
padding: 0.75em 1.75em
|
||||
background-color: #{colorThree}
|
||||
color: #{colorTwo}
|
||||
@ -51,8 +56,8 @@ a
|
||||
outline: none
|
||||
color: #{colorOne}
|
||||
background: #{colorTwo}
|
||||
margin: 1em 0
|
||||
border-style: none none none none
|
||||
margin: 0.5em 0
|
||||
border-style: none none solid none
|
||||
padding: 0.4em 0
|
||||
box-sizing: border-box
|
||||
-webkit-box-sizing: border-box
|
||||
@ -77,6 +82,9 @@ a
|
||||
.pwUtils
|
||||
width: 75%
|
||||
|
||||
.generators
|
||||
margin: 5% 0 0 0
|
||||
|
||||
.shareNew
|
||||
margin-bottom: 2em
|
||||
|
||||
|
19
views/gen.hamlet
Normal file
19
views/gen.hamlet
Normal file
@ -0,0 +1,19 @@
|
||||
<div #generators .generators>
|
||||
<h2>Generators
|
||||
<p>Generated password:
|
||||
<h3>#{genPw}
|
||||
<button .mainButton
|
||||
hx-get="/gen"
|
||||
hx-target="#generators"
|
||||
hx-swap="outerHTML"
|
||||
/>
|
||||
Generate New Password
|
||||
<br />
|
||||
<button .mainButton
|
||||
hx-post="/new"
|
||||
hx-target="#requestedPw"
|
||||
hx-swap="outerHTML"
|
||||
*{hsGeneratedSharing}
|
||||
/>
|
||||
Share Generated Password
|
||||
<img class="htmx-indicator" src="/loading.svg" />
|
@ -18,6 +18,7 @@ $doctype 5
|
||||
<a #titleLink .titleLink href="/">Purr
|
||||
|
||||
<div #pwUtils .pwUtils>
|
||||
<h2>Sharing Tools
|
||||
$if (link == "/")
|
||||
<div #requestedPw .requestedPw>
|
||||
<p .emptyReq>
|
||||
@ -62,3 +63,12 @@ $doctype 5
|
||||
/>
|
||||
Get Secret
|
||||
<img class="htmx-indicator" src="/loading.svg" />
|
||||
|
||||
<div #generators .generators>
|
||||
<h2>Generators
|
||||
<button .mainButton
|
||||
hx-get="/gen"
|
||||
hx-target="#generators"
|
||||
hx-swap="outerHTML"
|
||||
/>
|
||||
Generate Password
|
||||
|
@ -1,6 +1,7 @@
|
||||
<div #requestedPw .requestedPw>
|
||||
$maybe pw <- password
|
||||
<p>Here's the secret found at <a href="/pw/#{link}">/pw/#{link}</a>:
|
||||
<h2 .pwResult>#{pw}
|
||||
<h3 .pwResult>#{pw}
|
||||
<hr />
|
||||
$nothing
|
||||
<p>No secret found at <a href="/pw/#{link}">/pw/#{link}</a>
|
||||
<h3>No secret found at <a href="/pw/#{link}">/pw/#{link}</a>
|
||||
|
Reference in New Issue
Block a user