X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=applications%2Fluci-app-ddns%2Fluasrc%2Fview%2Fddns%2Foverview_status.htm;h=b409ed0728a83f9db01914ca8c2ee058eecb8501;hb=3bae3c7f5e8c383e481667fcfeae7765a1dacc75;hp=6cca0e75d9ded6403370de2601c739ff32371f9e;hpb=3efb9ed60b09f3b6377af204803b2223ea4da625;p=project%2Fluci.git 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 6cca0e75d..b409ed072 100644 --- a/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm +++ b/applications/luci-app-ddns/luasrc/view/ddns/overview_status.htm @@ -19,7 +19,7 @@ var section = data[i].section // Section to handle var cbx = document.getElementById("cbid.ddns." + section + ".enabled"); // Enabled var btn = document.getElementById("cbid.ddns." + section + "._startstop"); // Start/Stop button - var rip = document.getElementById("cbid.ddns." + section + "._domainIP.two"); // Registered IP + var rip = document.getElementById("cbid.ddns." + section + "._lookupIP.two"); // Registered IP var lup = document.getElementById("cbid.ddns." + section + "._update.one"); // Last Update var nup = document.getElementById("cbid.ddns." + section + "._update.two"); // Next Update if ( !(cbx && btn && rip && lup && nup) ) { return; } // security check @@ -76,12 +76,12 @@ break; } - // domain - // (data[i].domain ignored here + // lookup + // (data[i].lookup ignored here // registered IP // rip.innerHTML = "Registered IP"; - if (data[i].domain == "_nodomain_") + if (data[i].lookup == "_nolookup_") rip.innerHTML = ''; else if (data[i].reg_ip == "_nodata_") rip.innerHTML = '<%:No data%>'; @@ -136,7 +136,7 @@ // do start/stop var btnXHR = new XHR(); - btnXHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "startstop")%>/' + section + '/' + cbx.checked, null, + btnXHR.post('<%=url([[admin]], [[services]], [[ddns]], [[startstop]])%>/' + section + '/' + cbx.checked, { token: '<%=token%>' }, function(x, data) { if (x.responseText == "_uncommitted_") { // we need a trick to display Ampersand "&" in stead of "&" or "&" @@ -146,8 +146,7 @@ } else { // should have data because status changed // so update screen - if (data) - _data2elements(data); + if (data) { _data2elements(data); } } // make me invisible obj.parentNode.style.display = "none"; @@ -155,20 +154,19 @@ ); } - var ddns_ov_XHR = new XHR(); // force to immediate show status on page load (not waiting for XHR.poll) - ddns_ov_XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.get('<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, function(x, data) { - _data2elements(data); + if (data) { _data2elements(data); } } ); // 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 - ddns_ov_XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "services", "ddns", "status")%>', null, + XHR.poll(5, '<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null, function(x, data) { - _data2elements(data); + if (data) { _data2elements(data); } } );