diff options
26 files changed, 28 insertions, 27 deletions
diff --git a/applications/luci-app-adblock/luasrc/view/adblock/logread.htm b/applications/luci-app-adblock/luasrc/view/adblock/logread.htm index 7fe254ae80..48e367ec28 100644 --- a/applications/luci-app-adblock/luasrc/view/adblock/logread.htm +++ b/applications/luci-app-adblock/luasrc/view/adblock/logread.htm @@ -10,7 +10,7 @@ This is free software, licensed under the Apache License, Version 2.0 //<![CDATA[ function log_update() { - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "adblock", "logread")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "adblock", "logread")%>', null, function(x) { if (!x) diff --git a/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm index 0b5c748571..72e2b0d364 100644 --- a/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm +++ b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm @@ -123,7 +123,7 @@ This is free software, licensed under the Apache License, Version 2.0 status_update(json_info); }); - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "adblock", "status_update")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "adblock", "status_update")%>', null, function(x, json_info) { if (!x || !json_info || !json_info.data) diff --git a/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm b/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm index ab25f862b8..4e043aaf36 100644 --- a/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm +++ b/applications/luci-app-ahcp/luasrc/view/ahcp_status.htm @@ -1,5 +1,5 @@ <script type="text/javascript">//<![CDATA[ - XHR.poll(5, '<%=url('admin/network/ahcpd/status')%>', null, + XHR.poll(-1, '<%=url('admin/network/ahcpd/status')%>', null, function(x, st) { var tb = document.getElementById('ahcpd_status_table'); diff --git a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm index 318182c081..9d9ffeeac6 100644 --- a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm +++ b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm @@ -1,5 +1,5 @@ <script type="text/javascript">//<![CDATA[ -XHR.poll(5, '<%=luci.dispatcher.build_url("admin/services/aria2/status")%>', null, +XHR.poll(-1, '<%=luci.dispatcher.build_url("admin/services/aria2/status")%>', null, function(x, data) { var tb = document.getElementById('aria2_status'); if (data && tb) { diff --git a/applications/luci-app-banip/luasrc/view/banip/logview.htm b/applications/luci-app-banip/luasrc/view/banip/logview.htm index d298b24de1..86f1ea64fa 100644 --- a/applications/luci-app-banip/luasrc/view/banip/logview.htm +++ b/applications/luci-app-banip/luasrc/view/banip/logview.htm @@ -10,7 +10,7 @@ This is free software, licensed under the Apache License, Version 2.0 //<![CDATA[ function log_update() { - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "banip", "logview")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "banip", "logview")%>', null, function(x) { if (!x) diff --git a/applications/luci-app-banip/luasrc/view/banip/runtime.htm b/applications/luci-app-banip/luasrc/view/banip/runtime.htm index 65a58bd374..08ef90399d 100644 --- a/applications/luci-app-banip/luasrc/view/banip/runtime.htm +++ b/applications/luci-app-banip/luasrc/view/banip/runtime.htm @@ -76,7 +76,7 @@ function btn_action(action) status_update(json_info) }); - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "banip", "status")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "banip", "status")%>', null, function(x, json_info) { if (!x || !json_info) diff --git a/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm b/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm index f3f45e0d04..b6e89775c3 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm @@ -164,7 +164,7 @@ // define only ONE XHR.poll in a page because if one is running it blocks the other one // optimum is to define on Map or Section Level from here you can reach all elements // we need update every 15 seconds only - XHR.poll(5, '<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, + XHR.poll(-1, '<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, function(x, data) { if (data) { _data2elements(data); } } diff --git a/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm b/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm index 2fd7168bd2..6e7c082bb0 100644 --- a/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm +++ b/applications/luci-app-ltqtapi/luasrc/view/telephony_status.htm @@ -1,5 +1,5 @@ <script type="text/javascript">//<![CDATA[ -XHR.poll(5, '<%=url('admin/telephony/status')%>', null, +XHR.poll(-1, '<%=url('admin/telephony/status')%>', null, function(x, st) { var tb = document.getElementById('telephony_status_table'); diff --git a/applications/luci-app-minidlna/luasrc/view/minidlna_status.htm b/applications/luci-app-minidlna/luasrc/view/minidlna_status.htm index 866eded03e..eaf372137b 100644 --- a/applications/luci-app-minidlna/luasrc/view/minidlna_status.htm +++ b/applications/luci-app-minidlna/luasrc/view/minidlna_status.htm @@ -1,5 +1,5 @@ <script type="text/javascript">//<![CDATA[ - XHR.poll(5, '<%=url("admin/services/minidlna_status")%>', null, + XHR.poll(-1, '<%=url("admin/services/minidlna_status")%>', null, function(x, st) { var tb = document.getElementById('minidlna_status'); diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm index 49d120c1ae..259f3c975b 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm @@ -5,7 +5,7 @@ -%> <script type="text/javascript">//<![CDATA[ -XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null, +XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null, function(x, status) { var statusDiv = document.getElementById('mwan_status_text'); diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm index 12700c4a36..77fce3f913 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm @@ -14,7 +14,7 @@ </ul> <script type="text/javascript">//<![CDATA[ - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "detailed_status")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "detailed_status")%>', null, function(x) { var output = document.getElementById('diag-rc-output'); diff --git a/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm b/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm index c8f3f33d6b..9c69514b95 100644 --- a/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm +++ b/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm @@ -11,7 +11,7 @@ ); } - XHR.poll(5, '<%=url('admin/services/ocserv/status')%>', null, + XHR.poll(-1, '<%=url('admin/services/ocserv/status')%>', null, function(x, st) { var tb = document.getElementById('ocserv_status_table'); diff --git a/applications/luci-app-privoxy/luasrc/view/privoxy/detail_startstop.htm b/applications/luci-app-privoxy/luasrc/view/privoxy/detail_startstop.htm index 85975ac7d1..12df6fbab3 100644 --- a/applications/luci-app-privoxy/luasrc/view/privoxy/detail_startstop.htm +++ b/applications/luci-app-privoxy/luasrc/view/privoxy/detail_startstop.htm @@ -26,7 +26,7 @@ ); } - XHR.poll(5, '<%=url('admin/services/privoxy/status')%>', null, + XHR.poll(-1, '<%=url('admin/services/privoxy/status')%>', null, function(x, data) { _data2elements(x); } ); diff --git a/applications/luci-app-radicale/luasrc/view/radicale/btn_startstop.htm b/applications/luci-app-radicale/luasrc/view/radicale/btn_startstop.htm index d9ef82214f..48c2a84252 100644 --- a/applications/luci-app-radicale/luasrc/view/radicale/btn_startstop.htm +++ b/applications/luci-app-radicale/luasrc/view/radicale/btn_startstop.htm @@ -26,7 +26,7 @@ ); } - XHR.poll(5, '<%=url([[admin/services/radicale/status]])%>', null, + XHR.poll(-1, '<%=url([[admin/services/radicale/status]])%>', null, function(x, data) { _data2elements(x); } ); diff --git a/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm b/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm index f016dd47e6..27e101a4da 100644 --- a/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm +++ b/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm @@ -14,7 +14,7 @@ <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>" value="<%:Add%>" /> </div> <script type="text/javascript">//<![CDATA[ - XHR.poll(5, '<%=url('admin/services/shadowsocks-libev/status')%>', null, + XHR.poll(-1, '<%=url('admin/services/shadowsocks-libev/status')%>', null, function(x, st) { var names = [ diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm index 25c29b8bbe..221f915f8c 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm @@ -10,7 +10,7 @@ This is free software, licensed under the Apache License, Version 2.0 //<![CDATA[ function log_update() { - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "travelmate", "logread")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "travelmate", "logread")%>', null, function(x) { if (!x) diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm index 0b025fdaee..90c3e2b779 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm @@ -84,7 +84,7 @@ This is free software, licensed under the Apache License, Version 2.0 status_update(json_info) }); - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "travelmate", "status")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "travelmate", "status")%>', null, function(x, json_info) { if (!x || !json_info) diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm index 98e2e64bce..0e78803d06 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm @@ -86,7 +86,7 @@ This is free software, licensed under the Apache License, Version 2.0 status_update(json_info) }); - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "travelmate", "status")%>', null, + XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "travelmate", "status")%>', null, function(x, json_info) { if (!x || !json_info) diff --git a/applications/luci-app-upnp/luasrc/view/upnp_status.htm b/applications/luci-app-upnp/luasrc/view/upnp_status.htm index ea79e57a6a..7238a56802 100644 --- a/applications/luci-app-upnp/luasrc/view/upnp_status.htm +++ b/applications/luci-app-upnp/luasrc/view/upnp_status.htm @@ -10,7 +10,7 @@ ); } - XHR.poll(5, '<%=url('admin/services/upnp/status')%>', null, + XHR.poll(-1, '<%=url('admin/services/upnp/status')%>', null, function(x, st) { var tb = document.getElementById('upnp_status_table'); diff --git a/applications/luci-app-wireguard/luasrc/view/wireguard.htm b/applications/luci-app-wireguard/luasrc/view/wireguard.htm index 6ec9ddb368..53968da1da 100644 --- a/applications/luci-app-wireguard/luasrc/view/wireguard.htm +++ b/applications/luci-app-wireguard/luasrc/view/wireguard.htm @@ -113,7 +113,7 @@ } } - XHR.poll(5, '<%=REQUEST_URI%>', { status: 1 }, + XHR.poll(-1, '<%=REQUEST_URI%>', { status: 1 }, function(x, data) { for (var key in data) { if (!data.hasOwnProperty(key)) { continue; } diff --git a/modules/luci-base/htdocs/luci-static/resources/xhr.js b/modules/luci-base/htdocs/luci-static/resources/xhr.js index 8292fcdb6c..3133898b5e 100644 --- a/modules/luci-base/htdocs/luci-static/resources/xhr.js +++ b/modules/luci-base/htdocs/luci-static/resources/xhr.js @@ -169,8 +169,8 @@ XHR.post = function(url, data, callback) { } 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; diff --git a/modules/luci-base/luasrc/view/header.htm b/modules/luci-base/luasrc/view/header.htm index 2813c4d943..d68e39f917 100644 --- a/modules/luci-base/luasrc/view/header.htm +++ b/modules/luci-base/luasrc/view/header.htm @@ -18,6 +18,7 @@ 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> diff --git a/modules/luci-base/luasrc/view/lease_status.htm b/modules/luci-base/luasrc/view/lease_status.htm index 15b6b6908e..bf2a8968d1 100644 --- a/modules/luci-base/luasrc/view/lease_status.htm +++ b/modules/luci-base/luasrc/view/lease_status.htm @@ -1,5 +1,5 @@ <script type="text/javascript">//<![CDATA[ - XHR.poll(5, '<%=url('admin/dhcplease_status')%>', null, + XHR.poll(-1, '<%=url('admin/dhcplease_status')%>', null, function(x, st) { var tb = document.getElementById('lease_status_table'); diff --git a/modules/luci-base/luasrc/view/wifi_assoclist.htm b/modules/luci-base/luasrc/view/wifi_assoclist.htm index b7147bfb71..f6f66fbbc6 100644 --- a/modules/luci-base/luasrc/view/wifi_assoclist.htm +++ b/modules/luci-base/luasrc/view/wifi_assoclist.htm @@ -44,7 +44,7 @@ }); } - XHR.poll(5, '<%=url('admin/wireless_assoclist')%>', null, + XHR.poll(-1, '<%=url('admin/wireless_assoclist')%>', null, function(x, st) { var tb = document.getElementById('wifi_assoclist_table'); diff --git a/modules/luci-mod-network/luasrc/view/admin_network/switch_status.htm b/modules/luci-mod-network/luasrc/view/admin_network/switch_status.htm index 68f0bbc9d4..6e741b419a 100644 --- a/modules/luci-mod-network/luasrc/view/admin_network/switch_status.htm +++ b/modules/luci-mod-network/luasrc/view/admin_network/switch_status.htm @@ -21,7 +21,7 @@ return status_row; } - XHR.poll(5, '<%=url('admin/network/switch_status')%>/' + switches.join(','), null, + XHR.poll(-1, '<%=url('admin/network/switch_status')%>/' + switches.join(','), null, function(x, st) { for (var i = 0; i < switches.length; i++) diff --git a/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm b/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm index 37d8ae0e85..2c96eb4180 100644 --- a/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm +++ b/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm @@ -1,7 +1,7 @@ <%+cbi/valueheader%> <script type="text/javascript">//<![CDATA[ - XHR.poll(5, '<%=url('admin/system/clock_status')%>', null, + XHR.poll(-1, '<%=url('admin/system/clock_status')%>', null, function(x, rv) { var s = document.getElementById('<%=self.option%>-clock-status'); |