Changeset 13d80e6


Ignore:
Timestamp:
Nov 18, 2018 1:43:18 PM (20 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
a1baf85
Parents:
09ea40c
Message:

Wizard: Ajax fixes for IE (thx zlatinb) (summary bar also)
Form notices on results panel
Hide results if skipped

Location:
apps/routerconsole
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/com/vuze/plugins/mlab/MLabRunner.java

    r09ea40c r13d80e6  
    225225                            results.put("server_host", server_host);
    226226                            if (server_city != null)
    227                                 results.put("server_city", server_city);
     227                                results.put("server_city", server_city.replace("_", ", "));
    228228                            if (server_country != null)
    229229                                results.put("server_country", server_country);
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/WizardHandler.java

    r09ea40c r13d80e6  
    4747            if ("4".equals(page)) {
    4848                startNDT();
     49            } else if ("5".equals(page)) {
     50                synchronized (_helper) {
     51                    if (_helper.isNDTSuccessful()) {
     52                        addFormNotice(_t("Bandwidth test completed successfully"));
     53                    } else if (_helper.isNDTComplete()) {
     54                        addFormError(_t("Bandwidth test failed"));
     55                    } else if (_helper.isNDTRunning()) {
     56                        addFormError(_t("Bandwidth test did not complete"));
     57                    } else {
     58                        // didn't run at all?
     59                        addFormError(_t("Bandwidth test did not complete"));
     60                    }
     61                }
    4962            } else if ("6".equals(page)) {
    5063                Map<String, String> changes = new HashMap<String, String>();
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/WizardHelper.java

    r09ea40c r13d80e6  
    5454    public synchronized boolean isNDTRunning() {
    5555        return _listener != null && !_listener.isComplete();
     56    }
     57
     58    public synchronized boolean isNDTSuccessful() {
     59        return isNDTComplete() && getUpBandwidth() > 0 && getDownBandwidth() > 0;
    5660    }
    5761
  • apps/routerconsole/jsp/js/ajax.js

    r09ea40c r13d80e6  
    77    req.onreadystatechange = function() {ajaxDone(url, target, refresh);};
    88    req.open("GET", url, true);
     9    // IE https://www.jamesmaurer.com/ajax-refresh-problem-w-ie-not-refreshing.asp
     10    req.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
    911    req.send(null);
    1012    // IE/Windows ActiveX version
     
    1416      req.onreadystatechange = function() {ajaxDone(target);};
    1517      req.open("GET", url, true);
     18      // IE https://www.jamesmaurer.com/ajax-refresh-problem-w-ie-not-refreshing.asp
     19      req.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
    1620      req.send(null);
    1721    }
  • apps/routerconsole/jsp/js/welcomeajax.js

    r09ea40c r13d80e6  
    77    req.onreadystatechange = function() {ajaxDone(url, target, refresh);};
    88    req.open("GET", url, true);
     9    // IE https://www.jamesmaurer.com/ajax-refresh-problem-w-ie-not-refreshing.asp
     10    req.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
    911    req.send(null);
    1012    // IE/Windows ActiveX version
     
    1416      req.onreadystatechange = function() {ajaxDone(target);};
    1517      req.open("GET", url, true);
     18      // IE https://www.jamesmaurer.com/ajax-refresh-problem-w-ie-not-refreshing.asp
     19      req.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
    1620      req.send(null);
    1721    }
     
    3034      fails = 0;
    3135      var status;
    32       if (req.responseText.startsWith("1")) {
     36      // IE doesn't support startsWith()
     37      if (req.responseText.indexOf("1") == 0) {
    3338          results = doneMessage;
    3439          running = false;
  • apps/routerconsole/jsp/welcome.jsp

    r09ea40c r13d80e6  
    164164<jsp:useBean class="net.i2p.router.web.helpers.ConfigNetHelper" id="nethelper" scope="request" />
    165165<jsp:setProperty name="nethelper" property="contextId" value="<%=i2pcontextId%>" />
     166<%
     167        if (request.getParameter("skipbw") == null) {
     168            // don't display this if we skipped the test
     169%>
    166170<h3><%=intl._t("Bandwidth Test Results")%></h3>
    167171<table class="configtable">
     
    175179<tr><td><%=intl._t("Share of Bandwidth for I2P")%></td><td><%=Math.round(net.i2p.router.web.helpers.WizardHelper.BW_SCALE * 100)%>%</td></tr>
    176180</table>
     181<%
     182        } // skipbw
     183%>
    177184<h3><%=intl._t("Bandwidth Configuration")%></h3>
    178185<table id="bandwidthconfig" class="configtable">
Note: See TracChangeset for help on using the changeset viewer.