Automatically show HTTP root in Public Tautulli Domain input box

This commit is contained in:
JonnyWong16 2020-10-04 14:15:06 -07:00
commit 322c090d8a
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -2001,6 +2001,7 @@ Rating: {rating}/10 --> Rating: /10
<script src="${http_root}js/parsley.min.js"></script> <script src="${http_root}js/parsley.min.js"></script>
<script src="${http_root}js/Sortable.min.js"></script> <script src="${http_root}js/Sortable.min.js"></script>
<script src="${http_root}js/moment-with-locale.js"></script> <script src="${http_root}js/moment-with-locale.js"></script>
<script src="${http_root}js/jquery.inputaffix.min.js"></script>
<script src="${http_root}js/jquery.qrcode.min.js"></script> <script src="${http_root}js/jquery.qrcode.min.js"></script>
<script> <script>
function getConfigurationTable() { function getConfigurationTable() {
@ -2179,6 +2180,7 @@ $(document).ready(function() {
function preSaveChecks(_callback) { function preSaveChecks(_callback) {
verifyPMSWebURL(); verifyPMSWebURL();
setBaseURLSuffix(true);
if (serverChanged) { if (serverChanged) {
verifyServer(_callback); verifyServer(_callback);
} else if (typeof _callback === "function") { } else if (typeof _callback === "function") {
@ -2198,6 +2200,7 @@ $(document).ready(function() {
getNewslettersTable(); getNewslettersTable();
getMobileDevicesTable(); getMobileDevicesTable();
loadUpdateDistros(); loadUpdateDistros();
setBaseURLSuffix();
settingsChanged = false; settingsChanged = false;
} }
@ -2913,6 +2916,19 @@ $(document).ready(function() {
$(this).val($(this).val().replace(/\/*$/, '')); $(this).val($(this).val().replace(/\/*$/, ''));
}); });
$('#http_root').change(function() {
setBaseURLSuffix();
});
function setBaseURLSuffix(clear) {
if (clear){
$('#http_base_url').suffix("");
} else {
$('#http_base_url').suffix($('#http_root').val());
}
}
setBaseURLSuffix();
function apiEnabled() { function apiEnabled() {
var api_enabled = $('#api_enabled').prop('checked'); var api_enabled = $('#api_enabled').prop('checked');
$('#app_api_msg').toggle(!(api_enabled)); $('#app_api_msg').toggle(!(api_enabled));