Browse Source

Merge pull request #1287 in BA/design from ~NEIL/design:release/9.0 to release/9.0

* commit '5a27503c24012aa6c2f25daca99fa97e787d02ed':
  1
  无JIRA任务, build failed
master
superman 7 years ago
parent
commit
ffc889eb8f
  1. 12
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java
  2. 14
      designer_form/src/com/fr/design/mainframe/JForm.java

12
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java

@ -29,6 +29,8 @@ public class ErrorInfoUploader {
private static ErrorInfoUploader collector; private static ErrorInfoUploader collector;
private static boolean licSupport = true; private static boolean licSupport = true;
// 在一台不能上网的电脑里发现了10w个errorinfo...
private static final int MAX_ERROR_SIZE = 2000;
static { static {
GeneralContext.addEnvChangedListener(new EnvChangedListener() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@ -123,6 +125,11 @@ public class ErrorInfoUploader {
} }
File[] files = folder.listFiles(); File[] files = folder.listFiles();
if (files.length > MAX_ERROR_SIZE) {
StableUtils.deleteFile(folder);
return;
}
try { try {
for (File file : files) { for (File file : files) {
String filePath = file.getPath(); String filePath = file.getPath();
@ -131,6 +138,11 @@ public class ErrorInfoUploader {
if (suffix.endsWith(SUFFIX)) { if (suffix.endsWith(SUFFIX)) {
Thread.sleep(1000L); Thread.sleep(1000L);
String content = IOUtils.inputStream2String(new FileInputStream(file)); String content = IOUtils.inputStream2String(new FileInputStream(file));
if (content.length() > MAX_ERROR_SIZE) {
file.delete();
continue;
}
String url = SiteCenter.getInstance().acquireUrlByKind("design.error"); String url = SiteCenter.getInstance().acquireUrlByKind("design.error");
if (sendErroInfo(url, content)) { if (sendErroInfo(url, content)) {
file.delete(); file.delete();

14
designer_form/src/com/fr/design/mainframe/JForm.java

@ -18,6 +18,7 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
@ -58,8 +59,17 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;

Loading…
Cancel
Save