Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

count to the next update

allo6b20ccaa0f7d
diff --git a/htroot/WatchCrawler.html b/htroot/WatchCrawler.html
index 55952aec8..3f61a8853 100644
--- a/htroot/WatchCrawler.html
+++ b/htroot/WatchCrawler.html
@@ -11,11 +11,11 @@
<br>
<h2>Watch Crawler</h2>
<p />
-Indexing Queue:<br />
<div>
-Loader:
+Next update in <span id="nextUpdate" onclick="changeInterval()"></span> seconds.<br />
PPM: <span id="ppm">&nbsp;&nbsp;&nbsp;</span>
</div>
+Loader:
<table border="0" cellpadding="2" cellspacing="1" id="loaderTable" width="100%">
<tbody>
<tr class="TableHeader">
diff --git a/htroot/js/WatchCrawler.js b/htroot/js/WatchCrawler.js
index 19324df03..580a38713 100644
--- a/htroot/js/WatchCrawler.js
+++ b/htroot/js/WatchCrawler.js
@@ -2,6 +2,42 @@ DELETE_STRING="delete"
var statusRPC;
var queuesRPC;
+var refreshInterval=5;
+var wait=0;
+var changing=false; //change the interval
+
+refresh();
+//loadInterval=window.setInterval("refresh()", refreshInterval*1000);
+countInterval=window.setInterval("countdown()", 1000);
+
+function changeInterval(){
+ if(!changing){
+ window.clearInterval(countInterval);
+ counter=document.getElementById("nextUpdate");
+ counter.innerHTML='<input type="text" id="newInterval" onblur="newInterval()" size="2" />';
+ document.getElementById("newInterval").focus();
+ changing=true;
+ }
+}
+function newInterval(){
+ refreshInterval=document.getElementById("newInterval").value;
+ refresh();
+ countInterval=window.setInterval("countdown()", 1000);
+ changing=false;
+}
+function countdown(){
+ document.getElementById("nextUpdate").innerHTML=wait;
+ wait--;
+ if(wait==0){
+ refresh()
+ }
+}
+function refresh(){
+ wait=refreshInterval;
+ requestStatus();
+ requestQueues();
+}
+
function requestStatus(){
statusRPC=createRequestObject()
statusRPC.open('get', '/xml/status_p.xml');
@@ -15,8 +51,7 @@ function requestQueues(){
queuesRPC.send(null);
}
-window.setInterval("requestStatus()", 5000);
-window.setInterval("requestQueues()", 5000);
+
function handleStatus(){