You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/Ombi.UI/Views/Admin/SchedulerSettings.cshtml

217 lines
9.6 KiB

8 years ago
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.UI.Models.ScheduledJobsViewModel>
@Html.Partial("Shared/Partial/_Sidebar")
9 years ago
<div class="col-sm-8 col-sm-push-1">
8 years ago
<table class="table table-striped table-hover table-responsive table-condensed">
<thead>
<tr>
<td>Job Name</td>
<td>Last Run</td>
<td></td>
</tr>
</thead>
<tbody>
@foreach (var record in Model.JobRecorder)
{
<tr>
<td>
@record.Key
</td>
<td>
@record.Value.ToString("R")
</td>
<td class="refresh" id="@record.Key"><i class="fa fa-refresh"></i></td>
</tr>
}
</tbody>
</table>
9 years ago
<br/>
<br/>
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>
<legend>Scheduler Settings</legend>
<small>Please note, you will need to restart for these settings to take effect</small>
@if (Model.Plex)
{
<div class="form-group">
<label for="PlexAvailabilityChecker" class="control-label">Plex Availability Checker (min)</label>
<input type="text" class="form-control form-control-custom " id="PlexAvailabilityChecker" name="PlexAvailabilityChecker" value="@Model.PlexAvailabilityChecker">
</div>
9 years ago
<div class="form-group">
<label for="PlexContentCacher" class="control-label">Plex Content Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="PlexContentCacher" name="PlexContentCacher" value="@Model.PlexContentCacher">
</div>
9 years ago
<div class="form-group">
<label for="PlexUserChecker" class="control-label">Plex User Checker (hours)</label>
<input type="text" class="form-control form-control-custom " id="PlexUserChecker" name="PlexUserChecker" value="@Model.PlexUserChecker">
</div>
<small>Please note, the minimum time for this to run is 11 hours, if set below 11 then we will ignore that value. This is a very resource intensive job, the less we run it the better.</small>
<div class="form-group">
<label for="PlexEpisodeCacher" class="control-label">Plex Episode Cacher (hours)</label>
<input type="text" class="form-control form-control-custom " id="PlexEpisodeCacher" name="PlexEpisodeCacher" value="@Model.PlexEpisodeCacher">
</div>
}
@if (Model.Emby)
{
<div class="form-group">
<label for="EmbyAvailabilityChecker" class="control-label">Emby Availability Checker (min)</label>
<input type="text" class="form-control form-control-custom " id="EmbyAvailabilityChecker" name="EmbyAvailabilityChecker" value="@Model.EmbyAvailabilityChecker">
</div>
<div class="form-group">
<label for="EmbyContentCacher" class="control-label">Emby Content Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="EmbyContentCacher" name="EmbyContentCacher" value="@Model.EmbyContentCacher">
</div>
<div class="form-group">
<label for="EmbyUserChecker" class="control-label">Emby User Checker (hours)</label>
<input type="text" class="form-control form-control-custom " id="EmbyUserChecker" name="EmbyUserChecker" value="@Model.EmbyUserChecker">
</div>
<div class="form-group">
<label for="EmbyEpisodeCacher" class="control-label">Emby Episode Cacher (hours)</label>
<input type="text" class="form-control form-control-custom " id="EmbyEpisodeCacher" name="EmbyEpisodeCacher" value="@Model.EmbyEpisodeCacher">
</div>
}
9 years ago
<div class="form-group">
<label for="CouchPotatoCacher" class="control-label">Couch Potato Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="CouchPotatoCacher" name="CouchPotatoCacher" value="@Model.CouchPotatoCacher">
</div>
<div class="form-group">
<label for="WatcherCacher" class="control-label">Wactcher Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="WatcherCacher" name="WatcherCacher" value="@Model.WatcherCacher">
</div>
<div class="form-group">
<label for="RadarrCacher" class="control-label">Radarr Cacher (min)</label>
<input type="text" class="form-control form-control-custom " id="RadarrCacher" name="RadarrCacher" value="@Model.RadarrCacher">
</div>
9 years ago
9 years ago
<div class="form-group">
<label for="SonarrCacher" class="control-label">Sonarr Cacher (min)</label>
<div>
<input type="text" class="form-control form-control-custom " id="SonarrCacher" name="SonarrCacher" value="@Model.SonarrCacher">
</div>
</div>
<div class="form-group">
<label for="SickRageCacher" class="control-label">SickRage Cacher (min)</label>
<div>
<input type="text" class="form-control form-control-custom " id="SickRageCacher" name="SickRageCacher" value="@Model.SickRageCacher">
</div>
</div>
<div class="form-group">
8 years ago
<label for="StoreBackup" class="control-label">Store Backup (hours)</label>
9 years ago
<div>
<input type="text" class="form-control form-control-custom " id="StoreBackup" name="StoreBackup" value="@Model.StoreBackup">
</div>
</div>
<div class="form-group">
8 years ago
<label for="StoreCleanup" class="control-label">Store Cleanup (hours)</label>
9 years ago
<div>
<input type="text" class="form-control form-control-custom " id="StoreCleanup" name="StoreCleanup" value="@Model.StoreCleanup">
</div>
</div>
9 years ago
8 years ago
<small>Please note, this will not reset the users request limit, it will just check every @Model.UserRequestLimitResetter hours to see if it needs to be reset.</small>
9 years ago
<div class="form-group">
8 years ago
<label for="UserRequestLimitResetter" class="control-label">User Request Limit Reset (hours)</label>
9 years ago
<div>
<input type="text" class="form-control form-control-custom " id="UserRequestLimitResetter" name="UserRequestLimitResetter" value="@Model.UserRequestLimitResetter">
</div>
</div>
<small>Please note, this uses a Quartz CRON job, you can build a CRON <a href="http://www.cronmaker.com/">Here</a></small>
8 years ago
<div class="form-group">
<label for="RecentlyAddedCron" class="control-label">Recently Added Email (CRON)</label>
8 years ago
<div>
<input type="text" class="form-control form-control-custom " id="RecentlyAddedCron" name="RecentlyAddedCron" value="@Model.RecentlyAddedCron">
8 years ago
</div>
</div>
9 years ago
<div class="form-group">
<div>
<button id="save" type="submit" class="btn btn-primary-outline ">Submit</button>
</div>
</div>
</fieldset>
</form>
</div>
<script>
$(function () {
$('.date').each(function (i, obj) {
var $obj = $(obj);
var val = $obj.text();
var newDate = utcToLocal(val);
$obj.text(newDate);
});
8 years ago
$('.refresh').click(function(e) {
var id = e.currentTarget.id;
var ev = $(e.currentTarget.children[0]);
ev.addClass("fa-spin");
8 years ago
var url = createLocalUrl("/admin/schedulerun");
8 years ago
$.ajax({
type: 'POST',
data: {key:id},
url: url,
dataType: "json",
success: function (response) {
if (response.result === true) {
generateNotify("Success!", "success");
} else {
generateNotify(response.message, "warning");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
9 years ago
$('#save')
.click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
var data = $form.serialize();
$.ajax({
type: $form.prop("method"),
data: data,
url: $form.prop("action"),
dataType: "json",
success: function (response) {
if (response.result === true) {
generateNotify("Success!", "success");
} else {
generateNotify(response.message, "warning");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
});
</script>