mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-27 02:45:36 +00:00
Rework
This commit is contained in:
@@ -13,6 +13,7 @@ import io.xpipe.app.process.CommandBuilder;
|
||||
import io.xpipe.app.process.ShellControl;
|
||||
import io.xpipe.app.secret.SecretRetrievalStrategy;
|
||||
import io.xpipe.app.secret.SecretStrategyChoiceConfig;
|
||||
import io.xpipe.app.storage.DataStorage;
|
||||
import io.xpipe.app.util.DocumentationLink;
|
||||
import io.xpipe.app.util.LocalFileTracker;
|
||||
import io.xpipe.app.util.ThreadHelper;
|
||||
@@ -32,8 +33,8 @@ import lombok.extern.jackson.Jacksonized;
|
||||
import org.kordamp.ikonli.javafx.FontIcon;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Value
|
||||
@@ -43,6 +44,12 @@ import java.util.stream.Collectors;
|
||||
@AllArgsConstructor
|
||||
public class InPlaceKeyStrategy implements SshIdentityStrategy {
|
||||
|
||||
private static final Set<String> KEYS = new HashSet<>();
|
||||
|
||||
public static boolean isInPlaceKey(String keyName) {
|
||||
return KEYS.contains(keyName);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static OptionsBuilder createOptions(Property<InPlaceKeyStrategy> p, SshIdentityStrategyChoiceConfig config) {
|
||||
var options = new OptionsBuilder();
|
||||
@@ -182,9 +189,11 @@ public class InPlaceKeyStrategy implements SshIdentityStrategy {
|
||||
}
|
||||
|
||||
private FilePath getTargetFilePath(ShellControl sc) {
|
||||
var hash = Math.abs(Objects.hash(this, AppSystemInfo.ofCurrent().getUser()));
|
||||
var temp = sc.getSystemTemporaryDirectory()
|
||||
.join("xpipe-"
|
||||
+ Math.abs(Objects.hash(this, AppSystemInfo.ofCurrent().getUser())) + ".key");
|
||||
+ hash + ".key");
|
||||
KEYS.add(temp.getFileName());
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ public class RemoteDesktopWindow {
|
||||
}
|
||||
AppWindowStyle.addIcons(stage);
|
||||
AppWindowStyle.addStylesheets(stage.getScene());
|
||||
AppWindowStyle.addClickShield(stage);
|
||||
AppWindowStyle.addMaximizedPseudoClass(stage);
|
||||
AppWindowStyle.addFontSize(stage);
|
||||
AppTheme.initThemeHandlers(stage);
|
||||
|
||||
Reference in New Issue
Block a user