2020-03-18 12:22:22 +00:00
|
|
|
{% extends '_main.html' %}
|
2019-12-16 13:58:10 +00:00
|
|
|
|
2020-03-18 12:22:22 +00:00
|
|
|
{% block title %}Sonarr - Bazarr{% endblock %}
|
2019-12-16 13:58:10 +00:00
|
|
|
|
2020-03-18 12:22:22 +00:00
|
|
|
{% block page_head %}
|
2019-12-16 13:58:10 +00:00
|
|
|
|
2020-03-18 12:22:22 +00:00
|
|
|
{% endblock page_head %}
|
|
|
|
|
|
|
|
{% block bcleft %}
|
|
|
|
<div class="">
|
|
|
|
<button class="btn btn-outline" id="save_button">
|
|
|
|
<div>
|
|
|
|
<span class="fa-stack">
|
|
|
|
<i class="fas fa-save fa-stack-2x align-top text-themecolor text-center font-20" aria-hidden="true"></i>
|
|
|
|
<i id="save_button_checkmark" class="fas fa-check fa-stack-2x" style="color:green;"></i>
|
|
|
|
</span>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<div class="align-bottom text-themecolor small text-center">Save</div>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{% endblock bcleft %}
|
|
|
|
|
|
|
|
{% block bcright %}
|
|
|
|
|
|
|
|
{% endblock bcright %}
|
|
|
|
|
|
|
|
{% block body %}
|
|
|
|
<div class="container-fluid" style="padding-top: 3em;">
|
|
|
|
<form class="form" name="settings_form" id="settings_form">
|
|
|
|
<h4>Use Sonarr</h4>
|
|
|
|
<hr/>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>Enabled</b>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<div class="form-group col-sm-1">
|
|
|
|
<label class="custom-control custom-checkbox">
|
|
|
|
<input type="checkbox" class="custom-control-input" id="settings-general-use_sonarr" name="settings-general-use_sonarr">
|
|
|
|
<span class="custom-control-label" for="settings-general-use_sonarr"></span>
|
|
|
|
</label>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
2019-12-16 13:58:10 +00:00
|
|
|
|
2020-03-18 12:22:22 +00:00
|
|
|
<div id="sonarr_div">
|
|
|
|
<h4>Host</h4>
|
|
|
|
<hr/>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>Hostname or IP Address</b>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="text" class="form-control" id="settings-sonarr-ip" name="settings-sonarr-ip" value="{{settings.sonarr.ip}}">
|
|
|
|
</div>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>Port Number</b>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="text" class="form-control" id="settings-sonarr-port" name="settings-sonarr-port" value="{{settings.sonarr.port}}">
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>URL Base</b>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="text" class="form-control" id="settings-sonarr-base_url" name="settings-sonarr-base_url" value="{{settings.sonarr.base_url}}">
|
|
|
|
</div>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>SSL Enabled</b>
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-sm-1">
|
|
|
|
<label class="custom-control custom-checkbox">
|
|
|
|
<input type="checkbox" class="custom-control-input" id="settings-sonarr-ssl" name="settings-sonarr-ssl">
|
|
|
|
<span class="custom-control-label" for="settings-sonarr-ssl"></span>
|
|
|
|
</label>
|
|
|
|
</div>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>API Key</b>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="text" class="form-control" id="settings-sonarr-apikey" name="settings-sonarr-apikey" value="{{settings.sonarr.apikey}}">
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
|
|
|
|
|
|
|
<h4>Options</h4>
|
|
|
|
<hr/>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>Minimum Score</b>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-1">
|
|
|
|
<input type="number" min="0" max="100" step="1" onkeydown="return false" class="form-control" id="settings-general-minimum_score" name="settings-general-minimum_score" value="{{settings.general.minimum_score}}">
|
|
|
|
</div>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 text-right">
|
|
|
|
<b>Download Only Monitored</b>
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-sm-1">
|
|
|
|
<label class="custom-control custom-checkbox">
|
|
|
|
<input type="checkbox" class="custom-control-input" id="settings-sonarr-only_monitored" name="settings-sonarr-only_monitored">
|
|
|
|
<span class="custom-control-label" for="settings-sonarr-only_monitored"></span>
|
|
|
|
</label>
|
|
|
|
</div>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
|
|
|
<h4>PAth Mapping</h4>
|
|
|
|
<hr/>
|
|
|
|
<div class="row">
|
|
|
|
<table class="dataTable table table-striped" id="path_mapping">
|
|
|
|
|
|
|
|
</table>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
<br>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
</form>
|
2019-12-16 13:58:10 +00:00
|
|
|
</div>
|
2020-03-18 12:22:22 +00:00
|
|
|
{% endblock body %}
|
|
|
|
|
|
|
|
{% block tail %}
|
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
|
|
|
// Hide checkmark over save button
|
|
|
|
$('#save_button_checkmark').hide();
|
|
|
|
|
|
|
|
// Hide *_div on Select input changed to None
|
|
|
|
$('#settings-general-use_sonarr').on('change', function() {
|
|
|
|
if ($(this).prop('checked')) {
|
|
|
|
$('#sonarr_div').show();
|
|
|
|
} else {
|
|
|
|
$('#sonarr_div').hide();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Set Checkbox input values
|
|
|
|
$('#settings-general-use_sonarr').prop('checked', {{'true' if settings.general.getboolean('use_sonarr')}});
|
|
|
|
$('#settings-sonarr-ssl').prop('checked', {{'true' if settings.sonarr.getboolean('ssl')}});
|
|
|
|
$('#settings-sonarr-only_monitored').prop('checked', {{'true' if settings.sonarr.getboolean('only_monitored')}});
|
|
|
|
|
|
|
|
$('#save_button').on('click', function() {
|
|
|
|
var formdata = new FormData(document.getElementById("settings_form"));
|
|
|
|
|
|
|
|
// Make sure all checkbox input are sent with true/false value
|
|
|
|
$('input[type=checkbox]').each(function () {
|
|
|
|
formdata.set($(this).prop('id'), $(this).prop('checked'));
|
|
|
|
});
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
url: "{{ url_for('api.savesettings') }}",
|
|
|
|
data: formdata,
|
|
|
|
processData: false,
|
|
|
|
contentType: false,
|
|
|
|
type: 'POST',
|
|
|
|
complete: function () {
|
|
|
|
$('#save_button_checkmark').show();
|
|
|
|
setTimeout(
|
|
|
|
function()
|
|
|
|
{
|
|
|
|
$('#save_button_checkmark').hide();
|
|
|
|
}, 2000);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
table = $('#path_mapping').DataTable({
|
|
|
|
data: [["/tvsonarr", "/tvbazarr"]],
|
|
|
|
columns: [{
|
|
|
|
title: "Path for Sonarr",
|
|
|
|
type: "text"
|
|
|
|
}, {
|
|
|
|
title: "Path for Bazarr",
|
|
|
|
type: "text"
|
|
|
|
}],
|
|
|
|
dom: 'Bfrtip', // Needs button container
|
|
|
|
select: 'single',
|
|
|
|
responsive: true,
|
|
|
|
altEditor: true, // Enable altEditor
|
|
|
|
buttons: [{
|
|
|
|
text: 'Add',
|
|
|
|
name: 'add' // do not change name
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'selected', // Bind to Selected row
|
|
|
|
text: 'Edit',
|
|
|
|
name: 'edit' // do not change name
|
|
|
|
},
|
|
|
|
{
|
|
|
|
extend: 'selected', // Bind to Selected row
|
|
|
|
text: 'Delete',
|
|
|
|
name: 'delete' // do not change name
|
|
|
|
}]
|
|
|
|
});
|
2019-12-16 13:58:10 +00:00
|
|
|
});
|
2020-03-18 12:22:22 +00:00
|
|
|
</script>
|
|
|
|
{% endblock tail %}
|