mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-22 09:16:29 +00:00
Add ssh config support plus polishing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package io.xpipe.core.dialog;
|
||||
|
||||
import io.xpipe.core.charsetter.Charsetter;
|
||||
import io.xpipe.core.util.FailableSupplier;
|
||||
import io.xpipe.core.util.SecretValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -457,11 +458,6 @@ public abstract class Dialog {
|
||||
|
||||
protected abstract DialogElement next(String answer) throws Exception;
|
||||
|
||||
public interface FailableSupplier<T> {
|
||||
|
||||
T get() throws Exception;
|
||||
}
|
||||
|
||||
public static class Choice extends Dialog {
|
||||
|
||||
private final ChoiceElement element;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.xpipe.core.process;
|
||||
|
||||
import io.xpipe.core.dialog.Dialog;
|
||||
import io.xpipe.core.util.FailableFunction;
|
||||
import io.xpipe.core.util.FailableSupplier;
|
||||
import io.xpipe.core.util.SecretValue;
|
||||
import io.xpipe.core.util.XPipeSystemId;
|
||||
import lombok.NonNull;
|
||||
@@ -99,7 +99,7 @@ public interface ShellControl extends ProcessControl {
|
||||
default ShellControl elevationPassword(SecretValue value) {
|
||||
return elevationPassword(() -> value);
|
||||
}
|
||||
ShellControl elevationPassword(Dialog.FailableSupplier<SecretValue> value);
|
||||
ShellControl elevationPassword(FailableSupplier<SecretValue> value);
|
||||
|
||||
ShellControl initWith(String cmds);
|
||||
|
||||
@@ -107,7 +107,7 @@ public interface ShellControl extends ProcessControl {
|
||||
|
||||
ShellControl startTimeout(int ms);
|
||||
|
||||
Dialog.FailableSupplier<SecretValue> getElevationPassword();
|
||||
FailableSupplier<SecretValue> getElevationPassword();
|
||||
|
||||
default ShellControl subShell(@NonNull ShellDialect type) {
|
||||
return subShell(p -> type.getOpenCommand(), new TerminalOpenFunction() {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package io.xpipe.core.util;
|
||||
|
||||
public interface FailableSupplier<T> {
|
||||
|
||||
T get() throws Exception;
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package io.xpipe.core.util;
|
||||
|
||||
import io.xpipe.core.dialog.Dialog;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -15,7 +13,7 @@ public class UuidHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static Optional<UUID> parse(Dialog.FailableSupplier<String> supplier) {
|
||||
public static Optional<UUID> parse(FailableSupplier<String> supplier) {
|
||||
try {
|
||||
var s = supplier.get();
|
||||
return Optional.of(UUID.fromString(s));
|
||||
|
||||
Reference in New Issue
Block a user