mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add ability to configure scheduled task time limit
This commit is contained in:
parent
2fd4d6247f
commit
ecd1311a59
2 changed files with 27 additions and 1 deletions
|
@ -62,7 +62,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li id="fldSelectInterval">
|
<li id="fldSelectInterval">
|
||||||
<label for="selectInterval">${LabelEveryXMinutes}</label>
|
<label for="selectInterval">${LabelEveryXMinutes}</label>
|
||||||
<select id="selectInterval" name="selectInterval">
|
<select id="selectInterval">
|
||||||
<option value="9000000000">15 minutes</option>
|
<option value="9000000000">15 minutes</option>
|
||||||
<option value="18000000000">30 minutes</option>
|
<option value="18000000000">30 minutes</option>
|
||||||
<option value="27000000000">45 minutes</option>
|
<option value="27000000000">45 minutes</option>
|
||||||
|
@ -75,6 +75,10 @@
|
||||||
<option value="432000000000">12 hours</option>
|
<option value="432000000000">12 hours</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<label for="txtTimeLimit">${LabelTimeLimitHours}</label>
|
||||||
|
<input id="txtTimeLimit" type="number" pattern="[0-9]*" min="1" step=".5" />
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" data-theme="b" data-icon="check">
|
<button type="submit" data-theme="b" data-icon="check">
|
||||||
${ButtonAdd}
|
${ButtonAdd}
|
||||||
|
|
|
@ -40,7 +40,24 @@
|
||||||
html += '<li>';
|
html += '<li>';
|
||||||
|
|
||||||
html += '<a href="#">';
|
html += '<a href="#">';
|
||||||
|
|
||||||
|
html += '<h3>';
|
||||||
html += ScheduledTaskPage.getTriggerFriendlyName(trigger);
|
html += ScheduledTaskPage.getTriggerFriendlyName(trigger);
|
||||||
|
html += '</h3>';
|
||||||
|
|
||||||
|
if (trigger.MaxRuntimeMs) {
|
||||||
|
html += '<p>';
|
||||||
|
|
||||||
|
var hours = trigger.MaxRuntimeMs / 3600000;
|
||||||
|
|
||||||
|
if (hours == 1) {
|
||||||
|
html += Globalize.translate('ValueTimeLimitSingleHour');
|
||||||
|
} else {
|
||||||
|
html += Globalize.translate('ValueTimeLimitMultiHour', hours);
|
||||||
|
}
|
||||||
|
html += '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
html += '</a>';
|
html += '</a>';
|
||||||
|
|
||||||
html += '<a href="#" onclick="ScheduledTaskPage.confirmDeleteTrigger(' + i + ');">';
|
html += '<a href="#" onclick="ScheduledTaskPage.confirmDeleteTrigger(' + i + ');">';
|
||||||
|
@ -278,6 +295,11 @@
|
||||||
trigger.IntervalTicks = $('#selectInterval', page).val();
|
trigger.IntervalTicks = $('#selectInterval', page).val();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var timeLimit = $('#txtTimeLimit', page).val() || '0';
|
||||||
|
timeLimit = parseFloat(timeLimit) * 3600000;
|
||||||
|
|
||||||
|
trigger.MaxRuntimeMs = timeLimit || null;
|
||||||
|
|
||||||
return trigger;
|
return trigger;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue