Skip to content

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

display the bar only, if it makes sense.

allo1dd178106304
diff --git a/htroot/Network.html b/htroot/Network.html
index 9b1c8a2ec..16c06c7f3 100644
--- a/htroot/Network.html
+++ b/htroot/Network.html
@@ -105,9 +105,11 @@
<tr><td colspan="16" align="left"><p><font size="-3"><i>runtime: #[rt]# ms</i></font></p></td></tr>
</table>
</p>
+#(progressbar)#::
Progress towards the next Peer: #[percent]#%.<br />
At current PPM you will reach him #(timemessage)#in a unknown time::in #[time]#::never, because he is faster than you#(/timemessage)#.<br />
#{percent}#<img src="/env/grafics/green-bar.png">#{/percent}##{percent2}#<img src="/env/grafics/red-bar.png">#{/percent2}#
+#(/progressbar)#
::
<p><font size="1">All Peers:<br>
<table border="0" cellpadding="2" cellspacing="1">
diff --git a/htroot/Network.java b/htroot/Network.java
index d18e5b7ce..3336bf3c2 100644
--- a/htroot/Network.java
+++ b/htroot/Network.java
@@ -418,20 +418,26 @@ public class Network {
prop.put("table_total", (maxCount > conCount) ? conCount : maxCount);
prop.put("table_complete", ((complete)? 1 : 0) );
- int percent=(int)((float)(myValue-prevValue)/(float)(nextValue-prevValue)*100);
- long indexdiff=nextValue-myValue;
- long ppmdiff=myPPM-nextPPM;
- prop.put("table_percent", percent);
- prop.put("table_percent2", 100-percent);
- if(indexdiff!=0 && ppmdiff!=0)
- if(ppmdiff<0){
- prop.put("table_timemessage", 2);
- }else{
- prop.put("table_timemessage", 1);
- prop.put("table_timemessage_time", serverDate.intervalToString( (int)((float)indexdiff/(float)ppmdiff)*1000 ));
- }
- else
- prop.put("table_timemessage", 0);
+ if( (!post.containsKey("order") && !post.containsKey("sort")) && page==1){
+ int percent=(int)((float)(myValue-prevValue)/(float)(nextValue-prevValue)*100);
+ long indexdiff=nextValue-myValue;
+ long ppmdiff=myPPM-nextPPM;
+ prop.put("table_progressbar", 1); //display the bar
+ prop.put("table_progressbar_percent", percent);
+ prop.put("table_progressbar_percent2", 100-percent);
+ if(indexdiff!=0 && ppmdiff!=0)
+ if(ppmdiff<0){
+ prop.put("table_progressbar_timemessage", 2);
+ }else{
+ prop.put("table_progressbar_timemessage", 1);
+ prop.put("table_progressbar_timemessage_time", serverDate.intervalToString( (int)((float)indexdiff/(float)ppmdiff)*1000 ));
+ }
+ else
+ prop.put("table_progressbar_timemessage", 0);
+ }else{
+ prop.put("table_progressbar", 0); //no display
+ }
+
}
}
prop.put("page", page);