Browse Source

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

security/10.0
pengda 3 years ago
parent
commit
d61fdf98b9
  1. 4
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 15
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  3. 10
      designer-base/src/main/java/com/fr/start/BaseDesigner.java

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

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

15
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.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.swing.SwingWorker;
/**
* @author pengda
@ -95,9 +96,15 @@ public class VersionCheckUtils {
}
public static void showVersionCheckDialog(String envName) {
if (!VersionCheckUtils.versionCheck(envName)) {
showNotificationDialog(envName);
}
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
if (!VersionCheckUtils.versionCheck(envName)) {
showNotificationDialog(envName);
}
return null;
}
}.execute();
}
private static void showNotificationDialog(String envName) {
@ -294,7 +301,7 @@ public class VersionCheckUtils {
private static boolean isPluginNeedIgnore(JSONObject remotePlugin) {
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)));
}

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

Loading…
Cancel
Save