Make poll interval configurable. Use option from
----
config core 'main'
option pollinterval '5'
---
This will only be used if the interval option is less or equal zero.
If the poll interval is not configured then a default value of 5 seconds
is used.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
}
XHR.poll = function(interval, url, data, callback, post) {
- if (isNaN(interval) || interval < 1)
- interval = 5;
+ if (isNaN(interval) || interval <= 0)
+ interval = L.env.pollinterval;
if (!XHR._q) {
XHR._t = 0;
resource = resource,
scriptname = luci.http.getenv("SCRIPT_NAME"),
pathinfo = luci.http.getenv("PATH_INFO"),
- requestpath = luci.dispatcher.context.requestpath
+ requestpath = luci.dispatcher.context.requestpath,
+ pollinterval = luci.config.main.pollinterval or 5
}) %>);
</script>