display the bar only, if it makes sense.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1738 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent 468ca5b0e6
commit 1dd1781063

@ -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">

@ -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);

Loading…
Cancel
Save