Browse Source

Merge pull request #7903 in DESIGN/design from release/11.0 to feature/x

* commit '02682024e542fe1f8e746c54cfe8d595e230aba9':
  REPORT-66304 【组件商城风格优化】下载存在高版本组件的组件包,提示和效果跟设计不符
  REPORT-66324 【组件商城风格优化】设计器商城,搜索框部分显示有问题 & REPORT-66361 【组件商城风格优化】设计器商城,高dpi下显示异常
  REPORT-66521 完全移除log4j1.x依赖
feature/x
superman 3 years ago
parent
commit
9c8857453d
  1. 9
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java
  2. 19
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java
  3. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/util/OnlineShopUtils.java
  4. 12
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

9
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);

19
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();

7
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);

12
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);
}

Loading…
Cancel
Save