forked from I2P_Developers/i2p.i2p
Console: Better status feedback on manual reseed from URL
Reseed: Better status feedback and cleanup in summary bar
This commit is contained in:
@ -450,13 +450,13 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
ConsoleUpdateManager mgr = UpdateHandler.updateManager(_context);
|
||||
if (mgr == null)
|
||||
return;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (!mgr.isUpdateInProgress(PLUGIN)) {
|
||||
tmp.delete();
|
||||
break;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ie) {}
|
||||
}
|
||||
String status = mgr.getStatus();
|
||||
|
@ -49,25 +49,23 @@ public class ConfigReseedHandler extends FormHandler {
|
||||
addFormError(_("Reseeding is already in progress"));
|
||||
} else {
|
||||
// wait a while for completion but not forever
|
||||
for (int i = 0; i < 20; i++) {
|
||||
for (int i = 0; i < 40; i++) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ie) {}
|
||||
if (!_context.netDb().reseedChecker().inProgress()) {
|
||||
String status = _context.netDb().reseedChecker().getStatus();
|
||||
if (status.length() > 0)
|
||||
addFormNotice(status);
|
||||
else
|
||||
addFormNotice(_("Ressed complete, check summary bar for status"));
|
||||
return;
|
||||
}
|
||||
if (!_context.netDb().reseedChecker().inProgress())
|
||||
break;
|
||||
}
|
||||
if (_context.netDb().reseedChecker().inProgress()) {
|
||||
String status = _context.netDb().reseedChecker().getStatus();
|
||||
if (status.length() > 0)
|
||||
addFormNotice(status);
|
||||
else
|
||||
addFormNotice(_("Ressed in progress, check summary bar for status"));
|
||||
String status = _context.netDb().reseedChecker().getStatus();
|
||||
String error = _context.netDb().reseedChecker().getError();
|
||||
if (error.length() > 0) {
|
||||
addFormErrorNoEscape(error);
|
||||
} else if (status.length() > 0) {
|
||||
addFormNoticeNoEscape(status);
|
||||
} else if (_context.netDb().reseedChecker().inProgress()) {
|
||||
addFormNotice(_("Reseed in progress, check summary bar for status"));
|
||||
} else {
|
||||
addFormNotice(_("Reseed complete, check summary bar for status"));
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException iae) {
|
||||
|
@ -152,6 +152,17 @@ public abstract class FormHandler {
|
||||
_notices.add(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an error message to display
|
||||
* Use if it includes a link or other formatting.
|
||||
* Does not escape '<' and '>' before queueing
|
||||
* @since 0.9.19
|
||||
*/
|
||||
protected void addFormErrorNoEscape(String msg) {
|
||||
if (msg == null) return;
|
||||
_errors.add(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display everything, wrap it in a div for consistent presentation
|
||||
*
|
||||
|
Reference in New Issue
Block a user