Add QR code, Add MODT customisation

This commit is contained in:
2026-04-09 01:00:02 +02:00
parent e2f1bbcd64
commit 0ce248b2f9
8 changed files with 247 additions and 189 deletions

View File

@@ -6,6 +6,7 @@
<title>Send.it - File Ready</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<style>
* {
border-radius: 0 !important;
@@ -107,7 +108,7 @@
<div class="section-label mb-1">Download_Link:</div>
<div class="flex">
<input id="res-url" readonly class="input-text">
<button onclick="copy('res-url')" class="border-l-0">COPY</button>
<button onclick="copy('res-url')" class="border-l-0 pl-1 pr-1">COPY</button>
</div>
</div>
@@ -116,7 +117,15 @@
<div class="section-label mb-1 text-red-600">Deletion_Link <span class="text-gray-400 normal-case">(private)</span>:</div>
<div class="flex">
<input id="res-del" readonly class="input-text" style="color:#cc0000;">
<button onclick="copy('res-del')" class="border-l-0">COPY</button>
<button onclick="copy('res-del')" class="border-l-0 pl-1 pr-1">COPY</button>
</div>
</div>
<div>
<button id="qr-btn" onclick="toggleQR()" class="pl-1 pr-1">Show_QR</button>
<div id="qr-container" class="mt-3 hidden border-2 border-black p-4 flex justify-center">
<div id="qr-code"></div>
</div>
</div>
@@ -126,11 +135,13 @@
</div>
</div>
</div>
<!-- Footer -->
<div class="w-full mt-3 flex justify-between items-center">
<span class="text-[10px] font-black uppercase text-gray-400">A_Service_By_Brammie15</span>
<span class="text-[10px] font-black text-gray-400">{{ .MODT }}</span>
<div class="flex gap-4">
<a href="/static/TOS.txt" class="nav-link">TOS</a>
<a href="/admin" class="nav-link">SUDO</a>
@@ -153,6 +164,25 @@
document.getElementById("res-url").value = `${base}/api/files/view/${downloadKey}`;
document.getElementById("res-del").value = `${base}/api/files/delete/${deleteKey}`;
const downloadURL = `${base}/api/files/view/${downloadKey}`;
// Generate QR code
new QRCode(document.getElementById("qr-code"), {
text: downloadURL,
width: 160,
height: 160
});
function toggleQR() {
const container = document.getElementById("qr-container");
const btn = document.getElementById("qr-btn");
const isHidden = container.classList.contains("hidden");
container.classList.toggle("hidden");
btn.textContent = isHidden ? "Hide_QR" : "Show_QR";
}
</script>
</body>