Wizard: Ajax fixes for IE (thx zlatinb) (summary bar also)

Form notices on results panel
Hide results if skipped
This commit is contained in:
zzz
2018-11-18 13:43:18 +00:00
parent 09ea40ce8e
commit 13d80e604d
6 changed files with 35 additions and 2 deletions

View File

@ -224,7 +224,7 @@ public class MLabRunner {
results.put("down", down_bps);
results.put("server_host", server_host);
if (server_city != null)
results.put("server_city", server_city);
results.put("server_city", server_city.replace("_", ", "));
if (server_country != null)
results.put("server_country", server_country);
listener.complete(results);

View File

@ -46,6 +46,19 @@ public class WizardHandler extends FormHandler {
}
if ("4".equals(page)) {
startNDT();
} else if ("5".equals(page)) {
synchronized (_helper) {
if (_helper.isNDTSuccessful()) {
addFormNotice(_t("Bandwidth test completed successfully"));
} else if (_helper.isNDTComplete()) {
addFormError(_t("Bandwidth test failed"));
} else if (_helper.isNDTRunning()) {
addFormError(_t("Bandwidth test did not complete"));
} else {
// didn't run at all?
addFormError(_t("Bandwidth test did not complete"));
}
}
} else if ("6".equals(page)) {
Map<String, String> changes = new HashMap<String, String>();
boolean updated = updateRates(changes);

View File

@ -55,6 +55,10 @@ public class WizardHelper extends HelperBase {
return _listener != null && !_listener.isComplete();
}
public synchronized boolean isNDTSuccessful() {
return isNDTComplete() && getUpBandwidth() > 0 && getDownBandwidth() > 0;
}
/**
* @return HTML-escaped status string or ""
*/