console: Hide cancel graceful shutdown button unless we are shutting down

This commit is contained in:
zzz
2015-03-08 20:23:00 +00:00
parent 0972b6b56a
commit c7d1d2b69a
4 changed files with 18 additions and 2 deletions

View File

@ -183,6 +183,15 @@ public class ConfigServiceHandler extends FormHandler {
} }
} }
/**
* Should we show the cancel button?
*
* @since 0.9.19
*/
public boolean shouldShowCancelGraceful() {
return _context.router().gracefulShutdownInProgress();
}
@Override @Override
protected void processForm() { protected void processForm() {
if (_action == null) return; if (_action == null) return;

View File

@ -25,7 +25,9 @@
<hr><div class="formaction"> <hr><div class="formaction">
<input type="submit" class="stop" name="action" value="<%=intl._("Shutdown gracefully")%>" > <input type="submit" class="stop" name="action" value="<%=intl._("Shutdown gracefully")%>" >
<input type="submit" class="stop" name="action" value="<%=intl._("Shutdown immediately")%>" > <input type="submit" class="stop" name="action" value="<%=intl._("Shutdown immediately")%>" >
<% if (formhandler.shouldShowCancelGraceful()) { %>
<input type="submit" class="cancel" name="action" value="<%=intl._("Cancel graceful shutdown")%>" > <input type="submit" class="cancel" name="action" value="<%=intl._("Cancel graceful shutdown")%>" >
<% } %>
</div> </div>
<% if (System.getProperty("wrapper.version") != null) { %> <% if (System.getProperty("wrapper.version") != null) { %>
<p><%=intl._("If you want the router to restart itself after shutting down, you can choose one of the following.")%> <p><%=intl._("If you want the router to restart itself after shutting down, you can choose one of the following.")%>

View File

@ -1,3 +1,8 @@
2015-03-08 zzz
* i2psnark: Increase min and default bandwidth
* Throttle: Tweak messages during probabalistic rejection
* Transport: Add missing bogons to IP validity check
* 2015-02-22 0.9.18 released * 2015-02-22 0.9.18 released
2015-02-18 kytv 2015-02-18 kytv

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 0; public final static long BUILD = 1;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";