From 263c014715b2658c136ff01786004b47e8925243 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Sun, 22 Jun 2008 19:50:00 +0000 Subject: [PATCH] connect page,better support for remote daemons --- deluge/ui/webui/pages.py | 8 +++++++- deluge/ui/webui/templates/deluge/connect.html | 10 ++++++---- deluge/ui/webui/templates/white/header.html | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/deluge/ui/webui/pages.py b/deluge/ui/webui/pages.py index 488e34e0e..e594b8f16 100644 --- a/deluge/ui/webui/pages.py +++ b/deluge/ui/webui/pages.py @@ -284,14 +284,20 @@ class connect: @deco.check_session @deco.deluge_page_noauth def GET(self, name): + restart = False try: proxy.ping() connected = proxy.get_core_uri() + if connected.startswith("http://localhost"): + restart = True except: connected = None connect_list = ["http://localhost:58846"] - return render.connect(connect_list, connected) + if config.get('daemon') <> "http://localhost:58846": + connect_list = [config.get('daemon')] + connect_list + + return render.connect(connect_list, connected ,restart) def POST(self): vars = web.input(uri = None, other_uri = None) diff --git a/deluge/ui/webui/templates/deluge/connect.html b/deluge/ui/webui/templates/deluge/connect.html index ca66b73b7..ef9600eed 100644 --- a/deluge/ui/webui/templates/deluge/connect.html +++ b/deluge/ui/webui/templates/deluge/connect.html @@ -1,4 +1,4 @@ -$def with (connect_list, connected) +$def with (connect_list, connected, restart) $:render.header(_("Connect to Daemon"), 'connect') @@ -12,15 +12,17 @@ $if connected: $_('Connected to') $connected +  
- -
+ $if restart: + + $else:
$_("Not Connected to a daemon") diff --git a/deluge/ui/webui/templates/white/header.html b/deluge/ui/webui/templates/white/header.html index 4d7840da8..6e8514a36 100644 --- a/deluge/ui/webui/templates/white/header.html +++ b/deluge/ui/webui/templates/white/header.html @@ -39,7 +39,7 @@ $for id, title, url in admin_pages: - + $:part_stats()