|
|
|
@ -10,6 +10,7 @@ import com.fr.design.mainframe.DesignerContext;
|
|
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
|
import com.fr.env.detect.base.DetectorBridge; |
|
|
|
|
import com.fr.env.detect.base.DetectorUtil; |
|
|
|
|
import com.fr.env.detect.base.EnvDetectorConfig; |
|
|
|
|
import com.fr.env.detect.bean.DetectorResult; |
|
|
|
|
import com.fr.env.detect.bean.DetectorStatus; |
|
|
|
|
import com.fr.event.Event; |
|
|
|
@ -50,6 +51,14 @@ public class EnvDetectorCenter {
|
|
|
|
|
* 初始化 |
|
|
|
|
*/ |
|
|
|
|
public void init() { |
|
|
|
|
|
|
|
|
|
// 重置逻辑
|
|
|
|
|
DetectorBridge.getInstance().reset(); |
|
|
|
|
|
|
|
|
|
// 如果已经启动了,则不再启动
|
|
|
|
|
if (PROCESS.get() != null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 默认是启动
|
|
|
|
|
PROCESS.set(DetectorProcess.DESIGN_LAUNCH); |
|
|
|
@ -121,13 +130,17 @@ public class EnvDetectorCenter {
|
|
|
|
|
*/ |
|
|
|
|
public void stop() { |
|
|
|
|
|
|
|
|
|
// 一分钟后执行
|
|
|
|
|
// 结束
|
|
|
|
|
DetectorBridge.getInstance().stop(); |
|
|
|
|
|
|
|
|
|
// 30s后执行
|
|
|
|
|
DelayHelper.delayCall(EnvDetectorCenter.class.getName(), () -> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果当前没开启,则直接返回
|
|
|
|
|
if (!EnvDetectorConfig.getInstance().isEnabled()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect(); |
|
|
|
|
|
|
|
|
|
// 结束
|
|
|
|
|
DetectorBridge.getInstance().stop(); |
|
|
|
|
|
|
|
|
|
// 展示效果
|
|
|
|
|
NotificationDialogProperties properties = new NotificationDialogProperties(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Detect_Notification_Title")); |
|
|
|
|