|
|
@ -2,13 +2,11 @@ package com.fr.design.versioncheck; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.dialog.NotificationDialog; |
|
|
|
|
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.env.RemoteWorkspace; |
|
|
|
import com.fr.design.env.RemoteWorkspace; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.env.CheckServiceDialog; |
|
|
|
|
|
|
|
import com.fr.env.VersionCheckMessageDialog; |
|
|
|
import com.fr.env.VersionCheckMessageDialog; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.GeneralUtils; |
|
|
|
import com.fr.general.GeneralUtils; |
|
|
@ -24,6 +22,7 @@ import com.fr.plugin.manage.control.PluginControllerHelper; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskCallback; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskCallback; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskResult; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskResult; |
|
|
|
import com.fr.plugin.manage.control.ProgressCallback; |
|
|
|
import com.fr.plugin.manage.control.ProgressCallback; |
|
|
|
|
|
|
|
import com.fr.report.ReportHelper; |
|
|
|
import com.fr.rpc.Result; |
|
|
|
import com.fr.rpc.Result; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
@ -33,9 +32,6 @@ import com.fr.workspace.engine.base.FineObjectPool; |
|
|
|
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; |
|
|
|
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; |
|
|
|
import com.fr.workspace.engine.exception.WorkspaceConnectionException; |
|
|
|
import com.fr.workspace.engine.exception.WorkspaceConnectionException; |
|
|
|
import com.fr.workspace.engine.rpc.WorkspaceProxyPool; |
|
|
|
import com.fr.workspace.engine.rpc.WorkspaceProxyPool; |
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.awt.event.MouseListener; |
|
|
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.text.ParsePosition; |
|
|
|
import java.text.ParsePosition; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
@ -206,10 +202,7 @@ public class VersionCheckUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
if (selectedEnv.getType() == DesignerWorkspaceType.Remote) { |
|
|
|
return selectedEnv.getType() == DesignerWorkspaceType.Remote; |
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static JSONArray checkLocalAndRemotePlugin() { |
|
|
|
public static JSONArray checkLocalAndRemotePlugin() { |
|
|
@ -221,21 +214,26 @@ public class VersionCheckUtils { |
|
|
|
localPluginsMap.put(pluginContext.getID(), pluginContext); |
|
|
|
localPluginsMap.put(pluginContext.getID(), pluginContext); |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject remotePlugin; |
|
|
|
JSONObject remotePlugin; |
|
|
|
|
|
|
|
Map<String, String> pluginsNameMap = ReportHelper.getPluginNameMap(); |
|
|
|
for (int i = 0; i < remotePlugins.size(); i++) { |
|
|
|
for (int i = 0; i < remotePlugins.size(); i++) { |
|
|
|
remotePlugin = remotePlugins.getJSONObject(i); |
|
|
|
remotePlugin = remotePlugins.getJSONObject(i); |
|
|
|
if (localPluginsMap.containsKey(remotePlugin.getString(ID))) { |
|
|
|
if (ComparatorUtils.equals(remotePlugin.getString("running"), "false")) { |
|
|
|
if (ComparatorUtils.equals(localPluginsMap.get(remotePlugin.getString(ID)).getVersion(), remotePlugin.getString(VERSION))) { |
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String remotePluginID = remotePlugin.getString(ID); |
|
|
|
|
|
|
|
if (localPluginsMap.containsKey(remotePluginID)) { |
|
|
|
|
|
|
|
if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (remotePlugin.getString(NAME) == null) { |
|
|
|
if (remotePlugin.getString(NAME) == null) { |
|
|
|
remotePlugin.put(NAME, localPluginsMap.get(remotePlugin.getString(ID)).getName()); |
|
|
|
remotePlugin.put(NAME, localPluginsMap.get(remotePluginID).getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
remotePlugin.put("type", INCONSISTENCY); |
|
|
|
remotePlugin.put("type", INCONSISTENCY); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
remotePlugin.put("type", MISSING); |
|
|
|
remotePlugin.put("type", MISSING); |
|
|
|
if (remotePlugin.getString(NAME) == null) { |
|
|
|
if (remotePlugin.getString(NAME) == null) { |
|
|
|
remotePlugin.put(NAME, remotePlugin.getString("id")); |
|
|
|
remotePlugin.put(NAME, pluginsNameMap.getOrDefault(remotePluginID, remotePluginID)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
differentPlugins.put(remotePlugin); |
|
|
|
differentPlugins.put(remotePlugin); |
|
|
@ -333,8 +331,10 @@ public class VersionCheckUtils { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void done(PluginTaskResult result) { |
|
|
|
public void done(PluginTaskResult result) { |
|
|
|
latch.countDown(); |
|
|
|
latch.countDown(); |
|
|
|
|
|
|
|
if(result.isSuccess()) { |
|
|
|
FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID()); |
|
|
|
FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|