code may be a bit messy but.... also implemented a storage usage stat (that can be toggled in .env) that shows on the home page, you can also enable the total limit to show as well eventually i need to implement clearing old unfinished uploads both on startup, admin actions, and cleaning up on upload failure
81 lines
3.3 KiB
HTML
81 lines
3.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>minibin</title>
|
|
<link rel="stylesheet" href="/css/main.css" />
|
|
<script defer src="/js/dnd.js"></script>
|
|
<script defer src="/js/upload.js"></script>
|
|
{{if .Qt}}
|
|
<style>
|
|
:root {
|
|
--qt-url: url("{{.Qt}}");
|
|
}
|
|
</style>
|
|
{{end}}
|
|
<meta name="description" content="simple file and paste hosting service" />
|
|
<meta property="og:title" content="minibin" />
|
|
<meta property="og:description" content="simple file and paste hosting service" />
|
|
</head>
|
|
|
|
<body class="home-page" id="home-page">
|
|
{{template "site-header"}}
|
|
<main>
|
|
<p>simple file and paste hosting service</p>
|
|
<div class="upload-tabs">
|
|
<input type="radio" name="upload-type" id="type-file" checked />
|
|
<label for="type-file">file</label>
|
|
<input type="radio" name="upload-type" id="type-paste" />
|
|
<label for="type-paste">paste</label>
|
|
{{if or .StorageUsage .StorageLimit}}
|
|
<span class="muted" style="margin-left: auto; width: fit-content;">
|
|
{{.StorageUsage}}{{if .StorageLimit}} / {{.StorageLimit}}{{end}} used
|
|
</span>
|
|
{{end}}
|
|
<div class="file-panel">
|
|
<form id="upload-file-form" action="/upload?return=html" method="post" enctype="multipart/form-data">
|
|
<label class="muted" for="file-expiry">expiry</label>
|
|
<select id="file-expiry" name="expiry">
|
|
{{range .Expiries}}
|
|
<option value="{{.Label}}">{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
<label class="muted" for="file-id-length">id length</label>
|
|
<select id="file-id-length" name="idlength">
|
|
<option value="long">16 characters</option>
|
|
<option value="short">10 characters</option>
|
|
</select>
|
|
<input id="upload-file" data-max-size="{{.FileMaxSizeBytes}}" type="file" required name="file" />
|
|
<div class="submit-container">
|
|
<button id="upload-file-button" type="submit" class="btn">upload file</button>
|
|
<span id="upload-file-message"></span>
|
|
<span class="muted">max {{.FileMaxSize}}</span>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="paste-panel">
|
|
<form action="/upload?return=html" method="post">
|
|
<label class="muted" for="paste-expiry">expiry</label>
|
|
<select id="paste-expiry" name="expiry">
|
|
{{range .Expiries}}
|
|
<option value="{{.Label}}">{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
<label class="muted" for="paste-id-length">id length</label>
|
|
<select id="paste-id-length" name="idlength">
|
|
<option value="long">16 characters</option>
|
|
<option value="short">10 characters</option>
|
|
</select>
|
|
<textarea id="content" name="content" rows="10" required placeholder="{{.PastePlaceholder}}"></textarea>
|
|
<div class="submit-container">
|
|
<button type="submit" class="btn">upload paste</button>
|
|
<span class="muted">max {{.PasteMaxSize}}</span>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html>
|