Browse Source

无jira任务 添加数据中心调试参数

fbp/release
vito 4 weeks ago
parent
commit
09dcec30b3
  1. 30
      designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java

30
designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java

@ -9,6 +9,7 @@ import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.jxbrowser.JxEngine;
import com.fr.design.jxbrowser.JxUIPane;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.json.revise.EmbedJson;
import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.ImmutableMap;
@ -36,6 +37,7 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
private static final String DATA_CENTER_HELPER = "dcHelper";
private static final String DATA_CENTER_INJECT_URL = "fineServletURL";
private static final String DC_INDEX_HTML = "com/fr/design/data/tabledata/datacenter/web/data-choose.prod.html";
private static final String DATACENTERS_URL = System.getProperty("devMode.datacenters.url");
private final JxUIPane<String> dataCenterJxUIPane;
private final JxTableDataNamePane namePane = new JxTableDataNamePane(this);
// 用于复制粘贴场景
@ -62,13 +64,22 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
}
private static JxUIPane<String> getJxUIPane() {
return new JxUIPane.Builder<String>()
.engine(JX_ENGINE)
.namespace(DATA_CENTER)
.bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge)
.withEMB(DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl()))
.build();
if (DesignerUIModeConfig.getInstance().isUIDevMode()
&& StringUtils.isNotBlank(DATACENTERS_URL)) {
return new JxUIPane.Builder<String>()
.engine(JX_ENGINE)
.namespace(DATA_CENTER)
.bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge)
.withURL(DATACENTERS_URL, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl()))
.build();
} else {
return new JxUIPane.Builder<String>()
.engine(JX_ENGINE)
.namespace(DATA_CENTER)
.bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge)
.withEMB(DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl()))
.build();
}
}
private static String getDatacentersUrl() {
@ -96,7 +107,10 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
}
private void reload() {
dataCenterJxUIPane.redirect(EMB_TAG + SCHEME_HEADER + DC_INDEX_HTML,
dataCenterJxUIPane.redirect(
DesignerUIModeConfig.getInstance().isUIDevMode() && StringUtils.isNotBlank(DATACENTERS_URL)
? DATACENTERS_URL
: EMB_TAG + SCHEME_HEADER + DC_INDEX_HTML,
ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl()));
}

4
designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java

@ -6,6 +6,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.ui.ModernUIConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair;
@ -99,7 +100,8 @@ public class JxUIPane<T> extends BasicPane {
* 按需初始化debug界面UI
*/
private void initDebugIfNeeded() {
if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
if (DesignerEnvManager.getEnvManager().isOpenDebug()
|| DesignerUIModeConfig.getInstance().isUIDevMode()) {
UIToolbar toolbar = new UIToolbar();
add(toolbar, BorderLayout.NORTH);
UIButton openDebugButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Open_Debug_Window"));

Loading…
Cancel
Save