2005-11-25 jrandom
* Don't publish stats for periods we haven't reached yet (thanks zzz!) * Cleaned up the syndie threaded display to show the last updated date for a subthread, and to highlight threads updated in the last two days.
This commit is contained in:
@ -949,7 +949,8 @@ public class BlogManager {
|
||||
}
|
||||
|
||||
private final SimpleDateFormat _dateFormat = new SimpleDateFormat("yyyy/MM/dd", Locale.UK);
|
||||
private final long getDayBegin(long now) {
|
||||
public final long getDayBegin() { return getDayBegin(_context.clock().now()); }
|
||||
public final long getDayBegin(long now) {
|
||||
synchronized (_dateFormat) {
|
||||
try {
|
||||
String str = _dateFormat.format(new Date(now));
|
||||
|
@ -934,7 +934,14 @@ public abstract class BaseServlet extends HttpServlet {
|
||||
"}\n" +
|
||||
".threadNavRight {\n" +
|
||||
" text-align: right;\n" +
|
||||
" float: right;\n" +
|
||||
" background-color: #BBBBBB;\n" +
|
||||
"}\n" +
|
||||
".rightOffset {\n" +
|
||||
" float: right;\n" +
|
||||
" margin: 0 5px 0 0;\n" +
|
||||
" display: inline;\n" +
|
||||
"}\n" +
|
||||
".postMeta {\n" +
|
||||
" background-color: #BBBBFF;\n" +
|
||||
"}\n" +
|
||||
|
@ -99,6 +99,7 @@ public class ViewThreadedServlet extends BaseServlet {
|
||||
}
|
||||
out.write("</td><td class=\"threadNavRight\" nowrap=\"true\">\n");
|
||||
|
||||
out.write("<span class=\"rightOffset\">");
|
||||
int max = index.getRootCount();
|
||||
if (threadOffset + 10 > max) {
|
||||
out.write("Next Page> Last Page>>\n");
|
||||
@ -109,7 +110,8 @@ public class ViewThreadedServlet extends BaseServlet {
|
||||
out.write(getNavLink(req, -1));
|
||||
out.write("\">Last Page>></a>\n");
|
||||
}
|
||||
out.write("<!-- thread nav end -->\n");
|
||||
out.write("</span>");
|
||||
//out.write("<!-- thread nav end -->\n");
|
||||
out.write("</td></tr>\n");
|
||||
}
|
||||
|
||||
@ -247,7 +249,17 @@ public class ViewThreadedServlet extends BaseServlet {
|
||||
out.write("<a href=\"");
|
||||
out.write(getViewPostLink(req, node, user, false));
|
||||
out.write("\" title=\"View post\">");
|
||||
out.write(rend.getEntryDate(node.getEntry().getEntryId()));
|
||||
long dayBegin = BlogManager.instance().getDayBegin();
|
||||
long postId = node.getMostRecentPostDate();
|
||||
if (postId >= dayBegin) {
|
||||
out.write("<b>today</b>");
|
||||
} else if (postId >= dayBegin - 24*60*60*1000) {
|
||||
out.write("<b>yesterday</b>");
|
||||
} else {
|
||||
int daysAgo = (int)((dayBegin - postId + 24*60*60*1000-1)/(24*60*60*1000));
|
||||
out.write(daysAgo + " days ago");
|
||||
}
|
||||
|
||||
out.write(": ");
|
||||
EntryContainer entry = archive.getEntry(node.getEntry());
|
||||
if (entry == null) throw new RuntimeException("Unable to fetch the entry " + node.getEntry());
|
||||
@ -259,9 +271,15 @@ public class ViewThreadedServlet extends BaseServlet {
|
||||
subject = "";
|
||||
out.write(trim(subject, 40));
|
||||
out.write("</a>\n</td><td class=\"threadRight\">\n");
|
||||
out.write("<a href=\"");
|
||||
out.write(getViewThreadLink(req, node, user));
|
||||
out.write("\" title=\"View all posts in the thread\">view thread</a>\n");
|
||||
if (childCount > 0) {
|
||||
out.write(" <a href=\"");
|
||||
out.write(getViewThreadLink(req, node, user));
|
||||
out.write("\" title=\"View all posts in the thread\">view thread</a>\n");
|
||||
} else {
|
||||
out.write("<a href=\"");
|
||||
out.write(getViewPostLink(req, node, user, false));
|
||||
out.write("\" title=\"View the post\">view post</a>\n");
|
||||
}
|
||||
out.write("</td></tr>\n");
|
||||
|
||||
boolean rendered = true;
|
||||
|
@ -1,4 +1,9 @@
|
||||
$Id: history.txt,v 1.327 2005/11/23 11:04:56 jrandom Exp $
|
||||
$Id: history.txt,v 1.328 2005/11/24 03:45:57 jrandom Exp $
|
||||
|
||||
2005-11-25 jrandom
|
||||
* Don't publish stats for periods we haven't reached yet (thanks zzz!)
|
||||
* Cleaned up the syndie threaded display to show the last updated date for
|
||||
a subthread, and to highlight threads updated in the last two days.
|
||||
|
||||
2005-11-24 jrandom
|
||||
* Fix to save syndication settings in Syndie (thanks spaetz!)
|
||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.295 $ $Date: 2005/11/23 11:04:56 $";
|
||||
public final static String ID = "$Revision: 1.296 $ $Date: 2005/11/24 03:45:56 $";
|
||||
public final static String VERSION = "0.6.1.5";
|
||||
public final static long BUILD = 6;
|
||||
public final static long BUILD = 7;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||
System.out.println("Router ID: " + RouterVersion.ID);
|
||||
|
@ -182,6 +182,7 @@ public class StatisticsManager implements Service {
|
||||
if (rate == null) return;
|
||||
long periods[] = rate.getPeriods();
|
||||
for (int i = 0; i < periods.length; i++) {
|
||||
if (periods[i] > _context.router().getUptime()) continue;
|
||||
if (selectedPeriods != null) {
|
||||
boolean found = false;
|
||||
for (int j = 0; j < selectedPeriods.length; j++) {
|
||||
@ -233,22 +234,30 @@ public class StatisticsManager implements Service {
|
||||
private void includeThroughput(Properties stats) {
|
||||
RateStat sendRate = _context.statManager().getRate("bw.sendRate");
|
||||
if (sendRate != null) {
|
||||
Rate r = sendRate.getRate(5*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthSendBps.5m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
r = sendRate.getRate(60*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthSendBps.60m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
if (_context.router().getUptime() > 5*60*1000) {
|
||||
Rate r = sendRate.getRate(5*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthSendBps.5m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
}
|
||||
if (_context.router().getUptime() > 60*60*1000) {
|
||||
Rate r = sendRate.getRate(60*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthSendBps.60m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
}
|
||||
}
|
||||
|
||||
RateStat recvRate = _context.statManager().getRate("bw.recvRate");
|
||||
if (recvRate != null) {
|
||||
Rate r = recvRate.getRate(5*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthReceiveBps.5m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
r = recvRate.getRate(60*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthReceiveBps.60m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
if (_context.router().getUptime() > 5*60*1000) {
|
||||
Rate r = recvRate.getRate(5*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthReceiveBps.5m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
}
|
||||
if (_context.router().getUptime() > 60*60*1000) {
|
||||
Rate r = recvRate.getRate(60*60*1000);
|
||||
if (r != null)
|
||||
stats.setProperty("stat_bandwidthReceiveBps.60m", num(r.getAverageValue()) + ';' + num(r.getExtremeAverageValue()) + ";0;0;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user