Module: deluge Branch: master Commit: e2b78be264482719ec20c23a23c728cfc35a340a
Author: Damien Churchill <[email protected]> Date: Tue Mar 9 13:27:01 2010 +0000 improve support for a base config parameter --- deluge/ui/web/js/deluge-all/Deluge.UI.js | 2 +- deluge/ui/web/server.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/Deluge.UI.js b/deluge/ui/web/js/deluge-all/Deluge.UI.js index 52c47ce..c2634fa 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 a387af9..c396010 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: -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
