Browse Source
* commit 'df1ae8dcaba2fe66605e384069c8e5f52821e05b': REPORT-137327 远程设计下切换目录卡顿优化 优化命名 REPORT-137327 远程设计下切换目录卡顿优化 配置部分优化 REPORT-137231 fix:模板导出成功图标未变化修复 REPORT-137164 fix: 最近使用颜色展示问题 REPORT-137164 fix: 最近使用颜色展示问题 REPORT-135687 优化显示 1. 添加排序支持,序号,时间和大小排序 2. 日志异步记录 REPORT-135687 优化显示 1. 添加序号 2. 时间显示优化 3. 添加滚动保持 REPORT-136934 远程设计下双击目录卡顿优化 无jira任务,修复打包 REPORT-136650 fix:控件自适应按钮交互异常修复 REPORT-136077 fix:属性面板兼容旧图标 REPORT-135889 fix:远程失败堆栈页面优化fbp/research
superman
4 months ago
12 changed files with 268 additions and 97 deletions
@ -0,0 +1,83 @@ |
|||||||
|
package com.fr.design.remote.ui.debug; |
||||||
|
|
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
|
||||||
|
import java.text.DecimalFormat; |
||||||
|
import java.text.SimpleDateFormat; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 帮助类 |
||||||
|
* |
||||||
|
* @author vito |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2024/10/11 |
||||||
|
*/ |
||||||
|
public class RemoteDesignNetWorkHelper { |
||||||
|
private static final int UNIT = 1000; |
||||||
|
private static final int UNIT_BYTES = 1024; |
||||||
|
private static final String SECOND = "s"; |
||||||
|
private static final int K = 1024; |
||||||
|
private static final int MS = 1000; |
||||||
|
|
||||||
|
static String dateFormat(Date date) { |
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); |
||||||
|
return dateFormat.format(date); |
||||||
|
} |
||||||
|
|
||||||
|
static String simpleTime(long time) { |
||||||
|
if (time < 0) { |
||||||
|
return time + ""; |
||||||
|
} else if (time < MS) { |
||||||
|
return time + " ms"; |
||||||
|
} else { |
||||||
|
DecimalFormat df = new DecimalFormat("#.0"); |
||||||
|
return df.format((float) time / MS) + " s"; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
static String simpleSize(long bytes) { |
||||||
|
if (bytes < 0) { |
||||||
|
return bytes + ""; |
||||||
|
} else if (bytes < K) { |
||||||
|
return bytes + " B"; |
||||||
|
} else { |
||||||
|
DecimalFormat df = new DecimalFormat("#.00"); |
||||||
|
return df.format((float) bytes / K) + " K"; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
static long parseCostToMS(String timeStr) { |
||||||
|
String[] split = timeStr.split(" "); |
||||||
|
if (split.length > 1) { |
||||||
|
double number = Double.parseDouble(split[0]); |
||||||
|
String unit = split[1].toLowerCase(); |
||||||
|
|
||||||
|
if (StringUtils.equals(unit, SECOND)) { |
||||||
|
return (long) (number * UNIT); |
||||||
|
} |
||||||
|
return (long) number; |
||||||
|
} |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
static long parseSizeToBytes(String sizeStr) { |
||||||
|
String[] split = sizeStr.split(" "); |
||||||
|
if (split.length > 1) { |
||||||
|
double number = Double.parseDouble(split[0]); |
||||||
|
String unit = split[1].toUpperCase(); |
||||||
|
|
||||||
|
switch (unit) { |
||||||
|
case "K": |
||||||
|
return (long) (number * UNIT_BYTES); |
||||||
|
case "M": |
||||||
|
return (long) (number * UNIT_BYTES * UNIT_BYTES); |
||||||
|
case "G": |
||||||
|
return (long) (number * UNIT_BYTES * UNIT_BYTES * UNIT_BYTES); |
||||||
|
default: |
||||||
|
return (long) number; |
||||||
|
} |
||||||
|
} |
||||||
|
return 0; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
package com.fr.design.remote.ui.debug; |
||||||
|
|
||||||
|
import javax.swing.table.DefaultTableModel; |
||||||
|
import javax.swing.table.TableRowSorter; |
||||||
|
import java.util.Comparator; |
||||||
|
|
||||||
|
/** |
||||||
|
* 行排序器 |
||||||
|
* |
||||||
|
* @author vito |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2024/10/11 |
||||||
|
*/ |
||||||
|
public class RemoteDesignNetWorkTableRowSorter extends TableRowSorter<DefaultTableModel> { |
||||||
|
|
||||||
|
public RemoteDesignNetWorkTableRowSorter(DefaultTableModel model) { |
||||||
|
super(model); |
||||||
|
setComparator(0, (Comparator<Long>) Long::compareTo); |
||||||
|
setComparator(4, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseCostToMS)); |
||||||
|
setComparator(5, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes)); |
||||||
|
setComparator(6, Comparator.comparingLong(RemoteDesignNetWorkHelper::parseSizeToBytes)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean isSortable(int column) { |
||||||
|
return column == 0 |
||||||
|
|| column == 4 |
||||||
|
|| column == 5 |
||||||
|
|| column == 6; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
package com.fanruan.config; |
||||||
|
|
||||||
|
import com.fanruan.repository.ConfigRepository; |
||||||
|
import com.fr.config.utils.ConfData; |
||||||
|
import com.fr.config.utils.ConfigReadUtils; |
||||||
|
import com.fr.config.utils.PrefixHandler; |
||||||
|
import com.fr.config.utils.SetupDataOperator; |
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设计器远程下获取Updata的操作类 |
||||||
|
* |
||||||
|
* @author Destiny.Lin |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2024/10/14 |
||||||
|
*/ |
||||||
|
public class SetupDataDesignerRemoteOperator implements SetupDataOperator { |
||||||
|
|
||||||
|
private static final SetupDataDesignerRemoteOperator INSTANCE = new SetupDataDesignerRemoteOperator(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 单例 |
||||||
|
*/ |
||||||
|
public static SetupDataDesignerRemoteOperator getInstance() { |
||||||
|
return INSTANCE; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ConfData getData(String prefix, String tenantId) { |
||||||
|
return ConfigRepository.getInstance().getConfigByConfigsCache(getConfigNameSpace(prefix), () -> { |
||||||
|
ConfData data = new ConfData(); |
||||||
|
data.setDataMap(ConfigReadUtils.getData(prefix, tenantId)); |
||||||
|
data.setMap(ConfigReadUtils.getClassInfo(prefix, tenantId)); |
||||||
|
return data; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private String getConfigNameSpace(String id) { |
||||||
|
|
||||||
|
if (StringUtils.isEmpty(id)) { |
||||||
|
throw new IllegalArgumentException("id cannot be null"); |
||||||
|
} |
||||||
|
int length = id.length(); |
||||||
|
for (int i = 0; i < length; i++) { |
||||||
|
if (PrefixHandler.SEPERATOR == id.charAt(i)) { |
||||||
|
return id.substring(0, i); |
||||||
|
} |
||||||
|
} |
||||||
|
throw new IllegalArgumentException("cannot resolve namespace of " + id); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue