diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java index 0c21a4d414..81bc642b47 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java @@ -1,8 +1,12 @@ package com.fr.design.mainframe.share.ui.online.mini; +import com.fr.base.ScreenResolution; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.mini.MiniShopDisposingChecker; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.stable.Constants; +import com.fr.stable.unit.FU; +import com.fr.stable.unit.UNIT; import javax.swing.JFrame; import java.awt.Container; @@ -32,7 +36,10 @@ public class MiniComponentShopDialog { final JFrame frame = new JFrame(); final MiniComponentShopPane shopPane = new MiniComponentShopPane(); - frame.setSize(1200, 800); + final UNIT width = FU.getInstance(900 * Constants.FU_PER_OLD_PIX); + final UNIT height = FU.getInstance(600 * Constants.FU_PER_OLD_PIX); + int resolution = ScreenResolution.getScreenResolution(); + frame.setSize(width.toPixI(resolution), height.toPixI(resolution)); frame.setTitle(Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Window_Title")); frame.add(shopPane); frame.setResizable(false); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java index a579681747..e9daf3e0e5 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java @@ -13,6 +13,7 @@ import com.fr.design.mainframe.share.ui.online.installation.ComponentInstallatio import com.fr.design.mainframe.share.ui.online.installation.ComponentsPackageInstallation; import com.fr.design.mainframe.share.ui.online.installation.TemplateThemeInstallation; import com.fr.design.mainframe.share.ui.online.mini.MiniComponentShopDialog; +import com.fr.design.mainframe.share.util.OnlineShopUtils; import com.fr.form.share.Group; import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.bean.OnlineShareWidget; @@ -306,23 +307,31 @@ public class NativeProductBridge { @Override public void run() { boolean allowedDownload; - if (!widget.isCompatibleWithCurrentEnv()) { - int result = FineJOptionPane.showConfirmDialog( + OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, false); + boolean isCompatibleWithCurrentEnv = true; + for (OnlineShareWidget children: childrenWidgets) { + if (!children.isCompatibleWithCurrentEnv()) { + isCompatibleWithCurrentEnv = false; + break; + } + } + int result; + if (!isCompatibleWithCurrentEnv) { + result = FineJOptionPane.showConfirmDialog( MiniComponentShopDialog.getInstance().getContentPane(), Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Components_Package_Tip", childrenCount), "", FineJOptionPane.YES_NO_OPTION ); - allowedDownload = result == JOptionPane.YES_OPTION; } else { - int result = FineJOptionPane.showConfirmDialog( + result = FineJOptionPane.showConfirmDialog( MiniComponentShopDialog.getInstance().getContentPane(), Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenCount), "", FineJOptionPane.YES_NO_OPTION ); - allowedDownload = result == JOptionPane.YES_OPTION; } + allowedDownload = result == JOptionPane.YES_OPTION; if (allowedDownload) { fireStartEvent(null); action.install(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/OnlineShopUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/OnlineShopUtils.java index d0fbd83d5f..fef0caed2c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/OnlineShopUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/OnlineShopUtils.java @@ -256,7 +256,12 @@ public class OnlineShopUtils { } public static OnlineShareWidget[] getPackageWidgets(OnlineShareWidget widgetPackage) { - String plistUrl = getPackageChildrenPath() + widgetPackage.getId() + "?designerVersion="+ ProductConstants.RELEASE_VERSION; + return getPackageWidgets(widgetPackage, true); + } + + public static OnlineShareWidget[] getPackageWidgets(OnlineShareWidget widgetPackage, boolean requireCompatible) { + String targetDesignerVersion = requireCompatible ? ProductConstants.RELEASE_VERSION : "0"; + String plistUrl = getPackageChildrenPath() + widgetPackage.getId() + "?designerVersion="+ targetDesignerVersion; OnlineShareWidget[] widgets = getOnlineShareWidgets(plistUrl); for (OnlineShareWidget widget : widgets) { widget.setParentPackage(widgetPackage); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e5f44d4e44..d8f7265f7d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -22,7 +22,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; -import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.logging.log4j.core.LogEvent; import com.fr.third.org.apache.http.client.config.RequestConfig; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; @@ -33,6 +32,7 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.server.socket.CustomLogEvent; import com.fr.workspace.server.socket.LogEventConverter; import io.socket.client.IO; import io.socket.client.Socket; @@ -151,14 +151,14 @@ public class DesignerSocketIO { if (ArrayUtils.isNotEmpty(objects)) { try { Object obj = SerializerHelper.deserialize((byte[]) objects[0]); - // 兼容下老版本服务器 + // 完全去除log4j1.x LogEvent event; - if (obj instanceof LoggingEvent) { - event = LogEventConverter.convert((LoggingEvent) obj); + if (obj instanceof CustomLogEvent) { + event = LogEventConverter.convert((CustomLogEvent) obj); + DesignerLogger.log(event); } else { - event = (LogEvent) obj; + FineLoggerFactory.getLogger().warn("Unable to display server push logs, because server and designer versions are inconsistent!"); } - DesignerLogger.log(event); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); }