|
|
|
@ -2,13 +2,11 @@ package com.fr.design.versioncheck;
|
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.dialog.NotificationDialog; |
|
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
|
import com.fr.design.env.RemoteWorkspace; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.env.CheckServiceDialog; |
|
|
|
|
import com.fr.env.VersionCheckMessageDialog; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
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.PluginTaskResult; |
|
|
|
|
import com.fr.plugin.manage.control.ProgressCallback; |
|
|
|
|
import com.fr.report.ReportHelper; |
|
|
|
|
import com.fr.rpc.Result; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
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.exception.WorkspaceConnectionException; |
|
|
|
|
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.text.ParsePosition; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
@ -206,10 +202,7 @@ public class VersionCheckUtils {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
|
if (selectedEnv.getType() == DesignerWorkspaceType.Remote) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
return selectedEnv.getType() == DesignerWorkspaceType.Remote; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static JSONArray checkLocalAndRemotePlugin() { |
|
|
|
@ -221,21 +214,26 @@ public class VersionCheckUtils {
|
|
|
|
|
localPluginsMap.put(pluginContext.getID(), pluginContext); |
|
|
|
|
} |
|
|
|
|
JSONObject remotePlugin; |
|
|
|
|
Map<String, String> pluginsNameMap = ReportHelper.getPluginNameMap(); |
|
|
|
|
for (int i = 0; i < remotePlugins.size(); i++) { |
|
|
|
|
remotePlugin = remotePlugins.getJSONObject(i); |
|
|
|
|
if (localPluginsMap.containsKey(remotePlugin.getString(ID))) { |
|
|
|
|
if (ComparatorUtils.equals(localPluginsMap.get(remotePlugin.getString(ID)).getVersion(), remotePlugin.getString(VERSION))) { |
|
|
|
|
if (ComparatorUtils.equals(remotePlugin.getString("running"), "false")) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
String remotePluginID = remotePlugin.getString(ID); |
|
|
|
|
if (localPluginsMap.containsKey(remotePluginID)) { |
|
|
|
|
if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) { |
|
|
|
|
continue; |
|
|
|
|
} else { |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
remotePlugin.put("type", MISSING); |
|
|
|
|
if (remotePlugin.getString(NAME) == null) { |
|
|
|
|
remotePlugin.put(NAME, remotePlugin.getString("id")); |
|
|
|
|
remotePlugin.put(NAME, pluginsNameMap.getOrDefault(remotePluginID, remotePluginID)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
differentPlugins.put(remotePlugin); |
|
|
|
@ -303,7 +301,7 @@ public class VersionCheckUtils {
|
|
|
|
|
return uninstallFailedID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static JSONArray getPluginsSyncFailed(JSONArray differentPlugins){ |
|
|
|
|
private static JSONArray getPluginsSyncFailed(JSONArray differentPlugins) { |
|
|
|
|
JSONArray pluginsNeedSync = JSONArray.create(); |
|
|
|
|
List<PluginContext> localPlugins = PluginManager.getContexts(); |
|
|
|
|
Map<String, String> localPluginsInfo = new HashMap<>(); |
|
|
|
@ -333,8 +331,10 @@ public class VersionCheckUtils {
|
|
|
|
|
@Override |
|
|
|
|
public void done(PluginTaskResult result) { |
|
|
|
|
latch.countDown(); |
|
|
|
|
if(result.isSuccess()) { |
|
|
|
|
FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|