Browse Source

REPORT-145453 【fr-fbp】ssh和ssl的数据连接,去获取密钥等文件时,路径深的时候选择后路径有问题

fbp/release
Destiny.Lin 1 month ago
parent
commit
ec2002fb07
  1. 9
      designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java

9
designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java

@ -25,6 +25,7 @@ import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.ChooseFileFilter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.third.guava.collect.HashBiMap; import com.fr.third.guava.collect.HashBiMap;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -66,7 +67,7 @@ public class SshPane extends BasicPane {
private JPanel sshSettingPane; private JPanel sshSettingPane;
private SimpleCardPane verifyCardPane; private SimpleCardPane verifyCardPane;
private final UIButton fileChooserButton = new UIButton(); private final UIButton fileChooserButton = new UIButton();
private static final String TRIM = SslUtils.CERTIFICATES + ProjectConstants.FORWARD_SLASH;
private static final String USE_PASSWORD = "usePassword"; private static final String USE_PASSWORD = "usePassword";
private static final String USE_KEY = "useKey"; private static final String USE_KEY = "useKey";
@ -104,7 +105,11 @@ public class SshPane extends BasicPane {
if (file == null) { if (file == null) {
keyPath.setText(StringUtils.EMPTY); keyPath.setText(StringUtils.EMPTY);
} else { } else {
keyPath.setText(file.getPath()); String path = file.getPath();
if (path.startsWith(TRIM)) {
path = path.substring(TRIM.length());
}
keyPath.setText(path);
} }
} }
fileChooser.removeAllFilter(); fileChooser.removeAllFilter();

Loading…
Cancel
Save