forked from I2P_Developers/i2p.i2p
SU3 News: Tweaks after testing
Console /debug: Move DHT section to bottom
This commit is contained in:
@ -351,6 +351,7 @@ public class NewsXMLParser {
|
|||||||
}
|
}
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
ioe.printStackTrace();
|
ioe.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,11 +358,12 @@ class NewsFetcher extends UpdateRunner {
|
|||||||
} else {
|
} else {
|
||||||
from = _tempFile;
|
from = _tempFile;
|
||||||
}
|
}
|
||||||
boolean copied = FileUtil.copy(from, _newsFile, true, false);
|
boolean copied = FileUtil.rename(from, _newsFile);
|
||||||
_tempFile.delete();
|
_tempFile.delete();
|
||||||
if (copied) {
|
if (copied) {
|
||||||
String newVer = Long.toString(now);
|
String newVer = Long.toString(now);
|
||||||
_context.router().saveConfig(NewsHelper.PROP_LAST_UPDATED, newVer);
|
_context.router().saveConfig(NewsHelper.PROP_LAST_UPDATED, newVer);
|
||||||
|
// fixme su3 version ? but it will be older than file version, which is older than now.
|
||||||
_mgr.notifyVersionAvailable(this, _currentURI, NEWS, "", HTTP,
|
_mgr.notifyVersionAvailable(this, _currentURI, NEWS, "", HTTP,
|
||||||
null, newVer, "");
|
null, newVer, "");
|
||||||
_isNewer = true;
|
_isNewer = true;
|
||||||
@ -462,14 +463,7 @@ class NewsFetcher extends UpdateRunner {
|
|||||||
try {
|
try {
|
||||||
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(to), "UTF-8"));
|
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(to), "UTF-8"));
|
||||||
out.write("<!--\n");
|
out.write("<!--\n");
|
||||||
// su3 and feed metadata
|
// update metadata in old format
|
||||||
out.write("** News version:\t" + DataHelper.stripHTML(sudVersion) + '\n');
|
|
||||||
out.write("** Signed by:\t" + signingKeyName + '\n');
|
|
||||||
out.write("** Feed:\t" + DataHelper.stripHTML(data.feedTitle) + '\n');
|
|
||||||
out.write("** Feed ID:\t" + DataHelper.stripHTML(data.feedID) + '\n');
|
|
||||||
out.write("** Feed Date:\t" + (new Date(data.feedUpdated)) + "UTC\n");
|
|
||||||
// update metadata
|
|
||||||
out.write("<i2p.news date=\"$Date: 2014-09-20 00:00:00 $\">\n");
|
|
||||||
out.write("<i2p.release ");
|
out.write("<i2p.release ");
|
||||||
if (data.i2pVersion != null)
|
if (data.i2pVersion != null)
|
||||||
out.write(" version=\"" + data.i2pVersion + '"');
|
out.write(" version=\"" + data.i2pVersion + '"');
|
||||||
@ -482,13 +476,19 @@ class NewsFetcher extends UpdateRunner {
|
|||||||
if (data.su3Torrent != null)
|
if (data.su3Torrent != null)
|
||||||
out.write(" su3Torrent=\"" + data.su3Torrent + '"');
|
out.write(" su3Torrent=\"" + data.su3Torrent + '"');
|
||||||
out.write("/>\n");
|
out.write("/>\n");
|
||||||
|
// su3 and feed metadata for debugging
|
||||||
|
out.write("** News version:\t" + DataHelper.stripHTML(sudVersion) + '\n');
|
||||||
|
out.write("** Signed by:\t" + signingKeyName + '\n');
|
||||||
|
out.write("** Feed:\t" + DataHelper.stripHTML(data.feedTitle) + '\n');
|
||||||
|
out.write("** Feed ID:\t" + DataHelper.stripHTML(data.feedID) + '\n');
|
||||||
|
out.write("** Feed Date:\t" + (new Date(data.feedUpdated)) + '\n');
|
||||||
out.write("-->\n");
|
out.write("-->\n");
|
||||||
if (entries == null)
|
if (entries == null)
|
||||||
return;
|
return;
|
||||||
for (NewsEntry e : entries) {
|
for (NewsEntry e : entries) {
|
||||||
if (e.title == null || e.content == null)
|
if (e.title == null || e.content == null)
|
||||||
continue;
|
continue;
|
||||||
out.write("<!-- Entry Date: " + (new Date(e.updated)) + "UTC -->\n");
|
out.write("<!-- Entry Date: " + (new Date(e.updated)) + " -->\n");
|
||||||
out.write("<h3>");
|
out.write("<h3>");
|
||||||
out.write(e.title);
|
out.write(e.title);
|
||||||
out.write("</h3>\n");
|
out.write("</h3>\n");
|
||||||
|
@ -21,12 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
net.i2p.router.RouterContext ctx = (net.i2p.router.RouterContext) net.i2p.I2PAppContext.getGlobalContext();
|
net.i2p.router.RouterContext ctx = (net.i2p.router.RouterContext) net.i2p.I2PAppContext.getGlobalContext();
|
||||||
|
|
||||||
/*
|
|
||||||
* Print out the status for the NetDB
|
|
||||||
*/
|
|
||||||
out.print("<h2>Router DHT</h2>");
|
|
||||||
ctx.netDb().renderStatusHTML(out);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print out the status for the UpdateManager
|
* Print out the status for the UpdateManager
|
||||||
*/
|
*/
|
||||||
@ -58,5 +52,12 @@
|
|||||||
skm.renderStatusHTML(out);
|
skm.renderStatusHTML(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print out the status for the NetDB
|
||||||
|
*/
|
||||||
|
out.print("<h2>Router DHT</h2>");
|
||||||
|
ctx.netDb().renderStatusHTML(out);
|
||||||
|
|
||||||
%>
|
%>
|
||||||
</div></body></html>
|
</div></body></html>
|
||||||
|
Reference in New Issue
Block a user