I2PTunnel: Add hostname / destination (b32) info to server section on index page

For parity with client tunnels section
This commit is contained in:
str4d
2017-10-25 09:32:07 +00:00
parent 0e5b46e7d8
commit 5ecae1a951
4 changed files with 35 additions and 9 deletions

View File

@@ -63,10 +63,6 @@ public class EditBean extends IndexBean {
return port > 0 ? "" + port : "";
}
public String getSpoofedHost(int tunnel) {
return DataHelper.escapeHTML(_helper.getSpoofedHost(tunnel));
}
public String getPrivateKeyFile(int tunnel) {
return _helper.getPrivateKeyFile(tunnel);
}

View File

@@ -542,6 +542,13 @@ public class IndexBean {
return false;
}
/**
* @since 0.9.32 moved from EditBean
*/
public String getSpoofedHost(int tunnel) {
return DataHelper.escapeHTML(_helper.getSpoofedHost(tunnel));
}
///
/// bean props for form submission
///

View File

@@ -22,11 +22,11 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><%=intl._t("Hidden Services Manager")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<link href="/themes/console/images/favicon.ico" type="image/x-icon" rel="shortcut icon" />
<% if (indexBean.allowCSS()) {
%><link rel="icon" href="<%=indexBean.getTheme()%>images/favicon.ico" />
<link href="<%=indexBean.getTheme()%>i2ptunnel.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css" />
@@ -79,7 +79,7 @@
</div>
<div class="panel" id="servers">
<h2><%=intl._t("I2P Hidden Services")%></h2>
<table id="serverTunnels">
@@ -95,7 +95,6 @@
<%
for (int curServer = 0; curServer < indexBean.getTunnelCount(); curServer++) {
if (indexBean.isClient(curServer)) continue;
%>
@@ -166,6 +165,28 @@
%>
</td>
</tr>
<tr>
<td class="tunnelDestination" colspan="6">
<span class="tunnelDestinationLabel">
<%
String name = indexBean.getSpoofedHost(curServer);
if (name == null || name.equals("")) {
name = indexBean.getTunnelName(curServer);
out.write("<b>");
out.write(intl._t("Destination"));
out.write(":</b></span> ");
out.write(indexBean.getDestHashBase32(curServer));
} else {
out.write("<b>");
out.write(intl._t("Hostname"));
out.write(":</b></span> ");
out.write(name);
}
%>
</td>
</tr>
<tr>
<td class="tunnelDescription" colspan="6">
<span class="tunnelDescriptionLabel"><b>Description:</b></span>
@@ -211,7 +232,7 @@
<%
for (int curClient = 0; curClient < indexBean.getTunnelCount(); curClient++) {
if (!indexBean.isClient(curClient)) continue;
%>
%>
<tr class="tunnelProperties">

View File

@@ -22,6 +22,8 @@
- Add additional reachability states for clockskew and vmcomm (with icons)
- Homepage: Add 'Customize Sidebar' link to signpost the feature now that
there are more optional sections available (ticket #1996)
* I2PTunnel: Add hostname / destination (b32) information to server section on
index page (for parity with client tunnels section)
2017-10-11 zzz
* Console: Validate host header (thx Kevin Froman)