i2ptunnel: Hide description label if none

Identify shared clients on index page
This commit is contained in:
zzz
2020-05-15 19:32:23 +00:00
parent 09b647f283
commit 31b527a4c4
3 changed files with 41 additions and 8 deletions

View File

@@ -132,10 +132,6 @@ public class EditBean extends IndexBean {
return _helper.shouldStartAutomatically(tunnel);
}
public boolean isSharedClient(int tunnel) {
return _helper.isSharedClient(tunnel);
}
public boolean shouldDelay(int tunnel) {
return _helper.shouldDelayConnect(tunnel);
}

View File

@@ -378,6 +378,13 @@ public class IndexBean {
public static boolean isClient(String type) {
return TunnelController.isClient(type);
}
/**
* @since 0.9.46 moved from subclass
*/
public boolean isSharedClient(int tunnel) {
return _helper.isSharedClient(tunnel);
}
public String getTunnelName(int tunnel) {
String name = _helper.getTunnelName(tunnel);

View File

@@ -179,8 +179,18 @@
%>
<tr>
<td class="tunnelDescription" colspan="6">
<%
String descr = indexBean.getTunnelDescription(curServer);
if (descr != null && descr.length() > 0) {
%>
<span class="tunnelDestinationLabel"><b><%=intl._t("Description")%>:</b></span>
<%=indexBean.getTunnelDescription(curServer)%>
<%=descr%>
<%
} else {
// needed to make the spacing look right
%>&nbsp;<%
} // descr
%>
</td>
</tr>
<%
@@ -299,12 +309,32 @@
<% /* TODO SSL outproxy for httpclient if plugin not present */ %>
<tr>
<td class="tunnelDescription" colspan="6">
<span class="tunnelDescriptionLabel"><b><%=intl._t("Description")%>:</b></span>
<%=indexBean.getTunnelDescription(curClient)%>
<%
boolean isShared = indexBean.isSharedClient(curClient);
String descr = indexBean.getTunnelDescription(curClient);
if (isShared || (descr != null && descr.length() > 0)) {
%>
<span class="tunnelDescriptionLabel">
<%
if (isShared) {
%><b><%=intl._t("Shared Client")%><%
} else {
%><b><%=intl._t("Description")%><%
}
if (descr != null && descr.length() > 0) {
%>:</b></span> <%=descr%><%
} else {
%></b></span><%
}
} else {
// needed to make the spacing look right
%>&nbsp;<%
} // descr
%>
</td>
</tr>
<%
}
} // for loop
%>
<tr>
<td class="newTunnel" colspan="6">