Spaces:
Paused
Paused
Upload 18 files
Browse files- app.py +0 -1
- templates/index.html +33 -33
app.py
CHANGED
|
@@ -921,7 +921,6 @@ def start_gofile_upload_background(torrent_hash: str, torrent_name: str, file_pa
|
|
| 921 |
entry["gofile_link"] = download_page
|
| 922 |
entry["gofile_status"] = f"Upload GoFile berhasil: {download_page}"
|
| 923 |
entry["status_message"] = "Upload GoFile selesai. Link siap disalin."
|
| 924 |
-
add_event(state, "info", f"{torrent_name} berhasil diupload ke GoFile.")
|
| 925 |
|
| 926 |
update_state(success_mutator)
|
| 927 |
except GofileUploadCancelled:
|
|
|
|
| 921 |
entry["gofile_link"] = download_page
|
| 922 |
entry["gofile_status"] = f"Upload GoFile berhasil: {download_page}"
|
| 923 |
entry["status_message"] = "Upload GoFile selesai. Link siap disalin."
|
|
|
|
| 924 |
|
| 925 |
update_state(success_mutator)
|
| 926 |
except GofileUploadCancelled:
|
templates/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
</head>
|
| 10 |
<body class="min-h-screen bg-stone-950 text-stone-100">
|
| 11 |
<div id="toast-container" class="pointer-events-none fixed right-4 top-4 z-[60] flex w-[min(92vw,24rem)] flex-col gap-3"></div>
|
| 12 |
-
<div class="mx-auto max-w-6xl px-
|
| 13 |
<div class="mb-8 flex flex-col gap-4 rounded-3xl border border-white/10 bg-white/5 p-6 shadow-2xl shadow-black/20 backdrop-blur">
|
| 14 |
<div class="flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
|
| 15 |
<div>
|
|
@@ -40,8 +40,8 @@
|
|
| 40 |
{% endfor %}
|
| 41 |
</div>
|
| 42 |
|
| 43 |
-
<div class="grid gap-6 lg:grid-cols-[1.1fr_0.9fr]">
|
| 44 |
-
<section class="rounded-3xl border border-white/10 bg-white/5 p-6">
|
| 45 |
<div class="mb-4 flex items-center justify-between">
|
| 46 |
<h2 class="text-xl font-semibold text-white">Daftar Torrent</h2>
|
| 47 |
<span id="torrent-count" class="rounded-full border border-white/10 bg-white/5 px-3 py-1 text-xs uppercase tracking-[0.25em] text-stone-300">
|
|
@@ -52,11 +52,11 @@
|
|
| 52 |
<div id="torrent-list" class="space-y-4">
|
| 53 |
{% if torrents %}
|
| 54 |
{% for torrent in torrents %}
|
| 55 |
-
<article class="rounded-2xl border border-white/10 bg-black/20 p-4">
|
| 56 |
<div class="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
|
| 57 |
<div class="min-w-0 flex-1">
|
| 58 |
<div class="flex flex-wrap items-center gap-3">
|
| 59 |
-
<h3 class="
|
| 60 |
<span class="rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.2em] {{ torrent.state_badge }}">
|
| 61 |
{{ torrent.state_label }}
|
| 62 |
</span>
|
|
@@ -67,7 +67,7 @@
|
|
| 67 |
</div>
|
| 68 |
{% endif %}
|
| 69 |
</div>
|
| 70 |
-
<div class="text-sm text-stone-300">
|
| 71 |
<div>{{ torrent.total_size }}</div>
|
| 72 |
<div class="text-xs uppercase tracking-[0.2em] text-stone-500">{{ torrent.display_speed_label }}</div>
|
| 73 |
{% if torrent.gofile_uploading %}
|
|
@@ -88,7 +88,7 @@
|
|
| 88 |
</div>
|
| 89 |
</div>
|
| 90 |
|
| 91 |
-
<div class="mt-4 grid gap-3 text-sm text-stone-300
|
| 92 |
<div>
|
| 93 |
<p class="text-xs uppercase tracking-[0.2em] text-stone-500">Seeds</p>
|
| 94 |
<p class="mt-1 text-white">{{ torrent.num_seeds }}</p>
|
|
@@ -107,27 +107,27 @@
|
|
| 107 |
</div>
|
| 108 |
</div>
|
| 109 |
|
| 110 |
-
<div class="mt-4 flex flex-wrap gap-3">
|
| 111 |
{% if torrent.can_pause %}
|
| 112 |
-
<button type="button" data-action="pause" data-hash="{{ torrent.hash }}" class="rounded-2xl border border-white/10 bg-white/10 px-4 py-2 text-sm font-medium text-white transition hover:bg-white/15">
|
| 113 |
<i class="fa-solid fa-pause mr-2"></i>Pause
|
| 114 |
</button>
|
| 115 |
{% endif %}
|
| 116 |
{% if torrent.can_resume %}
|
| 117 |
-
<button type="button" data-action="resume" data-hash="{{ torrent.hash }}" class="rounded-2xl border border-emerald-400/30 bg-emerald-400/10 px-4 py-2 text-sm font-medium text-emerald-100 transition hover:bg-emerald-400/20">
|
| 118 |
<i class="fa-solid fa-play mr-2"></i>Resume
|
| 119 |
</button>
|
| 120 |
{% endif %}
|
| 121 |
-
<button type="button" data-action="delete" data-hash="{{ torrent.hash }}" data-name="{{ torrent.name }}" class="rounded-2xl border border-rose-400/30 bg-rose-400/10 px-4 py-2 text-sm font-medium text-rose-100 transition hover:bg-rose-400/20">
|
| 122 |
<i class="fa-solid fa-trash mr-2"></i>Delete
|
| 123 |
</button>
|
| 124 |
{% if torrent.can_cancel_gofile_upload %}
|
| 125 |
-
<button type="button" data-action="cancel-gofile" data-hash="{{ torrent.hash }}" class="rounded-2xl border border-amber-400/30 bg-amber-400/10 px-4 py-2 text-sm font-medium text-amber-100 transition hover:bg-amber-400/20">
|
| 126 |
<i class="fa-solid fa-ban mr-2"></i>Cancel Upload
|
| 127 |
</button>
|
| 128 |
{% endif %}
|
| 129 |
{% if torrent.can_gofile_upload %}
|
| 130 |
-
<button type="button" data-action="upload-gofile" data-hash="{{ torrent.hash }}" class="rounded-2xl border border-sky-400/30 bg-sky-400/10 px-4 py-2 text-sm font-medium text-sky-100 transition hover:bg-sky-400/20">
|
| 131 |
<i class="fa-solid fa-cloud-arrow-up mr-2"></i>Upload GoFile
|
| 132 |
</button>
|
| 133 |
{% endif %}
|
|
@@ -137,9 +137,9 @@
|
|
| 137 |
<div class="mt-4 rounded-2xl border border-sky-500/20 bg-sky-500/10 px-4 py-4 text-sm text-sky-100">
|
| 138 |
<p class="font-semibold text-sky-50">Upload Complete.</p>
|
| 139 |
<p class="mt-1 text-sky-200/90">GoFile Link:</p>
|
| 140 |
-
<div class="mt-3 flex
|
| 141 |
-
<code class="min-w-0 flex-1
|
| 142 |
-
<button type="button" data-action="copy-link" data-link="{{ torrent.gofile_link }}" class="shrink-0 rounded-xl border border-white/10 bg-white/5 px-3 py-2 text-xs font-medium text-stone-200 transition hover:bg-white/10">
|
| 143 |
<i class="fa-regular fa-copy mr-2"></i>Copy
|
| 144 |
</button>
|
| 145 |
</div>
|
|
@@ -159,8 +159,8 @@
|
|
| 159 |
</div>
|
| 160 |
</section>
|
| 161 |
|
| 162 |
-
<section class="space-y-6">
|
| 163 |
-
<div class="rounded-3xl border border-white/10 bg-white/5 p-6">
|
| 164 |
<h2 class="text-xl font-semibold text-white">Tambah Magnet Link</h2>
|
| 165 |
<form id="magnet-form" action="{{ url_for('add_magnet') }}" method="post" class="mt-4 space-y-4">
|
| 166 |
<textarea name="magnet_link" rows="5" placeholder="magnet:?xt=urn:btih:..." class="w-full rounded-2xl border border-white/10 bg-black/20 px-4 py-3 text-sm text-white outline-none transition focus:border-emerald-400"></textarea>
|
|
@@ -170,7 +170,7 @@
|
|
| 170 |
</form>
|
| 171 |
</div>
|
| 172 |
|
| 173 |
-
<div class="rounded-3xl border border-white/10 bg-white/5 p-6">
|
| 174 |
<h2 class="text-xl font-semibold text-white">Upload File Torrent</h2>
|
| 175 |
<form id="torrent-upload-form" action="{{ url_for('upload_torrent') }}" method="post" enctype="multipart/form-data" class="mt-4 space-y-4">
|
| 176 |
<label class="flex cursor-pointer flex-col items-center justify-center rounded-2xl border border-dashed border-white/15 bg-black/20 px-4 py-8 text-center text-sm text-stone-300">
|
|
@@ -184,7 +184,7 @@
|
|
| 184 |
</form>
|
| 185 |
</div>
|
| 186 |
|
| 187 |
-
<div class="rounded-3xl border border-white/10 bg-white/5 p-6">
|
| 188 |
<div class="flex items-center justify-between gap-4">
|
| 189 |
<h2 class="text-xl font-semibold text-white">Ringkasan Server</h2>
|
| 190 |
</div>
|
|
@@ -385,17 +385,17 @@
|
|
| 385 |
function actionButtons(torrent) {
|
| 386 |
const buttons = [];
|
| 387 |
if (torrent.can_pause) {
|
| 388 |
-
buttons.push(`<button type="button" data-action="pause" data-hash="${escapeHtml(torrent.hash)}" class="rounded-2xl border border-white/10 bg-white/10 px-4 py-2 text-sm font-medium text-white transition hover:bg-white/15"><i class="fa-solid fa-pause mr-2"></i>Pause</button>`);
|
| 389 |
}
|
| 390 |
if (torrent.can_resume) {
|
| 391 |
-
buttons.push(`<button type="button" data-action="resume" data-hash="${escapeHtml(torrent.hash)}" class="rounded-2xl border border-emerald-400/30 bg-emerald-400/10 px-4 py-2 text-sm font-medium text-emerald-100 transition hover:bg-emerald-400/20"><i class="fa-solid fa-play mr-2"></i>Resume</button>`);
|
| 392 |
}
|
| 393 |
-
buttons.push(`<button type="button" data-action="delete" data-hash="${escapeHtml(torrent.hash)}" data-name="${escapeHtml(torrent.name)}" class="rounded-2xl border border-rose-400/30 bg-rose-400/10 px-4 py-2 text-sm font-medium text-rose-100 transition hover:bg-rose-400/20"><i class="fa-solid fa-trash mr-2"></i>Delete</button>`);
|
| 394 |
if (torrent.can_cancel_gofile_upload) {
|
| 395 |
-
buttons.push(`<button type="button" data-action="cancel-gofile" data-hash="${escapeHtml(torrent.hash)}" class="rounded-2xl border border-amber-400/30 bg-amber-400/10 px-4 py-2 text-sm font-medium text-amber-100 transition hover:bg-amber-400/20"><i class="fa-solid fa-ban mr-2"></i>Cancel Upload</button>`);
|
| 396 |
}
|
| 397 |
if (torrent.can_gofile_upload) {
|
| 398 |
-
buttons.push(`<button type="button" data-action="upload-gofile" data-hash="${escapeHtml(torrent.hash)}" class="rounded-2xl border border-sky-400/30 bg-sky-400/10 px-4 py-2 text-sm font-medium text-sky-100 transition hover:bg-sky-400/20"><i class="fa-solid fa-cloud-arrow-up mr-2"></i>Upload GoFile</button>`);
|
| 399 |
}
|
| 400 |
return buttons.join("");
|
| 401 |
}
|
|
@@ -408,9 +408,9 @@
|
|
| 408 |
? `<div class="mt-4 rounded-2xl border border-sky-500/20 bg-sky-500/10 px-4 py-4 text-sm text-sky-100">
|
| 409 |
<p class="font-semibold text-sky-50">Upload Complete.</p>
|
| 410 |
<p class="mt-1 text-sky-200/90">GoFile Link:</p>
|
| 411 |
-
<div class="mt-3 flex
|
| 412 |
-
<code class="min-w-0 flex-1
|
| 413 |
-
<button type="button" data-action="copy-link" data-link="${escapeHtml(torrent.gofile_link)}" class="shrink-0 rounded-xl border border-white/10 bg-white/5 px-3 py-2 text-xs font-medium text-stone-200 transition hover:bg-white/10">
|
| 414 |
<i class="fa-regular fa-copy mr-2"></i>Copy
|
| 415 |
</button>
|
| 416 |
</div>
|
|
@@ -426,16 +426,16 @@
|
|
| 426 |
: "";
|
| 427 |
|
| 428 |
return `
|
| 429 |
-
<article class="rounded-2xl border border-white/10 bg-black/20 p-4">
|
| 430 |
<div class="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
|
| 431 |
<div class="min-w-0 flex-1">
|
| 432 |
<div class="flex flex-wrap items-center gap-3">
|
| 433 |
-
<h3 class="
|
| 434 |
<span class="rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.2em] ${torrent.state_badge}">${escapeHtml(torrent.state_label)}</span>
|
| 435 |
</div>
|
| 436 |
${messageBlock}
|
| 437 |
</div>
|
| 438 |
-
<div class="text-sm text-stone-300">
|
| 439 |
<div>${escapeHtml(torrent.total_size)}</div>
|
| 440 |
${transferSpeed}
|
| 441 |
</div>
|
|
@@ -449,13 +449,13 @@
|
|
| 449 |
<div class="h-2 rounded-full ${progressColor} transition-all duration-700" style="width: ${torrent.progress}%"></div>
|
| 450 |
</div>
|
| 451 |
</div>
|
| 452 |
-
<div class="mt-4 grid gap-3 text-sm text-stone-300
|
| 453 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">Seeds</p><p class="mt-1 text-white">${torrent.num_seeds}</p></div>
|
| 454 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">Peers</p><p class="mt-1 text-white">${torrent.num_leechs}</p></div>
|
| 455 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">Downloaded</p><p class="mt-1 text-white">${escapeHtml(torrent.downloaded)}</p></div>
|
| 456 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">ETA</p><p class="mt-1 text-white">${escapeHtml(torrent.eta)}</p></div>
|
| 457 |
</div>
|
| 458 |
-
<div class="mt-4 flex flex-wrap gap-3">${actionButtons(torrent)}</div>
|
| 459 |
${gofileBlock}
|
| 460 |
</article>
|
| 461 |
`;
|
|
|
|
| 9 |
</head>
|
| 10 |
<body class="min-h-screen bg-stone-950 text-stone-100">
|
| 11 |
<div id="toast-container" class="pointer-events-none fixed right-4 top-4 z-[60] flex w-[min(92vw,24rem)] flex-col gap-3"></div>
|
| 12 |
+
<div class="mx-auto max-w-6xl px-3 py-5 sm:px-5 sm:py-7 lg:px-8 lg:py-8">
|
| 13 |
<div class="mb-8 flex flex-col gap-4 rounded-3xl border border-white/10 bg-white/5 p-6 shadow-2xl shadow-black/20 backdrop-blur">
|
| 14 |
<div class="flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
|
| 15 |
<div>
|
|
|
|
| 40 |
{% endfor %}
|
| 41 |
</div>
|
| 42 |
|
| 43 |
+
<div class="grid items-start gap-6 lg:grid-cols-[1.1fr_0.9fr]">
|
| 44 |
+
<section class="self-start rounded-3xl border border-white/10 bg-white/5 p-4 sm:p-6">
|
| 45 |
<div class="mb-4 flex items-center justify-between">
|
| 46 |
<h2 class="text-xl font-semibold text-white">Daftar Torrent</h2>
|
| 47 |
<span id="torrent-count" class="rounded-full border border-white/10 bg-white/5 px-3 py-1 text-xs uppercase tracking-[0.25em] text-stone-300">
|
|
|
|
| 52 |
<div id="torrent-list" class="space-y-4">
|
| 53 |
{% if torrents %}
|
| 54 |
{% for torrent in torrents %}
|
| 55 |
+
<article class="overflow-hidden rounded-2xl border border-white/10 bg-black/20 p-4">
|
| 56 |
<div class="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
|
| 57 |
<div class="min-w-0 flex-1">
|
| 58 |
<div class="flex flex-wrap items-center gap-3">
|
| 59 |
+
<h3 class="min-w-0 break-words text-sm font-medium text-white sm:text-base">{{ torrent.name }}</h3>
|
| 60 |
<span class="rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.2em] {{ torrent.state_badge }}">
|
| 61 |
{{ torrent.state_label }}
|
| 62 |
</span>
|
|
|
|
| 67 |
</div>
|
| 68 |
{% endif %}
|
| 69 |
</div>
|
| 70 |
+
<div class="grid grid-cols-2 gap-3 text-sm text-stone-300 sm:block">
|
| 71 |
<div>{{ torrent.total_size }}</div>
|
| 72 |
<div class="text-xs uppercase tracking-[0.2em] text-stone-500">{{ torrent.display_speed_label }}</div>
|
| 73 |
{% if torrent.gofile_uploading %}
|
|
|
|
| 88 |
</div>
|
| 89 |
</div>
|
| 90 |
|
| 91 |
+
<div class="mt-4 grid grid-cols-2 gap-3 text-sm text-stone-300 lg:grid-cols-4">
|
| 92 |
<div>
|
| 93 |
<p class="text-xs uppercase tracking-[0.2em] text-stone-500">Seeds</p>
|
| 94 |
<p class="mt-1 text-white">{{ torrent.num_seeds }}</p>
|
|
|
|
| 107 |
</div>
|
| 108 |
</div>
|
| 109 |
|
| 110 |
+
<div class="mt-4 flex flex-wrap gap-2 sm:gap-3">
|
| 111 |
{% if torrent.can_pause %}
|
| 112 |
+
<button type="button" data-action="pause" data-hash="{{ torrent.hash }}" class="inline-flex w-full items-center justify-center rounded-2xl border border-white/10 bg-white/10 px-4 py-2 text-sm font-medium text-white transition hover:bg-white/15 sm:w-auto">
|
| 113 |
<i class="fa-solid fa-pause mr-2"></i>Pause
|
| 114 |
</button>
|
| 115 |
{% endif %}
|
| 116 |
{% if torrent.can_resume %}
|
| 117 |
+
<button type="button" data-action="resume" data-hash="{{ torrent.hash }}" class="inline-flex w-full items-center justify-center rounded-2xl border border-emerald-400/30 bg-emerald-400/10 px-4 py-2 text-sm font-medium text-emerald-100 transition hover:bg-emerald-400/20 sm:w-auto">
|
| 118 |
<i class="fa-solid fa-play mr-2"></i>Resume
|
| 119 |
</button>
|
| 120 |
{% endif %}
|
| 121 |
+
<button type="button" data-action="delete" data-hash="{{ torrent.hash }}" data-name="{{ torrent.name }}" class="inline-flex w-full items-center justify-center rounded-2xl border border-rose-400/30 bg-rose-400/10 px-4 py-2 text-sm font-medium text-rose-100 transition hover:bg-rose-400/20 sm:w-auto">
|
| 122 |
<i class="fa-solid fa-trash mr-2"></i>Delete
|
| 123 |
</button>
|
| 124 |
{% if torrent.can_cancel_gofile_upload %}
|
| 125 |
+
<button type="button" data-action="cancel-gofile" data-hash="{{ torrent.hash }}" class="inline-flex w-full items-center justify-center rounded-2xl border border-amber-400/30 bg-amber-400/10 px-4 py-2 text-sm font-medium text-amber-100 transition hover:bg-amber-400/20 sm:w-auto">
|
| 126 |
<i class="fa-solid fa-ban mr-2"></i>Cancel Upload
|
| 127 |
</button>
|
| 128 |
{% endif %}
|
| 129 |
{% if torrent.can_gofile_upload %}
|
| 130 |
+
<button type="button" data-action="upload-gofile" data-hash="{{ torrent.hash }}" class="inline-flex w-full items-center justify-center rounded-2xl border border-sky-400/30 bg-sky-400/10 px-4 py-2 text-sm font-medium text-sky-100 transition hover:bg-sky-400/20 sm:w-auto">
|
| 131 |
<i class="fa-solid fa-cloud-arrow-up mr-2"></i>Upload GoFile
|
| 132 |
</button>
|
| 133 |
{% endif %}
|
|
|
|
| 137 |
<div class="mt-4 rounded-2xl border border-sky-500/20 bg-sky-500/10 px-4 py-4 text-sm text-sky-100">
|
| 138 |
<p class="font-semibold text-sky-50">Upload Complete.</p>
|
| 139 |
<p class="mt-1 text-sky-200/90">GoFile Link:</p>
|
| 140 |
+
<div class="mt-3 flex flex-col gap-2 rounded-2xl border border-white/10 bg-stone-950/70 p-2 sm:flex-row sm:items-center">
|
| 141 |
+
<code class="min-w-0 flex-1 break-all px-2 py-2 text-xs text-cyan-200 sm:text-sm">{{ torrent.gofile_link }}</code>
|
| 142 |
+
<button type="button" data-action="copy-link" data-link="{{ torrent.gofile_link }}" class="shrink-0 rounded-xl border border-white/10 bg-white/5 px-3 py-2 text-xs font-medium text-stone-200 transition hover:bg-white/10 sm:w-auto">
|
| 143 |
<i class="fa-regular fa-copy mr-2"></i>Copy
|
| 144 |
</button>
|
| 145 |
</div>
|
|
|
|
| 159 |
</div>
|
| 160 |
</section>
|
| 161 |
|
| 162 |
+
<section class="space-y-6 self-start">
|
| 163 |
+
<div class="rounded-3xl border border-white/10 bg-white/5 p-4 sm:p-6">
|
| 164 |
<h2 class="text-xl font-semibold text-white">Tambah Magnet Link</h2>
|
| 165 |
<form id="magnet-form" action="{{ url_for('add_magnet') }}" method="post" class="mt-4 space-y-4">
|
| 166 |
<textarea name="magnet_link" rows="5" placeholder="magnet:?xt=urn:btih:..." class="w-full rounded-2xl border border-white/10 bg-black/20 px-4 py-3 text-sm text-white outline-none transition focus:border-emerald-400"></textarea>
|
|
|
|
| 170 |
</form>
|
| 171 |
</div>
|
| 172 |
|
| 173 |
+
<div class="rounded-3xl border border-white/10 bg-white/5 p-4 sm:p-6">
|
| 174 |
<h2 class="text-xl font-semibold text-white">Upload File Torrent</h2>
|
| 175 |
<form id="torrent-upload-form" action="{{ url_for('upload_torrent') }}" method="post" enctype="multipart/form-data" class="mt-4 space-y-4">
|
| 176 |
<label class="flex cursor-pointer flex-col items-center justify-center rounded-2xl border border-dashed border-white/15 bg-black/20 px-4 py-8 text-center text-sm text-stone-300">
|
|
|
|
| 184 |
</form>
|
| 185 |
</div>
|
| 186 |
|
| 187 |
+
<div class="rounded-3xl border border-white/10 bg-white/5 p-4 sm:p-6">
|
| 188 |
<div class="flex items-center justify-between gap-4">
|
| 189 |
<h2 class="text-xl font-semibold text-white">Ringkasan Server</h2>
|
| 190 |
</div>
|
|
|
|
| 385 |
function actionButtons(torrent) {
|
| 386 |
const buttons = [];
|
| 387 |
if (torrent.can_pause) {
|
| 388 |
+
buttons.push(`<button type="button" data-action="pause" data-hash="${escapeHtml(torrent.hash)}" class="inline-flex w-full items-center justify-center rounded-2xl border border-white/10 bg-white/10 px-4 py-2 text-sm font-medium text-white transition hover:bg-white/15 sm:w-auto"><i class="fa-solid fa-pause mr-2"></i>Pause</button>`);
|
| 389 |
}
|
| 390 |
if (torrent.can_resume) {
|
| 391 |
+
buttons.push(`<button type="button" data-action="resume" data-hash="${escapeHtml(torrent.hash)}" class="inline-flex w-full items-center justify-center rounded-2xl border border-emerald-400/30 bg-emerald-400/10 px-4 py-2 text-sm font-medium text-emerald-100 transition hover:bg-emerald-400/20 sm:w-auto"><i class="fa-solid fa-play mr-2"></i>Resume</button>`);
|
| 392 |
}
|
| 393 |
+
buttons.push(`<button type="button" data-action="delete" data-hash="${escapeHtml(torrent.hash)}" data-name="${escapeHtml(torrent.name)}" class="inline-flex w-full items-center justify-center rounded-2xl border border-rose-400/30 bg-rose-400/10 px-4 py-2 text-sm font-medium text-rose-100 transition hover:bg-rose-400/20 sm:w-auto"><i class="fa-solid fa-trash mr-2"></i>Delete</button>`);
|
| 394 |
if (torrent.can_cancel_gofile_upload) {
|
| 395 |
+
buttons.push(`<button type="button" data-action="cancel-gofile" data-hash="${escapeHtml(torrent.hash)}" class="inline-flex w-full items-center justify-center rounded-2xl border border-amber-400/30 bg-amber-400/10 px-4 py-2 text-sm font-medium text-amber-100 transition hover:bg-amber-400/20 sm:w-auto"><i class="fa-solid fa-ban mr-2"></i>Cancel Upload</button>`);
|
| 396 |
}
|
| 397 |
if (torrent.can_gofile_upload) {
|
| 398 |
+
buttons.push(`<button type="button" data-action="upload-gofile" data-hash="${escapeHtml(torrent.hash)}" class="inline-flex w-full items-center justify-center rounded-2xl border border-sky-400/30 bg-sky-400/10 px-4 py-2 text-sm font-medium text-sky-100 transition hover:bg-sky-400/20 sm:w-auto"><i class="fa-solid fa-cloud-arrow-up mr-2"></i>Upload GoFile</button>`);
|
| 399 |
}
|
| 400 |
return buttons.join("");
|
| 401 |
}
|
|
|
|
| 408 |
? `<div class="mt-4 rounded-2xl border border-sky-500/20 bg-sky-500/10 px-4 py-4 text-sm text-sky-100">
|
| 409 |
<p class="font-semibold text-sky-50">Upload Complete.</p>
|
| 410 |
<p class="mt-1 text-sky-200/90">GoFile Link:</p>
|
| 411 |
+
<div class="mt-3 flex flex-col gap-2 rounded-2xl border border-white/10 bg-stone-950/70 p-2 sm:flex-row sm:items-center">
|
| 412 |
+
<code class="min-w-0 flex-1 break-all px-2 py-2 text-xs text-cyan-200 sm:text-sm">${escapeHtml(torrent.gofile_link)}</code>
|
| 413 |
+
<button type="button" data-action="copy-link" data-link="${escapeHtml(torrent.gofile_link)}" class="shrink-0 rounded-xl border border-white/10 bg-white/5 px-3 py-2 text-xs font-medium text-stone-200 transition hover:bg-white/10 sm:w-auto">
|
| 414 |
<i class="fa-regular fa-copy mr-2"></i>Copy
|
| 415 |
</button>
|
| 416 |
</div>
|
|
|
|
| 426 |
: "";
|
| 427 |
|
| 428 |
return `
|
| 429 |
+
<article class="overflow-hidden rounded-2xl border border-white/10 bg-black/20 p-4">
|
| 430 |
<div class="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
|
| 431 |
<div class="min-w-0 flex-1">
|
| 432 |
<div class="flex flex-wrap items-center gap-3">
|
| 433 |
+
<h3 class="min-w-0 break-words text-sm font-medium text-white sm:text-base">${escapeHtml(torrent.name)}</h3>
|
| 434 |
<span class="rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.2em] ${torrent.state_badge}">${escapeHtml(torrent.state_label)}</span>
|
| 435 |
</div>
|
| 436 |
${messageBlock}
|
| 437 |
</div>
|
| 438 |
+
<div class="grid grid-cols-2 gap-3 text-sm text-stone-300 sm:block">
|
| 439 |
<div>${escapeHtml(torrent.total_size)}</div>
|
| 440 |
${transferSpeed}
|
| 441 |
</div>
|
|
|
|
| 449 |
<div class="h-2 rounded-full ${progressColor} transition-all duration-700" style="width: ${torrent.progress}%"></div>
|
| 450 |
</div>
|
| 451 |
</div>
|
| 452 |
+
<div class="mt-4 grid grid-cols-2 gap-3 text-sm text-stone-300 lg:grid-cols-4">
|
| 453 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">Seeds</p><p class="mt-1 text-white">${torrent.num_seeds}</p></div>
|
| 454 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">Peers</p><p class="mt-1 text-white">${torrent.num_leechs}</p></div>
|
| 455 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">Downloaded</p><p class="mt-1 text-white">${escapeHtml(torrent.downloaded)}</p></div>
|
| 456 |
<div><p class="text-xs uppercase tracking-[0.2em] text-stone-500">ETA</p><p class="mt-1 text-white">${escapeHtml(torrent.eta)}</p></div>
|
| 457 |
</div>
|
| 458 |
+
<div class="mt-4 flex flex-wrap gap-2 sm:gap-3">${actionButtons(torrent)}</div>
|
| 459 |
${gofileBlock}
|
| 460 |
</article>
|
| 461 |
`;
|