mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-24 10:16:40 +00:00
Rework
This commit is contained in:
@@ -18,6 +18,7 @@ import io.xpipe.app.platform.*;
|
||||
import io.xpipe.app.prefs.AppPrefs;
|
||||
import io.xpipe.app.storage.DataStoreColor;
|
||||
import io.xpipe.app.storage.DataStoreEntry;
|
||||
import io.xpipe.app.store.DataStoreCreationCategory;
|
||||
import io.xpipe.app.util.*;
|
||||
|
||||
import javafx.beans.binding.Bindings;
|
||||
@@ -269,7 +270,8 @@ public abstract class StoreEntryComp extends SimpleRegionBuilder {
|
||||
protected BaseRegionBuilder<?, ?> createScopeIcon() {
|
||||
var button = new IconButtonComp("mdi2a-account");
|
||||
button.style("user-icon");
|
||||
button.describe(d -> d.nameKey("restrictedConnection"));
|
||||
var identity = getWrapper().getEntry().getProvider() != null && getWrapper().getEntry().getProvider().getCreationCategory() == DataStoreCreationCategory.IDENTITY;
|
||||
button.describe(d -> d.nameKey(identity ? "restrictedIdentity" : "restrictedConnection"));
|
||||
button.apply(struc -> {
|
||||
AppFontSizes.base(struc);
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ import io.xpipe.app.util.ThreadHelper;
|
||||
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.*;
|
||||
import javafx.beans.value.ObservableBooleanValue;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.input.MouseButton;
|
||||
@@ -70,19 +71,26 @@ public class StoreIconChoiceComp extends ModalOverlayContentComp {
|
||||
|
||||
@Override
|
||||
protected Region createSimple() {
|
||||
var empty = new SimpleBooleanProperty(true);
|
||||
busy.subscribe(v -> {
|
||||
if (empty.get() && SystemIconManager.hasLoadedAnyImages()) {
|
||||
empty.set(false);
|
||||
}
|
||||
});
|
||||
|
||||
var table = new TableView<List<SystemIcon>>();
|
||||
table.visibleProperty().bind(PlatformThread.sync(busy.not()));
|
||||
initTable(table);
|
||||
filter.addListener((observable, oldValue, newValue) -> updateData(table, newValue));
|
||||
busy.addListener((observable, oldValue, newValue) -> {
|
||||
if (oldValue && !newValue) {
|
||||
if (oldValue && !newValue && !empty.get()) {
|
||||
PlatformThread.runLaterIfNeeded(() -> {
|
||||
updateData(table, filter.getValue());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var loading = createLoadingPane();
|
||||
var loading = createLoadingPane(empty);
|
||||
var stack = new StackPane();
|
||||
stack.getChildren().addAll(table, loading);
|
||||
|
||||
@@ -118,12 +126,7 @@ public class StoreIconChoiceComp extends ModalOverlayContentComp {
|
||||
}
|
||||
}
|
||||
|
||||
private Region createLoadingPane() {
|
||||
var empty = new SimpleBooleanProperty(!SystemIconManager.hasLoadedAnyImages());
|
||||
busy.addListener((observable, oldValue, newValue) -> {
|
||||
empty.set(false);
|
||||
});
|
||||
|
||||
private Region createLoadingPane(ObservableBooleanValue empty) {
|
||||
var refreshButton = new ButtonComp(
|
||||
Bindings.createStringBinding(
|
||||
() -> {
|
||||
@@ -149,7 +152,7 @@ public class StoreIconChoiceComp extends ModalOverlayContentComp {
|
||||
|
||||
var text = new LabelComp(Bindings.createStringBinding(
|
||||
() -> {
|
||||
return empty.get()
|
||||
return empty.get() && !busy.get()
|
||||
? AppI18n.get("refreshIconsIntroDescription")
|
||||
: AppI18n.get("refreshIconsDescription");
|
||||
},
|
||||
|
||||
@@ -28,6 +28,8 @@ public interface DataStorageAccessHandler {
|
||||
|
||||
Optional<EncryptionPrincipal> getEncryptionPrincipal(UUID uuid);
|
||||
|
||||
Optional<EncryptionPrincipal> getEncryptionPrincipal(String name);
|
||||
|
||||
Set<EncryptionPrincipal> getCurrentEncryptionPrincipals();
|
||||
|
||||
Set<EncryptionPrincipal> getAllEncryptionPrincipals();
|
||||
|
||||
@@ -126,7 +126,12 @@ public class IdentitySelectComp extends RegionBuilder<HBox> {
|
||||
return;
|
||||
}
|
||||
|
||||
StoreCreationDialog.showEdit(id.get(), id.get().getStore(), true, false, ignored -> {});
|
||||
StoreCreationDialog.showEdit(id.get(), id.get().getStore(), true, false, ignored -> {
|
||||
PlatformThread.runLaterIfNeeded(() -> {
|
||||
selectedReference.set(null);
|
||||
selectedReference.set(id);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Generated
+6
-2
@@ -19,7 +19,9 @@ addScript=Script ...
|
||||
addHost=Remote Host ...
|
||||
addShell=Shell Environment ...
|
||||
addCommand=Command ...
|
||||
addAutomatically=Search automatically ...
|
||||
#force
|
||||
#context: Verb, to find what is available
|
||||
addAutomatically=Find available ...
|
||||
addOther=Other ...
|
||||
connectionAdd=Add connection
|
||||
connectionEdit=Edit connection
|
||||
@@ -106,7 +108,8 @@ saveDirectoryTitle=Save directory
|
||||
unknown=Unknown
|
||||
scanAlertTitle=Add connections
|
||||
scanAlertChoiceHeader=Target
|
||||
scanAlertChoiceHeaderDescription=The system to search for available connections
|
||||
#force
|
||||
scanAlertChoiceHeaderDescription=The system to search for available subconnections
|
||||
scanAlertHeader=Connection types
|
||||
scanAlertHeaderDescription=Select connection types you want to add for the system
|
||||
noInformationAvailable=No information available
|
||||
@@ -1262,6 +1265,7 @@ openApiDocs=API documentation
|
||||
openApiDocsDescription=The HTTP API documentation is available online, including an OpenAPI .yaml specification. You can open it in your web browser or your preferred HTTP client.
|
||||
openApiDocsButton=Open docs
|
||||
pythonApi=Python API
|
||||
restrictedIdentity=This identity and associated connections are access restricted and not available to all users
|
||||
restrictedConnection=This connection and all its children are access restricted and not available to all users
|
||||
developerPrintInitFiles=Print init file execution
|
||||
developerPrintInitFilesDescription=Print all shell init scripts that are run when a terminal is launched.
|
||||
|
||||
Reference in New Issue
Block a user