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> <tr><td colspan="16" align="left"><p><font size="-3"><i>runtime: #[rt]# ms</i></font></p></td></tr>
</table> </table>
</p> </p>
#(progressbar)#::
Progress towards the next Peer: #[percent]#%.<br /> 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 /> 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}# #{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> <p><font size="1">All Peers:<br>
<table border="0" cellpadding="2" cellspacing="1"> <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_total", (maxCount > conCount) ? conCount : maxCount);
prop.put("table_complete", ((complete)? 1 : 0) ); prop.put("table_complete", ((complete)? 1 : 0) );
int percent=(int)((float)(myValue-prevValue)/(float)(nextValue-prevValue)*100); if( (!post.containsKey("order") && !post.containsKey("sort")) && page==1){
long indexdiff=nextValue-myValue; int percent=(int)((float)(myValue-prevValue)/(float)(nextValue-prevValue)*100);
long ppmdiff=myPPM-nextPPM; long indexdiff=nextValue-myValue;
prop.put("table_percent", percent); long ppmdiff=myPPM-nextPPM;
prop.put("table_percent2", 100-percent); prop.put("table_progressbar", 1); //display the bar
if(indexdiff!=0 && ppmdiff!=0) prop.put("table_progressbar_percent", percent);
if(ppmdiff<0){ prop.put("table_progressbar_percent2", 100-percent);
prop.put("table_timemessage", 2); if(indexdiff!=0 && ppmdiff!=0)
}else{ if(ppmdiff<0){
prop.put("table_timemessage", 1); prop.put("table_progressbar_timemessage", 2);
prop.put("table_timemessage_time", serverDate.intervalToString( (int)((float)indexdiff/(float)ppmdiff)*1000 )); }else{
} prop.put("table_progressbar_timemessage", 1);
else prop.put("table_progressbar_timemessage_time", serverDate.intervalToString( (int)((float)indexdiff/(float)ppmdiff)*1000 ));
prop.put("table_timemessage", 0); }
else
prop.put("table_progressbar_timemessage", 0);
}else{
prop.put("table_progressbar", 0); //no display
}
} }
} }
prop.put("page", page); prop.put("page", page);

Loading…
Cancel
Save