parent
ae46a0fc49
commit
e0b98337b2
@ -1,216 +0,0 @@
|
||||
{% extends '_main.html' %}
|
||||
{%- from 'settings_general.html' import settings_general with context %}
|
||||
{%- from 'settings_subtitles.html' import settings_subtitles with context %}
|
||||
{%- from 'settings_notifications.html' import settings_notifications with context %}
|
||||
{%- from 'settings_radarr.html' import settings_radarr with context %}
|
||||
{%- from 'settings_sonarr.html' import settings_sonarr with context %}
|
||||
{%- from 'providers.html' import settings_providers1 with context %}
|
||||
|
||||
{% block title %}Settings - Bazarr{% endblock %}
|
||||
{% block body %}
|
||||
|
||||
<div class="container-fluid">
|
||||
<!-- ============================================================== -->
|
||||
<!-- Bread crumb and right sidebar toggle -->
|
||||
<!-- ============================================================== -->
|
||||
<div class="row page-titles">
|
||||
<div class="col-md-5 col-8 align-self-center">
|
||||
<h3 class="text-themecolor m-b-0 m-t-0"><i class="fas fa-sync"></i></h3>
|
||||
</div>
|
||||
<div class="col-md-7 col-4 align-self-center">
|
||||
<div class="d-flex m-t-10 justify-content-end">
|
||||
<div class="d-flex m-r-20 m-l-10 hidden-md-down">
|
||||
<div class="chart-text m-r-10">
|
||||
<h5 class="m-t-0 text-white">Some page settings</h5></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ============================================================== -->
|
||||
<!-- End Bread crumb and right sidebar toggle -->
|
||||
<!-- ============================================================== -->
|
||||
<form name="settings_form" id="settings_form" action="{{ base_url }}save_settings" method="post" class="ui form"
|
||||
autocomplete="off">
|
||||
<div id="form_validation_error" class="ui error message">
|
||||
<p>Some fields are in error and you can't save settings until you have corrected them. Be sure to check
|
||||
in
|
||||
every tabs.</p>
|
||||
</div>
|
||||
<div class="ui top attached tabular menu">
|
||||
<a class="tabs item active" data-tab="general">General</a>
|
||||
<a class="tabs item" id="sonarr_tab" data-tab="sonarr">Sonarr</a>
|
||||
<a class="tabs item" id="radarr_tab" data-tab="radarr">Radarr</a>
|
||||
<a class="tabs item" data-tab="subtitles">Subtitles</a>
|
||||
<a class="tabs item" data-tab="notifier">Notifications</a>
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment active" data-tab="general">
|
||||
<div class="ui container">
|
||||
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
||||
form="settings_form">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
{% include 'settings_general.html' %}
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment" data-tab="sonarr">
|
||||
<div class="ui container">
|
||||
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
||||
form="settings_form">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
{% include 'settings_sonarr.html' %}
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment" data-tab="radarr">
|
||||
<div class="ui container">
|
||||
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
||||
form="settings_form">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
{% include 'settings_radarr.html' %}
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment" data-tab="subtitles">
|
||||
<div class="ui container">
|
||||
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
||||
form="settings_form">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
{% include 'settings_subtitles.html' %}
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment" data-tab="notifier">
|
||||
<div class="ui container">
|
||||
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
||||
form="settings_form">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
{% include 'settings_notifications.html' %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock body %}
|
||||
{% block tail %}
|
||||
|
||||
<script src="{{ url_for('static',filename='js/settings_validation.js') }}" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
function getQueryVariable(variable) {
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split("&");
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split("=");
|
||||
if (pair[0] == variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (getQueryVariable("saved") == 'true') {
|
||||
new Noty({
|
||||
text: 'Settings saved.',
|
||||
timeout: 5000,
|
||||
progressBar: false,
|
||||
animation: {
|
||||
open: null,
|
||||
close: null
|
||||
},
|
||||
killer: true,
|
||||
type: 'info',
|
||||
layout: 'bottomRight',
|
||||
theme: 'semanticui'
|
||||
}).show();
|
||||
}
|
||||
|
||||
$('.menu .item')
|
||||
.tab()
|
||||
;
|
||||
|
||||
$('a:not(.tabs), button:not(.cancel, .test, .no_loader)').on('click', function () {
|
||||
$('#loader').addClass('active');
|
||||
});
|
||||
|
||||
$('a[target="_blank"]').on('click', function () {
|
||||
$('#loader').removeClass('active');
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
});
|
||||
|
||||
$(".form :input").on('change paste keyup focusout', function () {
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
});
|
||||
|
||||
// Don't move this part to settings_general.tpl as #settings_form is undefined in this template
|
||||
if ($('#settings_proxy_type').val() === "None") {
|
||||
$('.proxy_option').hide();
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_url', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'integer[1..65535]');
|
||||
} else {
|
||||
$('#settings_form').form('add rule', 'settings_proxy_url', {
|
||||
rules: [{
|
||||
type: 'empty',
|
||||
prompt: '"General / Proxy settings / Hostname" must have a value'
|
||||
}]
|
||||
});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
||||
rules: [{
|
||||
type: 'empty',
|
||||
prompt: '"General / Proxy settings / Port" must have a value'
|
||||
}]
|
||||
});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
||||
rules: [{
|
||||
type: 'integer[1..65535]',
|
||||
prompt: '"General / Proxy settings / Port" must be an integer between 1 and 65535'
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
// Don't move this part to settings_general.tpl as #settings_form is undefined in this template
|
||||
$('#settings_proxy_type').dropdown('setting', 'onChange', function () {
|
||||
if ($('#settings_proxy_type').val() === "None") {
|
||||
$('.proxy_option').hide();
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_url', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'integer[1..65535]');
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
} else {
|
||||
$('.proxy_option').show();
|
||||
$('#settings_form').form('add rule', 'settings_proxy_url', {
|
||||
rules: [{
|
||||
type: 'empty',
|
||||
prompt: '"General / Proxy settings / Hostname" must have a value'
|
||||
}]
|
||||
});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
||||
rules: [{
|
||||
type: 'empty',
|
||||
prompt: '"General / Proxy settings / Port" must have a value'
|
||||
}]
|
||||
});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
||||
rules: [{
|
||||
type: 'integer[1..65535]',
|
||||
prompt: '"General / Proxy settings / Port" must be an integer between 1 and 65535'
|
||||
}]
|
||||
});
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ settings_general() }}
|
||||
{{ settings_subtitles() }}
|
||||
{{ settings_notifications() }}
|
||||
{{ settings_radarr() }}
|
||||
{{ settings_sonarr() }}
|
||||
{{ settings_providers1() }}
|
||||
{% endblock tail %}
|
@ -1,935 +0,0 @@
|
||||
|
||||
<div class="ui dividing header">Start-Up</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Listening IP Address</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input name="settings_general_ip" type="text" value="{{ settings.general.ip }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Requires restart to take effect" data-inverted="">
|
||||
<i class="yellow warning sign icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Valid IP4 Address or '0.0.0.0' for all interfaces"
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Listening Port</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input name="settings_general_port" type="text" value="{{ settings.general.port }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Requires restart to take effect" data-inverted="">
|
||||
<i class="yellow warning sign icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Valid TCP port (default: 6767)" data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Base URL</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class="ui fluid input">
|
||||
{% if settings.general.base_url == None %}
|
||||
{% set base_url = "/" %}
|
||||
{% else %}
|
||||
{% set base_url = settings.general.base_url %}
|
||||
{% endif %}
|
||||
<input name="settings_general_baseurl" type="text" value="{{ base_url }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Requires restart to take effect" data-inverted="">
|
||||
<i class="yellow warning sign icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="For reverse proxy support, default is '/'" data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Enable Debug Logging</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div id="settings_debug" class="ui toggle checkbox"
|
||||
data-debug={{ settings.general.getboolean('debug') }}>
|
||||
<input name="settings_general_debug" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Debug logging should only be enabled temporarily"
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="chmod_enabled" class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Enable CHMOD</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div id="settings_chmod_enabled" class="ui toggle checkbox"
|
||||
data-chmod={{ settings.general.getboolean('chmod_enabled') }}>
|
||||
<input name="settings_general_chmod_enabled" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="chmod" class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Set Subtitle file permissions to</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div id="settings_chmod" class="ui fluid input">
|
||||
<input name="settings_general_chmod" type="text"
|
||||
value={{ settings.general.chmod }}>
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Must be 4 digit octal, e.g.: 0775" data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Page Size</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<select name="settings_page_size" id="settings_page_size" class="ui fluid selection dropdown">
|
||||
<option value="">Page Size</option>
|
||||
<option value="-1">Unlimited</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="250">250</option>
|
||||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="How many items to show in a list." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dividing header">Proxy settings</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Proxy Type</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<select name="settings_proxy_type" id="settings_proxy_type" class="ui fluid selection dropdown">
|
||||
<option value="None">None</option>
|
||||
<option value="http">HTTP(S)</option>
|
||||
<option value="socks4">Socks4</option>
|
||||
<option value="socks5">Socks5</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Requires restart to take effect" data-inverted="">
|
||||
<i class="yellow warning sign icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Type of your proxy." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="proxy_option middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Hostname</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input id="settings_proxy_url" name="settings_proxy_url" type="text"
|
||||
value="{{ settings.proxy.url }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="proxy_option middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Port</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input id="settings_proxy_port" name="settings_proxy_port" type="text"
|
||||
value="{{ settings.proxy.port }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="proxy_option middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Username</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input id="settings_proxy_username" name="settings_proxy_username" type="text"
|
||||
value="{{ settings.proxy.username }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="UYou only need to enter a username and password if one is required. Leave them blank otherwise"
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="proxy_option middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Password</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input id="settings_proxy_password" name="settings_proxy_password" type="password"
|
||||
value="{{ settings.proxy.password }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="You only need to enter a username and password if one is required. Leave them blank otherwise"
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="proxy_option middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Ignored Addresses</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input id="settings_proxy_exclude" name="settings_proxy_exclude" type="text"
|
||||
value="{{ settings.proxy.exclude }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Use ',' as a separator, and '*.' as a wildcard for subdomains"
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dividing header">Security Settings</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Authentication</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<select name="settings_auth_type" id="settings_auth_type" class="ui fluid selection dropdown">
|
||||
<option value="None">None</option>
|
||||
<option value="basic">Basic (Browser Popup)</option>
|
||||
<option value="form">Forms (Login Page)</option>
|
||||
</select>
|
||||
<label></label>
|
||||
</div>
|
||||
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Requires restart to take effect" data-inverted="">
|
||||
<i class="yellow warning sign icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Require Username and Password to access Bazarr."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="auth_option middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Username</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input id="settings_auth_username" name="settings_auth_username" type="text" autocomplete="nope"
|
||||
value="{{ settings.auth.username }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="auth_option middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Password</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<input id="settings_auth_password" name="settings_auth_password" type="password"
|
||||
autocomplete="new-password" value="{{ settings.auth.password }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="Authentication send username and password in clear text over the network. You should add SSL encryption through a reverse proxy."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>API Key</label>
|
||||
</div>
|
||||
<div class="six wide column">
|
||||
<div class='field'>
|
||||
<div class="ui action input">
|
||||
<input id="settings_auth_apikey" name="settings_auth_apikey" type="text" readonly
|
||||
value="{{ settings.auth.apikey }}">
|
||||
<button class="no_loader ui red icon button" type="button" onclick="generate_apikey()">
|
||||
<i class="sync icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dividing header">Integration settings</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Use Sonarr</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_use_sonarr" class="ui toggle checkbox"
|
||||
data-enabled={{ settings.general.getboolean('use_sonarr') }}>
|
||||
<input name="settings_general_use_sonarr" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Enable Sonarr Integration." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Use Radarr</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_use_radarr" class="ui toggle checkbox"
|
||||
data-enabled={{ settings.general.getboolean('use_radarr') }}>
|
||||
<input name="settings_general_use_radarr" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Enable Radarr Integration." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dividing header">Path Mappings For TV Shows</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
{% if settings.general.path_mappings != None %}
|
||||
{% set path_substitutions = ast.literal_eval(settings.general.path_mappings) %}
|
||||
{% else %}
|
||||
{% set path_substitutions = [] %}
|
||||
{% endif %}
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
|
||||
</div>
|
||||
<div class="two wide column">
|
||||
<div class="ui fluid input">
|
||||
<h4 class="ui header">
|
||||
Path for Sonarr:
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Root path to the directory Sonarr accesses."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="two wide center aligned column">
|
||||
|
||||
</div>
|
||||
<div class="two wide column">
|
||||
<div class="ui fluid input">
|
||||
<h4 class="ui header">
|
||||
Path for Bazarr:
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="Path that Bazarr should use to access the same directory remotely."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% for x in range(0, 5) %}
|
||||
{% set path = [] %}
|
||||
{% if path_substitutions[x] %}
|
||||
{% set path = path_substitutions[x] %}
|
||||
{% else %}
|
||||
{% set path = ["", ""] %}
|
||||
{% endif %}
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
|
||||
</div>
|
||||
<div class="four wide column">
|
||||
<div class="ui fluid input">
|
||||
<input name="settings_general_sourcepath" type="text" value="{{ path[0] }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="center aligned column">
|
||||
<i class="arrow circle right icon"></i>
|
||||
</div>
|
||||
<div class="four wide column">
|
||||
<div class="ui fluid input">
|
||||
<input name="settings_general_destpath" type="text" value="{{ path[1] }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dividing header">Path Mappings For Movies</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
{% if settings.general.path_mappings_movie != None %}
|
||||
{% set path_substitutions_movie = ast.literal_eval(settings.general.path_mappings_movie) %}
|
||||
{% else %}
|
||||
{% set path_substitutions_movie = [] %}
|
||||
{% endif %}
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
|
||||
</div>
|
||||
<div class="two wide column">
|
||||
<div class="ui fluid input">
|
||||
<h4 class="ui header">
|
||||
Path for Radarr:
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Root path to the directory Radarr accesses."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="two wide center aligned column">
|
||||
|
||||
</div>
|
||||
<div class="two wide column">
|
||||
<div class="ui fluid input">
|
||||
<h4 class="ui header">
|
||||
Path for Bazarr:
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="Path that Bazarr should use to access the same directory remotely."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% for x in range(0, 5) %}
|
||||
{% set path_movie = [] %}
|
||||
{% if path_substitutions_movie[x] %}
|
||||
{% set path_movie = path_substitutions_movie[x] %}
|
||||
{% else %}
|
||||
{% set path_movie = ["", ""] %}
|
||||
{% endif %}
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
|
||||
</div>
|
||||
<div class="four wide column">
|
||||
<div class="ui fluid input">
|
||||
<input name="settings_general_sourcepath_movie" type="text" value="{{ path_movie[0] }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="center aligned column">
|
||||
<i class="arrow circle right icon"></i>
|
||||
</div>
|
||||
<div class="four wide column">
|
||||
<div class="ui fluid input">
|
||||
<input name="settings_general_destpath_movie" type="text" value="{{ path_movie[1] }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dividing header">Post-processing</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui orange message">
|
||||
<p>Be aware that the execution of post-processing command will prevent the user interface from being accessible
|
||||
until completion, when downloading subtitles in interactive mode (meaning you'll see a loader during
|
||||
post-processing).</p>
|
||||
</div>
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Use post-processing</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_use_postprocessing" class="ui toggle checkbox"
|
||||
data-postprocessing={{ settings.general.getboolean('use_postprocessing') }}>
|
||||
<input name="settings_general_use_postprocessing" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="Enable the post-processing execution after downloading a subtitles."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row postprocessing">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Post-processing command</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div id="settings_general_postprocessing_cmd_div" class="ui fluid input">
|
||||
<input name="settings_general_postprocessing_cmd" type="text"
|
||||
value="{{ settings.general.postprocessing_cmd if settings.general.postprocessing_cmd != None else '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row postprocessing">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Variables you can use in your command (include the double curly brace):</label>
|
||||
</div>
|
||||
<div class="ten wide column">
|
||||
<div class="ui list">
|
||||
<div class="item">
|
||||
<div class="header">{{directory}}</div>
|
||||
The full path of the episode file parent directory.
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="header">{{episode}}</div>
|
||||
The full path of the episode file.
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="header">{{episode_name}}</div>
|
||||
The filename of the episode without parent directory or extension.
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="header">{{subtitles}}</div>
|
||||
The full path of the subtitles file.
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="header">{{subtitles_language}}</div>
|
||||
The language of the subtitles file.
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="header">{{subtitles_language_code2}}</div>
|
||||
The 2-letter ISO-639 language code of the subtitles language.
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="header">{{subtitles_language_code3}}</div>
|
||||
The 3-letter ISO-639 language code of the subtitles language.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_update">
|
||||
<div class="ui dividing header">Updates</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row" id="div_branch">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Branch</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<select name="settings_general_branch" id="settings_branch" class="ui fluid selection dropdown">
|
||||
<option value="">Branch</option>
|
||||
<option value="master">master</option>
|
||||
<option value="development">development</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="Only select development branch if you want to live on the edge."
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Automatic</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_automatic_div" class="ui toggle checkbox"
|
||||
data-automatic={{ settings.general.getboolean('auto_update') }}>
|
||||
<input name="settings_general_automatic" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="Automatically download and install updates. You will still be able to install from System: Tasks"
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Restart after update</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_update_restart" class="ui toggle checkbox"
|
||||
data-update-restart={{ settings.general.getboolean('update_restart') }}>
|
||||
<input name="settings_general_update_restart" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon"
|
||||
data-tooltip="Automatically restart after downloading and installing updates. You will still be able to restart manually"
|
||||
data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui dividing header">Analytics</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Enable</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_analytics_enabled" class="ui toggle checkbox"
|
||||
data-analytics={{ settings.analytics.getboolean('enabled') }}>
|
||||
<input name="settings_analytics_enabled" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle align row">
|
||||
<div class="right aligned four wide column">
|
||||
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
<div class="ten wide column">
|
||||
Send anonymous usage information, nothing that can identify you. This includes information on which
|
||||
providers you use, what languages you search for, Bazarr, Python, Sonarr, Radarr and what OS version you
|
||||
are using. We will use this information to prioritize features and bug fixes. Please, keep this enabled
|
||||
as this is the only way we have to better understand how you use Bazarr.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% macro settings_general() %}
|
||||
<script>
|
||||
{% if args.no_update %}
|
||||
$("#div_update").hide();
|
||||
{% elif args.release_update %}
|
||||
$("#div_branch").hide();
|
||||
{% endif %}
|
||||
|
||||
{%if sys.platform.startswith('win')%}
|
||||
$("#chmod").hide();
|
||||
$("#chmod_enabled").hide();
|
||||
{%endif%}
|
||||
|
||||
if ($('#settings_automatic_div').data("automatic") === "True") {
|
||||
$("#settings_automatic_div").checkbox('check');
|
||||
} else {
|
||||
$("#settings_automatic_div").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_update_restart').data("update-restart") === "True") {
|
||||
$("#settings_update_restart").checkbox('check');
|
||||
} else {
|
||||
$("#settings_update_restart").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_debug').data("debug") === "True") {
|
||||
$("#settings_debug").checkbox('check');
|
||||
} else {
|
||||
$("#settings_debug").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_chmod_enabled').data("chmod") === "True") {
|
||||
$("#settings_chmod_enabled").checkbox('check');
|
||||
} else {
|
||||
$("#settings_chmod_enabled").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_analytics_enabled').data("analytics") === "True") {
|
||||
$("#settings_analytics_enabled").checkbox('check');
|
||||
} else {
|
||||
$("#settings_analytics_enabled").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_use_postprocessing').data("postprocessing") === "True") {
|
||||
$("#settings_use_postprocessing").checkbox('check');
|
||||
$("#settings_general_postprocessing_cmd_div").removeClass('disabled');
|
||||
} else {
|
||||
$("#settings_use_postprocessing").checkbox('uncheck');
|
||||
$("#settings_general_postprocessing_cmd_div").addClass('disabled');
|
||||
}
|
||||
|
||||
$("#settings_use_postprocessing").on('change', function (i, obj) {
|
||||
if ($("#settings_use_postprocessing").checkbox('is checked')) {
|
||||
$("#settings_general_postprocessing_cmd_div").removeClass('disabled');
|
||||
} else {
|
||||
$("#settings_general_postprocessing_cmd_div").addClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#settings_use_postprocessing').data("postprocessing") === "True") {
|
||||
$('.postprocessing').show();
|
||||
} else {
|
||||
$('.postprocessing').hide();
|
||||
}
|
||||
|
||||
$('#settings_use_postprocessing').checkbox({
|
||||
onChecked: function () {
|
||||
$('.postprocessing').show();
|
||||
},
|
||||
onUnchecked: function () {
|
||||
$('.postprocessing').hide();
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#settings_use_sonarr').data("enabled") === "True") {
|
||||
$("#settings_use_sonarr").checkbox('check');
|
||||
$("#sonarr_tab").removeClass('disabled');
|
||||
} else {
|
||||
$("#settings_use_sonarr").checkbox('uncheck');
|
||||
$("#sonarr_tab").addClass('disabled');
|
||||
}
|
||||
|
||||
$('#settings_use_sonarr').checkbox({
|
||||
onChecked: function () {
|
||||
$("#sonarr_tab").removeClass('disabled');
|
||||
$('#sonarr_validated').checkbox('uncheck');
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
},
|
||||
onUnchecked: function () {
|
||||
$("#sonarr_tab").addClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#settings_use_radarr').data("enabled") === "True") {
|
||||
$("#settings_use_radarr").checkbox('check');
|
||||
$("#radarr_tab").removeClass('disabled');
|
||||
} else {
|
||||
$("#settings_use_radarr").checkbox('uncheck');
|
||||
$("#radarr_tab").addClass('disabled');
|
||||
}
|
||||
|
||||
$('#settings_use_radarr').checkbox({
|
||||
onChecked: function () {
|
||||
$("#radarr_tab").removeClass('disabled');
|
||||
$('#radarr_validated').checkbox('uncheck');
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
},
|
||||
onUnchecked: function () {
|
||||
$("#radarr_tab").addClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#settings_chmod_enabled').data("chmod") === "True") {
|
||||
$('#chmod').show();
|
||||
} else {
|
||||
$('#chmod').hide();
|
||||
}
|
||||
|
||||
$('#settings_chmod_enabled').checkbox({
|
||||
onChecked: function () {
|
||||
$('#chmod').show();
|
||||
},
|
||||
onUnchecked: function () {
|
||||
$('#chmod').hide();
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#settings_auth_type').val() === "None") {
|
||||
$('.auth_option').hide();
|
||||
}
|
||||
|
||||
$('#settings_auth_type').dropdown('setting', 'onChange', function () {
|
||||
if ($('#settings_auth_type').val() === "None") {
|
||||
$('.auth_option').hide();
|
||||
} else {
|
||||
$('.auth_option').show();
|
||||
}
|
||||
});
|
||||
|
||||
// Load default value for Settings_auth_type
|
||||
$('#settings_auth_type').dropdown('clear');
|
||||
$('#settings_auth_type').dropdown('set selected', '{{settings.auth.type|safe}}');
|
||||
|
||||
// Remove value from Password input when changing to Form login to prevent bad password saving
|
||||
$("#settings_auth_type").on('change', function () {
|
||||
if ($(this).val() === 'form') {
|
||||
$('#settings_auth_password').val('');
|
||||
} else {
|
||||
$('#settings_auth_password').val('{{settings.auth.password}}');
|
||||
}
|
||||
});
|
||||
|
||||
$('#settings_loglevel').dropdown('clear');
|
||||
$('#settings_loglevel').dropdown('set selected', '{{settings.general.getboolean('debug')|safe}}');
|
||||
$('#settings_page_size').dropdown('clear');
|
||||
$('#settings_page_size').dropdown('set selected', '{{settings.general.page_size|safe}}');
|
||||
$('#settings_proxy_type').dropdown('clear');
|
||||
$('#settings_proxy_type').dropdown('set selected', '{{settings.proxy.type|safe}}');
|
||||
$('#settings_branch').dropdown('clear');
|
||||
$('#settings_branch').dropdown('set selected', '{{settings.general.branch|safe}}');
|
||||
|
||||
$('#settings_auth_username').on('keyup', function () {
|
||||
$('#settings_auth_password').val('');
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
});
|
||||
|
||||
function generate_apikey() {
|
||||
var result = '';
|
||||
var characters = 'abcdef0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < 32; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
$("#settings_auth_apikey").val(result);
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endmacro %}
|
@ -0,0 +1,251 @@
|
||||
{% extends '_main.html' %}
|
||||
|
||||
{% block title %}General - Bazarr{% endblock %}
|
||||
|
||||
{% block bcleft %}
|
||||
<div class="">
|
||||
<button class="btn btn-outline" id="save_button">
|
||||
<div><i class="fas fa-save align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>
|
||||
<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;">
|
||||
<h4>Host</h4>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Listening IP Address</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-general-ip" name="settings-general-ip" value="{{settings.general.ip}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Listening Port</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-general-port" name="settings-general-port" value="{{settings.general.port}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Base URL</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-general-base_url" name="settings-general-base_url" value="{{settings.general.base_url}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h4>Security</h4>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Authentication</b>
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<select class="selectpicker" id="settings-auth-type" name="settings-auth-type">
|
||||
<option value="None">None</option>
|
||||
<option value="Basic">Basic</option>
|
||||
<option value="Form">Form</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="authentication_div">
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Username</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-auth-username" name="settings-auth-username" value="{{settings.auth.username}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Password</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="password" class="form-control" id="settings-auth-password" name="settings-auth-password" value="{{settings.auth.password}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
<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-auth-apikey" name="settings-auth-apikey" value="{{settings.auth.apikey}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h4>Proxy</h4>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Type</b>
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<select class="selectpicker" id="settings-proxy-type" name="settings-proxy-type">
|
||||
<option value="None">None</option>
|
||||
<option value="http">HTTP(S)</option>
|
||||
<option value="socks4">Socks4</option>
|
||||
<option value="socks5">Socks5</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="proxy_div">
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Hostname</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-proxy-url" name="settings-proxy-url" value="{{settings.proxy.url}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Port</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-proxy-port" name="settings-proxy-port" value="{{settings.proxy.port}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Username</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-proxy-username" name="settings-proxy-username" value="{{settings.proxy.username}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Password</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="password" class="form-control" id="settings-proxy-password" name="settings-proxy-password" value="{{settings.proxy.password}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Ignored Addresses</b>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="settings-proxy-exclude" name="settings-proxy-exclude" value="{{settings.proxy.exclude}}">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<h4>UI</h4>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Page Size</b>
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<select class="selectpicker" id="settings-general-page_size" name="settings-general-page_size">
|
||||
<option value="-1">Unlimited</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="250">250</option>
|
||||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h4>Logging</h4>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Debug</b>
|
||||
</div>
|
||||
<div class="form-group col-sm-1">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="settings-general-debug" name="settings-general-debug">
|
||||
<span class="custom-control-label" for="settings-general-debug"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h4>Analytics</h4>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>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-analytics-enabled" name="settings-analytics-enabled">
|
||||
<span class="custom-control-label" for="settings-analytics-enabled"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h4>Updates</h4>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Branch</b>
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<select class="selectpicker" id="settings-general-branch" name="settings-general-branch">
|
||||
<option value="master">master</option>
|
||||
<option value="development">development</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Automatic</b>
|
||||
</div>
|
||||
<div class="form-group col-sm-1">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="settings-general-auto_update" name="settings-general-auto_update">
|
||||
<span class="custom-control-label" for="settings-general-auto_update"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-right">
|
||||
<b>Restart After Update</b>
|
||||
</div>
|
||||
<div class="form-group col-sm-1">
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="settings-general-update_restart" name="settings-general-update_restart">
|
||||
<span class="custom-control-label" for="settings-general-update_restart"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock body %}
|
||||
|
||||
{% block tail %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
})
|
||||
</script>
|
||||
{% endblock tail %}
|
@ -1,564 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script src="{{base_url}}static/jquery/jquery-latest.min.js"></script>
|
||||
<script src="{{base_url}}static/semantic/semantic.min.js"></script>
|
||||
<script src="{{base_url}}static/jquery/tablesort.js"></script>
|
||||
<script src="{{base_url}}static/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="{{base_url}}static/datatables/dataTables.semanticui.min.js"></script>
|
||||
<script src="{{base_url}}static/moment/moment.js"></script>
|
||||
<link rel="stylesheet" href="{{base_url}}static/semantic/semantic.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="{{base_url}}static/datatables/datatables.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="{{base_url}}static/datatables/semanticui.min.css"/>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="{{base_url}}static/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{base_url}}static/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{base_url}}static/favicon-16x16.png">
|
||||
<link rel="manifest" href="{{base_url}}static/manifest.json">
|
||||
<link rel="mask-icon" href="{{base_url}}static/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<link rel="shortcut icon" href="{{base_url}}static/favicon.ico">
|
||||
<meta name="msapplication-config" content="{{base_url}}static/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<title>System - Bazarr</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #272727;
|
||||
}
|
||||
#fondblanc {
|
||||
background-color: #ffffff;
|
||||
border-radius: 0;
|
||||
box-shadow: 0 0 5px 5px #ffffff;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 3em;
|
||||
padding: 1em;
|
||||
}
|
||||
.fast.backward, .backward, .forward, .fast.forward {
|
||||
cursor: pointer;
|
||||
}
|
||||
.fast.backward, .backward, .forward, .fast.forward { pointer-events: auto; }
|
||||
.fast.backward.disabled, .backward.disabled, .forward.disabled, .fast.forward.disabled { pointer-events: none; }
|
||||
.dataTables_filter{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#logs > tbody > tr { cursor: pointer; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id='loader' class="ui page dimmer">
|
||||
<div id='loader_text' class="ui indeterminate text loader">Loading...</div>
|
||||
</div>
|
||||
|
||||
<div id="fondblanc" class="ui container">
|
||||
<div class="ui basic icon buttons" style="float: right;">
|
||||
<div id="shutdown" class="ui icon button" data-tooltip="Shutdown" data-inverted=""><i class="red power off icon"></i></div>
|
||||
<div id="restart" class="ui icon button" data-tooltip="Restart" data-inverted=""><i class="redo alternate icon"></i></div>
|
||||
{% if settings.auth.type != "None" %}
|
||||
<div id="logout" class="ui icon button" data-tooltip="Logout" data-inverted=""><i class="sign-out icon"></i></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% set throttled_providers_count = settings.general.throtteled_providers|length %}
|
||||
<div class="ui top attached tabular menu">
|
||||
<a class="tabs item active" data-tab="tasks">Tasks</a>
|
||||
<a class="tabs item" data-tab="logs">Logs</a>
|
||||
<a class="tabs item" data-tab="providers">Providers
|
||||
{% if throttled_providers_count %}
|
||||
<div class="ui tiny yellow label">
|
||||
{{throttled_providers_count}}
|
||||
</div>
|
||||
{% endif %}
|
||||
</a>
|
||||
<a class="tabs item" data-tab="status">Status</a>
|
||||
<a class="tabs item" data-tab="releases">Releases</a>
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment active" data-tab="tasks">
|
||||
<div class="content">
|
||||
<table class="ui very basic selectable table" id="tasks">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Execution Frequency</th>
|
||||
<th>Next Execution</th>
|
||||
<th class="collapsing"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for task in task_list %}
|
||||
<tr id="{{task[3]}}">
|
||||
<td>{{task[0]}}</td>
|
||||
<td>{{task[1]}}</td>
|
||||
<td>{{task[2]}}</td>
|
||||
<td class="collapsing">
|
||||
<div class="execute ui inverted basic compact icon" data-tooltip="Execute {{task[0]}}" data-inverted="" data-taskid='{{task[3]}}'>
|
||||
<i class="ui black refresh icon"></i>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment" data-tab="logs">
|
||||
|
||||
<div class="ui two column grid container">
|
||||
<div class="row">
|
||||
<div class="left floatedcolumn">
|
||||
<div class="ui basic buttons">
|
||||
<button id="refresh_log" class="ui button"><i class="refresh icon"></i>Refresh Current Page</button>
|
||||
<button id="download_log" class="ui button"><i class="download icon"></i>Download Log File</button>
|
||||
<button id="empty_log" class="ui button"><i class="trash icon"></i>Empty Log</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right floated right aligned column">
|
||||
<div class="ui basic icon buttons">
|
||||
<button class="ui active button filter_log" id="all_log" data-level="ALL" data-tooltip="All"><i class="circle outline icon"></i></button>
|
||||
<button class="ui button filter_log" id="info_log" data-level="INFO" data-tooltip="Info"><i class="blue info circle icon"></i></button>
|
||||
<button class="ui button filter_log" id="warning_log" data-level="WARNING" data-tooltip="Warning"><i class="yellow warning circle icon"></i></button>
|
||||
<button class="ui button filter_log" id="error_log" data-level="ERROR" data-tooltip="Error"><i class="red bug icon"></i></button>
|
||||
<button class="ui button filter_log" id="debug_log" data-level="DEBUG" data-tooltip="Debug"><i class="black bug icon"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<table id="logs" class="display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="collapsing"></th>
|
||||
<th style="text-align: left;">Message:</th>
|
||||
<th class="collapsing" style="text-align: left;">Time:</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment" data-tab="providers">
|
||||
<div class="content">
|
||||
<table class="ui very basic table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Next retry</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for provider in throttled_providers %}
|
||||
<tr>
|
||||
<td>{{provider[0]}}</td>
|
||||
<td>{{provider[1] if provider[1] is not None else "Good"}}</td>
|
||||
<td>{{provider[2] if provider[2] != "now" else "-"}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment" data-tab="status">
|
||||
<div class="ui dividing header">About</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Bazarr Version:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
{{bazarr_version}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if settings.general.getboolean('use_sonarr') %}
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Sonarr Version:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
{{sonarr_version}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if settings.general.getboolean('use_radarr') %}
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Radarr Version:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
{{radarr_version}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Operating System:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
{{operating_system}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Python Version:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
{{python_version}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Bazarr Directory:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
{{bazarr_dir}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Bazarr Config Directory:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
{{config_dir}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui dividing header">More info</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Home Page:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<i class="paper plane icon"></i><a href="https://www.bazarr.media" target="_blank">Bazarr Website</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Source:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<i class="github icon"></i><a href="https://github.com/morpheus65535/bazarr" target="_blank">Bazarr on GitHub</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Wiki:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<i class="wikipedia w icon"></i><a href="https://github.com/morpheus65535/bazarr/wiki" target="_blank">Bazarr Wiki</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Discord:</label>
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
<div class='field'>
|
||||
<div class="ui fluid input">
|
||||
<i class="discord icon"></i><a href="https://discord.gg/MH2e2eb" target="_blank">Bazarr on Discord</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui bottom attached tab segment" data-tab="releases">
|
||||
{% for release in releases %}
|
||||
<h2 class="ui header">
|
||||
{% if release[0][1:] == bazarr_version %}
|
||||
{{release[0]}} <div class="ui green label">Current Version</div>
|
||||
{% else %}
|
||||
{{release[0]}}
|
||||
{% endif %}
|
||||
</h2>
|
||||
<div class="ui list">
|
||||
{% set release_lines = release[1].split('\r\n') %}
|
||||
{% for i, release_line in enumerate(release_lines) %}
|
||||
{% if i == 0 %}
|
||||
<div class="item">
|
||||
<div><h4>{{release_line}}</h4></div>
|
||||
<div class="list">
|
||||
{% else %}
|
||||
<div class="item">{{release_line}}</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal" class="ui small modal">
|
||||
<i class="close icon"></i>
|
||||
<div class="header">
|
||||
<div>Details</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
Message
|
||||
<div id='message' class="ui segment">
|
||||
<p></p>
|
||||
</div>
|
||||
Exception
|
||||
<div id='exception' class="ui segment">
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui cancel button" >Close</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include('footer.html') %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
<script>
|
||||
$('.modal')
|
||||
.modal({
|
||||
autofocus: false
|
||||
});
|
||||
|
||||
$('.menu .item')
|
||||
.tab();
|
||||
|
||||
$('#refresh_log').on('click', function(){
|
||||
table.ajax.reload();
|
||||
});
|
||||
|
||||
$('#download_log').on('click', function(){
|
||||
window.location = '{{base_url}}bazarr.log';
|
||||
});
|
||||
|
||||
$('#empty_log').on('click', function(){
|
||||
window.location = '{{base_url}}emptylog';
|
||||
});
|
||||
|
||||
$('.execute').on('click', function(){
|
||||
$(this).addClass('disabled');
|
||||
$(this).find('i:first').addClass('loading');
|
||||
$.ajax({
|
||||
url: '{{base_url}}execute/' + $(this).data("taskid")
|
||||
})
|
||||
});
|
||||
|
||||
$('a:not(.tabs), button:not(.cancel, #download_log, .filter_log, #refresh_log), #restart').on('click', function(){
|
||||
$('#loader').addClass('active');
|
||||
});
|
||||
|
||||
$('a[target="_blank"]').on('click', function(){
|
||||
$('#loader').removeClass('active');
|
||||
});
|
||||
|
||||
$('#shutdown').on('click', function(){
|
||||
$.ajax({
|
||||
url: "{{base_url}}shutdown",
|
||||
async: false
|
||||
})
|
||||
.always(function(){
|
||||
document.open();
|
||||
document.write('Bazarr has shutdown.');
|
||||
document.close();
|
||||
});
|
||||
});
|
||||
|
||||
$('#logout').on('click', function(){
|
||||
window.location = '{{base_url}}logout';
|
||||
});
|
||||
|
||||
$('#restart').on('click', function(){
|
||||
$('#loader_text').text("Bazarr is restarting, please wait...");
|
||||
$.ajax({
|
||||
url: "{{base_url}}restart",
|
||||
async: true,
|
||||
error: (function () {
|
||||
setTimeout(function () { setInterval(ping, 2000); }, 8000);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
{% set ip = settings.general.ip %}
|
||||
{% set port = args.port if args.port else settings.general.port %}
|
||||
{% set base_url = settings.general.base_url %}
|
||||
|
||||
if ("{{ip}}" === "0.0.0.0") {
|
||||
public_ip = window.location.hostname;
|
||||
} else {
|
||||
public_ip = "{{ip}}";
|
||||
}
|
||||
|
||||
protocol = window.location.protocol;
|
||||
|
||||
if (window.location.port === '{{current_port}}') {
|
||||
public_port = '{{port}}';
|
||||
} else {
|
||||
public_port = window.location.port;
|
||||
}
|
||||
|
||||
function ping() {
|
||||
$.ajax({
|
||||
url: protocol + '//' + public_ip + ':' + public_port + '{{base_url}}',
|
||||
success: function(result) {
|
||||
window.location.href= protocol + '//' + public_ip + ':' + public_port + '{{base_url}}';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var table = $('#logs').DataTable( {
|
||||
destroy: true,
|
||||
language: {
|
||||
loadingRecords: '<br><div class="ui active inverted dimmer" style="width: 95%;"><div class="ui centered inline loader"></div></div><br>',
|
||||
zeroRecords: 'No entries found in logs matching this log level.'
|
||||
},
|
||||
paging: true,
|
||||
lengthChange: false,
|
||||
pageLength: {{page_size}},
|
||||
searching: true,
|
||||
search: {
|
||||
regex: true
|
||||
},
|
||||
ordering: false,
|
||||
processing: false,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
url: '{{base_url}}logs',
|
||||
dataSrc: 'data'
|
||||
},
|
||||
drawCallback: function(settings) {
|
||||
$('.inline.dropdown').dropdown();
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
data: 1,
|
||||
render: function (data, type, row) {
|
||||
return $.trim(data);
|
||||
}
|
||||
},
|
||||
{ data: 1,
|
||||
render: function ( data, type, row ) {
|
||||
var icon;
|
||||
switch ($.trim(data)) {
|
||||
case 'INFO':
|
||||
icon = 'blue info circle icon';
|
||||
break;
|
||||
case 'WARNING':
|
||||
icon = 'yellow warning circle icon';
|
||||
break;
|
||||
case 'ERROR':
|
||||
icon = 'red bug icon';
|
||||
break;
|
||||
case 'DEBUG':
|
||||
icon = 'black bug icon';
|
||||
}
|
||||
return '<i class="' + icon + '"></i>';
|
||||
}
|
||||
},
|
||||
{ data: 3,
|
||||
render: function ( data, type, row ) {
|
||||
return $.trim(data);
|
||||
}
|
||||
},
|
||||
{ data: 0,
|
||||
render: function ( data, type, row ) {
|
||||
return '<div class="description" data-tooltip="' + $.trim(data) + '" data-inverted="" data-position="top left">' + moment($.trim(data), "DD/MM/YYYY hh:mm:ss").fromNow() + '</div>'
|
||||
}
|
||||
},
|
||||
{ data: 4,
|
||||
render: function ( data, type, row ) {
|
||||
return $.trim(data);
|
||||
}
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
"targets": [ 0 ],
|
||||
"visible": false,
|
||||
"searchable": true
|
||||
},
|
||||
{
|
||||
"targets": [ 4 ],
|
||||
"visible": false,
|
||||
"searchable": false
|
||||
}
|
||||
]
|
||||
} );
|
||||
|
||||
$('.filter_log').on( 'click', function () {
|
||||
$('.filter_log').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
if ( $(this).data('level') === 'INFO') {
|
||||
table.column( 0 ).search( 'INFO|WARNING|ERROR|DEBUG', true, false).draw();
|
||||
} else if ( $(this).data('level') === 'WARNING') {
|
||||
table.column( 0 ).search( 'WARNING|ERROR|DEBUG', true, false ).draw();
|
||||
} else if ( $(this).data('level') === 'ERROR') {
|
||||
table.column( 0 ).search( 'ERROR|DEBUG', true, false ).draw();
|
||||
} else if ( $(this).data('level') === 'DEBUG') {
|
||||
table.column( 0 ).search( 'DEBUG', true, false ).draw();
|
||||
} else if ( $(this).data('level') === 'ALL') {
|
||||
table.column(0).search('').draw();
|
||||
}
|
||||
} );
|
||||
|
||||
$('#logs').on('click', 'tr', function(event) {
|
||||
var data = table.row( this ).data();
|
||||
|
||||
$("#message").html(data[3]);
|
||||
let exception = data[4];
|
||||
exception = exception.replace(/'/g,"");
|
||||
exception = exception.replace(/\\n\s\s\s\s/g, "\\n  ");
|
||||
exception = exception.replace(/\\n\s\s/g, "\\n ");
|
||||
exception = exception.replace(/\\n/g, "<br />");
|
||||
$("#exception").html(exception);
|
||||
$('#modal').modal('show');
|
||||
});
|
||||
</script>
|
Loading…
Reference in new issue