diff --git a/PlexPy.py b/PlexPy.py index 054198e4..3aa66109 100755 --- a/PlexPy.py +++ b/PlexPy.py @@ -246,6 +246,8 @@ def main(): plexpy.shutdown() elif plexpy.SIGNAL == 'restart': plexpy.shutdown(restart=True) + elif plexpy.SIGNAL == 'checkout': + plexpy.shutdown(restart=True, checkout=True) else: plexpy.shutdown(restart=True, update=True) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 956893d4..736cd592 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -60,6 +60,28 @@ select[multiple] option { -moz-border-radius: 2px; border-radius: 2px; } +select.form-control { + margin: 5px 0 5px 0; + color: #fff; + border: 0px solid #444; + background: #555; + height: 32px; + padding: 6px 12px; + background-color: #555; + border-radius: 3px; + transition: background-color .3s; +} +select.form-control:focus { + outline: 0; + outline: thin dotted \9; + color: #555; + background-color: #fff; + transition: background-color .3s; +} +select.form-control option { + color: #555; + background-color: #fff; +} img { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; @@ -3118,3 +3140,9 @@ a:hover .overlay-refresh-image:hover { border: 1px solid #444; border-bottom-color: transparent; } +.git-group input.form-control { + width: 40%; +} +.git-group select.form-control { + width: 60%; +} \ No newline at end of file diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 1b15dc46..3cd16ab8 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -82,7 +82,7 @@ -

If you have Git installed, allow periodic checks for updates.

+

Check for PlexPy updates periodically.

@@ -101,6 +101,44 @@

Optional: Use your own GitHub API token when checking for updates.

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

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

+
+
+ +
+
+ +
+
+

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

+
+ % endif

Display Settings

@@ -2033,32 +2071,32 @@ $(document).ready(function() { initConfigCheckbox('#notify_upload_posters'); initConfigCheckbox('#monitor_pms_updates'); - $("#menu_link_shutdown").click(function() { - $("#confirm-message").text("Are you sure you want to shutdown PlexPy?"); + $('#menu_link_shutdown').click(function() { + $('#confirm-message').text("Are you sure you want to shutdown PlexPy?"); $('#confirm-modal').modal(); $('#confirm-modal').one('click', '#confirm-button', function () { - window.location.href = "shutdown"; + window.location.href = 'shutdown'; }); }); - $("#menu_link_restart").click(function() { + $('#menu_link_restart').click(function() { $("#confirm-message").text("Are you sure you want to restart PlexPy?"); $('#confirm-modal').modal(); $('#confirm-modal').one('click', '#confirm-button', function () { - window.location.href = "restart"; + window.location.href = 'restart'; }); }); - $("#menu_link_update_check").click(function() { + $('#menu_link_update_check').click(function() { // Allow the update bar to show again if previously dismissed. setCookie('updateDismiss', 'true', 0); $(this).html(' Checking'); $(this).prop('disabled', true); - window.location.href = "checkGithub"; + window.location.href = 'checkGithub'; }); - $("#modal_link_restart").click(function() { - window.location.href = "restart"; + $('#modal_link_restart').click(function() { + window.location.href = 'restart'; }); getConfigurationTable(); @@ -2114,6 +2152,26 @@ $(document).ready(function() { confirmAjaxCall(url, msg); }); + $("#switch_git_branch").click(function () { + var current_remote = "${config['git_remote']}"; + var current_branch = "${config['git_branch']}"; + var new_remote = $("#git_remote").val(); + var new_branch = $("#git_branch option:selected").val(); + + if (new_remote === current_remote && new_branch === current_branch) { + showMsg(' Already on the ' + current_remote + ' ' + current_branch + ' branch.', false, true, 5000, true) + } else { + var msg = 'Are you sure you want to switch to the ' + new_remote + ' ' + new_branch + ' branch?' + + '
This may cause PlexPy to become unstable.
PlexPy will restart.'; + $('#confirm-message').html(msg); + $('#confirm-modal').modal(); + $('#confirm-modal').one('click', '#confirm-button', function () { + settingsChanged = false; + window.location.href = 'checkout_git_branch?git_remote=' + new_remote + '&git_branch=' + new_branch; + }); + } + }); + $('#api_key').click(function(){ $('#api_key').select() }); $("#generate_api").click(function() { $.get('generateAPI', diff --git a/data/interfaces/default/shutdown.html b/data/interfaces/default/shutdown.html index 5ab93c9f..68f43d2c 100644 --- a/data/interfaces/default/shutdown.html +++ b/data/interfaces/default/shutdown.html @@ -12,7 +12,7 @@