mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Send Use SSL and Remote Server checkbox values when disabled
This commit is contained in:
parent
f77bd6c17b
commit
78034b82a9
4 changed files with 93 additions and 50 deletions
|
@ -103,7 +103,7 @@ div.form-control .selectize-input {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.selectize-dropdown.form-control.selectize-pms-ip {
|
#selectize-pms-ip-container .selectize-dropdown.form-control.selectize-pms-ip {
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
.wizard-input-section .selectize-control.form-control.selectize-pms-ip .selectize-dropdown .selectize-dropdown-content {
|
.wizard-input-section .selectize-control.form-control.selectize-pms-ip .selectize-dropdown .selectize-dropdown-content {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import plexpy
|
import plexpy
|
||||||
from plexpy import common, notifiers
|
from plexpy import common, notifiers
|
||||||
from plexpy.helpers import anon_url
|
from plexpy.helpers import anon_url, checked
|
||||||
|
|
||||||
available_notification_agents = sorted(notifiers.available_notification_agents(), key=lambda k: k['label'])
|
available_notification_agents = sorted(notifiers.available_notification_agents(), key=lambda k: k['label'])
|
||||||
%>
|
%>
|
||||||
|
@ -650,13 +650,15 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="pms_is_remote" name="pms_is_remote" value="1" ${config['pms_is_remote']}> Remote Server
|
<input type="checkbox" id="pms_is_remote_checkbox" class="checkbox-toggle" data-id="pms_is_remote" value="1" ${checked(config['pms_is_remote'])}> Remote Server
|
||||||
|
<input type="hidden" id="pms_is_remote" name="pms_is_remote" value="${config['pms_is_remote']}">
|
||||||
</label>
|
</label>
|
||||||
<p class="help-block">Check this if your Plex Server is not on the same local network as Tautulli.</p>
|
<p class="help-block">Check this if your Plex Server is not on the same local network as Tautulli.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="pms_ssl" name="pms_ssl" value="1" ${config['pms_ssl']}> Use SSL
|
<input type="checkbox" id="pms_ssl_checkbox" class="checkbox-toggle" data-id="pms_ssl" value="1" ${checked(config['pms_ssl'])}> Use SSL
|
||||||
|
<input type="hidden" id="pms_ssl" name="pms_ssl" value="${config['pms_ssl']}">
|
||||||
</label>
|
</label>
|
||||||
<p class="help-block">If you have secure connections enabled on your Plex Server, communicate with it securely.</p>
|
<p class="help-block">If you have secure connections enabled on your Plex Server, communicate with it securely.</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1586,7 +1588,7 @@ $(document).ready(function() {
|
||||||
if (serverChanged || authChanged || httpChanged || directoryChanged) {
|
if (serverChanged || authChanged || httpChanged || directoryChanged) {
|
||||||
$('#restart-modal').modal('show');
|
$('#restart-modal').modal('show');
|
||||||
}
|
}
|
||||||
$("#http_hashed_password").val($("#http_hash_password").is(":checked") ? 1 : 0)
|
$("#http_hashed_password").val($("#http_hash_password").is(":checked") ? 1 : 0);
|
||||||
getConfigurationTable();
|
getConfigurationTable();
|
||||||
getSchedulerTable();
|
getSchedulerTable();
|
||||||
getNotifiersTable();
|
getNotifiersTable();
|
||||||
|
@ -1772,6 +1774,15 @@ $(document).ready(function() {
|
||||||
verifyServer();
|
verifyServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.checkbox-toggle').click(function () {
|
||||||
|
var configToggle = $(this).data('id');
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('#'+configToggle).val(1);
|
||||||
|
} else {
|
||||||
|
$('#'+configToggle).val(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var $select_pms = $('#pms_ip').selectize({
|
var $select_pms = $('#pms_ip').selectize({
|
||||||
createOnBlur: true,
|
createOnBlur: true,
|
||||||
openOnFocus: true,
|
openOnFocus: true,
|
||||||
|
@ -1823,10 +1834,12 @@ $(document).ready(function() {
|
||||||
var is_cloud = $(pms_ip_selected).data('is_cloud');
|
var is_cloud = $(pms_ip_selected).data('is_cloud');
|
||||||
|
|
||||||
$("#pms_identifier").val(identifier !== 'undefined' ? identifier : '');
|
$("#pms_identifier").val(identifier !== 'undefined' ? identifier : '');
|
||||||
$('#pms_port').val((port !== 'undefined' ? port : 32400));
|
$('#pms_port').val(port !== 'undefined' ? port : 32400);
|
||||||
$('#pms_is_remote').prop('checked', (local !== 'undefined' && local === 0));
|
$('#pms_is_remote_checkbox').prop('checked', (local !== 'undefined' && local === 0));
|
||||||
$('#pms_ssl').prop('checked', (ssl !== 'undefined' && ssl === 1));
|
$('#pms_is_remote').val(local !== 'undefined' && local === 0 ? 1 : 0);
|
||||||
$('#pms_is_cloud').val((is_cloud !== 'undefined' && is_cloud === true ? 1 : 0));
|
$('#pms_ssl_checkbox').prop('checked', (ssl !== 'undefined' && ssl === 1));
|
||||||
|
$('#pms_ssl').val(ssl !== 'undefined' && ssl === 1 ? 1 : 0);
|
||||||
|
$('#pms_is_cloud').val(is_cloud !== 'undefined' && is_cloud === true ? 1 : 0);
|
||||||
$('#pms_url_manual').prop('checked', false);
|
$('#pms_url_manual').prop('checked', false);
|
||||||
PMSCloudCheck();
|
PMSCloudCheck();
|
||||||
}
|
}
|
||||||
|
@ -1858,8 +1871,10 @@ $(document).ready(function() {
|
||||||
function PMSCloudCheck () {
|
function PMSCloudCheck () {
|
||||||
if ($('#pms_is_cloud').val() === "1") {
|
if ($('#pms_is_cloud').val() === "1") {
|
||||||
$('#pms_port').val(443).prop('readonly', true);
|
$('#pms_port').val(443).prop('readonly', true);
|
||||||
$('#pms_is_remote').prop('checked', true).prop('disabled', true);
|
$('#pms_is_remote_checkbox').prop('checked', true).prop('disabled', true);
|
||||||
$('#pms_ssl').prop('checked', true).prop('disabled', true);
|
$('#pms_is_remote').val(1);
|
||||||
|
$('#pms_ssl_checkbox').prop('checked', true).prop('disabled', true);
|
||||||
|
$('#pms_ssl').val(1);
|
||||||
$('#pms_url_manual').prop('checked', false).prop('disabled', true);
|
$('#pms_url_manual').prop('checked', false).prop('disabled', true);
|
||||||
$('#monitor_pms_updates').prop('checked', false).prop('disabled', true);
|
$('#monitor_pms_updates').prop('checked', false).prop('disabled', true);
|
||||||
$('#pms_update_options').hide();
|
$('#pms_update_options').hide();
|
||||||
|
@ -1867,18 +1882,18 @@ $(document).ready(function() {
|
||||||
$('#cloudManualConnection').show();
|
$('#cloudManualConnection').show();
|
||||||
$('#cloudMonitorUpdates').show();
|
$('#cloudMonitorUpdates').show();
|
||||||
$('#cloudMonitorRemoteAccess').show();
|
$('#cloudMonitorRemoteAccess').show();
|
||||||
$('#remoteAccessCheck').hide();
|
|
||||||
} else {
|
} else {
|
||||||
$('#pms_port').prop('readonly', false);
|
$('#pms_port').prop('readonly', false);
|
||||||
$('#pms_is_remote').prop('disabled', false);
|
$('#pms_is_remote_checkbox').prop('disabled', false);
|
||||||
$('#pms_ssl').prop('disabled', false);
|
$('#pms_is_remote').val($('#pms_is_remote_checkbox').is(':checked') ? 1 : 0);
|
||||||
|
$('#pms_ssl_checkbox').prop('disabled', false);
|
||||||
|
$('#pms_ssl').val($('#pms_ssl_checkbox').is(':checked') ? 1 : 0);
|
||||||
$('#pms_url_manual').prop('disabled', false);
|
$('#pms_url_manual').prop('disabled', false);
|
||||||
$('#monitor_pms_updates').prop('disabled', false);
|
$('#monitor_pms_updates').prop('disabled', false);
|
||||||
$('#monitor_remote_access').prop('disabled', false);
|
$('#monitor_remote_access').prop('disabled', false);
|
||||||
$('#cloudManualConnection').hide();
|
$('#cloudManualConnection').hide();
|
||||||
$('#cloudMonitorUpdates').hide();
|
$('#cloudMonitorUpdates').hide();
|
||||||
$('#cloudMonitorRemoteAccess').hide();
|
$('#cloudMonitorRemoteAccess').hide();
|
||||||
remoteAccessEnabledCheck();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PMSCloudCheck();
|
PMSCloudCheck();
|
||||||
|
@ -1887,8 +1902,8 @@ $(document).ready(function() {
|
||||||
var pms_ip = $("#pms_ip").val();
|
var pms_ip = $("#pms_ip").val();
|
||||||
var pms_port = $("#pms_port").val();
|
var pms_port = $("#pms_port").val();
|
||||||
var pms_identifier = $("#pms_identifier").val();
|
var pms_identifier = $("#pms_identifier").val();
|
||||||
var pms_ssl = $("#pms_ssl").is(':checked') ? 1 : 0;
|
var pms_ssl = $("#pms_ssl").val();
|
||||||
var pms_is_remote = $("#pms_is_remote").is(':checked') ? 1 : 0;
|
var pms_is_remote = $("#pms_is_remote").val();
|
||||||
|
|
||||||
if (($("#pms_ip").val() !== '') || ($("#pms_port").val() !== '')) {
|
if (($("#pms_ip").val() !== '') || ($("#pms_port").val() !== '')) {
|
||||||
$("#pms_verify").html('<i class="fa fa-refresh fa-spin"></i>').fadeIn('fast');
|
$("#pms_verify").html('<i class="fa fa-refresh fa-spin"></i>').fadeIn('fast');
|
||||||
|
@ -2008,8 +2023,7 @@ $(document).ready(function() {
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data !== 'true') {
|
if (data !== 'true') {
|
||||||
$("#remoteAccessCheck").html("Remote access must be enabled on your Plex Server. <a target='_blank' href='${anon_url('https://support.plex.tv/hc/en-us/articles/200484543-Enabling-Remote-Access-for-a-Server')}'>Click here</a> for help.");
|
$("#remoteAccessCheck").html("Remote access must be enabled on your Plex Server. <a target='_blank' href='${anon_url('https://support.plex.tv/hc/en-us/articles/200484543-Enabling-Remote-Access-for-a-Server')}'>Click here</a> for help.");
|
||||||
$("#monitor_remote_access").attr("disabled", true);
|
$("#monitor_remote_access").attr("checked", false).attr("disabled", true);
|
||||||
$("#monitor_remote_access").attr("checked", false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -2024,11 +2038,11 @@ $(document).ready(function() {
|
||||||
home_sections.push(sec.value);
|
home_sections.push(sec.value);
|
||||||
});
|
});
|
||||||
$('#home_sections').val(home_sections);
|
$('#home_sections').val(home_sections);
|
||||||
};
|
}
|
||||||
|
|
||||||
var sec_cards = ${config['home_sections'] | n};
|
var sec_cards = ${config['home_sections'] | n};
|
||||||
sec_cards.reverse().forEach(function (item) {
|
sec_cards.reverse().forEach(function (item) {
|
||||||
$('#hsec-' + item).prop('checked', !$(this).prop('checked'))
|
$('#hsec-' + item).prop('checked', !$(this).prop('checked'));
|
||||||
$('#hsec-' + item).closest('li.card').prependTo('#sortable_home_sections');
|
$('#hsec-' + item).closest('li.card').prependTo('#sortable_home_sections');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2050,11 +2064,11 @@ $(document).ready(function() {
|
||||||
home_stats_cards.push(card.value);
|
home_stats_cards.push(card.value);
|
||||||
});
|
});
|
||||||
$('#home_stats_cards').val(home_stats_cards);
|
$('#home_stats_cards').val(home_stats_cards);
|
||||||
};
|
}
|
||||||
|
|
||||||
var config_cards = ${config['home_stats_cards'] | n};
|
var config_cards = ${config['home_stats_cards'] | n};
|
||||||
config_cards.reverse().forEach(function (item) {
|
config_cards.reverse().forEach(function (item) {
|
||||||
$('#hscard-' + item).prop('checked', !$(this).prop('checked'))
|
$('#hscard-' + item).prop('checked', !$(this).prop('checked'));
|
||||||
$('#hscard-' + item).closest('li.card').prependTo('#sortable_home_stats_cards');
|
$('#hscard-' + item).closest('li.card').prependTo('#sortable_home_stats_cards');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2076,7 +2090,7 @@ $(document).ready(function() {
|
||||||
home_library_cards.push(card.value);
|
home_library_cards.push(card.value);
|
||||||
});
|
});
|
||||||
$('#home_library_cards').val(home_library_cards);
|
$('#home_library_cards').val(home_library_cards);
|
||||||
};
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'get_library_sections',
|
url: 'get_library_sections',
|
||||||
|
@ -2115,12 +2129,10 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function allowPlexAdminCheck () {
|
function allowPlexAdminCheck () {
|
||||||
if ($("#http_basic_auth").is(":checked")) {
|
if ($("#http_basic_auth").is(":checked")) {
|
||||||
$("#http_plex_admin").attr("disabled", true);
|
$("#http_plex_admin").attr("checked", false).attr("disabled", true);
|
||||||
$("#http_plex_admin").attr("checked", false);
|
|
||||||
$("#allowPlexCheck").html("Plex admin login cannot be enabled with basic authentication.");
|
$("#allowPlexCheck").html("Plex admin login cannot be enabled with basic authentication.");
|
||||||
} else if ($('#http_username').val() == '' || $('#http_password').val() == '') {
|
} else if ($('#http_username').val() == '' || $('#http_password').val() == '') {
|
||||||
$("#http_plex_admin").attr("disabled", true);
|
$("#http_plex_admin").attr("checked", false).attr("disabled", true);
|
||||||
$("#http_plex_admin").attr("checked", false);
|
|
||||||
$("#allowPlexCheck").html("You must set an admin username and password above to allow Plex admin login.");
|
$("#allowPlexCheck").html("You must set an admin username and password above to allow Plex admin login.");
|
||||||
} else {
|
} else {
|
||||||
$("#http_plex_admin").attr("disabled", false);
|
$("#http_plex_admin").attr("disabled", false);
|
||||||
|
@ -2135,12 +2147,10 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function allowGuestAccessCheck () {
|
function allowGuestAccessCheck () {
|
||||||
if ($("#http_basic_auth").is(":checked")) {
|
if ($("#http_basic_auth").is(":checked")) {
|
||||||
$("#allow_guest_access").attr("disabled", true);
|
$("#allow_guest_access").attr("checked", false).attr("disabled", true);
|
||||||
$("#allow_guest_access").attr("checked", false);
|
|
||||||
$("#allowGuestCheck").html("Guest access cannot be enabled with basic authentication.");
|
$("#allowGuestCheck").html("Guest access cannot be enabled with basic authentication.");
|
||||||
} else if ($('#http_username').val() == '' || $('#http_password').val() == '') {
|
} else if ($('#http_username').val() == '' || $('#http_password').val() == '') {
|
||||||
$("#allow_guest_access").attr("disabled", true);
|
$("#allow_guest_access").attr("checked", false).attr("disabled", true);
|
||||||
$("#allow_guest_access").attr("checked", false);
|
|
||||||
$("#allowGuestCheck").html("You must set an admin username and password above to allow guest access.");
|
$("#allowGuestCheck").html("You must set an admin username and password above to allow guest access.");
|
||||||
} else {
|
} else {
|
||||||
$("#allow_guest_access").attr("disabled", false);
|
$("#allow_guest_access").attr("disabled", false);
|
||||||
|
@ -2155,8 +2165,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function hashPasswordCheck () {
|
function hashPasswordCheck () {
|
||||||
if ($("#http_basic_auth").is(":checked")) {
|
if ($("#http_basic_auth").is(":checked")) {
|
||||||
$("#http_hash_password").attr("checked", false);
|
$("#http_hash_password").attr("checked", false).attr("disabled", true);
|
||||||
$("#http_hash_password").attr("disabled", true);
|
|
||||||
$("#hashPasswordCheck").html("Password cannot be hashed with basic authentication.");
|
$("#hashPasswordCheck").html("Password cannot be hashed with basic authentication.");
|
||||||
} else {
|
} else {
|
||||||
$("#http_hash_password").attr("disabled", false);
|
$("#http_hash_password").attr("disabled", false);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<%
|
<%
|
||||||
import plexpy
|
import plexpy
|
||||||
from plexpy import common
|
from plexpy import common, helpers
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
@ -109,20 +109,23 @@
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="pms_ssl" name="pms_ssl" value="1" ${config['pms_ssl']}> Use SSL
|
<input type="checkbox" id="pms_ssl_checkbox" class="checkbox-toggle" data-id="pms_ssl" value="1" ${helpers.checked(config['pms_ssl'])}> Use SSL
|
||||||
|
<input type="hidden" id="pms_ssl" name="pms_ssl" value="${config['pms_ssl']}">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="pms_is_remote" name="pms_is_remote" value="1" ${config['pms_is_remote']}> Remote Server
|
<input type="checkbox" id="pms_is_remote_checkbox" class="checkbox-toggle" data-id="pms_is_remote" value="1" ${helpers.checked(config['pms_is_remote'])}> Remote Server
|
||||||
|
<input type="hidden" id="pms_is_remote" name="pms_is_remote" value="${config['pms_is_remote']}">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" class="form-control pms-settings" id="pms_valid" data-validate="validatePMSip" value="">
|
<input type="hidden" class="form-control pms-settings" id="pms_valid" data-validate="validatePMSip" value="">
|
||||||
|
<input type="hidden" id="pms_is_cloud" name="pms_is_cloud" value="${config['pms_is_cloud']}">
|
||||||
<input type="hidden" class="form-control pms-settings" id="pms_identifier" name="pms_identifier" value="${config['pms_identifier']}">
|
<input type="hidden" class="form-control pms-settings" id="pms_identifier" name="pms_identifier" value="${config['pms_identifier']}">
|
||||||
<a class="btn btn-dark" id="verify-plex-server" href="#" role="button">Verify</a><span style="margin-left: 10px; display: none;" id="pms-verify-status"></span>
|
<a class="btn btn-dark" id="verify-plex-server" href="#" role="button">Verify</a><span style="margin-left: 10px; display: none;" id="pms-verify-status"></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -286,6 +289,15 @@ $(document).ready(function() {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.checkbox-toggle').click(function () {
|
||||||
|
var configToggle = $(this).data('id');
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('#'+configToggle).val(1);
|
||||||
|
} else {
|
||||||
|
$('#'+configToggle).val(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var $select_pms = $('#pms_ip').selectize({
|
var $select_pms = $('#pms_ip').selectize({
|
||||||
createOnBlur: true,
|
createOnBlur: true,
|
||||||
openOnFocus: true,
|
openOnFocus: true,
|
||||||
|
@ -303,6 +315,7 @@ $(document).ready(function() {
|
||||||
'" data-identifier="' + item.clientIdentifier +
|
'" data-identifier="' + item.clientIdentifier +
|
||||||
'" data-ip="' + item.ip +
|
'" data-ip="' + item.ip +
|
||||||
'" data-port="' + item.port +
|
'" data-port="' + item.port +
|
||||||
|
'" data-is_cloud="' + item.is_cloud +
|
||||||
'" data-label="' + item.label + '">' +
|
'" data-label="' + item.label + '">' +
|
||||||
'<span class="item-text">' + escape(label) + '</span>' +
|
'<span class="item-text">' + escape(label) + '</span>' +
|
||||||
(caption ? '<span class="item-value">' + escape(caption) + '</span>' : '') +
|
(caption ? '<span class="item-value">' + escape(caption) + '</span>' : '') +
|
||||||
|
@ -316,6 +329,7 @@ $(document).ready(function() {
|
||||||
'" data-identifier="' + item.clientIdentifier +
|
'" data-identifier="' + item.clientIdentifier +
|
||||||
'" data-ip="' + item.ip +
|
'" data-ip="' + item.ip +
|
||||||
'" data-port="' + item.port +
|
'" data-port="' + item.port +
|
||||||
|
'" data-is_cloud="' + item.is_cloud +
|
||||||
'" data-label="' + item.label + '">' +
|
'" data-label="' + item.label + '">' +
|
||||||
escape(label) +
|
escape(label) +
|
||||||
(caption ? '<span class="caption">' + escape(caption) + '</span>' : '') +
|
(caption ? '<span class="caption">' + escape(caption) + '</span>' : '') +
|
||||||
|
@ -331,14 +345,28 @@ $(document).ready(function() {
|
||||||
var port = $(pms_ip_selected).data('port');
|
var port = $(pms_ip_selected).data('port');
|
||||||
var local = $(pms_ip_selected).data('local');
|
var local = $(pms_ip_selected).data('local');
|
||||||
var ssl = $(pms_ip_selected).data('ssl');
|
var ssl = $(pms_ip_selected).data('ssl');
|
||||||
|
var is_cloud = $(pms_ip_selected).data('is_cloud');
|
||||||
|
|
||||||
$("#pms_valid").val((identifier !== 'undefined' ? 'valid' : ''));
|
$("#pms_valid").val(identifier !== 'undefined' ? 'valid' : '');
|
||||||
$("#pms-verify-status").html((identifier !== 'undefined' ? '<i class="fa fa-check"></i> Server found!' : '')).fadeIn('fast');
|
$("#pms-verify-status").html(identifier !== 'undefined' ? '<i class="fa fa-check"></i> Server found!' : '').fadeIn('fast');
|
||||||
|
|
||||||
$("#pms_identifier").val(identifier !== 'undefined' ? identifier : '');
|
$("#pms_identifier").val(identifier !== 'undefined' ? identifier : '');
|
||||||
$('#pms_port').val((port !== 'undefined' ? port : 32400));
|
$('#pms_port').val(port !== 'undefined' ? port : 32400);
|
||||||
$('#pms_is_remote').prop('checked', (local !== 'undefined' && local === 0));
|
$('#pms_is_remote_checkbox').prop('checked', (local !== 'undefined' && local === 0));
|
||||||
$('#pms_ssl').prop('checked', (ssl !== 'undefined' && ssl === 1));
|
$('#pms_is_remote').val(local !== 'undefined' && local === 0 ? 1 : 0);
|
||||||
|
$('#pms_ssl_checkbox').prop('checked', (ssl !== 'undefined' && ssl === 1));
|
||||||
|
$('#pms_ssl').val(ssl !== 'undefined' && ssl === 1 ? 1 : 0);
|
||||||
|
$('#pms_is_cloud').val(is_cloud !== 'undefined' && is_cloud === true ? 1 : 0);
|
||||||
|
|
||||||
|
if (is_cloud === true) {
|
||||||
|
$('#pms_port').prop('readonly', true);
|
||||||
|
$('#pms_is_remote_checkbox').prop('disabled', true);
|
||||||
|
$('#pms_ssl_checkbox').prop('disabled', true);
|
||||||
|
} else {
|
||||||
|
$('#pms_port').prop('readonly', false);
|
||||||
|
$('#pms_is_remote_checkbox').prop('disabled', false);
|
||||||
|
$('#pms_ssl_checkbox').prop('disabled', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var select_pms = $select_pms[0].selectize;
|
var select_pms = $select_pms[0].selectize;
|
||||||
|
@ -372,14 +400,19 @@ $(document).ready(function() {
|
||||||
var pms_ip = $("#pms_ip").val().trim();
|
var pms_ip = $("#pms_ip").val().trim();
|
||||||
var pms_port = $("#pms_port").val().trim();
|
var pms_port = $("#pms_port").val().trim();
|
||||||
var pms_identifier = $("#pms_identifier").val();
|
var pms_identifier = $("#pms_identifier").val();
|
||||||
var pms_ssl = $("#pms_ssl").is(':checked') ? 1 : 0;
|
var pms_ssl = $("#pms_ssl").val();
|
||||||
var pms_is_remote = $("#pms_is_remote").is(':checked') ? 1 : 0;
|
var pms_is_remote = $("#pms_is_remote").val();
|
||||||
if ((pms_ip !== '') || (pms_port !== '')) {
|
if ((pms_ip !== '') || (pms_port !== '')) {
|
||||||
$("#pms-verify-status").html('<i class="fa fa-refresh fa-spin"></i> Validating server...');
|
$("#pms-verify-status").html('<i class="fa fa-refresh fa-spin"></i> Validating server...');
|
||||||
$('#pms-verify-status').fadeIn('fast');
|
$('#pms-verify-status').fadeIn('fast');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'get_server_id',
|
url: 'get_server_id',
|
||||||
data: { hostname: pms_ip, port: pms_port, identifier: pms_identifier, ssl: pms_ssl, remote: pms_is_remote },
|
data: {
|
||||||
|
hostname: pms_ip,
|
||||||
|
port: pms_port,
|
||||||
|
identifier: pms_identifier,
|
||||||
|
ssl: pms_ssl,
|
||||||
|
remote: pms_is_remote },
|
||||||
cache: true,
|
cache: true,
|
||||||
async: true,
|
async: true,
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
|
|
|
@ -98,10 +98,11 @@ class WebInterface(object):
|
||||||
config = {
|
config = {
|
||||||
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER,
|
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER,
|
||||||
"pms_ip": plexpy.CONFIG.PMS_IP,
|
"pms_ip": plexpy.CONFIG.PMS_IP,
|
||||||
"pms_is_remote": checked(plexpy.CONFIG.PMS_IS_REMOTE),
|
|
||||||
"pms_port": plexpy.CONFIG.PMS_PORT,
|
"pms_port": plexpy.CONFIG.PMS_PORT,
|
||||||
|
"pms_is_remote": plexpy.CONFIG.PMS_IS_REMOTE,
|
||||||
|
"pms_ssl": plexpy.CONFIG.PMS_SSL,
|
||||||
|
"pms_is_cloud": plexpy.CONFIG.PMS_IS_CLOUD,
|
||||||
"pms_token": plexpy.CONFIG.PMS_TOKEN,
|
"pms_token": plexpy.CONFIG.PMS_TOKEN,
|
||||||
"pms_ssl": checked(plexpy.CONFIG.PMS_SSL),
|
|
||||||
"pms_uuid": plexpy.CONFIG.PMS_UUID,
|
"pms_uuid": plexpy.CONFIG.PMS_UUID,
|
||||||
"logging_ignore_interval": plexpy.CONFIG.LOGGING_IGNORE_INTERVAL
|
"logging_ignore_interval": plexpy.CONFIG.LOGGING_IGNORE_INTERVAL
|
||||||
}
|
}
|
||||||
|
@ -2562,8 +2563,8 @@ class WebInterface(object):
|
||||||
"pms_logs_folder": plexpy.CONFIG.PMS_LOGS_FOLDER,
|
"pms_logs_folder": plexpy.CONFIG.PMS_LOGS_FOLDER,
|
||||||
"pms_port": plexpy.CONFIG.PMS_PORT,
|
"pms_port": plexpy.CONFIG.PMS_PORT,
|
||||||
"pms_token": plexpy.CONFIG.PMS_TOKEN,
|
"pms_token": plexpy.CONFIG.PMS_TOKEN,
|
||||||
"pms_ssl": checked(plexpy.CONFIG.PMS_SSL),
|
"pms_ssl": plexpy.CONFIG.PMS_SSL,
|
||||||
"pms_is_remote": checked(plexpy.CONFIG.PMS_IS_REMOTE),
|
"pms_is_remote": plexpy.CONFIG.PMS_IS_REMOTE,
|
||||||
"pms_is_cloud": plexpy.CONFIG.PMS_IS_CLOUD,
|
"pms_is_cloud": plexpy.CONFIG.PMS_IS_CLOUD,
|
||||||
"pms_url_manual": checked(plexpy.CONFIG.PMS_URL_MANUAL),
|
"pms_url_manual": checked(plexpy.CONFIG.PMS_URL_MANUAL),
|
||||||
"pms_uuid": plexpy.CONFIG.PMS_UUID,
|
"pms_uuid": plexpy.CONFIG.PMS_UUID,
|
||||||
|
@ -2623,7 +2624,7 @@ class WebInterface(object):
|
||||||
checked_configs = [
|
checked_configs = [
|
||||||
"launch_browser", "enable_https", "https_create_cert", "api_enabled", "freeze_db", "check_github",
|
"launch_browser", "enable_https", "https_create_cert", "api_enabled", "freeze_db", "check_github",
|
||||||
"grouping_global_history", "grouping_user_history", "grouping_charts", "group_history_tables",
|
"grouping_global_history", "grouping_user_history", "grouping_charts", "group_history_tables",
|
||||||
"pms_ssl", "pms_is_remote", "pms_url_manual", "week_start_monday",
|
"pms_url_manual", "week_start_monday",
|
||||||
"refresh_libraries_on_startup", "refresh_users_on_startup",
|
"refresh_libraries_on_startup", "refresh_users_on_startup",
|
||||||
"notify_consecutive", "notify_upload_posters", "notify_recently_added_upgrade",
|
"notify_consecutive", "notify_upload_posters", "notify_recently_added_upgrade",
|
||||||
"notify_group_recently_added_grandparent", "notify_group_recently_added_parent",
|
"notify_group_recently_added_grandparent", "notify_group_recently_added_parent",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue