Files
warpbox-dev/backend/templates/pages/home.html
Daniel Legt 3471e2b0cf feat(api): add API documentation and ShareX integration
- Add an API documentation page with curl and ShareX examples.
- Implement a dynamic ShareX configuration endpoint (`/api/v1/sharex/warpbox-anonymous.sxcu`) that generates a `.sxcu` file pre-configured with the instance's base URL.
- Update anonymous uploads to return a private management link (`manageUrl`) and a deletion link (`deleteUrl`) in JSON responses.
- Update README with details on Stage 3 Anonymous Integrations.
- Add styling for the new API documentation view and management details.
2026-05-29 23:44:05 +03:00

91 lines
3.5 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>
<p class="manage-link" id="manage-link" hidden>
<span>Keep this private:</span>
<a href="/" target="_blank" rel="noopener noreferrer">Manage or delete this upload</a>
</p>
</div>
</section>
</section>
{{end}}