From 770f12b632e15d9414893e1824ffafae36c68315 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 20 Jan 2018 14:03:23 -0800 Subject: [PATCH 1/4] Hide advanced settings --- data/interfaces/default/css/plexpy.css | 12 ++ data/interfaces/default/settings.html | 225 ++++++++++++------------- plexpy/config.py | 1 + plexpy/webserve.py | 3 +- 4 files changed, 123 insertions(+), 118 deletions(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 79fd6d92..55e1e72e 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -2122,6 +2122,18 @@ a:hover .item-children-poster { top: 5px; left: 12px; } +#menu_link_show_advanced_settings.active { + color: #fff; + background-color: #cc7b19; +} +.advanced-setting { + display: none; +} +div.checkbox.advanced-setting, +div.form-group.advanced-setting { + border-left: 1px solid #e5a00d; + padding-left: 10px; +} .user-info-wrapper { } .user-info-poster-face { diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 0a2d2b9d..8a3fabdc 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -26,11 +26,16 @@ Settings
+ % if config['show_advanced_settings'] == 1: + + % else: + + % endif % if config['check_github']: % endif - +
@@ -43,19 +48,16 @@
  • General
  • Homepage
  • Web Interface
  • -
  • Access Control
  • Plex Media Server
  • -
  • Plex.tv Account
  • -
  • Activity Monitoring
  • Notifications
  • -
  • Notification Agents
  • -
  • Extra Settings
  • +
  • Import & Backups
  • Tautulli Remote Android App beta
  • +
    % if common.VERSION_NUMBER: @@ -78,6 +80,7 @@
    +
    @@ -102,24 +105,39 @@

    Set your preferred time format. Click here to see the parameter list.

    -
    +

    Change the "Play by day of week" graph to start on Monday. Default is start on Sunday.

    -
    +

    Group successive play history by the same user as a single entry in the tables and watch statistics.

    -
    +

    Include current activity in the history tables. Statistics will not be counted until the stream has ended.

    + +
    +

    History Logging

    +
    + +
    + +
    +
    + +
    + +
    +

    The interval (in seconds) an item must be in a playing state before logging it. 0 to disable.

    +
    @@ -168,7 +186,7 @@

    Update Tautulli automatically if an update is available.

    -
    +
    @@ -331,7 +349,13 @@

    Note: Web interface changes require a restart.

    -
    +
    + +

    Launch browser pointed to Tautulli on startup.

    +
    +
    @@ -359,34 +383,27 @@

    The base URL of the web server. Used for reverse proxies.

    -
    +

    Respect the X-Forwarded-Proto header. Used for reverse proxies with SSL.

    -
    -
    - -

    Launch browser pointed to Tautulli on startup.

    -
    -
    +

    Enable HTTPS for web server for encrypted communication.

    -
    +

    Check to have Tautulli create a self-signed SSL certificate. Uncheck if you want to use your own certificate.

    -
    +
    @@ -395,7 +412,7 @@

    The domain names used to access Tautulli, separated by commas (,).

    -
    +
    @@ -405,7 +422,7 @@

    The IP addresses used to access Tautulli, separated by commas (,).

    -
    +
    @@ -414,7 +431,7 @@

    The location of the SSL certificate.

    -
    +
    @@ -423,7 +440,7 @@

    The location of the SSL certificate chain.

    -
    +
    @@ -433,11 +450,6 @@

    The location of the SSL key.

    -

    - -
    - -

    Authentication

    @@ -463,15 +475,7 @@

    Password for web server authentication. Leave empty to disable.

    -
    - - -

    Store a hashed password in the config file.
    Warning: Your password cannot be recovered if forgotten!

    -
    - +
    -
    +
    + + +

    Store a hashed password in the config file.
    Warning: Your password cannot be recovered if forgotten!

    +
    + +
    @@ -500,18 +513,18 @@

    Allow shared users to login to Tautulli using their Plex.tv account. Individual user access needs to be enabled from Users > Edit Mode.

    -
    +

    API

    -
    +

    Allow remote applications to interface with Tautulli.

    -
    +
    @@ -621,7 +634,7 @@

    If you have secure connections enabled on your Plex Server, communicate with it securely.

    -
    +
    % if config['pms_is_cloud']:
    -
    +
    @@ -655,11 +668,7 @@ -
    -

    Plex Logs

    -
    - -
    +
    @@ -674,11 +683,6 @@

    - - -
    -
    -

    Plex.tv Authentication

    @@ -699,11 +703,7 @@

    Token for Plex.tv authentication.

    -
    -

    Friends List

    -
    - -
    +
    @@ -713,18 +713,14 @@

    The interval (in hours) Tautulli will request an updated friends list from Plex.tv. Minimum 1, maximum 24, default 12.

    -
    +

    Refresh the users list when Tautulli starts.

    -
    -

    Libraries List

    -
    - -
    +
    @@ -734,7 +730,7 @@

    The interval (in hours) Tautulli will request an updated libraries list from your Plex Media Server. Minimum 1, maximum 24, default 12.

    -
    +
    @@ -745,25 +741,23 @@
    -
    +
    -

    History Logging

    +

    Notification Agents

    -
    - -
    -
    - -
    - -
    -

    The interval (in seconds) an item must be in a playing state before logging it. 0 to disable.

    +

    + Add a new notification agent, or configure an existing notification agent by clicking the settings icon on the right. +

    +
    +
    +
    Loading notification agents...
    +
    -

    Buffer Warnings

    +

    Current Activity Notifications

    Note: Buffer warnings only work on certain Plex clients. Android and Plex Web do not report buffer events accurately or at all.

    @@ -787,17 +781,6 @@

    The value (in seconds) Tautulli should wait before triggering the next buffer warning. 0 to always trigger.

    - -

    - -
    - -
    - -
    -

    Current Activity Notifications

    -
    -
    -
    - -
    -

    Notification Agents

    -
    - -

    - Add a new notification agent, or configure an existing notification agent by clicking the settings icon on the right. -

    -
    -
    -
    Loading notification agents...
    -
    -
    - -
    -
    -
    +

    Extra Settings

    -
    +

    Enable if you want Tautulli to calculate the total file size for TV Shows/Seasons and Artists/Albums on the media info tables.

    -
    +
    @@ -941,7 +907,7 @@ Note: Only logs from the time this setting is enabled will be masked. Do not post your logs publically without masking sensitive information!

    -
    +
    @@ -950,7 +916,7 @@ Note: Video preview thumbnails (BIF) are not cached.

    -
    +
    @@ -959,7 +925,7 @@

    Backlink protection via anonymizer service, must end in "?".

    -
    +

    Attempt to fix history logging by flushing out all of the temporary sessions in the database.
    @@ -975,11 +941,11 @@

    % if plexpy.INSTALL_TYPE == 'git': -
    +

    Git Settings

    -
    +
    @@ -1002,7 +968,7 @@

    The git tracking remote and branch (default "origin/master"). Select to switch the git branch (requires restart).

    -
    +
    @@ -1658,6 +1624,15 @@ $(document).ready(function() { } } + function advancedSettings() { + var advanced_button = $('#menu_link_show_advanced_settings'); + if (advanced_button.hasClass('active')) { + $('.advanced-setting').show(); + } else { + $('.advanced-setting').hide(); + } + } + $('.save-button').click(function() { preSaveChecks(function () { saveSettings() }); }); @@ -1697,6 +1672,22 @@ $(document).ready(function() { window.location.href = 'restart'; }); + $('#menu_link_show_advanced_settings').click(function() { + $(this).toggleClass('active'); + if ($(this).hasClass('active')) { + $(this).html(' Hide Advanced'); + $('#show_advanced_settings').val(1); + } else { + $(this).html(' Show Advanced'); + $('#show_advanced_settings').val(0); + } + if (document.location.hash == '#tab_tabs-extra_settings') { + $('.nav-settings a[href=#tabs-help_info]').tab('show'); + } + advancedSettings() + }); + + advancedSettings(); getConfigurationTable(); getSchedulerTable(); getNotifiersTable(); diff --git a/plexpy/config.py b/plexpy/config.py index 9d7b72b2..251042ac 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -480,6 +480,7 @@ _CONFIG_DEFINITIONS = { 'REFRESH_USERS_ON_STARTUP': (int, 'Monitoring', 1), 'REMOTE_ACCESS_PING_THRESHOLD': (int, 'Advanced', 3), 'SESSION_DB_WRITE_ATTEMPTS': (int, 'Advanced', 5), + 'SHOW_ADVANCED_SETTINGS': (int, 'General', 0), 'SLACK_ENABLED': (int, 'Slack', 0), 'SLACK_HOOK': (str, 'Slack', ''), 'SLACK_CHANNEL': (str, 'Slack', ''), diff --git a/plexpy/webserve.py b/plexpy/webserve.py index dfdefe8d..76158fe7 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2612,7 +2612,8 @@ class WebInterface(object): "tv_watched_percent": plexpy.CONFIG.TV_WATCHED_PERCENT, "music_watched_percent": plexpy.CONFIG.MUSIC_WATCHED_PERCENT, "themoviedb_lookup": checked(plexpy.CONFIG.THEMOVIEDB_LOOKUP), - "tvmaze_lookup": checked(plexpy.CONFIG.TVMAZE_LOOKUP) + "tvmaze_lookup": checked(plexpy.CONFIG.TVMAZE_LOOKUP), + "show_advanced_settings": plexpy.CONFIG.SHOW_ADVANCED_SETTINGS } return serve_template(templatename="settings.html", title="Settings", config=config, kwargs=kwargs) From 170591c79e746bf20cf79f340263607f3e2aa0f4 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 11 Feb 2018 16:11:00 -0800 Subject: [PATCH 2/4] Move some settings, split notifications agents back out --- data/interfaces/default/css/plexpy.css | 8 +- data/interfaces/default/settings.html | 143 +++++++++++++------------ 2 files changed, 81 insertions(+), 70 deletions(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 55e1e72e..74c18984 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -2129,11 +2129,13 @@ a:hover .item-children-poster { .advanced-setting { display: none; } -div.checkbox.advanced-setting, -div.form-group.advanced-setting { - border-left: 1px solid #e5a00d; +div.advanced-setting { + border-left: 1px solid #cc7b19; padding-left: 10px; } +li.advanced-setting { + border-left: 1px solid #cc7b19; +} .user-info-wrapper { } .user-info-poster-face { diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 8a3fabdc..5960adaa 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -50,6 +50,7 @@
  • Web Interface
  • Plex Media Server
  • Notifications
  • +
  • Notification Agents
  • Import & Backups
  • Tautulli Remote Android App beta
  • @@ -374,7 +375,7 @@

    Port to bind web server to. Note that ports below 1024 may require root.

    -
    +
    @@ -455,7 +456,7 @@

    Authentication

    -

    Authentication changes require a restart.

    +

    Note: Authentication changes require a restart.

    @@ -513,18 +514,18 @@

    Allow shared users to login to Tautulli using their Plex.tv account. Individual user access needs to be enabled from Users > Edit Mode.

    -
    +

    API

    -
    +

    Allow remote applications to interface with Tautulli.

    -
    +
    @@ -550,52 +551,6 @@

    Plex Media Server Version ${config['pms_version']}

    -
    - % if config['pms_is_cloud']: - - Not available for Plex Cloud servers. - % else: - - % endif -

    Enable to have Tautulli check if updates are available for the Plex Media Server.

    -
    -
    -
    -
    -
    - - -
    -
    - - - -
    -
    -
    -
    -
    - % if config['pms_is_cloud']: - - Not available for Plex Cloud servers. - % else: - - - % endif -

    Enable to have Tautulli check if remote access to the Plex Media Server goes down.

    -
    -
    @@ -683,6 +638,56 @@

    +
    +

    Server Monitoring

    +
    + +
    + % if config['pms_is_cloud']: + + Not available for Plex Cloud servers. + % else: + + % endif +

    Enable to have Tautulli check if updates are available for the Plex Media Server.

    +
    +
    +
    +
    +
    + + +
    +
    + + + +
    +
    +
    +
    +
    + % if config['pms_is_cloud']: + + Not available for Plex Cloud servers. + % else: + + + % endif +

    Enable to have Tautulli check if remote access to the Plex Media Server goes down.

    +
    +

    Plex.tv Authentication

    @@ -743,19 +748,6 @@
    -
    -

    Notification Agents

    -
    - -

    - Add a new notification agent, or configure an existing notification agent by clicking the settings icon on the right. -

    -
    -
    -
    Loading notification agents...
    -
    -
    -

    Current Activity Notifications

    @@ -771,7 +763,7 @@

    How many buffer events should we wait before triggering the first warning. Buffer events increment on each monitor ping if play state is buffering. 0 to disable buffer warnings.

    -
    +
    @@ -781,13 +773,13 @@

    The value (in seconds) Tautulli should wait before triggering the next buffer warning. 0 to always trigger.

    -
    +

    Enable to allow sending of consecutive notifications (i.e. both watched & stopped notifications).

    -
    +
    @@ -886,6 +878,23 @@
    +
    + +
    +

    Notification Agents

    +
    + +

    + Add a new notification agent, or configure an existing notification agent by clicking the settings icon on the right. +

    +
    +
    +
    Loading notification agents...
    +
    +
    + +
    +
    From 13036183d34fdfcc5499916a7f3296a92337c4be Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 11 Feb 2018 16:38:21 -0800 Subject: [PATCH 3/4] Move extra settings to other tabs --- data/interfaces/default/settings.html | 188 ++++++++++++-------------- 1 file changed, 87 insertions(+), 101 deletions(-) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 5960adaa..16724011 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -51,7 +51,6 @@
  • Plex Media Server
  • Notifications
  • Notification Agents
  • -
  • Import & Backups
  • Tautulli Remote Android App beta
  • @@ -124,6 +123,21 @@

    Include current activity in the history tables. Statistics will not be counted until the stream has ended.

    +
    + +

    Enable if you want Tautulli to calculate the total file size for TV Shows/Seasons and Artists/Albums on the media info tables.

    +
    +
    + +

    + Enable to mask passwords, access tokens, and public IP addresses with asterisks (*) in the logs.
    + Note: Only logs from the time this setting is enabled will be masked. Do not post your logs publically without masking sensitive information! +

    +

    History Logging

    @@ -169,6 +183,20 @@

    Set the percentage for a music track to be considered as listened. Minimum 50, Maximum 95.

    +
    + +

    + Attempt to fix history logging by flushing out all of the temporary sessions in the database.
    + Warning: This will reset all currently active sessions. For emergency use only when history logging is stuck! +

    +
    +
    +
    + +
    +
    +
    +

    Updates

    @@ -198,6 +226,45 @@
    + % if plexpy.INSTALL_TYPE == 'git': +
    +

    Git Settings

    +
    + +
    + +
    +
    +
    + + + + + +
    +
    +
    +

    The git tracking remote and branch (default "origin/master"). Select to switch the git branch (requires restart).

    +
    +
    + +
    +
    + +
    +
    +

    Optional: The path to your git environment variable. Leave blank for default.

    +
    + % endif +

    @@ -452,6 +519,16 @@
    +
    + +
    +
    + +
    +
    +

    Backlink protection via anonymizer service, must end in "?".

    +
    +

    Authentication

    @@ -637,6 +714,15 @@ Click here for help.

    +
    + +

    + Enable to cache images from Plex to reduce API calls and improve loading times.
    + Note: Video preview thumbnails (BIF) are not cached. +

    +

    Server Monitoring

    @@ -895,103 +981,6 @@
    -
    - -
    -

    Extra Settings

    -
    - -
    - -

    Enable if you want Tautulli to calculate the total file size for TV Shows/Seasons and Artists/Albums on the media info tables.

    -
    -
    - -

    - Enable to mask passwords, access tokens, and public IP addresses with asterisks (*) in the logs.
    - Note: Only logs from the time this setting is enabled will be masked. Do not post your logs publically without masking sensitive information! -

    -
    -
    - -

    - Enable to cache images from Plex to reduce API calls and improve loading times.
    - Note: Video preview thumbnails (BIF) are not cached. -

    -
    -
    - -
    -
    - -
    -
    -

    Backlink protection via anonymizer service, must end in "?".

    -
    -
    - -

    - Attempt to fix history logging by flushing out all of the temporary sessions in the database.
    - Warning: This will reset all currently active sessions. For emergency use only when history logging is stuck! -

    -
    -
    -
    - -
    -
    -
    -
    - - % if plexpy.INSTALL_TYPE == 'git': -
    -

    Git Settings

    -
    - -
    - -
    -
    -
    - - - - - -
    -
    -
    -

    The git tracking remote and branch (default "origin/master"). Select to switch the git branch (requires restart).

    -
    -
    - -
    -
    - -
    -
    -

    Optional: The path to your git environment variable. Leave blank for default.

    -
    - % endif - -

    - -
    -
    @@ -1690,9 +1679,6 @@ $(document).ready(function() { $(this).html(' Show Advanced'); $('#show_advanced_settings').val(0); } - if (document.location.hash == '#tab_tabs-extra_settings') { - $('.nav-settings a[href=#tabs-help_info]').tab('show'); - } advancedSettings() }); From 373a15524f2ea5c2e09928a4d24d5f005b845a98 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 11 Feb 2018 17:17:08 -0800 Subject: [PATCH 4/4] Remove redundant settings headers --- data/interfaces/default/settings.html | 60 ++++++++++++--------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 16724011..e30c42df 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -227,10 +227,6 @@
    % if plexpy.INSTALL_TYPE == 'git': -
    -

    Git Settings

    -
    -
    @@ -554,13 +550,6 @@

    Password for web server authentication. Leave empty to disable.

    -
    - - -

    Allow the Plex server admin to login as a Tautulli admin using their Plex.tv account.

    -