mirror of https://github.com/Ombi-app/Ombi
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.
179 lines
6.5 KiB
179 lines
6.5 KiB
@Html.Partial("_Sidebar")
|
|
@{
|
|
int port;
|
|
if (Model.Port == 0)
|
|
{
|
|
port = 8081;
|
|
}
|
|
else
|
|
{
|
|
port = Model.Port;
|
|
}
|
|
}
|
|
<div class="col-sm-8 col-sm-push-1">
|
|
<form class="form-horizontal" method="POST" id="mainForm">
|
|
<fieldset>
|
|
<legend>SickRage Settings</legend>
|
|
<div class="form-group">
|
|
<div class="checkbox">
|
|
<label>
|
|
@if (Model.Enabled)
|
|
{
|
|
<input type="checkbox" id="Enabled" name="Enabled" checked="checked"><text>Enabled</text>
|
|
}
|
|
else
|
|
{
|
|
<input type="checkbox" id="Enabled" name="Enabled"><text>Enabled</text>
|
|
}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="Ip" class="control-label">SickRage Hostname or IP</label>
|
|
<div class="">
|
|
<input type="text" class="form-control form-control-custom " id="Ip" name="Ip" placeholder="localhost" value="@Model.Ip">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="portNumber" class="control-label">Port</label>
|
|
|
|
<div class="">
|
|
<input type="text" class="form-control form-control-custom " id="portNumber" name="Port" placeholder="Port Number" value="@port">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label for="ApiKey" class="control-label">SickRage API Key</label>
|
|
<div>
|
|
<input type="text" class="form-control form-control-custom " id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="checkbox">
|
|
<label>
|
|
@if (Model.Ssl)
|
|
{
|
|
<input type="checkbox" id="Ssl" name="Ssl" checked="checked"><text>SSL</text>
|
|
}
|
|
else
|
|
{
|
|
<input type="checkbox" id="Ssl" name="Ssl"><text>SSL</text>
|
|
}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="SubDir" class="control-label">SickRage SubDirectory</label>
|
|
<div>
|
|
<input type="text" class="form-control form-control-custom " id="SubDir" name="SubDir" value="@Model.SubDir">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="profiles" class="control-label ">Quality Profiles</label>
|
|
<div id="profiles">
|
|
<select class="form-control form-control-custom" value="selected">
|
|
<option id="default" value="default">Use Deafult</option>
|
|
<option id="sdtv" value="sdtv">SD TV</option>
|
|
<option id="sddvd" value="sddvd">SD DVD</option>
|
|
<option id="hdtv" value="hdtv">HD TV</option>
|
|
<option id="rawhdtv" value="rawhdtv">Raw HD TV</option>
|
|
<option id="hdwebdl" value="hdwebdl">HD Web DL</option>
|
|
<option id="fullhdwebdl" value="fullhdwebdl">Full HD Web DL</option>
|
|
<option id="hdbluray" value="hdbluray">HD Bluray</option>
|
|
<option id="fullhdbluray" value="fullhdbluray">Full HD Bluray</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div>
|
|
<button id="testSickRage" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<div>
|
|
<button id="save" type="submit" class="btn btn-primary-outline ">Submit</button>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
$(function() {
|
|
|
|
@if (!string.IsNullOrEmpty(Model.QualityProfile))
|
|
{
|
|
<text>
|
|
var qualitySelected = '@Model.QualityProfile';
|
|
$('#' + qualitySelected).prop("selected", "selected");
|
|
</text>
|
|
}
|
|
|
|
$('#save').click(function (e) {
|
|
e.preventDefault();
|
|
var port = $('#portNumber').val();
|
|
if (isNaN(port)) {
|
|
generateNotify("You must specify a Port.", "warning");
|
|
return;
|
|
}
|
|
var qualityProfile = $("#profiles option:selected").val();
|
|
|
|
var $form = $("#mainForm");
|
|
|
|
var data = $form.serialize();
|
|
data = data + "&qualityProfile=" + qualityProfile;
|
|
|
|
$.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");
|
|
}
|
|
});
|
|
});
|
|
|
|
$('#testSickRage').click(function (e) {
|
|
e.preventDefault();
|
|
var $form = $("#mainForm");
|
|
$.ajax({
|
|
type: $form.prop("method"),
|
|
url: "/test/sickrage",
|
|
data: $form.serialize(),
|
|
dataType: "json",
|
|
success: function (response) {
|
|
console.log(response);
|
|
if (response.result === true) {
|
|
generateNotify(response.message, "success");
|
|
} else {
|
|
generateNotify(response.message, "warning");
|
|
}
|
|
},
|
|
error: function (e) {
|
|
console.log(e);
|
|
generateNotify("Something went wrong!", "danger");
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
})
|
|
</script> |