From 697804941604a13b20f74d26ec1a1b3f573390c4 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 1 Jan 2021 10:49:14 -0500 Subject: [PATCH] Console: Link to our gitlab on /jars --- .../router/web/helpers/FileDumpHelper.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/FileDumpHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/FileDumpHelper.java index 3673b2761..c8b53c06e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/FileDumpHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/FileDumpHelper.java @@ -32,6 +32,8 @@ import net.i2p.util.SystemVersion; public class FileDumpHelper extends HelperBase { private static final boolean isWindows = SystemVersion.isWindows(); + private static final String LINK = "http://git.idk.i2p/i2p-hackers/i2p.i2p/-/tree/"; + public String getFileSummary() { StringBuilder buf = new StringBuilder(16*1024); buf.append("\n" + @@ -56,7 +58,7 @@ public class FileDumpHelper extends HelperBase { } Collections.sort(flist); for (File f : flist) { - dumpFile(buf, f); + dumpFile(buf, f, true); } } @@ -65,14 +67,14 @@ public class FileDumpHelper extends HelperBase { buf.append("\n"); - dumpDir(buf, dir, ".jar"); + dumpDir(buf, dir, ".jar", true); // our wars dir = new File(_context.getBaseDir(), "webapps"); buf.append("\n"); - dumpDir(buf, dir, ".war"); + dumpDir(buf, dir, ".war", true); // plugins File pluginDir = new File(_context.getConfigDir(), PluginStarter.PLUGIN_DIR); @@ -87,9 +89,9 @@ public class FileDumpHelper extends HelperBase { buf.append(""); - dumpDir(buf, dir, ".jar"); + dumpDir(buf, dir, ".jar", false); dir = new File(files[i], "console/webapps"); - dumpDir(buf, dir, ".war"); + dumpDir(buf, dir, ".war", false); } } @@ -97,17 +99,17 @@ public class FileDumpHelper extends HelperBase { return buf.toString(); } - private static void dumpDir(StringBuilder buf, File dir, String suffix) { + private static void dumpDir(StringBuilder buf, File dir, String suffix, boolean linkrev) { File[] files = dir.listFiles(new FileSuffixFilter(suffix)); if (files == null) return; Arrays.sort(files); for (int i = 0; i < files.length; i++) { - dumpFile(buf, files[i]); + dumpFile(buf, files[i], linkrev); } } - private static void dumpFile(StringBuilder buf, File f) { + private static void dumpFile(StringBuilder buf, File f, boolean linkrev) { buf.append("" + "" + "
FileSizeDateSHA 256Revision
Router Jar Files: "); buf.append(dir.getAbsolutePath()); buf.append("
Router War Files: "); buf.append(dir.getAbsolutePath()); buf.append("
Plugin File Location: "); buf.append(dir.getAbsolutePath()); buf.append("
").append(f.getName()).append("").append(f.length()).append(""); @@ -143,13 +145,13 @@ public class FileDumpHelper extends HelperBase { if (s != null && s.length() > 20) { if (iv != null) buf.append("
"); - // fix and uncomment if a reliable viewmtn host appears - //buf.append(""); + if (linkrev) + buf.append(""); buf.append("").append(s.substring(0, 20)).append("" + "
" + "").append(s.substring(20)).append("
"); - //buf.append(""); + if (linkrev) + buf.append("
"); } buf.append("
"); s = getAtt(att, "Created-By");