Add http_root to settings page

This commit is contained in:
JonnyWong16 2016-04-20 22:25:33 -07:00
parent 54a7367fb6
commit 6f97173b00
3 changed files with 17 additions and 3 deletions

View file

@ -379,11 +379,20 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
</div> </div>
<p class="help-block">Port to bind web server to. Note that ports below 1024 may require root.</p> <p class="help-block">Port to bind web server to. Note that ports below 1024 may require root.</p>
</div> </div>
<div class="form-group">
<label for="http_root">HTTP Root</label>
<div class="row">
<div class="col-md-6">
<input type="text" class="form-control http-settings" id="http_root" name="http_root" value="${config['http_root']}" data-parsley-trigger="change">
</div>
</div>
<p class="help-block">The base URL for the web server. Used for reverse proxies.</p>
</div>
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']}> Launch Browser on Startup <input type="checkbox" name="launch_browser" value="1" ${config['launch_browser']}> Launch Browser on Startup
</label> </label>
<p class="help-block">Launch browser pointed to PlexPy, on startup.</p> <p class="help-block">Launch browser pointed to PlexPy on startup.</p>
</div> </div>
<div class="checkbox"> <div class="checkbox">
<label> <label>

View file

@ -148,7 +148,7 @@ _CONFIG_DEFINITIONS = {
'HTTP_PASSWORD': (str, 'General', ''), 'HTTP_PASSWORD': (str, 'General', ''),
'HTTP_PORT': (int, 'General', 8181), 'HTTP_PORT': (int, 'General', 8181),
'HTTP_PROXY': (int, 'General', 0), 'HTTP_PROXY': (int, 'General', 0),
'HTTP_ROOT': (str, 'General', '/'), 'HTTP_ROOT': (str, 'General', ''),
'HTTP_USERNAME': (str, 'General', ''), 'HTTP_USERNAME': (str, 'General', ''),
'INTERFACE': (str, 'General', 'default'), 'INTERFACE': (str, 'General', 'default'),
'IP_LOGGING_ENABLE': (int, 'General', 0), 'IP_LOGGING_ENABLE': (int, 'General', 0),
@ -598,4 +598,8 @@ class Config(object):
self.NOTIFY_ON_WATCHED_SUBJECT_TEXT = self.NOTIFY_ON_WATCHED_SUBJECT_TEXT.replace('{progress}','{progress_duration}') self.NOTIFY_ON_WATCHED_SUBJECT_TEXT = self.NOTIFY_ON_WATCHED_SUBJECT_TEXT.replace('{progress}','{progress_duration}')
self.NOTIFY_ON_WATCHED_BODY_TEXT = self.NOTIFY_ON_WATCHED_BODY_TEXT.replace('{progress}','{progress_duration}') self.NOTIFY_ON_WATCHED_BODY_TEXT = self.NOTIFY_ON_WATCHED_BODY_TEXT.replace('{progress}','{progress_duration}')
self.NOTIFY_SCRIPTS_ARGS_TEXT = self.NOTIFY_SCRIPTS_ARGS_TEXT.replace('{progress}','{progress_duration}') self.NOTIFY_SCRIPTS_ARGS_TEXT = self.NOTIFY_SCRIPTS_ARGS_TEXT.replace('{progress}','{progress_duration}')
self.CONFIG_VERSION = '3' self.CONFIG_VERSION = '3'
if self.CONFIG_VERSION == '3':
if self.HTTP_ROOT == '/': self.HTTP_ROOT = ''
self.CONFIG_VERSION = '4'

View file

@ -1196,6 +1196,7 @@ class WebInterface(object):
"http_username": plexpy.CONFIG.HTTP_USERNAME, "http_username": plexpy.CONFIG.HTTP_USERNAME,
"http_port": plexpy.CONFIG.HTTP_PORT, "http_port": plexpy.CONFIG.HTTP_PORT,
"http_password": http_password, "http_password": http_password,
"http_root": plexpy.CONFIG.HTTP_ROOT,
"launch_browser": checked(plexpy.CONFIG.LAUNCH_BROWSER), "launch_browser": checked(plexpy.CONFIG.LAUNCH_BROWSER),
"enable_https": checked(plexpy.CONFIG.ENABLE_HTTPS), "enable_https": checked(plexpy.CONFIG.ENABLE_HTTPS),
"https_create_cert": checked(plexpy.CONFIG.HTTPS_CREATE_CERT), "https_create_cert": checked(plexpy.CONFIG.HTTPS_CREATE_CERT),