Initial commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{{define "content"}}
|
||||
<section class="card">
|
||||
<h1>{{.Status}}</h1>
|
||||
<p>{{.Message}}</p>
|
||||
<p><a href="{{.Base}}">Back to the upload page</a></p>
|
||||
</section>
|
||||
{{end}}
|
||||
@@ -0,0 +1,55 @@
|
||||
{{define "content"}}
|
||||
<form id="upload" class="card" method="post" action="{{.Base}}api/upload" enctype="multipart/form-data">
|
||||
<!-- Field order is load-bearing: the server streams this body and must know
|
||||
the credentials and options before the file part arrives. -->
|
||||
<label class="field">
|
||||
<span>Token <em>optional</em></span>
|
||||
<input type="password" name="token" id="token" autocomplete="off" placeholder="anonymous">
|
||||
</label>
|
||||
|
||||
<div class="row">
|
||||
<label class="field">
|
||||
<span>Expires in</span>
|
||||
<input type="text" name="expiry" id="expiry" placeholder="{{.DefaultExpiry}}" autocomplete="off">
|
||||
</label>
|
||||
<label class="field" id="vanity-field">
|
||||
<span>Vanity name <em>token only</em></span>
|
||||
<input type="text" name="vanity" id="vanity" placeholder="auto" autocomplete="off"
|
||||
pattern="[A-Za-z0-9][A-Za-z0-9._-]{1,63}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="drop" id="drop">
|
||||
<input type="file" name="file" id="file" required>
|
||||
<p class="hint" id="drop-hint">Choose a file, or drop one here.</p>
|
||||
</div>
|
||||
|
||||
<div class="progress" id="progress" hidden>
|
||||
<div class="bar"><div class="fill" id="bar-fill"></div></div>
|
||||
<p class="hint" id="progress-text"></p>
|
||||
</div>
|
||||
|
||||
<button type="submit" id="submit">Upload</button>
|
||||
<p class="hint" id="error" hidden></p>
|
||||
</form>
|
||||
|
||||
<section class="limits">
|
||||
<h2>Current limits</h2>
|
||||
<dl id="limits">
|
||||
<dt>Maximum size</dt><dd id="limit-size">{{.MaxSize}}</dd>
|
||||
<dt>Longest lifetime</dt><dd id="limit-expiry">{{.MaxExpiry}}</dd>
|
||||
<dt>Default lifetime</dt><dd id="limit-default">{{.DefaultExpiry}}</dd>
|
||||
<dt>Vanity names</dt><dd id="limit-vanity">requires a token</dd>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section class="cli">
|
||||
<h2>From the command line</h2>
|
||||
<pre><code>curl --data-binary @file.zip \
|
||||
-H 'Content-Disposition: attachment; filename="file.zip"' \
|
||||
-H 'Authorization: Bearer <token>' \
|
||||
-H 'Vanity: my-file' \
|
||||
-H 'Expiry: 3d' \
|
||||
{{.AbsBase}}api/upload</code></pre>
|
||||
</section>
|
||||
{{end}}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{define "content"}}
|
||||
<section class="card">
|
||||
<h1 class="filename">{{.Meta.Filename}}</h1>
|
||||
<dl>
|
||||
<dt>Size</dt><dd>{{.Size}}</dd>
|
||||
<dt>Expires</dt><dd>{{.Expires}}</dd>
|
||||
<dt>SHA-256</dt><dd class="mono wrap">{{.Meta.SHA256}}</dd>
|
||||
</dl>
|
||||
<p><a class="button" href="{{.Base}}d/{{.Meta.ID}}">Download</a></p>
|
||||
</section>
|
||||
{{end}}
|
||||
@@ -0,0 +1,19 @@
|
||||
{{define "layout"}}<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{.Title}} · Uncensored Send</title>
|
||||
<link rel="stylesheet" href="{{.Base}}static/style.css">
|
||||
</head>
|
||||
<body data-base="{{.Base}}">
|
||||
<header>
|
||||
<a class="brand" href="{{.Base}}">Uncensored Send</a>
|
||||
</header>
|
||||
<main>
|
||||
{{template "content" .}}
|
||||
</main>
|
||||
<footer>Files are removed automatically when they expire.</footer>
|
||||
{{if .Script}}<script src="{{.Base}}static/app.js" defer></script>{{end}}
|
||||
</body>
|
||||
</html>{{end}}
|
||||
@@ -0,0 +1,29 @@
|
||||
{{define "content"}}
|
||||
<section class="card result">
|
||||
<h1>Uploaded</h1>
|
||||
<p class="filename">{{.Meta.Filename}}</p>
|
||||
|
||||
<label class="field">
|
||||
<span>Download link</span>
|
||||
<input type="text" id="link" value="{{.URL}}" readonly>
|
||||
</label>
|
||||
|
||||
<dl>
|
||||
<dt>Size</dt><dd>{{.Size}}</dd>
|
||||
<dt>Expires</dt><dd>{{.Expires}}</dd>
|
||||
<dt>SHA-256</dt><dd class="mono wrap">{{.Meta.SHA256}}</dd>
|
||||
</dl>
|
||||
|
||||
<div class="warn">
|
||||
<h2>Delete token</h2>
|
||||
<p>Shown once. Keep it if you want to remove the file before it expires.</p>
|
||||
<p class="mono wrap">{{.DeleteToken}}</p>
|
||||
<form method="post" action="{{.Base}}api/d/{{.Meta.ID}}/delete">
|
||||
<input type="hidden" name="token" value="{{.DeleteToken}}">
|
||||
<button type="submit" class="danger">Delete it now</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p><a href="{{.Base}}">Upload another</a></p>
|
||||
</section>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user