Skip to content

Commit

Permalink
Redirect to proper HTTP root on state change
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 committed Nov 5, 2016
1 parent 254f41a commit 57f1af0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/interfaces/default/shutdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h4>Restart in <span class="countdown"></span></h4>

// Redirect to home page after countdown.
function reloadPage() {
window.location.href = "index";
window.location.href = "${new_http_root}index";
}
</script>
</%def>
7 changes: 6 additions & 1 deletion plexpy/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -3212,8 +3212,13 @@ def do_state_change(self, signal, title, timer, **kwargs):
quote = self.random_arnold_quotes()
plexpy.SIGNAL = signal

if plexpy.CONFIG.HTTP_ROOT:
new_http_root = '/' + plexpy.CONFIG.HTTP_ROOT.strip('/') + '/'
else:
new_http_root = '/'

return serve_template(templatename="shutdown.html", title=title,
message=message, timer=timer, quote=quote)
new_http_root=new_http_root, message=message, timer=timer, quote=quote)

@cherrypy.expose
@requireAuth(member_of("admin"))
Expand Down

0 comments on commit 57f1af0

Please sign in to comment.