no crash on invalid daemon+cosmetics
This commit is contained in:
parent
aad8a926d6
commit
b6a300f687
|
@ -43,7 +43,6 @@ config_page = component.get("ConfigPageManager")
|
||||||
|
|
||||||
class NetworkPorts(config_forms.CfgForm ):
|
class NetworkPorts(config_forms.CfgForm ):
|
||||||
title = _("Ports")
|
title = _("Ports")
|
||||||
info = _("Restart daemon after changing these values.")
|
|
||||||
_port_from = forms.IntegerField(label= _("From"),min_value = 0, max_value=65535)
|
_port_from = forms.IntegerField(label= _("From"),min_value = 0, max_value=65535)
|
||||||
_port_to = forms.IntegerField(label = _("To"),min_value = 0, max_value=65535)
|
_port_to = forms.IntegerField(label = _("To"),min_value = 0, max_value=65535)
|
||||||
random_port = forms.CheckBox(label = _("Random"))
|
random_port = forms.CheckBox(label = _("Random"))
|
||||||
|
|
|
@ -296,10 +296,11 @@ class connect:
|
||||||
def POST(self):
|
def POST(self):
|
||||||
vars = web.input(uri = None, other_uri = None)
|
vars = web.input(uri = None, other_uri = None)
|
||||||
uri = ''
|
uri = ''
|
||||||
if vars.uri == 'other_uri':
|
print "URI=",uri
|
||||||
if not vars.other:
|
if vars.uri == 'other':
|
||||||
|
if not vars.other_uri:
|
||||||
return error_page(_("no uri"))
|
return error_page(_("no uri"))
|
||||||
uri = vars.other
|
uri = vars.other_uri
|
||||||
else:
|
else:
|
||||||
uri = vars.uri
|
uri = vars.uri
|
||||||
#TODO: more error-handling
|
#TODO: more error-handling
|
||||||
|
|
|
@ -43,7 +43,7 @@ $fspeed(torrent.download_payload_rate)</td></td></tr>
|
||||||
<td class="info_value">$ftime(torrent.eta) </td></tr>
|
<td class="info_value">$ftime(torrent.eta) </td></tr>
|
||||||
|
|
||||||
<tr><td class="info_label">$_('Pieces'):</td>
|
<tr><td class="info_label">$_('Pieces'):</td>
|
||||||
<td class="info_value">$torrent.num_pieces x $fsize(torrent.piece_length) </td>
|
<td class="info_value">$torrent.num_pieces ($fsize(torrent.piece_length)) </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -23,7 +23,7 @@ $def with (torrent_list, organize_filters)
|
||||||
|
|
||||||
</td><td>
|
</td><td>
|
||||||
|
|
||||||
</td><td align="right" width="320px">
|
</td><td align="right" width="450px">
|
||||||
$:part_stats()
|
$:part_stats()
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
|
|
||||||
|
@ -34,8 +34,7 @@ $if organize_filters:
|
||||||
$:render.part_organize(organize_filters)
|
$:render.part_organize(organize_filters)
|
||||||
|
|
||||||
|
|
||||||
|
<table id="torrent_list_block" width="80%">
|
||||||
<table id="torrent_list_block" width="70%">
|
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<div id="toolbar">
|
<div id="toolbar">
|
||||||
$:render.part_toolbar()
|
$:render.part_toolbar()
|
||||||
|
@ -50,7 +49,7 @@ $if organize_filters:
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="panel" id="info_panel_div" style="width:740px;">
|
<div class="panel" id="info_panel_div" style="width:740px;margin-left:180px">
|
||||||
<iframe
|
<iframe
|
||||||
style="border-style:hidden;width:740px;height:200px;"
|
style="border-style:hidden;width:740px;height:200px;"
|
||||||
id="torrent_info">
|
id="torrent_info">
|
||||||
|
@ -58,7 +57,6 @@ $if organize_filters:
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@ div.progress_bar{
|
||||||
|
|
||||||
|
|
||||||
td.info_label {
|
td.info_label {
|
||||||
width:100px;
|
/*width:80px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#torrent_tab tr.head {
|
#torrent_tab tr.head {
|
||||||
|
|
|
@ -285,7 +285,10 @@ def set_config_defaults():
|
||||||
def apply_config():
|
def apply_config():
|
||||||
#etc, mostly for apache:
|
#etc, mostly for apache:
|
||||||
from render import render
|
from render import render
|
||||||
sclient.set_core_uri(config.get('daemon'))
|
try:
|
||||||
|
sclient.set_core_uri(config.get('daemon'))
|
||||||
|
except:
|
||||||
|
print "error setting core uri:",config.get('daemon')
|
||||||
render.set_global('base', config.get('base'))
|
render.set_global('base', config.get('base'))
|
||||||
render.apply_cfg()
|
render.apply_cfg()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue