adding scheduler slots
This commit is contained in:
+3
-3
@@ -313,7 +313,7 @@ function renderScheduler() {
|
||||
$("#scheduler-empty").classList.toggle("hidden", items.length > 0);
|
||||
const active = items.filter((item) => item.active).length;
|
||||
const optedIn = items.filter((item) => item.optedIn).length;
|
||||
setText($("#scheduler-count"), `${active} active · ${optedIn} opted in`);
|
||||
setText($("#scheduler-count"), `${active} / ${schedulerData.maxActive} active slots · ${optedIn} opted in`);
|
||||
}
|
||||
|
||||
function renderSchedulerHistory() {
|
||||
@@ -387,7 +387,7 @@ async function setSchedulerSlots(value) {
|
||||
method: "POST", headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ maxActive: value }),
|
||||
});
|
||||
setText($("#scheduler-feedback"), "Seed slots saved.");
|
||||
setText($("#scheduler-feedback"), "Active slots saved.");
|
||||
schedulerError = "";
|
||||
await loadScheduler();
|
||||
} catch (err) {
|
||||
@@ -892,7 +892,7 @@ function wireEvents() {
|
||||
event.preventDefault();
|
||||
const value = Number($("#scheduler-slots").value);
|
||||
if (!Number.isInteger(value) || value < 1 || value > 100) {
|
||||
schedulerError = "Seed slots must be a whole number from 1 to 100.";
|
||||
schedulerError = "Active slots must be a whole number from 1 to 100.";
|
||||
renderScheduler();
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -115,10 +115,10 @@
|
||||
<div class="scheduler-heading">
|
||||
<div>
|
||||
<h2>Seed scheduler</h2>
|
||||
<p>Completed torrents take turns when a scheduled seed has not uploaded for one hour.</p>
|
||||
<p>Opted-in completed torrents share the active slots and rotate after one hour without upload. Other torrents remain under Transmission's control.</p>
|
||||
</div>
|
||||
<form id="scheduler-settings" class="scheduler-settings">
|
||||
<label for="scheduler-slots">Seed slots</label>
|
||||
<label for="scheduler-slots">Active slots</label>
|
||||
<input id="scheduler-slots" type="number" min="1" max="100" value="1" required />
|
||||
<button type="submit" class="scheduler-button">Save</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user