Browse Source

Pull request #9320: REPORT-71839 设计器启动时启动服务器,仍连曾断开的服务器,会有远程更新提醒

Merge in DESIGN/design from ~PENGDA/design:release/10.0 to release/10.0

* commit '4585ce89a8cac1bd5aaf6e80b3d50b0d87245d0e':
  REPORT-71839 设计器启动时启动服务器,仍连曾断开的服务器,会有远程更新提醒
  REPORT-71839 设计器启动时启动服务器,仍连曾断开的服务器,会有远程更新提醒
  REPORT-71839 设计器启动时启动服务器,仍连曾断开的服务器,会有远程更新提醒
  REPORT-71839 设计器启动时启动服务器,仍连曾断开的服务器,会有远程更新提醒
pengda 2 years ago
parent
commit
c3c288d9e4
  1. 2
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 19
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  3. 10
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  4. 12
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

2
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -427,9 +427,11 @@ public class EnvChangeEntrance {
DesignerExiter.getInstance().execute(); DesignerExiter.getInstance().execute();
} else { } else {
updateNotRememberPwdEnv(); updateNotRememberPwdEnv();
if (DesignerContext.getDesignerFrame().isVisible()) {
VersionCheckUtils.showVersionCheckDialog(envListPane.getSelectedName()); VersionCheckUtils.showVersionCheckDialog(envListPane.getSelectedName());
} }
} }
}
@Override @Override
public void doCancel() { public void doCancel() {

19
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -52,6 +52,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.swing.SwingWorker;
/** /**
* @author pengda * @author pengda
@ -95,9 +96,23 @@ public class VersionCheckUtils {
} }
public static void showVersionCheckDialog(String envName) { public static void showVersionCheckDialog(String envName) {
if (!VersionCheckUtils.versionCheck(envName)) { new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground() {
return !VersionCheckUtils.versionCheck(envName);
}
@Override
protected void done() {
try {
if (get()) {
showNotificationDialog(envName); showNotificationDialog(envName);
} }
} catch (Exception e) {
FineLoggerFactory.getLogger().warn(e.getMessage(), e);
}
}
}.execute();
} }
private static void showNotificationDialog(String envName) { private static void showNotificationDialog(String envName) {
@ -294,7 +309,7 @@ public class VersionCheckUtils {
private static boolean isPluginNeedIgnore(JSONObject remotePlugin) { private static boolean isPluginNeedIgnore(JSONObject remotePlugin) {
return ComparatorUtils.equals(remotePlugin.getString(RUNNING), "false") || (remotePlugin.containsKey(SYNC) && !remotePlugin.getBoolean(SYNC)) return ComparatorUtils.equals(remotePlugin.getString(RUNNING), "false") || (remotePlugin.containsKey(SYNC) && !remotePlugin.getBoolean(SYNC))
|| (remotePlugin.containsKey(GROUP) && ComparatorUtils.equals(remotePlugin.containsKey(GROUP), BI) || remotePlugin.getString(ID).startsWith(BIPREFIX) || (remotePlugin.containsKey(GROUP) && ComparatorUtils.equals(remotePlugin.getString(GROUP), BI) || remotePlugin.getString(ID).startsWith(BIPREFIX)
|| pluginsNeedIgnore.contains(remotePlugin.getString(ID))); || pluginsNeedIgnore.contains(remotePlugin.getString(ID)));
} }

10
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -16,6 +16,7 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
import com.fr.design.monitor.DesignerLifecycleMonitorContext; import com.fr.design.monitor.DesignerLifecycleMonitorContext;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
@ -84,10 +85,19 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue()));
} }
collectUserInformation(); collectUserInformation();
checkVersion();
} }
}); });
} }
private void checkVersion() {
try {
VersionCheckUtils.showVersionCheckDialog(DesignerEnvManager.getEnvManager().getCurEnvName());
} catch (Exception e) {
FineLoggerFactory.getLogger().warn("Check Service Failed");
}
}
public void show() { public void show() {
UIUtil.invokeLaterIfNeeded(this::refreshTemplateTree); UIUtil.invokeLaterIfNeeded(this::refreshTemplateTree);
} }

12
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -61,18 +61,6 @@ public class DesignerWorkspaceProvider extends Activator {
EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(null, workspaceInfo); EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(null, workspaceInfo);
} else { } else {
WorkContext.switchTo(workspace); WorkContext.switchTo(workspace);
//在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可
final String selectEnv = current;
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() {
@Override
public void on(Event event, Null aNull) {
try {
VersionCheckUtils.showVersionCheckDialog(selectEnv);
} catch (Exception e) {
FineLoggerFactory.getLogger().warn("Check Service Failed");
}
}
});
} }
} catch (Throwable e) { } catch (Throwable e) {
EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(e, workspaceInfo); EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(e, workspaceInfo);

Loading…
Cancel
Save