Changeset 0531801 for apps


Ignore:
Timestamp:
May 13, 2019 2:44:35 PM (11 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4e267f6
Parents:
8840532
Message:

Console: Prevent editing a client while it's starting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHelper.java

    r8840532 r0531801  
    141141            boolean showStart;
    142142            boolean showStop;
     143            boolean showEdit;
    143144            if (isConsole) {
    144145                showStart = false;
    145146                showStop = false;
     147                showEdit = true;
    146148            } else {
    147149                ClientApp clientApp = _context.routerAppManager().getClientApp(ca.className, LoadClientAppsJob.parseArgs(ca.args));
    148150                showStart = clientApp == null;
    149151                showStop = clientApp != null && clientApp.getState() == ClientAppState.RUNNING;
     152                showEdit = !showStop && (clientApp == null || clientApp.getState() != ClientAppState.STARTING);
    150153            }
    151154            String scur = Integer.toString(cur);
     
    162165                       allowEdit && scur.equals(_edit),
    163166                       // show edit button, show update button
    164                        // Don't allow edit if it's running, or else we would lose the "handle" to the ClientApp to stop it.
    165                        allowEdit && !showStop, false,
     167                       // Don't allow edit if it's running or starting, or else we would lose the "handle" to the ClientApp to stop it.
     168                       allowEdit && showEdit,
     169                       false,
    166170                       // show stop button
    167171                       showStop,
Note: See TracChangeset for help on using the changeset viewer.