Browse Source

Pull request #7117: 无jira 解决冲突

Merge in DESIGN/design from ~HADES/design:feature/x to feature/x

* commit '4319065b6207193abdb6c0beb41e05442ecb7629':
  无jira 去掉无用 import
  KERNEL-9860 插件修改xml中active标签逻辑重构 跟vito讨论了下,决定模板报错的一键处理这儿,也是需要修改xml的,因为也是用户自己点的处理
  CHART-22213 fix:新增警戒线 默认应该是9px12px 不是9px
  KERNEL-9860 插件修改xml中active标签逻辑重构 【问题原因】rt 【改动思路】详见https://kms.fineres.com/pages/viewpage.action?pageId=289590798 【review建议】
  REPORT-64095 websocket频繁出现断开又连上问题
feature/x
ju|剧浩宇 3 years ago
parent
commit
9afbbdc933
  1. 29
      designer-base/src/main/java/com/fr/design/extra/PluginInstalledPane.java
  2. 12
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  3. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java
  4. 3
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/AbstractSocketConfig.java
  5. 1
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/ContainerSocketConfig.java

29
designer-base/src/main/java/com/fr/design/extra/PluginInstalledPane.java

@ -60,11 +60,14 @@ public class PluginInstalledPane extends PluginAbstractViewPane {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
PluginView plugin = controlPane.getSelectedPlugin(); PluginView plugin = controlPane.getSelectedPlugin();
if (plugin != null) { if (plugin != null) {
boolean isActive = plugin.isActive(); PluginContext pluginContext = getPluginContextByView(plugin);
PluginMarker pluginMarker = PluginMarker.create(plugin.getID(), plugin.getVersion()); if (pluginContext == null) {
final String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Actived") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled"); return;
if (isActive) { }
PluginManager.getController().forbid(pluginMarker, new PluginTaskCallback() { boolean running = pluginContext.isRunning();
final String modifyMessage = running ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Actived") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled");
if (running) {
PluginManager.getController().forbidPersistently(pluginContext.getMarker(), new PluginTaskCallback() {
@Override @Override
public void done(PluginTaskResult result) { public void done(PluginTaskResult result) {
if (result.isSuccess()) { if (result.isSuccess()) {
@ -75,7 +78,7 @@ public class PluginInstalledPane extends PluginAbstractViewPane {
} }
}); });
} else { } else {
PluginManager.getController().enable(pluginMarker, new PluginTaskCallback() { PluginManager.getController().enablePersistently(pluginContext.getMarker(), new PluginTaskCallback() {
@Override @Override
public void done(PluginTaskResult result) { public void done(PluginTaskResult result) {
if (result.isSuccess()) { if (result.isSuccess()) {
@ -145,13 +148,25 @@ public class PluginInstalledPane extends PluginAbstractViewPane {
} }
private void changeTextForButton(PluginView plugin) { private void changeTextForButton(PluginView plugin) {
if (plugin.isActive()) { PluginContext pluginContext = getPluginContextByView(plugin);
if (pluginContext == null) {
return;
}
if (pluginContext.isRunning()) {
disableButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Disable")); disableButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Disable"));
} else { } else {
disableButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Active")); disableButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Active"));
} }
} }
private PluginContext getPluginContextByView(PluginView pluginView) {
if (pluginView != null) {
PluginMarker pluginMarker = PluginMarker.create(pluginView.getID(), pluginView.getVersion());
return PluginManager.getContext(pluginMarker);
}
return null;
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "Installed"; return "Installed";

12
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -99,9 +99,9 @@ public class PluginOperateUtils {
public void run() { public void run() {
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo);
PluginContext plugin = PluginManager.getContext(pluginMarker); PluginContext plugin = PluginManager.getContext(pluginMarker);
boolean active = plugin.isActive(); boolean isRunning = plugin.isRunning();
PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback); PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(isRunning, jsCallback);
if (active) { if (isRunning) {
PluginXmlElement forbidReminder = plugin.getXml().getElement(PluginElementName.ForbidReminder); PluginXmlElement forbidReminder = plugin.getXml().getElement(PluginElementName.ForbidReminder);
if (forbidReminder != null && forbidReminder.getContent() != null) { if (forbidReminder != null && forbidReminder.getContent() != null) {
// 禁用前提示 // 禁用前提示
@ -113,14 +113,14 @@ public class PluginOperateUtils {
JOptionPane.WARNING_MESSAGE JOptionPane.WARNING_MESSAGE
); );
if (rv == JOptionPane.OK_OPTION) { if (rv == JOptionPane.OK_OPTION) {
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); PluginManager.getController().forbidPersistently(pluginMarker, modifyStatusCallback);
} }
} else { } else {
// 正常禁用 // 正常禁用
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); PluginManager.getController().forbidPersistently(pluginMarker, modifyStatusCallback);
} }
} else { } else {
PluginManager.getController().enable(pluginMarker, modifyStatusCallback); PluginManager.getController().enablePersistently(pluginMarker, modifyStatusCallback);
} }
} }
}); });

2
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -220,7 +220,7 @@ public class DesignerAppUtils {
Multimap<String, PluginMarkerAdapter> stringPluginMarkerAdapterMultimap = popPluginInfoMap(key); Multimap<String, PluginMarkerAdapter> stringPluginMarkerAdapterMultimap = popPluginInfoMap(key);
Collection<PluginMarkerAdapter> disablePlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN); Collection<PluginMarkerAdapter> disablePlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN);
for (PluginMarkerAdapter disablePlugin : disablePlugins) { for (PluginMarkerAdapter disablePlugin : disablePlugins) {
PluginManager.getController().enable(disablePlugin, new ModifyStatusCallback(false)); PluginManager.getController().enablePersistently(disablePlugin, new ModifyStatusCallback(false));
} }
Collection<PluginMarkerAdapter> uninstallPlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN); Collection<PluginMarkerAdapter> uninstallPlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN);

3
designer-realize/src/main/java/com/fr/design/mainframe/socketio/AbstractSocketConfig.java

@ -15,6 +15,8 @@ import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnection;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import io.socket.client.IO; import io.socket.client.IO;
import io.socket.engineio.client.transports.Polling;
import io.socket.engineio.client.transports.WebSocket;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
@ -45,6 +47,7 @@ public abstract class AbstractSocketConfig {
public IO.Options createOptions() { public IO.Options createOptions() {
IO.Options options = new IO.Options(); IO.Options options = new IO.Options();
options.path = WebSocketConfig.getInstance().getSocketContext(); options.path = WebSocketConfig.getInstance().getSocketContext();
options.transports = new String[]{WebSocket.NAME, Polling.NAME};;
try { try {
if (ComparatorUtils.equals(currentProtocol, HTTPS)) { if (ComparatorUtils.equals(currentProtocol, HTTPS)) {
options.sslContext = getSSLContext(); options.sslContext = getSSLContext();

1
designer-realize/src/main/java/com/fr/design/mainframe/socketio/ContainerSocketConfig.java

@ -29,7 +29,6 @@ public class ContainerSocketConfig extends AbstractSocketConfig {
@Override @Override
public IO.Options createOptions() { public IO.Options createOptions() {
IO.Options options = super.createOptions(); IO.Options options = super.createOptions();
options.transports = new String[]{WebSocket.NAME, Polling.NAME};
options.path = String.format("/%s%s", FRContext.getCommonOperator().getAppName(), WebSocketConstants.WEBSOCKET_PATH); options.path = String.format("/%s%s", FRContext.getCommonOperator().getAppName(), WebSocketConstants.WEBSOCKET_PATH);
return options; return options;
} }

Loading…
Cancel
Save