mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-22 07:29:05 -04:00
Rework
This commit is contained in:
@@ -100,7 +100,7 @@ public class AppMainWindowContentComp extends SimpleComp {
|
||||
});
|
||||
|
||||
var loadingTextCounter = new SimpleIntegerProperty();
|
||||
GlobalTimer.scheduleUntil(Duration.ofMillis(300), false, () -> {
|
||||
GlobalTimer.scheduleUntil(Duration.ofMillis(500), false, () -> {
|
||||
if (loaded.getValue() != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -211,12 +211,10 @@ public class ModalOverlayComp extends SimpleComp {
|
||||
max.set(d);
|
||||
}
|
||||
});
|
||||
}
|
||||
node.minWidthProperty().bind(max);
|
||||
buttonBar.getChildren().add(node);
|
||||
if (o instanceof ModalButton) {
|
||||
node.minWidthProperty().bind(max);
|
||||
node.prefHeightProperty().bind(buttonBar.heightProperty());
|
||||
}
|
||||
buttonBar.getChildren().add(node);
|
||||
}
|
||||
content.getChildren().add(buttonBar);
|
||||
AppFontSizes.apply(buttonBar, sizes -> {
|
||||
|
||||
@@ -129,7 +129,7 @@ public class AppMainWindow {
|
||||
}
|
||||
|
||||
public static void loadingText(String key) {
|
||||
loadingText.setValue(key != null && AppI18n.get() != null ? AppI18n.get(key) : "...");
|
||||
loadingText.setValue(key != null && AppI18n.get() != null ? AppI18n.get(key) : "?");
|
||||
}
|
||||
|
||||
public static synchronized void initContent() {
|
||||
|
||||
@@ -280,7 +280,7 @@ public final class AppPrefs {
|
||||
final ObjectProperty<VaultAuthentication> vaultAuthentication = new GlobalObjectProperty<>();
|
||||
|
||||
final ObjectProperty<DataStorageGroupStrategy> groupSecretStrategy = map(Mapping.builder()
|
||||
.property(new GlobalObjectProperty<>(new DataStorageGroupStrategy.None()))
|
||||
.property(new GlobalObjectProperty<>())
|
||||
.key("groupSecretStrategy")
|
||||
.valueClass(DataStorageGroupStrategy.class)
|
||||
.requiresRestart(true)
|
||||
|
||||
@@ -74,7 +74,7 @@ public class VaultCategory extends AppPrefsCategory {
|
||||
authChoice.maxWidth(600);
|
||||
authChoice.disable(Bindings.createBooleanBinding(() -> {
|
||||
return uh.getUserCount() > 0 && prefs.vaultAuthentication.get() == VaultAuthentication.USER ||
|
||||
prefs.groupSecretStrategy.get().requiresUnlock() && prefs.vaultAuthentication.get() == VaultAuthentication.GROUP;
|
||||
(prefs.groupSecretStrategy.get() != null && prefs.vaultAuthentication.get() == VaultAuthentication.GROUP);
|
||||
}, prefs.vaultAuthentication, prefs.groupSecretStrategy));
|
||||
|
||||
builder.addTitle("vault")
|
||||
|
||||
@@ -24,6 +24,7 @@ import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Value;
|
||||
import lombok.extern.jackson.Jacksonized;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
@@ -41,38 +42,19 @@ public interface DataStorageGroupStrategy {
|
||||
|
||||
static List<Class<?>> getClasses() {
|
||||
var l = new ArrayList<Class<?>>();
|
||||
l.add(None.class);
|
||||
l.add(File.class);
|
||||
l.add(Command.class);
|
||||
l.add(HttpRequest.class);
|
||||
return l;
|
||||
}
|
||||
|
||||
default boolean requiresUnlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
default void checkComplete() throws ValidationException {}
|
||||
|
||||
byte[] queryEncryptionSecret() throws Exception;
|
||||
|
||||
@JsonTypeName("none")
|
||||
@Value
|
||||
public class None implements DataStorageGroupStrategy {
|
||||
|
||||
@Override
|
||||
public boolean requiresUnlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] queryEncryptionSecret() throws Exception {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@JsonTypeName("file")
|
||||
@Builder
|
||||
@Jacksonized
|
||||
@Value
|
||||
public class File implements DataStorageGroupStrategy {
|
||||
|
||||
@@ -122,6 +104,7 @@ public interface DataStorageGroupStrategy {
|
||||
|
||||
@JsonTypeName("command")
|
||||
@Builder
|
||||
@Jacksonized
|
||||
@Value
|
||||
public class Command implements DataStorageGroupStrategy {
|
||||
|
||||
@@ -171,6 +154,7 @@ public interface DataStorageGroupStrategy {
|
||||
|
||||
@JsonTypeName("httpRequest")
|
||||
@Builder
|
||||
@Jacksonized
|
||||
@Value
|
||||
public class HttpRequest implements DataStorageGroupStrategy {
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.xpipe.app.storage;
|
||||
|
||||
import io.xpipe.app.core.AppProperties;
|
||||
import io.xpipe.app.core.mode.AppOperationMode;
|
||||
import io.xpipe.app.core.window.AppMainWindow;
|
||||
import io.xpipe.app.ext.DataStorageExtensionProvider;
|
||||
import io.xpipe.app.ext.LocalStore;
|
||||
import io.xpipe.app.issue.ErrorEventFactory;
|
||||
@@ -306,6 +307,8 @@ public class StandardStorage extends DataStorage {
|
||||
|
||||
initVaultKey();
|
||||
|
||||
AppMainWindow.loadingText("unlockingVault");
|
||||
|
||||
try {
|
||||
dataStorageUserHandler.init();
|
||||
} catch (IOException e) {
|
||||
|
||||
3
lang/strings/translations_en.properties
generated
3
lang/strings/translations_en.properties
generated
@@ -617,6 +617,7 @@ loadingGit=Syncing with git repo
|
||||
loadingGpg=Starting GnuPG daemon for git
|
||||
loadingSettings=Loading settings
|
||||
loadingConnections=Loading connections
|
||||
unlockingVault=Unlocking vault
|
||||
loadingUserInterface=Loading user interface
|
||||
ptbNotice=Notice for the public test build
|
||||
userDeletionTitle=User deletion
|
||||
@@ -1734,3 +1735,5 @@ commandSecretFieldDescription=The command or script that will return the secret
|
||||
httpRequestSecretField=Request URI
|
||||
vaultAuthentication=Vault authentication
|
||||
vaultAuthenticationDescription=How to authenticate / unlock the vault data. There are multiple different ways of encrypting and unlocking vault data, depending on who you want to share the vault data with.
|
||||
groupAuthFailed=Secret authentication failed
|
||||
userAuthFailed=Password authentication failed
|
||||
|
||||
Reference in New Issue
Block a user