diff --git a/data/interfaces/default/css/tautulli.css b/data/interfaces/default/css/tautulli.css index fb73e05c..9ef64595 100644 --- a/data/interfaces/default/css/tautulli.css +++ b/data/interfaces/default/css/tautulli.css @@ -3223,7 +3223,7 @@ div.dataTables_info { #libraries-to-purge > li { color: #e9a049; } -#updatebar { +#updatebar, #token_error_bar { background-color: #444; opacity: 0.95; color: #999999; @@ -3238,32 +3238,35 @@ div.dataTables_info { z-index: 9999; display: block; } -#updatebar .msg { +#updatebar .msg, #token_error_bar .msg { line-height: normal; padding-left: 20px; } -#updatebar .loader { +#updatebar .loader, #token_error_bar .loader { position: relative; top: 2px; } -#updatebar.success { +#updatebar.success, #token_error_bar.success { padding: 15px 10px; text-align: left; } -#updatebar.error { +#updatebar.error, #token_error_bar.error { padding: 15px 10px; text-align: left; } -#updatebar .ui-icon { +#updatebar .ui-icon, #token_error_bar .ui-icon { display: inline-block; margin-left: -20px; top: 2px; position: relative; margin-right: 3px; } -#updatebar a:hover { +#updatebar a:hover, #token_error_bar a:hover { color: #e9a049; } +#token_error_bar { + background-color: rgba(255,0,0,0.5) !important; +} .body-container { position: absolute; top: 50px; diff --git a/data/interfaces/default/js/script.js b/data/interfaces/default/js/script.js index b72fffb2..7d7f9c18 100644 --- a/data/interfaces/default/js/script.js +++ b/data/interfaces/default/js/script.js @@ -71,8 +71,9 @@ function refreshTab() { function showMsg(msg, loader, timeout, ms, error) { var feedback = $("#ajaxMsg"); var update = $("#updatebar"); - if (update.is(":visible")) { - var height = update.height() + 35; + var token_error = $("#token_error_bar"); + if (update.is(":visible") || token_error.is(":visible")) { + var height = (update.is(":visible") ? update.height() : 0) + (token_error.is(":visible") ? token_error.height() : 0) + 35; feedback.css("bottom", height + "px"); } else { feedback.removeAttr("style"); @@ -131,8 +132,9 @@ function doAjaxCall(url, elem, reload, form, showMsg, callback) { // Set Message var feedback = (showMsg) ? $("#ajaxMsg") : $(); var update = $("#updatebar"); - if (update.is(":visible")) { - var height = update.height() + 35; + var token_error = $("#token_error_bar"); + if (update.is(":visible") || token_error.is(":visible")) { + var height = (update.is(":visible") ? update.height() : 0) + (token_error.is(":visible") ? token_error.height() : 0) + 35; feedback.css("bottom", height + "px"); } else { feedback.removeAttr("style"); diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 5a68d29c..dc27c31c 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1558,6 +1558,10 @@ +
%def> <%def name="modalIncludes()"> @@ -2648,12 +2652,28 @@ $(document).ready(function() { window.open(pms_web_url, '_blank'); }); + $.ajax({ + url: "https://plex.tv/api/resources", + type: 'GET', + dataType: 'json', + beforeSend: function (xhr) { + xhr.setRequestHeader('X-Plex-Token', $('#pms_token').val()); + }, + statusCode: { + 401: function (xhr, status) { + $("#updatebar").hide(); + $("#token_error_bar").show(); + } + } + }); + function OAuthPreFunction() { $("#token_verify").html('').fadeIn('fast'); } function OAuthSuccessCallback(authToken) { $("#pms_token").val(authToken); $("#token_verify").html('').fadeIn('fast'); + $('#token_error_bar').hide(); getServerOptions(authToken); } function OAuthErrorCallback() {