diff --git a/deluge/ui/web/js/deluge-all/Deluge.UI.js b/deluge/ui/web/js/deluge-all/Deluge.UI.js index 52c47ce01..c2634fa50 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.UI.js +++ b/deluge/ui/web/js/deluge-all/Deluge.UI.js @@ -71,7 +71,7 @@ Deluge.UI = { Deluge.Events.on("connect", this.onConnect, this); Deluge.Events.on("disconnect", this.onDisconnect, this); Deluge.Client = new Ext.ux.util.RpcClient({ - url: '/json' + url: Deluge.config.base + 'json' }); for (var plugin in Deluge.Plugins) { diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index a387af9f4..c396010d0 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -97,6 +97,7 @@ CONFIG_DEFAULTS = { "theme": "gray", # Server Settings + "base": "/", "port": 8112, "https": False, "pkey": "ssl/daemon.pkey", @@ -105,7 +106,7 @@ CONFIG_DEFAULTS = { UI_CONFIG_KEYS = ( "theme", "sidebar_show_zero", "sidebar_show_trackers", - "show_session_speed" + "show_session_speed", "base" ) OLD_CONFIG_KEYS = ( @@ -404,6 +405,8 @@ class TopLevel(resource.Resource): theme = CONFIG_DEFAULTS.get("theme") self.__stylesheets.insert(1, "/css/xtheme-%s.css" % theme) + self.base = component.get("DelugeWeb").config["base"] + @property def scripts(self): @@ -474,10 +477,9 @@ class TopLevel(resource.Resource): else: scripts = self.scripts[:] - base = request.args.get('base', [''])[-1] template = Template(filename=rpath("index.html")) request.setHeader("content-type", "text/html; charset=utf-8") - return template.render(scripts=scripts, stylesheets=self.stylesheets, debug=debug, base=base) + return template.render(scripts=scripts, stylesheets=self.stylesheets, debug=debug, base=self.base) class ServerContextFactory: