Hi,
I'm not a developper, but I found a little bug on the web UI when you go in "Router -> Network -> DHCP and DNS -> Static Leases". Everything works well excepted if you want to use Static Lease (MAC address hot swap) [source: http://wiki.openwrt.org/doc/uci/dhcp#st … hot.swap]. You won't be able to put more than one mac address, and the webui won't let you save your changes. Hopefully, there is a little JS script fix :-)
> Bug:
If you enter more than one mac address in those fields, you won't be able to save you config as the WebUI detects a syntax error. Moreover, you will have everything in red. Bwerk
> Explanation:
Fields content are checked via JavaScript (not a good way to do but ... anyway). The function applies a regex on the content and return a code depending the field content is OK or not. In the mac address field, we should be able to define more than one mac address but the current regex does not support it. That's why I purpose this little fix to resolve this problem :-)
> Patch
The concerned file is /www/luci-static/resources/cbi.js and you need to replace this part of code:
'macaddr': function(v)
{
return (v.match(/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/) != null);
},by:
'macaddr': function(v)
{
return (v.match(/^(([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}\s)*([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/) != null);
}, > Issue:
This chunk of code may be used somewhere else in the webUI, and other fields using this function to check their content may not be happy to have many mac address instead of one. The best way to fix that is to duplicate this filter (especially used for many mac addresses) and use this specific one on this specific field :-)
I'm quite new with OpenWRT, and I don't know very well the rules of this community. So I post this little patch here, with the secret hope than somebody will integrate it in the dev. As I told you, I'm not a programmer, and I'm lazy to learn all the code submit process ... I'm not even sure if my patch is the good way of fixing this issue, but anyway, I posted my solution by thinking somebody would be happy to find it here :-)
Cheeeers
