Skip to content

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

all queues on WatchCrawler.html

alloa4b3981f332b
diff --git a/htroot/WatchCrawler.html b/htroot/WatchCrawler.html
index 85adcf871..55952aec8 100644
--- a/htroot/WatchCrawler.html
+++ b/htroot/WatchCrawler.html
@@ -13,22 +13,61 @@
<p />
Indexing Queue:<br />
<div>
+Loader:
+PPM: <span id="ppm">&nbsp;&nbsp;&nbsp;</span>
+</div>
+<table border="0" cellpadding="2" cellspacing="1" id="loaderTable" width="100%">
+ <tbody>
+ <tr class="TableHeader">
+ <th class="small">Initiator</th>
+ <th class="small">Depth</th>
+ <th class="small">Modified Date</th>
+ <th class="small">Anchor Name</th>
+ <th class="small" width="100%">URL</th>
+ </tr>
+ </tbody>
+</table>
+<div>
+Indexing Queue:
Queue Size: <span id="indexingqueuesize">&nbsp;&nbsp;&nbsp;</span>
Queue Max: <span id="indexingqueuemax">&nbsp;&nbsp;&nbsp;</span>
-PPM: <span id="ppm">&nbsp;&nbsp;&nbsp;</span>
</div>
<table border="0" cellpadding="2" cellspacing="1" id="indexingTable" width="100%">
-<tbody>
-<tr class="TableHeader">
-<th class="small">Initiator</th>
-<th class="small">Depth</th>
-<th class="small">Modified Date</th>
-<th class="small">Anchor Name</th>
-<th class="small" width="100%">URL</th>
-<th class="small">Size</th>
-<th class="small">Delete</th>
-</tr>
-</tbody>
+ <tbody>
+ <tr class="TableHeader">
+ <th class="small">Initiator</th>
+ <th class="small">Depth</th>
+ <th class="small">Modified Date</th>
+ <th class="small">Anchor Name</th>
+ <th class="small" width="100%">URL</th>
+ <th class="small">Size</th>
+ <th class="small">Delete</th>
+ </tr>
+ </tbody>
+</table>
+<div>Local Crawler</div>
+<table border="0" cellpadding="2" cellspacing="1" id="localCrawlerTable" width="100%">
+ <tbody>
+ <tr class="TableHeader">
+ <th class="small">Initiator</th>
+ <th class="small">Depth</th>
+ <th class="small">Modified Date</th>
+ <th class="small">Anchor Name</th>
+ <th class="small" width="100%">URL</th>
+ </tr>
+ </tbody>
+</table>
+<div>Remote Crawler</div>
+<table border="0" cellpadding="2" cellspacing="1" id="remoteCrawlerTable" width="100%">
+ <tbody>
+ <tr class="TableHeader">
+ <th class="small">Profile</th>
+ <th class="small">Depth</th>
+ <th class="small">Modified Date</th>
+ <th class="small">Anchor Name</th>
+ <th class="small" width="100%">URL</th>
+ </tr>
+ </tbody>
</table>
#%env/templates/footer.template%#
diff --git a/htroot/js/WatchCrawler.js b/htroot/js/WatchCrawler.js
index fb27c169f..19324df03 100644
--- a/htroot/js/WatchCrawler.js
+++ b/htroot/js/WatchCrawler.js
@@ -46,20 +46,60 @@ function handleQueues(){
return;
}
var queuesResponse = queuesRPC.responseXML;
- indexingTable=document.getElementById("indexingTable");
xml=getFirstChild(queuesResponse);
if(queuesResponse != null){
- entries=getFirstChild(xml, "indexingqueue").getElementsByTagName("entry");
+ createIndexingTable(getFirstChild(xml, "indexingqueue"));
+ createLoaderTable(getFirstChild(xml, "loaderqueue"));
+ createLocalCrawlerTable(getFirstChild(xml, "localcrawlerqueue"));
+ createRemoteCrawlerTable(getFirstChild(xml, "remotecrawlerqueue"));
+ }
+}
+function clearTable(table, numSkip){
+ if(numSkip==null){
+ numSkip=0;
+ }
+ row=getFirstChild(getFirstChild(table, "tbody"), "tr");
+ //skip numSkip rows
+ for(i=0;i<numSkip;i++){
+ row=getNextSibling(row, "tr");
}
-
- //skip the Tableheade
- row=getNextSibling(getFirstChild(getFirstChild(indexingTable, "tbody"), "tr"), "tr")
- //row=indexingTable.firstChild.nextSibling.firstChild.nextSibling.nextSibling;
-
while(row != null){ //delete old entries
- getFirstChild(indexingTable, "").removeChild(row);
- row=getNextSibling(getFirstChild(getFirstChild(indexingTable, "tbody"), "tr"), "tr")
+ getFirstChild(table, "tbody").removeChild(row);
+ row=getFirstChild(getFirstChild(table, "tbody"), "tr");
+ //skip numSkip rows
+ for(i=0;i<numSkip;i++){
+ row=getNextSibling(row, "tr");
+ }
}
+}
+function createLoaderTable(loaderqueue){
+ entries=loaderqueue.getElementsByTagName("entry");
+ loaderTable=document.getElementById("loaderTable");
+ clearTable(loaderTable, 1);
+ dark=false;
+ for(i=0;i<entries.length;i++){
+ initiator=getValue(getFirstChild(entries[i], "initiator"));
+ depth=getValue(getFirstChild(entries[i], "depth"));
+ modified=getValue(getFirstChild(entries[i], "modified"));
+ anchor=getValue(getFirstChild(entries[i], "anchor"));
+ url=getValue(getFirstChild(entries[i], "url"));
+
+ row=createLoaderRow(initiator, depth, modified, anchor, url);
+
+ //create row
+ if(dark){
+ row.setAttribute("class", "TableCellDark");
+ }else{
+ row.setAttribute("class", "TableCellLight");
+ }
+ getFirstChild(loaderTable, "tbody").appendChild(row);
+ dark=!dark;
+ }
+}
+function createIndexingTable(indexingqueue){
+ indexingTable=document.getElementById("indexingTable");
+ entries=indexingqueue.getElementsByTagName("entry");
+ clearTable(indexingTable, 1);
dark=false;
for(i=0;i<entries.length;i++){
@@ -76,6 +116,7 @@ function handleQueues(){
}
row=createIndexingRow(initiator, depth, modified, anchor, url, size, hash);
+
//create row
if(inProcess){
row.setAttribute("class", "TableCellActive");
@@ -88,6 +129,70 @@ function handleQueues(){
dark=!dark;
}
}
+function createLocalCrawlerTable(localcrawlerqueue){
+ localCrawlerTable=document.getElementById("localCrawlerTable");
+ entries=localcrawlerqueue.getElementsByTagName("entry");
+ clearTable(localCrawlerTable, 1);
+
+ dark=false;
+ for(i=0;i<entries.length;i++){
+ initiator=getValue(getFirstChild(entries[i], "initiator"));
+ depth=getValue(getFirstChild(entries[i], "depth"));
+ modified=getValue(getFirstChild(entries[i], "modified"));
+ anchor=getValue(getFirstChild(entries[i], "anchor"));
+ url=getValue(getFirstChild(entries[i], "url"));
+ //hash=getValue(getFirstChild(entries[i], "hash"));
+ inProcess=false;
+ if(getValue(getFirstChild(entries[i], "inProcess"))=="true"){
+ inProcess=true;
+ }
+
+ row=createLocalCrawlerRow(initiator, depth, modified, anchor, url);
+
+ //create row
+ if(inProcess){
+ row.setAttribute("class", "TableCellActive");
+ }else if(dark){
+ row.setAttribute("class", "TableCellDark");
+ }else{
+ row.setAttribute("class", "TableCellLight");
+ }
+ getFirstChild(localCrawlerTable, "tbody").appendChild(row);
+ dark=!dark;
+ }
+}
+function createRemoteCrawlerTable(remotecrawlerqueue){
+ remoteCrawlerTable=document.getElementById("remoteCrawlerTable");
+ entries=remotecrawlerqueue.getElementsByTagName("entry");
+ clearTable(remoteCrawlerTable, 1);
+
+ dark=false;
+ for(i=0;i<entries.length;i++){
+ profile=getValue(getFirstChild(entries[i], "profile"));
+ depth=getValue(getFirstChild(entries[i], "depth"));
+ modified=getValue(getFirstChild(entries[i], "modified"));
+ anchor=getValue(getFirstChild(entries[i], "anchor"));
+ url=getValue(getFirstChild(entries[i], "url"));
+ //hash=getValue(getFirstChild(entries[i], "hash"));
+ inProcess=false;
+ if(getValue(getFirstChild(entries[i], "inProcess"))=="true"){
+ inProcess=true;
+ }
+
+ row=createRemoteCrawlerRow(profile, depth, modified, anchor, url);
+
+ //create row
+ if(inProcess){
+ row.setAttribute("class", "TableCellActive");
+ }else if(dark){
+ row.setAttribute("class", "TableCellDark");
+ }else{
+ row.setAttribute("class", "TableCellLight");
+ }
+ getFirstChild(remoteCrawlerTable, "tbody").appendChild(row);
+ dark=!dark;
+ }
+}
function getValue(element){
if(element == null){
return "";
@@ -149,6 +254,33 @@ function createIndexingRow(initiator, depth, modified, anchor, url, size, hash){
row.appendChild(createLinkCol("IndexCreateIndexingQueue_p.html?deleteEntry="+hash, DELETE_STRING));
return row;
}
+function createLoaderRow(initiator, depth, modified, anchor, url){
+ row=document.createElement("tr");
+ row.appendChild(createCol(initiator));
+ row.appendChild(createCol(depth));
+ row.appendChild(createCol(modified));
+ row.appendChild(createCol(anchor));
+ row.appendChild(createLinkCol(url, url));
+ return row;
+}
+function createLocalCrawlerRow(initiator, depth, modified, anchor, url){
+ row=document.createElement("tr");
+ row.appendChild(createCol(initiator));
+ row.appendChild(createCol(depth));
+ row.appendChild(createCol(modified));
+ row.appendChild(createCol(anchor));
+ row.appendChild(createLinkCol(url, url));
+ return row;
+}
+function createRemoteCrawlerRow(profile, depth, modified, anchor, url){
+ row=document.createElement("tr");
+ row.appendChild(createCol(profile));
+ row.appendChild(createCol(depth));
+ row.appendChild(createCol(modified));
+ row.appendChild(createCol(anchor));
+ row.appendChild(createLinkCol(url, url));
+ return row;
+}
function createLinkCol(url, linktext){
col=document.createElement("td");
link=document.createElement("a");