Changeset bb05310


Ignore:
Timestamp:
Apr 3, 2009 9:33:35 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8de5609
Parents:
0c7cb9d7
Message:

Console: Fix bug with IE buttons not working, because it sends the label instead of the value

Location:
apps
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java

    r0c7cb9d7 rbb05310  
    143143   
    144144    private String processAction() {
    145         if ( (_action == null) || (_action.trim().length() <= 0) )
     145        if ( (_action == null) || (_action.trim().length() <= 0) || ("Cancel".equals(_action)))
    146146            return "";
    147147        if ( (_prevNonce != _curNonce) && (!validPassphrase(_passphrase)) )
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    r0c7cb9d7 rbb05310  
    3434        } else if (_action.startsWith("Start ")) {
    3535            String app = _action.substring(6);
     36            int appnum = -1;
     37            try {
     38                appnum = Integer.parseInt(app);
     39            } catch (NumberFormatException nfe) {}
     40            if (appnum >= 0)
     41                startClient(appnum);
     42            else
     43                startWebApp(app);
     44        } else if (_action.toLowerCase().startsWith("start<span class=hide> ") &&
     45                   _action.toLowerCase().endsWith("</span>")) {
     46            // IE sucks
     47            String app = _action.substring(23, _action.length() - 7);
    3648            int appnum = -1;
    3749            try {
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java

    r0c7cb9d7 rbb05310  
    6363                buf.append("disabled=\"true\" ");
    6464        }
    65         buf.append("/></td><td>&nbsp");
     65        buf.append("/></td><td>&nbsp;");
    6666        if (!enabled) {
    67             buf.append("<button type=\"submit\" name=\"action\" value=\"Start ").append(index).append("\" >Start</button>");
     67            buf.append("<button type=\"submit\" name=\"action\" value=\"Start ").append(index).append("\" >Start<span class=hide> ").append(index).append("</span></button>");
    6868        }
    69         buf.append("&nbsp</td><td>").append(desc).append("</td></tr>\n");
     69        buf.append("&nbsp;</td><td>").append(desc).append("</td></tr>\n");
    7070    }
    7171}
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java

    r0c7cb9d7 rbb05310  
    2525        String systemNonce = getNonce();
    2626        if ( (nonce != null) && (systemNonce.equals(nonce)) && (action != null) ) {
    27             if ("shutdownImmediate".equals(action)) {
     27            // Normal browsers send value, IE sends button label
     28            if ("shutdownImmediate".equals(action) || "Shutdown immediately".equals(action)) {
    2829                ctx.addShutdownTask(new ConfigServiceHandler.UpdateWrapperManagerTask(Router.EXIT_HARD));
    2930                //ctx.router().shutdown(Router.EXIT_HARD); // never returns
    3031                ctx.router().shutdownGracefully(Router.EXIT_HARD); // give the UI time to respond
    31             } else if ("cancelShutdown".equals(action)) {
     32            } else if ("cancelShutdown".equals(action) || "Cancel shutdown".equals(action)) {
    3233                ctx.router().cancelGracefulShutdown();
    33             } else if ("restartImmediate".equals(action)) {
     34            } else if ("restartImmediate".equals(action) || "Restart immediately".equals(action)) {
    3435                ctx.addShutdownTask(new ConfigServiceHandler.UpdateWrapperManagerTask(Router.EXIT_HARD_RESTART));
    3536                //ctx.router().shutdown(Router.EXIT_HARD_RESTART); // never returns
    3637                ctx.router().shutdownGracefully(Router.EXIT_HARD_RESTART); // give the UI time to respond
    37             } else if ("restart".equals(action)) {
     38            } else if ("restart".equalsIgnoreCase(action)) {
    3839                ctx.addShutdownTask(new ConfigServiceHandler.UpdateWrapperManagerTask(Router.EXIT_GRACEFUL_RESTART));
    3940                ctx.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
    40             } else if ("shutdown".equals(action)) {
     41            } else if ("shutdown".equalsIgnoreCase(action)) {
    4142                ctx.addShutdownTask(new ConfigServiceHandler.UpdateWrapperManagerTask(Router.EXIT_GRACEFUL));
    4243                ctx.router().shutdownGracefully();
  • apps/routerconsole/jsp/configclients.jsp

    r0c7cb9d7 rbb05310  
    66<title>I2P Router Console - config clients</title>
    77<link rel="stylesheet" href="default.css" type="text/css" />
     8<style type='text/css'>
     9button span.hide{
     10    display:none;
     11}
     12</style>
    813</head><body>
    914
Note: See TracChangeset for help on using the changeset viewer.