- Implement a token-authenticated admin console at `/admin` with overview metrics and file management. - Add a background worker to periodically clean up expired boxes based on `WARPBOX_CLEANUP_EVERY`. - Add a background worker to generate image and video thumbnails based on `WARPBOX_THUMBNAIL_EVERY`. - Update file storage paths to use `@each@` and `@thumb@` prefixes to separate original files from thumbnails. - Add severity fields to startup logs and update configuration templates.
87 lines
3.4 KiB
HTML
87 lines
3.4 KiB
HTML
{{define "home.html"}}{{template "base" .}}{{end}}
|
|
|
|
{{define "content"}}
|
|
<section class="upload-view" aria-labelledby="upload-title">
|
|
<div class="hero-copy">
|
|
<h1 id="upload-title">Send a file. Get a link.</h1>
|
|
<p>Anonymous, self-hosted transfers. No account required.</p>
|
|
</div>
|
|
|
|
<form class="upload-panel card" id="upload-form" action="/api/v1/upload" method="post" enctype="multipart/form-data">
|
|
<div class="card-content">
|
|
<label class="drop-zone" for="file-input">
|
|
<span class="drop-icon" aria-hidden="true">
|
|
<svg viewBox="0 0 24 24" role="img" focusable="false" aria-hidden="true"><path d="M12 16V4m0 0 4 4m-4-4-4 4M5 20h14" /></svg>
|
|
</span>
|
|
<span class="drop-title">Drop files to upload</span>
|
|
<span class="drop-copy">or click to browse</span>
|
|
<span class="drop-meta">Max file size: {{.Data.MaxUploadSize}} · Links expire in 7 days</span>
|
|
<input id="file-input" name="file" type="file" multiple>
|
|
</label>
|
|
|
|
<details class="advanced-options">
|
|
<summary>
|
|
<svg viewBox="0 0 24 24" role="img" focusable="false" aria-hidden="true"><path d="m6 9 6 6 6-6" /></svg>
|
|
Advanced options
|
|
</summary>
|
|
<div class="option-grid">
|
|
<label>
|
|
<span>Expires in</span>
|
|
<select name="max_days">
|
|
<option value="7">7 days</option>
|
|
<option value="1">1 day</option>
|
|
<option value="30">30 days</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
<span>Max downloads</span>
|
|
<input type="number" name="max_downloads" min="1" placeholder="Unlimited">
|
|
</label>
|
|
<label>
|
|
<span>Password</span>
|
|
<input type="password" name="password" autocomplete="new-password" placeholder="Optional">
|
|
</label>
|
|
<label class="checkbox-field">
|
|
<input type="checkbox" name="obfuscate_metadata">
|
|
<span>Hide file names/count until unlocked</span>
|
|
</label>
|
|
</div>
|
|
</details>
|
|
|
|
<div class="upload-progress" id="upload-progress" hidden>
|
|
<div class="progress-row">
|
|
<span>Uploading</span>
|
|
<span id="upload-status">Preparing...</span>
|
|
</div>
|
|
<div class="progress"><span id="total-progress-bar"></span></div>
|
|
</div>
|
|
<div class="result-list upload-queue" id="upload-queue" hidden></div>
|
|
|
|
<div class="form-footer">
|
|
<p id="file-summary">Choose one or more files to begin.</p>
|
|
<button class="button button-primary" type="submit">Upload files</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<section class="upload-result card" id="upload-result" hidden aria-live="polite">
|
|
<div class="card-content">
|
|
<div class="result-header">
|
|
<div>
|
|
<div class="result-title">
|
|
<svg viewBox="0 0 24 24" role="img" focusable="false" aria-hidden="true"><path d="M20 6 9 17l-5-5" /></svg>
|
|
<span>Upload complete</span>
|
|
</div>
|
|
<p id="result-meta"></p>
|
|
</div>
|
|
<div class="result-actions">
|
|
<button class="button button-outline" type="button" id="copy-url">Copy URL</button>
|
|
<a class="button button-primary" id="open-box" href="/">Open box</a>
|
|
</div>
|
|
</div>
|
|
<div class="result-list" id="result-list"></div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
{{end}}
|