Files
Proxer-Downloader/views/index.ejs
T
2026-10-23 16:38:55 +02:00

154 lines
4.2 KiB
Plaintext
Executable File

<%- include("partials/header") %>
<div class="card card-dark p-4">
<!-- MODE TOGGLE -->
<div class="d-flex justify-content-center mb-4">
<div class="pill-toggle">
<div class="pill-option active" id="pillSeries">Series</div>
<div class="pill-option" id="pillVideo">Video</div>
<div class="pill-indicator" id="pillIndicator"></div>
</div>
</div>
<form method="POST" action="/queue" id="jobForm">
<input type="hidden" name="mode" id="modeInput" value="series" />
<!-- ===================== -->
<!-- 1. ID / URL -->
<!-- ===================== -->
<!-- SERIES: ID -->
<div id="seriesFields">
<div class="mb-3">
<label class="form-label">ID</label>
<input
class="form-control"
name="id"
type="number"
placeholder="ID"
/>
</div>
</div>
<!-- VIDEO: URL -->
<div id="videoFields" style="display: none">
<div class="mb-3">
<label class="form-label">URL</label>
<input
class="form-control"
name="url"
placeholder="https://proxer.me/watch/..."
/>
</div>
</div>
<!-- ===================== -->
<!-- 2. TITEL (shared) -->
<!-- ===================== -->
<div class="mb-3">
<label class="form-label">Title / filename</label>
<input
class="form-control"
name="name"
placeholder="Title S01E01"
/>
</div>
<!-- ===================== -->
<!-- 3. LANGUAGE (shared) -->
<!-- ===================== -->
<div class="mb-3">
<label class="form-label">Language</label>
<select class="form-select" name="language">
<option value="engsub">EngSub</option>
<option value="engdub">EngDub</option>
<option value="gersub">GerSub</option>
<option value="gerdub">GerDub</option>
</select>
</div>
<!-- ===================== -->
<!-- 4. EPISODES (series only) -->
<!-- ===================== -->
<div id="seriesEpisodes">
<div class="mb-3">
<label class="form-label">Episodes</label>
<div class="row">
<div class="col">
<input
class="form-control"
name="episode_from"
type="number"
min="1"
placeholder="From"
/>
</div>
<div class="col">
<input
class="form-control"
name="episode_to"
type="number"
min="1"
placeholder="To"
/>
</div>
</div>
</div>
</div>
<!-- ===================== -->
<!-- 5. TOKEN (shared) -->
<!-- ===================== -->
<div class="mb-3">
<label class="form-label">Token</label>
<input
class="form-control"
name="token"
type="password"
autocomplete="off"
required
placeholder="Token"
/>
</div>
<!-- ACTIONS -->
<div class="d-flex justify-content-between">
<button class="btn btn-danger">Queue Download</button>
<a class="btn btn-outline-light" href="/status">View Queue</a>
</div>
</form>
</div>
<script>
const indicator = document.getElementById("pillIndicator");
const btnSeries = document.getElementById("pillSeries");
const btnVideo = document.getElementById("pillVideo");
const modeInput = document.getElementById("modeInput");
const seriesFields = document.getElementById("seriesFields");
const seriesEpisodes = document.getElementById("seriesEpisodes");
const videoFields = document.getElementById("videoFields");
function updateMode(mode) {
const isSeries = mode === "series";
indicator.style.transform = isSeries
? "translateX(0)"
: "translateX(100%)";
btnSeries.classList.toggle("active", isSeries);
btnVideo.classList.toggle("active", !isSeries);
modeInput.value = mode;
seriesFields.style.display = isSeries ? "" : "none";
seriesEpisodes.style.display = isSeries ? "" : "none";
videoFields.style.display = isSeries ? "none" : "";
}
btnSeries.onclick = () => updateMode("series");
btnVideo.onclick = () => updateMode("video");
</script>
<%- include("partials/footer") %>