update UI and fixes

This commit is contained in:
Xuu 2020-08-31 12:35:59 -06:00
parent 220be8f732
commit 10b5ccd0c4
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F
5 changed files with 121 additions and 103 deletions

View File

@ -1,9 +1,9 @@
body,html {color: #c8c8c8 !important; background-color: #272b30 !important; }
body,html {color: black !important; background-color: #272b30 !important; }
header + section { padding-top: 52px; padding-bottom: 2.1em }
footer { background-color: #3e444c; position:fixed; bottom:0; width: 100%; height: 2em; border-top: 1px solid #bbb; padding: 4px }
footer span.left { float: left; }
footer span.right { float: right; }
pre {background-color: #c8c8c8; color: black}
pre { color: black}
.breadcrumb label { color: black; }
.sidebar .list-group {

View File

@ -95,6 +95,8 @@ const PASTE_API = "https://paste.dn42.us/paste"
const syntaxItems = [
["text", "Plain Text"],
["markdown", "Markdown"],
["apache", "Apache"],
["bash", "Bash"],
["coffeescript", "CoffeeScript"],
@ -108,7 +110,6 @@ const syntaxItems = [
["javascript", "JavaScript"],
["json", "JSON"],
["makefile", "Makefile"],
["markdown", "Markdown"],
["nginx", "Nginx"],
["objectivec", "Objective C"],
["perl", "Perl"],
@ -313,10 +314,10 @@ function PasteCreate({error, onSubmit, onChange, syntax, syntaxItems, expire, ex
return (
<section className="container">
<div>
{!!error ?
<Alert bsStyle="warning">
{!!error &&
<Alert warning>
<strong>Holy guacamole!</strong> {error}
</Alert> : ""}
</Alert>}
<Form name='paste' onSubmit={onSubmit}>
<div className="form-inline">
@ -337,12 +338,15 @@ function PasteCreate({error, onSubmit, onChange, syntax, syntaxItems, expire, ex
</div>
<textarea required className='form-control' rows='20' name="plain" onChange={onChange} value={plain}></textarea>
<pre>Additional Entropy: {entropy} bytes / Content size: {blength(plain)} bytes</pre>
<pre className="grey">Additional Entropy: {entropy} bytes / Content size: {blength(plain)} bytes</pre>
<Button type='submit' className='btn btn-default btn-lg btn-block'>Encrypt</Button>
</Form>
<br/>
<p>Create pastes from the command line! <a href='./paste.sh' download>paste.sh</a></p>
<div className="card">
<div className="card-body">
<p>Create pastes from the command line! <a href='/paste.sh' download>paste.sh</a></p>
<pre>{`$ echo /etc/passwd | ./paste.sh
env options:
@ -352,43 +356,54 @@ PASTE_BURN - 0 = No Burn on Read, 1 = Burn on read (default: 0)
PASTE_DATE - Value to be used when setting expire date. (default: next-week)`}
</pre>
</div>
</div>
</div>
</section>
);
}
function PasteView({hash, decryptKey, expires, gzip, cipher, plain, syntax, onNew, onCopy}) {
function PasteView({hash, decryptKey, expires, burn, gzip, cipher, plain, syntax, onNew, onCopy}) {
const gzipOpts = gzip ? '| gzip -dc' : '';
return (
<section className="container">
<div className="input-group">
<span className="input-group-btn">
<span className="input-group-prepend">
<button className="btn btn-default" type="button" onClick={onNew}>New</button>
</span>
<input type='text' readOnly className='form-control' value={`${window.location.origin}/paste/#/${hash}!${decryptKey}`} onClick={(e) => e.target.select()}/>
<span className="input-group-btn">
<span className="input-group-append">
<button className="btn btn-default" type="button" onClick={onCopy}>Copy</button>
</span>
</div>
<div ng-if="store.err == undefined">
<div className='well well-sm'>
<b>Lang:</b> {syntax}, <b>Expires:</b> {expires}
<br/>
<div className="card">
<div className='card-header'>
<b>Lang:</b> {syntax}
&nbsp;
<b>Expires:</b> {expires}
&nbsp;
{burn && (<b> BURN ON READ </b>)}
</div>
<div className="card-body">
{syntax==="markdown" ? (
<Markdown source={plain} />
) : (
<Highlight className={syntax}>{plain}</Highlight>
)}
</div>
<div className="card-footer">
<pre>{`# Command Line:
curl -s "${PASTE_API}/${hash}" \\
curl -s "${PASTE_API}/${hash}" \\
| sed "1,/^\\$/d" \\
| openssl aes-256-cbc -md md5 \\
-d -a -k "${decryptKey}" ${gzipOpts}
${cipher}`}</pre>
</div>
</div>
</section>
);
}

View File

@ -2,6 +2,9 @@ section.container { margin-bottom: 2em; }
textarea { font-family: "Fira Code",hack,"Anonymous Pro",monospace; }
pre { font-family: "Fira Code",hack,"Anonymous Pro",monospace; }
code { font-family: "Fira Code",hack,"Anonymous Pro",monospace; }
pre.grey { background-color: lightgrey; }
label { color: lightgrey; }
table a:link {
color: #666;

View File

@ -254,7 +254,7 @@ func publicSwaggerJson() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "public/swagger.json", size: 4895, mode: os.FileMode(0644), modTime: time.Unix(1598654963, 0)}
info := bindataFileInfo{name: "public/swagger.json", size: 4895, mode: os.FileMode(0644), modTime: time.Unix(1598898929, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xcc, 0xe, 0x5f, 0xc1, 0xe9, 0xd6, 0xa9, 0x46, 0x93, 0xde, 0x3d, 0x71, 0x10, 0x7f, 0xa9, 0x1e, 0x98, 0x11, 0x70, 0xc6, 0xcf, 0x1c, 0xa, 0x57, 0x84, 0xfc, 0x3c, 0xf7, 0x28, 0x3, 0x67}}
return a, nil
}

File diff suppressed because one or more lines are too long