mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Reformat
This commit is contained in:
parent
a7c046520c
commit
7821d0e779
55 changed files with 1242 additions and 1179 deletions
|
@ -94,7 +94,8 @@ final class BrowserBookmarkComp extends SimpleComp {
|
||||||
event.consume();
|
event.consume();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, true);
|
},
|
||||||
|
true);
|
||||||
var category = new DataStoreCategoryChoiceComp(
|
var category = new DataStoreCategoryChoiceComp(
|
||||||
StoreViewState.get().getAllConnectionsCategory(),
|
StoreViewState.get().getAllConnectionsCategory(),
|
||||||
StoreViewState.get().getActiveCategory(),
|
StoreViewState.get().getActiveCategory(),
|
||||||
|
|
|
@ -124,7 +124,11 @@ public class BrowserTransferModel {
|
||||||
try {
|
try {
|
||||||
try (var b = new BooleanScope(downloading).start()) {
|
try (var b = new BooleanScope(downloading).start()) {
|
||||||
FileSystemHelper.dropFilesInto(
|
FileSystemHelper.dropFilesInto(
|
||||||
FileSystemHelper.getLocal(TEMP), List.of(item.getFileEntry()), true, false, progress -> {
|
FileSystemHelper.getLocal(TEMP),
|
||||||
|
List.of(item.getFileEntry()),
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
progress -> {
|
||||||
item.getProgress().setValue(progress);
|
item.getProgress().setValue(progress);
|
||||||
item.getOpenFileSystemModel().getProgress().setValue(progress);
|
item.getOpenFileSystemModel().getProgress().setValue(progress);
|
||||||
});
|
});
|
||||||
|
@ -158,7 +162,8 @@ public class BrowserTransferModel {
|
||||||
public ObservableBooleanValue downloadFinished() {
|
public ObservableBooleanValue downloadFinished() {
|
||||||
return Bindings.createBooleanBinding(
|
return Bindings.createBooleanBinding(
|
||||||
() -> {
|
() -> {
|
||||||
return progress.getValue() != null && progress.getValue().done();
|
return progress.getValue() != null
|
||||||
|
&& progress.getValue().done();
|
||||||
},
|
},
|
||||||
progress);
|
progress);
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,8 +123,7 @@ public class FileSystemHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!model.getFileSystem().directoryExists(path)) {
|
if (!model.getFileSystem().directoryExists(path)) {
|
||||||
throw ErrorEvent.expected(
|
throw ErrorEvent.expected(new IllegalArgumentException(String.format("Directory %s does not exist", path)));
|
||||||
new IllegalArgumentException(String.format("Directory %s does not exist", path)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -153,7 +152,11 @@ public class FileSystemHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dropLocalFilesInto(
|
public static void dropLocalFilesInto(
|
||||||
FileSystem.FileEntry entry, List<Path> files, Consumer<BrowserTransferProgress> progress, boolean checkConflicts) throws Exception {
|
FileSystem.FileEntry entry,
|
||||||
|
List<Path> files,
|
||||||
|
Consumer<BrowserTransferProgress> progress,
|
||||||
|
boolean checkConflicts)
|
||||||
|
throws Exception {
|
||||||
var entries = files.stream()
|
var entries = files.stream()
|
||||||
.map(path -> {
|
.map(path -> {
|
||||||
try {
|
try {
|
||||||
|
@ -202,7 +205,8 @@ public class FileSystemHelper {
|
||||||
AtomicReference<BrowserAlerts.FileConflictChoice> lastConflictChoice = new AtomicReference<>();
|
AtomicReference<BrowserAlerts.FileConflictChoice> lastConflictChoice = new AtomicReference<>();
|
||||||
for (var file : files) {
|
for (var file : files) {
|
||||||
if (file.getFileSystem().equals(target.getFileSystem())) {
|
if (file.getFileSystem().equals(target.getFileSystem())) {
|
||||||
dropFileAcrossSameFileSystem(target, file, explicitCopy, lastConflictChoice, files.size() > 1, checkConflicts);
|
dropFileAcrossSameFileSystem(
|
||||||
|
target, file, explicitCopy, lastConflictChoice, files.size() > 1, checkConflicts);
|
||||||
progress.accept(BrowserTransferProgress.finished(file.getName(), file.getSize()));
|
progress.accept(BrowserTransferProgress.finished(file.getName(), file.getSize()));
|
||||||
} else {
|
} else {
|
||||||
dropFileAcrossFileSystems(target, file, progress, lastConflictChoice, files.size() > 1, checkConflicts);
|
dropFileAcrossFileSystems(target, file, progress, lastConflictChoice, files.size() > 1, checkConflicts);
|
||||||
|
@ -297,8 +301,12 @@ public class FileSystemHelper {
|
||||||
if (sourceFile.getKind() == FileKind.DIRECTORY) {
|
if (sourceFile.getKind() == FileKind.DIRECTORY) {
|
||||||
target.getFileSystem().mkdirs(targetFile);
|
target.getFileSystem().mkdirs(targetFile);
|
||||||
} else if (sourceFile.getKind() == FileKind.FILE) {
|
} else if (sourceFile.getKind() == FileKind.FILE) {
|
||||||
if (checkConflicts && !handleChoice(
|
if (checkConflicts
|
||||||
lastConflictChoice, target.getFileSystem(), targetFile, multiple || flatFiles.size() > 1)) {
|
&& !handleChoice(
|
||||||
|
lastConflictChoice,
|
||||||
|
target.getFileSystem(),
|
||||||
|
targetFile,
|
||||||
|
multiple || flatFiles.size() > 1)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,13 +79,12 @@ public class SystemStateComp extends SimpleComp {
|
||||||
public static ObservableValue<State> shellState(StoreEntryWrapper w) {
|
public static ObservableValue<State> shellState(StoreEntryWrapper w) {
|
||||||
return BindingsHelper.map(w.getPersistentState(), o -> {
|
return BindingsHelper.map(w.getPersistentState(), o -> {
|
||||||
if (o instanceof ShellStoreState s) {
|
if (o instanceof ShellStoreState s) {
|
||||||
if (s.getShellDialect() != null && !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) {
|
if (s.getShellDialect() != null
|
||||||
|
&& !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) {
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.getRunning() != null
|
return s.getRunning() != null ? s.getRunning() ? SUCCESS : FAILURE : OTHER;
|
||||||
? s.getRunning() ? SUCCESS : FAILURE
|
|
||||||
: OTHER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return OTHER;
|
return OTHER;
|
||||||
|
|
|
@ -216,7 +216,9 @@ public class StoreEntryWrapper {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.getValidity().isUsable() && entry.getProvider().getSearchableTerms(entry.getStore()).stream().anyMatch(s -> s.toLowerCase().contains(filter.toLowerCase()))) {
|
if (entry.getValidity().isUsable()
|
||||||
|
&& entry.getProvider().getSearchableTerms(entry.getStore()).stream()
|
||||||
|
.anyMatch(s -> s.toLowerCase().contains(filter.toLowerCase()))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,8 @@ public class StoreSectionComp extends Comp<CompStructure<VBox>> {
|
||||||
.apply(struc -> struc.get().setFillHeight(true))
|
.apply(struc -> struc.get().setFillHeight(true))
|
||||||
.hide(BindingsHelper.persist(Bindings.or(
|
.hide(BindingsHelper.persist(Bindings.or(
|
||||||
Bindings.not(section.getWrapper().getExpanded()),
|
Bindings.not(section.getWrapper().getExpanded()),
|
||||||
Bindings.size(section.getShownChildren()).isEqualTo(0))))))
|
Bindings.size(section.getShownChildren())
|
||||||
|
.isEqualTo(0))))))
|
||||||
.styleClass("store-entry-section-comp")
|
.styleClass("store-entry-section-comp")
|
||||||
.apply(struc -> {
|
.apply(struc -> {
|
||||||
struc.get().setFillWidth(true);
|
struc.get().setFillWidth(true);
|
||||||
|
|
|
@ -33,18 +33,21 @@ public class StoreSectionMiniComp extends Comp<CompStructure<VBox>> {
|
||||||
private static final PseudoClass TOP = PseudoClass.getPseudoClass("top");
|
private static final PseudoClass TOP = PseudoClass.getPseudoClass("top");
|
||||||
private static final PseudoClass SUB = PseudoClass.getPseudoClass("sub");
|
private static final PseudoClass SUB = PseudoClass.getPseudoClass("sub");
|
||||||
|
|
||||||
|
|
||||||
private final StoreSection section;
|
private final StoreSection section;
|
||||||
private final BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment;
|
private final BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment;
|
||||||
private final boolean condensedStyle;
|
private final boolean condensedStyle;
|
||||||
|
|
||||||
public StoreSectionMiniComp(StoreSection section, BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment, boolean condensedStyle) {
|
public StoreSectionMiniComp(
|
||||||
|
StoreSection section,
|
||||||
|
BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment,
|
||||||
|
boolean condensedStyle) {
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.augment = augment;
|
this.augment = augment;
|
||||||
this.condensedStyle = condensedStyle;
|
this.condensedStyle = condensedStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Comp<?> createList(StoreSection top, BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment, boolean condensedStyle) {
|
public static Comp<?> createList(
|
||||||
|
StoreSection top, BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment, boolean condensedStyle) {
|
||||||
return new StoreSectionMiniComp(top, augment, condensedStyle);
|
return new StoreSectionMiniComp(top, augment, condensedStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,8 +131,7 @@ public class StoreSectionMiniComp extends Comp<CompStructure<VBox>> {
|
||||||
if (condensedStyle) {
|
if (condensedStyle) {
|
||||||
vert.styleClass("condensed");
|
vert.styleClass("condensed");
|
||||||
}
|
}
|
||||||
return vert
|
return vert.styleClass("store-section-mini-comp")
|
||||||
.styleClass("store-section-mini-comp")
|
|
||||||
.apply(struc -> {
|
.apply(struc -> {
|
||||||
struc.get().setFillWidth(true);
|
struc.get().setFillWidth(true);
|
||||||
SimpleChangeListener.apply(expanded, val -> {
|
SimpleChangeListener.apply(expanded, val -> {
|
||||||
|
|
|
@ -52,7 +52,11 @@ public class AppFileWatcher {
|
||||||
try {
|
try {
|
||||||
watchService = FileSystems.getDefault().newWatchService();
|
watchService = FileSystems.getDefault().newWatchService();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
ErrorEvent.fromThrowable("Unable to initialize file watcher. Watching and updating files in the file browser will be unavailable.", e).expected().handle();
|
ErrorEvent.fromThrowable(
|
||||||
|
"Unable to initialize file watcher. Watching and updating files in the file browser will be unavailable.",
|
||||||
|
e)
|
||||||
|
.expected()
|
||||||
|
.handle();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,10 @@ import java.util.Optional;
|
||||||
@Value
|
@Value
|
||||||
public class AppVersion implements Comparable<AppVersion> {
|
public class AppVersion implements Comparable<AppVersion> {
|
||||||
|
|
||||||
|
int major;
|
||||||
|
int minor;
|
||||||
|
int patch;
|
||||||
|
|
||||||
public static Optional<AppVersion> parse(String version) {
|
public static Optional<AppVersion> parse(String version) {
|
||||||
try {
|
try {
|
||||||
var releaseSplit = version.split("-");
|
var releaseSplit = version.split("-");
|
||||||
|
@ -23,10 +27,6 @@ public class AppVersion implements Comparable<AppVersion> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int major;
|
|
||||||
int minor;
|
|
||||||
int patch;
|
|
||||||
|
|
||||||
public boolean greaterThan(AppVersion other) {
|
public boolean greaterThan(AppVersion other) {
|
||||||
return compareTo(other) > 0;
|
return compareTo(other) > 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,8 @@ public abstract class ScanProvider {
|
||||||
FailableRunnable<Exception> scanner;
|
FailableRunnable<Exception> scanner;
|
||||||
String licenseFeatureId;
|
String licenseFeatureId;
|
||||||
|
|
||||||
public ScanOperation(String nameKey, boolean disabled, boolean defaultSelected, FailableRunnable<Exception> scanner) {
|
public ScanOperation(
|
||||||
|
String nameKey, boolean disabled, boolean defaultSelected, FailableRunnable<Exception> scanner) {
|
||||||
this.nameKey = nameKey;
|
this.nameKey = nameKey;
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
this.defaultSelected = defaultSelected;
|
this.defaultSelected = defaultSelected;
|
||||||
|
|
|
@ -100,7 +100,8 @@ public class DataStoreChoiceComp<T extends DataStore> extends SimpleComp {
|
||||||
if (!applicable.test(s.getWrapper())) {
|
if (!applicable.test(s.getWrapper())) {
|
||||||
comp.disable(new SimpleBooleanProperty(true));
|
comp.disable(new SimpleBooleanProperty(true));
|
||||||
}
|
}
|
||||||
}, false);
|
},
|
||||||
|
false);
|
||||||
var category = new DataStoreCategoryChoiceComp(
|
var category = new DataStoreCategoryChoiceComp(
|
||||||
initialCategory != null ? initialCategory.getRoot() : null,
|
initialCategory != null ? initialCategory.getRoot() : null,
|
||||||
StoreViewState.get().getActiveCategory(),
|
StoreViewState.get().getActiveCategory(),
|
||||||
|
|
|
@ -60,8 +60,8 @@ public class AppPrefs {
|
||||||
map(new SimpleBooleanProperty(false), "disableCertutilUse", Boolean.class);
|
map(new SimpleBooleanProperty(false), "disableCertutilUse", Boolean.class);
|
||||||
public final BooleanProperty useLocalFallbackShell =
|
public final BooleanProperty useLocalFallbackShell =
|
||||||
map(new SimpleBooleanProperty(false), "useLocalFallbackShell", Boolean.class);
|
map(new SimpleBooleanProperty(false), "useLocalFallbackShell", Boolean.class);
|
||||||
public final BooleanProperty disableTerminalRemotePasswordPreparation =
|
public final BooleanProperty disableTerminalRemotePasswordPreparation = mapVaultSpecific(
|
||||||
mapVaultSpecific(new SimpleBooleanProperty(false), "disableTerminalRemotePasswordPreparation", Boolean.class);
|
new SimpleBooleanProperty(false), "disableTerminalRemotePasswordPreparation", Boolean.class);
|
||||||
public final Property<Boolean> alwaysConfirmElevation =
|
public final Property<Boolean> alwaysConfirmElevation =
|
||||||
mapVaultSpecific(new SimpleObjectProperty<>(false), "alwaysConfirmElevation", Boolean.class);
|
mapVaultSpecific(new SimpleObjectProperty<>(false), "alwaysConfirmElevation", Boolean.class);
|
||||||
public final BooleanProperty dontCachePasswords =
|
public final BooleanProperty dontCachePasswords =
|
||||||
|
@ -95,7 +95,6 @@ public class AppPrefs {
|
||||||
map(new SimpleBooleanProperty(true), "openConnectionSearchWindowOnConnectionCreation", Boolean.class);
|
map(new SimpleBooleanProperty(true), "openConnectionSearchWindowOnConnectionCreation", Boolean.class);
|
||||||
final ObjectProperty<Path> storageDirectory =
|
final ObjectProperty<Path> storageDirectory =
|
||||||
map(new SimpleObjectProperty<>(DEFAULT_STORAGE_DIR), "storageDirectory", Path.class);
|
map(new SimpleObjectProperty<>(DEFAULT_STORAGE_DIR), "storageDirectory", Path.class);
|
||||||
private AppPrefsStorageHandler vaultStorageHandler;
|
|
||||||
final BooleanProperty developerMode = map(new SimpleBooleanProperty(false), "developerMode", Boolean.class);
|
final BooleanProperty developerMode = map(new SimpleBooleanProperty(false), "developerMode", Boolean.class);
|
||||||
final BooleanProperty developerDisableUpdateVersionCheck =
|
final BooleanProperty developerDisableUpdateVersionCheck =
|
||||||
map(new SimpleBooleanProperty(false), "developerDisableUpdateVersionCheck", Boolean.class);
|
map(new SimpleBooleanProperty(false), "developerDisableUpdateVersionCheck", Boolean.class);
|
||||||
|
@ -107,30 +106,24 @@ public class AppPrefs {
|
||||||
bindDeveloperTrue(developerDisableGuiRestrictions);
|
bindDeveloperTrue(developerDisableGuiRestrictions);
|
||||||
private final ObjectProperty<SupportedLocale> language =
|
private final ObjectProperty<SupportedLocale> language =
|
||||||
map(new SimpleObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class);
|
map(new SimpleObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class);
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Property<InPlaceSecretValue> lockPassword = new SimpleObjectProperty<>();
|
private final Property<InPlaceSecretValue> lockPassword = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final StringProperty lockCrypt =
|
private final StringProperty lockCrypt =
|
||||||
mapVaultSpecific(new SimpleStringProperty(), "workspaceLock", String.class);
|
mapVaultSpecific(new SimpleStringProperty(), "workspaceLock", String.class);
|
||||||
|
|
||||||
private final IntegerProperty editorReloadTimeout =
|
private final IntegerProperty editorReloadTimeout =
|
||||||
map(new SimpleIntegerProperty(1000), "editorReloadTimeout", Integer.class);
|
map(new SimpleIntegerProperty(1000), "editorReloadTimeout", Integer.class);
|
||||||
private final BooleanProperty confirmDeletions =
|
private final BooleanProperty confirmDeletions =
|
||||||
map(new SimpleBooleanProperty(true), "confirmDeletions", Boolean.class);
|
map(new SimpleBooleanProperty(true), "confirmDeletions", Boolean.class);
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final List<AppPrefsCategory> categories;
|
private final List<AppPrefsCategory> categories;
|
||||||
|
|
||||||
private final AppPrefsStorageHandler globalStorageHandler = new AppPrefsStorageHandler(
|
private final AppPrefsStorageHandler globalStorageHandler = new AppPrefsStorageHandler(
|
||||||
AppProperties.get().getDataDir().resolve("settings").resolve("preferences.json"));
|
AppProperties.get().getDataDir().resolve("settings").resolve("preferences.json"));
|
||||||
private final Map<Mapping<?>, Comp<?>> customEntries = new LinkedHashMap<>();
|
private final Map<Mapping<?>, Comp<?>> customEntries = new LinkedHashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Property<AppPrefsCategory> selectedCategory;
|
private final Property<AppPrefsCategory> selectedCategory;
|
||||||
|
|
||||||
private final PrefsHandler extensionHandler = new PrefsHandlerImpl();
|
private final PrefsHandler extensionHandler = new PrefsHandlerImpl();
|
||||||
|
private AppPrefsStorageHandler vaultStorageHandler;
|
||||||
|
|
||||||
private AppPrefs() {
|
private AppPrefs() {
|
||||||
this.categories = List.of(
|
this.categories = List.of(
|
||||||
|
@ -159,7 +152,8 @@ public class AppPrefs {
|
||||||
PrefsProvider.getAll().forEach(prov -> prov.addPrefs(INSTANCE.extensionHandler));
|
PrefsProvider.getAll().forEach(prov -> prov.addPrefs(INSTANCE.extensionHandler));
|
||||||
INSTANCE.loadLocal();
|
INSTANCE.loadLocal();
|
||||||
INSTANCE.fixInvalidLocalValues();
|
INSTANCE.fixInvalidLocalValues();
|
||||||
INSTANCE.vaultStorageHandler = new AppPrefsStorageHandler(INSTANCE.storageDirectory().getValue().resolve("preferences.json"));
|
INSTANCE.vaultStorageHandler = new AppPrefsStorageHandler(
|
||||||
|
INSTANCE.storageDirectory().getValue().resolve("preferences.json"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initSharedRemote() {
|
public static void initSharedRemote() {
|
||||||
|
@ -474,7 +468,8 @@ public class AppPrefs {
|
||||||
public void save() {
|
public void save() {
|
||||||
for (Mapping<?> m : mapping) {
|
for (Mapping<?> m : mapping) {
|
||||||
AppPrefsStorageHandler handler = m.isVaultSpecific() ? vaultStorageHandler : globalStorageHandler;
|
AppPrefsStorageHandler handler = m.isVaultSpecific() ? vaultStorageHandler : globalStorageHandler;
|
||||||
// It might be possible that we save while the vault handler is not initialized yet / has no file or directory
|
// It might be possible that we save while the vault handler is not initialized yet / has no file or
|
||||||
|
// directory
|
||||||
if (!handler.isInitialized()) {
|
if (!handler.isInitialized()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,10 @@ public class AppPrefsStorageHandler {
|
||||||
public <T> T loadObject(String id, Class<T> type, T defaultObject) {
|
public <T> T loadObject(String id, Class<T> type, T defaultObject) {
|
||||||
var tree = getContent(id);
|
var tree = getContent(id);
|
||||||
if (tree == null) {
|
if (tree == null) {
|
||||||
TrackEvent.withDebug("Preferences value not found").tag("id", id).tag("default", defaultObject).handle();
|
TrackEvent.withDebug("Preferences value not found")
|
||||||
|
.tag("id", id)
|
||||||
|
.tag("default", defaultObject)
|
||||||
|
.handle();
|
||||||
return defaultObject;
|
return defaultObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -196,8 +196,12 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
||||||
@Override
|
@Override
|
||||||
protected void execute(Path file, LaunchConfiguration configuration) throws Exception {
|
protected void execute(Path file, LaunchConfiguration configuration) throws Exception {
|
||||||
// Tabby has a very weird handling of output, even detaching with start does not prevent it from printing
|
// Tabby has a very weird handling of output, even detaching with start does not prevent it from printing
|
||||||
LocalShell.getShell().executeSimpleCommand(
|
LocalShell.getShell()
|
||||||
CommandBuilder.of().addFile(file.toString()).add("run").addFile(configuration.getScriptFile()).discardOutput());
|
.executeSimpleCommand(CommandBuilder.of()
|
||||||
|
.addFile(file.toString())
|
||||||
|
.add("run")
|
||||||
|
.addFile(configuration.getScriptFile())
|
||||||
|
.discardOutput());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -421,8 +421,11 @@ public abstract class DataStorage {
|
||||||
// pair.getKey().setStoreInternal(pair.getValue().getStore(), false);
|
// pair.getKey().setStoreInternal(pair.getValue().getStore(), false);
|
||||||
|
|
||||||
// Update state by merging
|
// Update state by merging
|
||||||
if (pair.getKey().getStorePersistentState() != null && pair.getValue().get().getStorePersistentState() != null) {
|
if (pair.getKey().getStorePersistentState() != null
|
||||||
var classMatch = pair.getKey().getStorePersistentState().getClass()
|
&& pair.getValue().get().getStorePersistentState() != null) {
|
||||||
|
var classMatch = pair.getKey()
|
||||||
|
.getStorePersistentState()
|
||||||
|
.getClass()
|
||||||
.equals(pair.getValue().get().getStorePersistentState().getClass());
|
.equals(pair.getValue().get().getStorePersistentState().getClass());
|
||||||
// Children classes might not be the same, the same goes for state classes
|
// Children classes might not be the same, the same goes for state classes
|
||||||
// This can happen when there are multiple child classes and the ids got switched around
|
// This can happen when there are multiple child classes and the ids got switched around
|
||||||
|
|
|
@ -171,7 +171,11 @@ public class StandardStorage extends DataStorage {
|
||||||
local.deleteFromDisk();
|
local.deleteFromDisk();
|
||||||
hasFixedLocal = false;
|
hasFixedLocal = false;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ErrorEvent.fromThrowable(ex).terminal(true).expected().build().handle();
|
ErrorEvent.fromThrowable(ex)
|
||||||
|
.terminal(true)
|
||||||
|
.expected()
|
||||||
|
.build()
|
||||||
|
.handle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,9 @@ public class AppDownloads {
|
||||||
// If we are currently running a prerelease, always return this as the suitable release!
|
// If we are currently running a prerelease, always return this as the suitable release!
|
||||||
if (preIncluding.isPresent()
|
if (preIncluding.isPresent()
|
||||||
&& preIncluding.get().isPrerelease()
|
&& preIncluding.get().isPrerelease()
|
||||||
&& AppProperties.get().getVersion().equals(preIncluding.get().getTagName())) {
|
&& AppProperties.get()
|
||||||
|
.getVersion()
|
||||||
|
.equals(preIncluding.get().getTagName())) {
|
||||||
return preIncluding;
|
return preIncluding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,19 +66,28 @@ public class AppInstaller {
|
||||||
@Override
|
@Override
|
||||||
public void installLocal(String file) throws Exception {
|
public void installLocal(String file) throws Exception {
|
||||||
var shellProcessControl = new LocalStore().control().start();
|
var shellProcessControl = new LocalStore().control().start();
|
||||||
var exec = (AppProperties.get().isDevelopmentEnvironment() ? Path.of(XPipeInstallation.getLocalDefaultInstallationBasePath()) :
|
var exec = (AppProperties.get().isDevelopmentEnvironment()
|
||||||
XPipeInstallation.getCurrentInstallationBasePath())
|
? Path.of(XPipeInstallation.getLocalDefaultInstallationBasePath())
|
||||||
.resolve(XPipeInstallation.getDaemonExecutablePath(OsType.getLocal())).toString();
|
: XPipeInstallation.getCurrentInstallationBasePath())
|
||||||
|
.resolve(XPipeInstallation.getDaemonExecutablePath(OsType.getLocal()))
|
||||||
|
.toString();
|
||||||
var logsDir = FileNames.join(XPipeInstallation.getDataDir().toString(), "logs");
|
var logsDir = FileNames.join(XPipeInstallation.getDataDir().toString(), "logs");
|
||||||
var logFile = FileNames.join(logsDir, "installer_" + FileNames.getFileName(file) + ".log");
|
var logFile = FileNames.join(logsDir, "installer_" + FileNames.getFileName(file) + ".log");
|
||||||
var command = LocalShell.getShell().getShellDialect().equals(ShellDialects.CMD) ?
|
var command = LocalShell.getShell().getShellDialect().equals(ShellDialects.CMD)
|
||||||
getCmdCommand(file, logFile, exec) : getPowershellCommand(file, logFile, exec);
|
? getCmdCommand(file, logFile, exec)
|
||||||
var toRun = LocalShell.getShell().getShellDialect().equals(ShellDialects.CMD) ?
|
: getPowershellCommand(file, logFile, exec);
|
||||||
"start \"XPipe Updater\" /min cmd /c \"" + ScriptHelper.createLocalExecScript(command) + "\"" :
|
var toRun = LocalShell.getShell().getShellDialect().equals(ShellDialects.CMD)
|
||||||
"Start-Process -WindowStyle Minimized -FilePath powershell -ArgumentList \"-ExecutionPolicy\", \"Bypass\", \"-File\", \"`\"" + ScriptHelper.createLocalExecScript(command) + "`\"\"";
|
? "start \"XPipe Updater\" /min cmd /c \"" + ScriptHelper.createLocalExecScript(command) + "\""
|
||||||
|
: "Start-Process -WindowStyle Minimized -FilePath powershell -ArgumentList \"-ExecutionPolicy\", \"Bypass\", \"-File\", \"`\""
|
||||||
|
+ ScriptHelper.createLocalExecScript(command) + "`\"\"";
|
||||||
shellProcessControl.executeSimpleCommand(toRun);
|
shellProcessControl.executeSimpleCommand(toRun);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getExtension() {
|
||||||
|
return ".msi";
|
||||||
|
}
|
||||||
|
|
||||||
private String getCmdCommand(String file, String logFile, String exec) {
|
private String getCmdCommand(String file, String logFile, String exec) {
|
||||||
return String.format(
|
return String.format(
|
||||||
"""
|
"""
|
||||||
|
@ -106,11 +115,6 @@ public class AppInstaller {
|
||||||
""",
|
""",
|
||||||
file, file, logFile, file, logFile, exec, exec);
|
file, file, logFile, file, logFile, exec, exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getExtension() {
|
|
||||||
return ".msi";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonTypeName("debian")
|
@JsonTypeName("debian")
|
||||||
|
@ -119,7 +123,8 @@ public class AppInstaller {
|
||||||
@Override
|
@Override
|
||||||
public void installLocal(String file) throws Exception {
|
public void installLocal(String file) throws Exception {
|
||||||
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
||||||
var command = String.format("""
|
var command = String.format(
|
||||||
|
"""
|
||||||
function exec {
|
function exec {
|
||||||
echo "+ sudo apt install \\"%s\\""
|
echo "+ sudo apt install \\"%s\\""
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qy "%s" || return 1
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qy "%s" || return 1
|
||||||
|
@ -128,7 +133,8 @@ public class AppInstaller {
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
||||||
""", file, file, name);
|
""",
|
||||||
|
file, file, name);
|
||||||
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +149,8 @@ public class AppInstaller {
|
||||||
@Override
|
@Override
|
||||||
public void installLocal(String file) throws Exception {
|
public void installLocal(String file) throws Exception {
|
||||||
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
||||||
var command = String.format("""
|
var command = String.format(
|
||||||
|
"""
|
||||||
function exec {
|
function exec {
|
||||||
echo "+ sudo rpm -U -v --force \\"%s\\""
|
echo "+ sudo rpm -U -v --force \\"%s\\""
|
||||||
sudo rpm -U -v --force "%s" || return 1
|
sudo rpm -U -v --force "%s" || return 1
|
||||||
|
@ -152,7 +159,8 @@ public class AppInstaller {
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
||||||
""", file, file, name);
|
""",
|
||||||
|
file, file, name);
|
||||||
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +175,8 @@ public class AppInstaller {
|
||||||
@Override
|
@Override
|
||||||
public void installLocal(String file) throws Exception {
|
public void installLocal(String file) throws Exception {
|
||||||
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
||||||
var command = String.format("""
|
var command = String.format(
|
||||||
|
"""
|
||||||
function exec {
|
function exec {
|
||||||
echo "+ sudo installer -verboseR -allowUntrusted -pkg \\"%s\\" -target /"
|
echo "+ sudo installer -verboseR -allowUntrusted -pkg \\"%s\\" -target /"
|
||||||
sudo installer -verboseR -allowUntrusted -pkg "%s" -target / || return 1
|
sudo installer -verboseR -allowUntrusted -pkg "%s" -target / || return 1
|
||||||
|
@ -176,7 +185,8 @@ public class AppInstaller {
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
exec || echo "Update failed ..." && read -rs -k 1 key
|
exec || echo "Update failed ..." && read -rs -k 1 key
|
||||||
""", file, file, name);
|
""",
|
||||||
|
file, file, name);
|
||||||
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@ public class ApplicationHelper {
|
||||||
ShellControl processControl, String executable, String displayName, DataStoreEntry connection)
|
ShellControl processControl, String executable, String displayName, DataStoreEntry connection)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
if (!isInPath(processControl, executable)) {
|
if (!isInPath(processControl, executable)) {
|
||||||
throw ErrorEvent.expected(new IOException(displayName + " executable " + executable
|
throw ErrorEvent.expected(new IOException(displayName + " executable " + executable + " not found in PATH"
|
||||||
+ " not found in PATH" + (connection != null ? " on system " + connection.getName() : "")));
|
+ (connection != null ? " on system " + connection.getName() : "")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,11 @@ public class DataStoreFormatter {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.getShellDialect() != null && !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) {
|
if (s.getShellDialect() != null
|
||||||
return s.getOsName() != null ? s.getOsName() : s.getShellDialect().getDisplayName();
|
&& !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) {
|
||||||
|
return s.getOsName() != null
|
||||||
|
? s.getOsName()
|
||||||
|
: s.getShellDialect().getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.isRunning() ? s.getOsName() : "Connection failed";
|
return s.isRunning() ? s.getOsName() : "Connection failed";
|
||||||
|
|
|
@ -72,7 +72,8 @@ public class FileOpener {
|
||||||
editor.launch(Path.of(localFile).toRealPath());
|
editor.launch(Path.of(localFile).toRealPath());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ErrorEvent.fromThrowable(e)
|
ErrorEvent.fromThrowable(e)
|
||||||
.description("Unable to launch editor " + editor.toTranslatedString().getValue()
|
.description("Unable to launch editor "
|
||||||
|
+ editor.toTranslatedString().getValue()
|
||||||
+ ".\nMaybe try to use a different editor in the settings.")
|
+ ".\nMaybe try to use a different editor in the settings.")
|
||||||
.expected()
|
.expected()
|
||||||
.handle();
|
.handle();
|
||||||
|
|
|
@ -65,7 +65,8 @@ public class ScanAlert {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void show(
|
private static void show(
|
||||||
DataStoreEntry initialStore, BiFunction<DataStoreEntry, ShellControl,List<ScanProvider.ScanOperation>> applicable) {
|
DataStoreEntry initialStore,
|
||||||
|
BiFunction<DataStoreEntry, ShellControl, List<ScanProvider.ScanOperation>> applicable) {
|
||||||
DialogComp.showWindow(
|
DialogComp.showWindow(
|
||||||
"scanAlertTitle",
|
"scanAlertTitle",
|
||||||
stage -> new Dialog(stage, initialStore != null ? initialStore.ref() : null, applicable));
|
stage -> new Dialog(stage, initialStore != null ? initialStore.ref() : null, applicable));
|
||||||
|
@ -110,13 +111,14 @@ public class ScanAlert {
|
||||||
});
|
});
|
||||||
|
|
||||||
BooleanScope.execute(busy, () -> {
|
BooleanScope.execute(busy, () -> {
|
||||||
shellControl.start();
|
|
||||||
entry.get().get().setExpanded(true);
|
entry.get().get().setExpanded(true);
|
||||||
var copy = new ArrayList<>(selected);
|
var copy = new ArrayList<>(selected);
|
||||||
for (var a : copy) {
|
for (var a : copy) {
|
||||||
// If the user decided to remove the selected entry
|
// If the user decided to remove the selected entry
|
||||||
// while the scan is running, just return instantly
|
// while the scan is running, just return instantly
|
||||||
if (!DataStorage.get().getStoreEntriesSet().contains(entry.get().get())) {
|
if (!DataStorage.get()
|
||||||
|
.getStoreEntriesSet()
|
||||||
|
.contains(entry.get().get())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +202,10 @@ public class ScanAlert {
|
||||||
}
|
}
|
||||||
|
|
||||||
var suffix = LicenseProvider.get().getFeature(s.getLicensedFeatureId());
|
var suffix = LicenseProvider.get().getFeature(s.getLicensedFeatureId());
|
||||||
return n + suffix.getDescriptionSuffix().map(d -> " (" + d + ")").orElse("");
|
return n
|
||||||
|
+ suffix.getDescriptionSuffix()
|
||||||
|
.map(d -> " (" + d + ")")
|
||||||
|
.orElse("");
|
||||||
};
|
};
|
||||||
var r = new ListSelectorComp<>(
|
var r = new ListSelectorComp<>(
|
||||||
a,
|
a,
|
||||||
|
|
|
@ -116,7 +116,8 @@ public class SecretQueryProgress {
|
||||||
private boolean shouldCache(SecretQuery query, String prompt) {
|
private boolean shouldCache(SecretQuery query, String prompt) {
|
||||||
var shouldCache = query.cache()
|
var shouldCache = query.cache()
|
||||||
&& SecretManager.shouldCacheForPrompt(prompt)
|
&& SecretManager.shouldCacheForPrompt(prompt)
|
||||||
&& (!query.respectDontCacheSetting() || !AppPrefs.get().dontCachePasswords().get());
|
&& (!query.respectDontCacheSetting()
|
||||||
|
|| !AppPrefs.get().dontCachePasswords().get());
|
||||||
return shouldCache;
|
return shouldCache;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,11 @@ public class ShellTemp {
|
||||||
|
|
||||||
// Always delete legacy directory and do not care whether it partially fails
|
// Always delete legacy directory and do not care whether it partially fails
|
||||||
// This system xpipe temp directory might contain other files on the local machine, so only clear the exec
|
// This system xpipe temp directory might contain other files on the local machine, so only clear the exec
|
||||||
d.deleteFileOrDirectory(proc, FileNames.join(systemTemp, "xpipe", "exec")).executeAndCheck();
|
d.deleteFileOrDirectory(proc, FileNames.join(systemTemp, "xpipe", "exec"))
|
||||||
|
.executeAndCheck();
|
||||||
d.deleteFileOrDirectory(proc, FileNames.join(home, ".xpipe", "temp")).executeAndCheck();
|
d.deleteFileOrDirectory(proc, FileNames.join(home, ".xpipe", "temp")).executeAndCheck();
|
||||||
d.deleteFileOrDirectory(proc, FileNames.join(home, ".xpipe", "system_id")).executeAndCheck();
|
d.deleteFileOrDirectory(proc, FileNames.join(home, ".xpipe", "system_id"))
|
||||||
|
.executeAndCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkDirectoryPermissions(ShellControl proc, String dir) throws Exception {
|
private static boolean checkDirectoryPermissions(ShellControl proc, String dir) throws Exception {
|
||||||
|
|
|
@ -227,7 +227,9 @@
|
||||||
-fx-background-color: -color-neutral-muted;
|
-fx-background-color: -color-neutral-muted;
|
||||||
}
|
}
|
||||||
|
|
||||||
.browser .tab-content-area { -fx-padding: 0; }
|
.browser .tab-content-area {
|
||||||
|
-fx-padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.browser .singular {
|
.browser .singular {
|
||||||
-fx-tab-max-height: 0;
|
-fx-tab-max-height: 0;
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.root:pretty:dark .color-box.gray {
|
.root:pretty:dark .color-box.gray {
|
||||||
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, derive(-color-bg-default, 13%) 40%, derive(-color-bg-default, 11%) 50%, derive(-color-bg-default, 14%) 100%);
|
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, derive(-color-bg-default, 13%) 40%, derive(-color-bg-default, 11%) 50%, derive(-color-bg-default, 14%) 100%);
|
||||||
-fx-border-color: -color-border-default;
|
-fx-border-color: -color-border-default;
|
||||||
|
@ -45,7 +44,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.root:pretty:light .color-box.blue {
|
.root:pretty:light .color-box.blue {
|
||||||
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(130, 130, 250, 0.2) 40%, rgb(57, 57, 200, 0.2) 50%, rgb(137, 137, 250, 0.2) 100%);
|
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(130, 130, 250, 0.2) 40%, rgb(57, 57, 200, 0.2) 50%, rgb(137, 137, 250, 0.2) 100%);
|
||||||
-fx-border-color: rgba(80, 100, 150, 0.3);
|
-fx-border-color: rgba(80, 100, 150, 0.3);
|
||||||
|
@ -75,7 +73,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.root:pretty:light .color-box.red {
|
.root:pretty:light .color-box.red {
|
||||||
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(220, 100, 100, 0.15) 40%, rgb(205, 50, 50, 0.15) 50%, rgb(200, 90, 90, 0.15) 100%);
|
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(220, 100, 100, 0.15) 40%, rgb(205, 50, 50, 0.15) 50%, rgb(200, 90, 90, 0.15) 100%);
|
||||||
-fx-border-color: rgba(150, 100, 80, 0.4);
|
-fx-border-color: rgba(150, 100, 80, 0.4);
|
||||||
|
@ -105,7 +102,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.root:pretty:light .color-box.yellow {
|
.root:pretty:light .color-box.yellow {
|
||||||
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(180, 180, 30, 0.2) 40%, rgb(135, 135, 27, 0.2) 50%, rgb(200, 200, 37, 0.2) 100%);
|
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(180, 180, 30, 0.2) 40%, rgb(135, 135, 27, 0.2) 50%, rgb(200, 200, 37, 0.2) 100%);
|
||||||
-fx-border-color: rgba(170, 170, 80, 0.3);
|
-fx-border-color: rgba(170, 170, 80, 0.3);
|
||||||
|
@ -135,7 +131,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.root:pretty:light .color-box.green {
|
.root:pretty:light .color-box.green {
|
||||||
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(30, 180, 30, 0.1) 40%, rgb(20, 120, 20, 0.15) 50%, rgb(37, 200, 37, 0.1) 100%);
|
-fx-background-color: linear-gradient(from 100% 0% to 0% 100%, rgb(30, 180, 30, 0.1) 40%, rgb(20, 120, 20, 0.15) 50%, rgb(37, 200, 37, 0.1) 100%);
|
||||||
-fx-border-color: rgba(100, 150, 80, 0.2);
|
-fx-border-color: rgba(100, 150, 80, 0.2);
|
||||||
|
|
|
@ -18,12 +18,15 @@
|
||||||
.store-entry-grid:incomplete .name {
|
.store-entry-grid:incomplete .name {
|
||||||
-fx-text-fill: #ee4829;
|
-fx-text-fill: #ee4829;
|
||||||
}
|
}
|
||||||
|
|
||||||
.store-entry-grid:incomplete .summary {
|
.store-entry-grid:incomplete .summary {
|
||||||
-fx-text-fill: #ee4829;
|
-fx-text-fill: #ee4829;
|
||||||
}
|
}
|
||||||
|
|
||||||
.store-entry-grid:incomplete .information {
|
.store-entry-grid:incomplete .information {
|
||||||
-fx-text-fill: #ee4829;
|
-fx-text-fill: #ee4829;
|
||||||
}
|
}
|
||||||
|
|
||||||
.store-entry-grid:incomplete .icon {
|
.store-entry-grid:incomplete .icon {
|
||||||
-fx-opacity: 0.5;
|
-fx-opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
.third-party-dependency-list-comp .titled-pane {
|
.third-party-dependency-list-comp .titled-pane {
|
||||||
-fx-background-color: transparent;
|
-fx-background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.titled-pane .content {
|
.titled-pane .content {
|
||||||
-fx-padding: 0em;
|
-fx-padding: 0em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,8 @@ public class BeaconDaemonExtensionTest {
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setup() throws Exception {
|
public static void setup() throws Exception {
|
||||||
JacksonMapper.initModularized(ModuleLayer.boot());
|
JacksonMapper.initModularized(ModuleLayer.boot());
|
||||||
BeaconDaemonController.start(OsType.getLocal().equals(OsType.WINDOWS) ? XPipeDaemonMode.TRAY : XPipeDaemonMode.BACKGROUND);
|
BeaconDaemonController.start(
|
||||||
|
OsType.getLocal().equals(OsType.WINDOWS) ? XPipeDaemonMode.TRAY : XPipeDaemonMode.BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
|
|
|
@ -27,7 +27,8 @@ public class ConnectionFileSystem implements FileSystem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getFileSize(String file) throws Exception {
|
public long getFileSize(String file) throws Exception {
|
||||||
return Long.parseLong(shellControl.getShellDialect().queryFileSize(shellControl, file).readStdoutOrThrow());
|
return Long.parseLong(
|
||||||
|
shellControl.getShellDialect().queryFileSize(shellControl, file).readStdoutOrThrow());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,16 +12,6 @@ import java.util.List;
|
||||||
|
|
||||||
public class DeleteLinkAction implements LeafAction {
|
public class DeleteLinkAction implements LeafAction {
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean automaticallyResolveLinks() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isApplicable(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
|
||||||
return entries.stream().allMatch(browserEntry -> browserEntry.getRawFileEntry().getKind() == FileKind.LINK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(OpenFileSystemModel model, List<BrowserEntry> entries) throws Exception {
|
public void execute(OpenFileSystemModel model, List<BrowserEntry> entries) throws Exception {
|
||||||
var toDelete = entries.stream().map(entry -> entry.getRawFileEntry()).toList();
|
var toDelete = entries.stream().map(entry -> entry.getRawFileEntry()).toList();
|
||||||
|
@ -43,4 +33,15 @@ public class DeleteLinkAction implements LeafAction {
|
||||||
public String getName(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
public String getName(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
||||||
return "Delete link";
|
return "Delete link";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isApplicable(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
||||||
|
return entries.stream()
|
||||||
|
.allMatch(browserEntry -> browserEntry.getRawFileEntry().getKind() == FileKind.LINK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean automaticallyResolveLinks() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,9 @@ public abstract class ScriptStore extends JacksonizedValue implements DataStore,
|
||||||
.mapToInt(value ->
|
.mapToInt(value ->
|
||||||
value.get().getName().hashCode() + value.getStore().hashCode())
|
value.get().getName().hashCode() + value.getStore().hashCode())
|
||||||
.sum();
|
.sum();
|
||||||
var targetDir = FileNames.join(ShellTemp.getUserSpecificTempDataDirectory(proc,"scripts"), proc.getShellDialect().getId());
|
var targetDir = FileNames.join(
|
||||||
|
ShellTemp.getUserSpecificTempDataDirectory(proc, "scripts"),
|
||||||
|
proc.getShellDialect().getId());
|
||||||
var hashFile = FileNames.join(targetDir, "hash");
|
var hashFile = FileNames.join(targetDir, "hash");
|
||||||
var d = proc.getShellDialect();
|
var d = proc.getShellDialect();
|
||||||
if (d.createFileExistsCommand(proc, hashFile).executeAndCheck()) {
|
if (d.createFileExistsCommand(proc, hashFile).executeAndCheck()) {
|
||||||
|
|
Loading…
Reference in a new issue