mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
connect page,better support for remote daemons
This commit is contained in:
parent
b6a300f687
commit
263c014715
3 changed files with 14 additions and 6 deletions
|
@ -284,14 +284,20 @@ class connect:
|
||||||
@deco.check_session
|
@deco.check_session
|
||||||
@deco.deluge_page_noauth
|
@deco.deluge_page_noauth
|
||||||
def GET(self, name):
|
def GET(self, name):
|
||||||
|
restart = False
|
||||||
try:
|
try:
|
||||||
proxy.ping()
|
proxy.ping()
|
||||||
connected = proxy.get_core_uri()
|
connected = proxy.get_core_uri()
|
||||||
|
if connected.startswith("http://localhost"):
|
||||||
|
restart = True
|
||||||
except:
|
except:
|
||||||
connected = None
|
connected = None
|
||||||
|
|
||||||
connect_list = ["http://localhost:58846"]
|
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):
|
def POST(self):
|
||||||
vars = web.input(uri = None, other_uri = None)
|
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')
|
$:render.header(_("Connect to Daemon"), 'connect')
|
||||||
|
|
||||||
|
@ -12,12 +12,14 @@ $if connected:
|
||||||
$_('Connected to')
|
$_('Connected to')
|
||||||
$connected
|
$connected
|
||||||
</td><td>
|
</td><td>
|
||||||
|
|
||||||
<form method="POST" action="$base/daemon/control/stop">
|
<form method="POST" action="$base/daemon/control/stop">
|
||||||
<input type="submit" name="stop"
|
<input type="submit" name="stop"
|
||||||
value="$_('Stop')">
|
value="$_('Stop')">
|
||||||
</form>
|
</form>
|
||||||
</td><td>
|
</td><td>
|
||||||
<form method="POST" action="$base/daemon/control/restart">
|
<form method="POST" action="$base/daemon/control/restart">
|
||||||
|
$if restart:
|
||||||
<input type="submit" name="restart"
|
<input type="submit" name="restart"
|
||||||
value="$_('Restart')">
|
value="$_('Restart')">
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -39,7 +39,7 @@ $for id, title, url in admin_pages:
|
||||||
|
|
||||||
</td><td>
|
</td><td>
|
||||||
|
|
||||||
</td><td align="right" width="320px">
|
</td><td align="right" width="420px">
|
||||||
$:part_stats()
|
$:part_stats()
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue