Browse Source

REPORT-78881【迭代】【起始页】先选择一个会失败的工作目录,再选择本地目录启动,预览模板失败

让内置服务器晚点启动
feature/x
Harrison 2 years ago
parent
commit
9163788f7b
  1. 3
      designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java
  2. 3
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  3. 4
      designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java

3
designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java

@ -22,6 +22,7 @@ public class DesignerStartupContext {
/** /**
* 可以启动 * 可以启动
* 当遇到 mac 双击启动时需要将这里置为 false, {@link FileOpen4MacDeepLink}
*/ */
private boolean enabled = true; private boolean enabled = true;
@ -127,7 +128,7 @@ public class DesignerStartupContext {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
Iterator<String> envNameIterator = envManager.getEnvNameIterator(); Iterator<String> envNameIterator = envManager.getEnvNameIterator();
ArrayList<String> envs = Lists.newArrayList(envNameIterator); ArrayList<String> envs = Lists.newArrayList(envNameIterator);
return !startupArgs.isDemo() && DesignerStartupUtil.convertArgs2FILE(startupArgs.get()) == null && !envs.isEmpty() && envManager.isStartupPageEnabled() && enabled; return !startupArgs.isDemo() && DesignerStartupUtil.convertArgs2FILE(startupArgs.get()) == null && !envs.isEmpty() && (envs.size() != 1) && envManager.isStartupPageEnabled() && enabled;
} }
/* 预热相关 */ /* 预热相关 */

3
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -33,6 +33,7 @@ import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.start.DesignerProcessType; import com.fr.start.DesignerProcessType;
import com.fr.start.ServerStarter; import com.fr.start.ServerStarter;
import com.fr.start.common.DesignerStartupContext;
import com.fr.start.event.LazyStartupEvent; import com.fr.start.event.LazyStartupEvent;
import com.fr.start.preload.PreLoadService; import com.fr.start.preload.PreLoadService;
import com.fr.start.server.FineEmbedServer; import com.fr.start.server.FineEmbedServer;
@ -120,7 +121,7 @@ public class DesignerStartup extends Activator {
|| FineEmbedServer.isRunning()) { || FineEmbedServer.isRunning()) {
return; return;
} }
if (DaoSelectorFactory.getDaoSelector().useCacheDao()) { if (DaoSelectorFactory.getDaoSelector().useCacheDao() || DesignerStartupContext.getInstance().isOnStartup()) {
listenEvent(LazyStartupEvent.INSTANCE, new Listener<Null>(Integer.MIN_VALUE) { listenEvent(LazyStartupEvent.INSTANCE, new Listener<Null>(Integer.MIN_VALUE) {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {

4
designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java

@ -1,6 +1,7 @@
package com.fr.start.module.optimized; package com.fr.start.module.optimized;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator; import com.fr.module.Activator;
@ -110,6 +111,9 @@ public class DesignerStartupPageActivator extends Activator {
// 将选中的环境设置为当前环境 // 将选中的环境设置为当前环境
StartupWorkspaceBean selectWorkspaceInfo = model.getSelectWorkspaceInfo(); StartupWorkspaceBean selectWorkspaceInfo = model.getSelectWorkspaceInfo();
DesignerEnvManager.getEnvManager().setCurEnvName(selectWorkspaceInfo.getName()); DesignerEnvManager.getEnvManager().setCurEnvName(selectWorkspaceInfo.getName());
UIUtil.invokeLaterIfNeeded(() -> {
DesignerContext.getDesignerFrame().setTitle();
});
} }
private void launchAfterWarmup(DesignerPreWarmTask warmTask) { private void launchAfterWarmup(DesignerPreWarmTask warmTask) {

Loading…
Cancel
Save