connect page,better support for remote daemons
This commit is contained in:
parent
b6a300f687
commit
263c014715
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
</td><td>
|
||||
|
||||
<form method="POST" action="$base/daemon/control/stop">
|
||||
<input type="submit" name="stop"
|
||||
value="$_('Stop')">
|
||||
</form>
|
||||
</td><td>
|
||||
<form method="POST" action="$base/daemon/control/restart">
|
||||
<input type="submit" name="restart"
|
||||
value="$_('Restart')">
|
||||
</form>
|
||||
$if restart:
|
||||
<input type="submit" name="restart"
|
||||
value="$_('Restart')">
|
||||
</form>
|
||||
</td></tr></table>
|
||||
$else:
|
||||
<div class="error">$_("Not Connected to a daemon")
|
||||
|
|
|
@ -39,7 +39,7 @@ $for id, title, url in admin_pages:
|
|||
|
||||
</td><td>
|
||||
|
||||
</td><td align="right" width="320px">
|
||||
</td><td align="right" width="420px">
|
||||
$:part_stats()
|
||||
</td></tr></table>
|
||||
|
||||
|
|
Loading…
Reference in New Issue