mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
add ability to configure scheduled task time limit
This commit is contained in:
parent
2fd4d6247f
commit
ecd1311a59
@ -62,7 +62,7 @@
|
||||
</li>
|
||||
<li id="fldSelectInterval">
|
||||
<label for="selectInterval">${LabelEveryXMinutes}</label>
|
||||
<select id="selectInterval" name="selectInterval">
|
||||
<select id="selectInterval">
|
||||
<option value="9000000000">15 minutes</option>
|
||||
<option value="18000000000">30 minutes</option>
|
||||
<option value="27000000000">45 minutes</option>
|
||||
@ -75,6 +75,10 @@
|
||||
<option value="432000000000">12 hours</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label for="txtTimeLimit">${LabelTimeLimitHours}</label>
|
||||
<input id="txtTimeLimit" type="number" pattern="[0-9]*" min="1" step=".5" />
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonAdd}
|
||||
|
@ -40,7 +40,24 @@
|
||||
html += '<li>';
|
||||
|
||||
html += '<a href="#">';
|
||||
|
||||
html += '<h3>';
|
||||
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 href="#" onclick="ScheduledTaskPage.confirmDeleteTrigger(' + i + ');">';
|
||||
@ -278,6 +295,11 @@
|
||||
trigger.IntervalTicks = $('#selectInterval', page).val();
|
||||
}
|
||||
|
||||
var timeLimit = $('#txtTimeLimit', page).val() || '0';
|
||||
timeLimit = parseFloat(timeLimit) * 3600000;
|
||||
|
||||
trigger.MaxRuntimeMs = timeLimit || null;
|
||||
|
||||
return trigger;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user