I'm looking for a way to add extra parameters in the "Server" section of the config, but more importantly being able to use them in the program. This is related to this topic : http://forums.sabnzbd.org/http://forums ... 589#p37589.
So far I have been able modify smpl template to add (and hide in my case) fields and write them in the config :
In config.py, line 336
Code: Select all
self.socks_host = OptionStr(name, 'socks_host','proxy.example.com',add=False)
self.socks_port = OptionNumber(name, 'socks_port',80,add=False)
self.socks_login = OptionStr(name, 'socks_login','login',add=False)
self.socks_password = OptionStr(name, 'socks_password','password',add=False)
Code: Select all
<div class="server">
<form class="cmxform" id="$servers[$server]['host']$servers[$server]['port']" autocomplete="off">
<fieldset class="EntryFieldSet">
<legend>Giganews SSL</legend>
<hr />
<input type="hidden" name="host" value="$servers[$server]['host']">
<input type="hidden" name="port" value="$servers[$server]['port']">
<input type="hidden" name="username" value="$servers[$server]['username']">
<input type="hidden" name="password" value="$servers[$server]['password']">
<input type="hidden" name="timeout" value="$servers[$server]['timeout']">
<br class="clear" />
<label class="label">$T('srv-connections'):</label><input type="text" size="25" name="connections" value="$servers[$server]['connections']">
<input type="hidden" name="ssl" value="1"/>
<input type="hidden" name="fillserver" value="0"/>
<input type="hidden" name="optional" value="0"/>
<br class="clear" />
<label class="label">Proxy:</label><input type="text" name="socks_host" value="$servers[$server]['socks_host']" ></label>
<br class="clear" />
<label class="label">Port:</label><input type="text" name="socks_port" value="$servers[$server]['socks_port']" ></label>
<br class="clear" />
<label class="label">Login:</label><input type="text" name="socks_login" value="$servers[$server]['socks_login']" ></label>
<br class="clear" />
<label class="label">Password:</label><input type="password" name="socks_password" value="$servers[$server]['socks_password']" ></label>
<br class="clear" />
<div id="$servers[$server]['host']$servers[$server]['port']-result" class="server-test">$T('srv-testHint')</div>
<input type="hidden" name="server" value="$server">
<p><input type="button" class="submitindent" size="40" value="$T('button-saveChanges')" onclick="javascript:submitconfig('config/server/saveServer',this,'$servers[$server]['host']$servers[$server]['port']')">
<br class="clear" />
<input type="button" class="submitindent" size="40" value="$T('button-testServer')" onclick="javascript:testServer('$servers[$server]['host']$servers[$server]['port']')">
Thanks