i2ptunnel: Tooltips for disabled options

This commit is contained in:
zzz
2020-05-08 20:47:39 +00:00
parent 59901ec7c3
commit 69ef47e68c
2 changed files with 37 additions and 19 deletions

View File

@ -493,7 +493,13 @@
} // if httpclient
int currentSigType = editBean.getSigType(curTunnel, tunnelType);
String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" ";
boolean canChangeSigType = editBean.canChangeSigType(curTunnel);
String stopFirst = editBean.isSharedClient(curTunnel) ?
intl._t("Tunnel and all other shared client tunnels must be stopped to change this configuration") :
intl._t("Tunnel must be stopped to change this configuration");
String tstopFirst = " title=\"" + stopFirst + "\" ";
String shdisabled = canChangeSigType ? "" : tstopFirst;
String disabled = canChangeSigType ? "" : " disabled=\"disabled\" ";
%>
</table>
<table class="tunnelConfig" id="cryptoOptions">
@ -502,12 +508,12 @@
<%=intl._t("Tunnel Cryptography Options")%>
</th>
</tr><tr>
<th colspan="2">
<th colspan="2" <%=shdisabled%>>
<%=intl._t("Signature type")%>
</th>
</tr><tr>
<td colspan="2">
<select id="sigType" name="sigType" class="selectbox">
<select id="sigType" name="sigType" class="selectbox" <%=shdisabled%>>
<option title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>" value="0" <%=(currentSigType==0 ? " selected=\"selected\"" : disabled)%> >
DSA-SHA1</option>
<%
@ -542,23 +548,25 @@
<%
boolean has0 = editBean.hasEncType(curTunnel, 0);
boolean has4 = editBean.hasEncType(curTunnel, 4);
String edisabled = editBean.canChangeEncType(curTunnel) ? "" : " disabled=\"disabled\" ";
boolean canChangeEncType = editBean.canChangeEncType(curTunnel);
String ehdisabled = canChangeEncType ? "" : tstopFirst;
String edisabled = canChangeEncType ? "" : " disabled=\"disabled\" ";
%>
<tr>
<th colspan="2">
<th colspan="2" <%=ehdisabled%>>
<%=intl._t("Encryption types")%>
</th>
</tr><tr>
<td colspan="2">
<span class="multiOption">
<span class="multiOption" <%=ehdisabled%>>
<label><input value="0" type="radio" id="startOnLoad" name="encType" <%=(has0 ? " checked=\"checked\"" : edisabled)%> class="tickbox" />
ElGamal-2048</label>
</span>
<span class="multiOption">
<span class="multiOption" <%=ehdisabled%>>
<label><input value="4" type="radio" id="startOnLoad" name="encType" <%=(has4 ? " checked=\"checked\"" : edisabled)%> class="tickbox" />
ECIES-X25519 (<%=intl._t("Experts only!")%>)</label>
</span>
<span class="multiOption">
<span class="multiOption" <%=ehdisabled%>>
<label><input value="4,0" type="radio" id="startOnLoad" name="encType" <%=((has0 && has4) ? " checked=\"checked\"" : edisabled)%> class="tickbox" />
<%=intl._t("Both encryption types")%></label>
</span>

View File

@ -406,6 +406,11 @@
} // isAdvanced() End outbound config section
%>
<%
boolean canChangeEncType = editBean.canChangeEncType(curTunnel);
String stopFirst = intl._t("Tunnel must be stopped to change this configuration");
String tstopFirst = " title=\"" + stopFirst + "\" ";
String ehdisabled = canChangeEncType ? "" : tstopFirst;
// TODO, encrypted + offline is unimplemented
if (!editBean.getIsOfflineKeys(curTunnel)) {
%>
@ -423,10 +428,9 @@
<td colspan="2">
<%
String curEncryptMode = editBean.getEncryptMode(curTunnel);
boolean canChangeEncType = editBean.canChangeEncType(curTunnel);
String cdisabled = canChangeEncType ? "" : " disabled=\"disabled\" ";
%>
<select id="encryptMode" name="encryptMode" class="selectbox">
<select id="encryptMode" name="encryptMode" class="selectbox" <%=ehdisabled%>>
<option title="<%=intl._t("Allow all clients to connect to this service")%>" value="0" <%=(curEncryptMode.equals("0") ? " selected=\"selected\"" : cdisabled)%> >
<%=intl._t("Disable")%></option>
<%
@ -495,8 +499,10 @@
<td>
<%
if (allowBlinding /* && editBean.isAdvanced() */) {
String pwTitle = "title=\"" + intl._t("Set password required to access this service") +
(canChangeEncType ? "" : (" - " + stopFirst)) + '"';
%>
<input type="password" name="nofilter_blindedPassword" title="<%=intl._t("Set password required to access this service")%>" value="<%=editBean.getBlindedPassword(curTunnel)%>" class="freetext password" <%=bdisabled%>/>
<input type="password" name="nofilter_blindedPassword" <%=pwTitle%> value="<%=editBean.getBlindedPassword(curTunnel)%>" class="freetext password" <%=bdisabled%>/>
<%
} // allowBlinding
%>
@ -614,15 +620,19 @@
<%
**********************/
int currentSigType = editBean.getSigType(curTunnel, tunnelType);
String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" ";
String tooLate = intl._t("Configuration cannot be changed after destination is created");
String tTooLate = " title=\"" + tooLate + "\" ";
boolean canChangeSigType = editBean.canChangeSigType(curTunnel);
String shdisabled = canChangeSigType ? "" : tTooLate;
String disabled = canChangeSigType ? "" : " disabled=\"disabled\" ";
%>
<tr>
<th colspan="2">
<th colspan="2" <%=shdisabled%>>
<%=intl._t("Signature type")%>
</th>
</tr><tr>
<td colspan="2">
<select id="sigType" name="sigType" class="selectbox">
<select id="sigType" name="sigType" class="selectbox" <%=shdisabled%>>
<option title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>" value="0" <%=(currentSigType==0 ? " selected=\"selected\"" : disabled)%> >
DSA-SHA1</option>
<% if (editBean.isSigTypeAvailable(1)) { %>
@ -652,23 +662,23 @@
<%
boolean has0 = editBean.hasEncType(curTunnel, 0);
boolean has4 = editBean.hasEncType(curTunnel, 4);
String edisabled = editBean.canChangeEncType(curTunnel) ? "" : " disabled=\"disabled\" ";
String edisabled = canChangeEncType ? "" : " disabled=\"disabled\" ";
%>
<tr>
<th colspan="2">
<th colspan="2" <%=ehdisabled%>>
<%=intl._t("Encryption types")%>
</th>
</tr><tr>
<td colspan="2">
<span class="multiOption">
<span class="multiOption" <%=ehdisabled%>>
<label><input value="0" type="radio" id="startOnLoad" name="encType" <%=(has0 ? " checked=\"checked\"" : edisabled)%> class="tickbox" />
ElGamal-2048</label>
</span>
<span class="multiOption">
<span class="multiOption" <%=ehdisabled%>>
<label><input value="4" type="radio" id="startOnLoad" name="encType" <%=(has4 ? " checked=\"checked\"" : edisabled)%> class="tickbox" />
ECIES-X25519 (<%=intl._t("Experts only!")%>)</label>
</span>
<span class="multiOption">
<span class="multiOption" <%=ehdisabled%>>
<label><input value="4,0" type="radio" id="startOnLoad" name="encType" <%=((has0 && has4) ? " checked=\"checked\"" : edisabled)%> class="tickbox" />
<%=intl._t("Both encryption types")%></label>
</span>