Cluster add fixes

This commit is contained in:
crschnick 2024-02-20 01:28:58 +00:00
parent fa9374c68d
commit e428ea052f
9 changed files with 122 additions and 145 deletions

View file

@ -8,6 +8,7 @@ import io.xpipe.app.comp.base.PopupMenuButtonComp;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.core.AppWindowHelper;
import io.xpipe.app.ext.DataStoreProvider;
import io.xpipe.app.ext.DataStoreProviders;
import io.xpipe.app.fxcomps.Comp;
import io.xpipe.app.fxcomps.augment.GrowAugment;
import io.xpipe.app.fxcomps.util.PlatformThread;
@ -151,12 +152,16 @@ public class StoreCreationComp extends DialogComp {
e);
}
public static void showCreation(DataStoreProvider selected, Predicate<DataStoreProvider> filter) {
public static void showCreation(DataStoreProvider selected, DataStoreProvider.CreationCategory category) {
showCreation(selected != null ? selected.defaultStore() : null, category);
}
public static void showCreation(DataStore base, DataStoreProvider.CreationCategory category) {
show(
null,
selected,
selected != null ? selected.defaultStore() : null,
filter,
base != null ? DataStoreProviders.byStore(base) : null,
base,
dataStoreProvider -> category.equals(dataStoreProvider.getCreationCategory()),
e -> {
try {
DataStorage.get().addStoreEntryIfNotPresent(e);

View file

@ -39,9 +39,6 @@ public class StoreCreationMenu {
menu.getItems().add(category("addTunnel", "mdi2v-vector-polyline-plus",
DataStoreProvider.CreationCategory.TUNNEL, null));
menu.getItems().add(category("addCluster", "mdi2d-domain-plus",
DataStoreProvider.CreationCategory.CLUSTER, null));
menu.getItems().add(category("addDatabase", "mdi2d-database-plus",
DataStoreProvider.CreationCategory.DATABASE, null));
}
@ -53,8 +50,7 @@ public class StoreCreationMenu {
item.setGraphic(new FontIcon(graphic));
item.textProperty().bind(AppI18n.observable(name));
item.setOnAction(event -> {
StoreCreationComp.showCreation(defaultProvider != null ? DataStoreProviders.byName(defaultProvider).orElseThrow() : null,
v -> category.equals(v.getCreationCategory()));
StoreCreationComp.showCreation(defaultProvider != null ? DataStoreProviders.byName(defaultProvider).orElseThrow() : null, category);
event.consume();
});
return item;
@ -69,7 +65,7 @@ public class StoreCreationMenu {
}
StoreCreationComp.showCreation(defaultProvider != null ? DataStoreProviders.byName(defaultProvider).orElseThrow() : null,
v -> category.equals(v.getCreationCategory()));
category);
event.consume();
});
sub.forEach(dataStoreProvider -> {
@ -77,7 +73,7 @@ public class StoreCreationMenu {
item.setGraphic(PrettyImageHelper.ofFixedSmallSquare(dataStoreProvider.getDisplayIconFileName(null)).createRegion());
item.setOnAction(event -> {
StoreCreationComp.showCreation(dataStoreProvider,
v -> category.equals(v.getCreationCategory()));
category);
event.consume();
});
menu.getItems().add(item);

View file

@ -28,7 +28,7 @@ public class StoreProviderChoiceComp extends Comp<CompStructure<ComboBox<DataSto
boolean staticDisplay;
private List<DataStoreProvider> getProviders() {
return DataStoreProviders.getAll().stream().filter(filter).toList();
return DataStoreProviders.getAll().stream().filter(val -> filter == null || filter.test(val)).toList();
}
private Region createGraphic(DataStoreProvider provider) {

View file

@ -219,6 +219,7 @@ public abstract class DataStorage {
public abstract void save(boolean dispose);
public abstract boolean supportsSharing();
public boolean shouldShare(DataStoreCategory entry) {
if (!entry.canShare()) {
return false;

View file

@ -1,75 +0,0 @@
storeForLaterUse=Store for later use
localMachine=Local
localFile=Local File
network=Network
recentFiles=Recent files
newDataSource=New data source
newDataStore=New data store
selectInput=Select Input
configure=Configure
retrieve=Retrieve
internet=Internet
table=Table
update=Update
selectStreamStore=Select Stream Store
openStreamStoreWizard=Open Stream Store Wizard
updateDataSource=Update Data Source
structure=Structure
text=Text
raw=Raw
collection=Collection
anyFile=Any file
anyStream=Any Stream Type
noMatchingStoreFound=No suitable saved store was found
addStore=Add Store
anyStreamDescription=Or choose specific type
restart=Restart XPipe
restartDescription=A restart can often be a quick fix
reportIssue=Report Issue
reportIssueDescription=Open the integrated issue reporter
usefulActions=Useful actions
stored=Saved
troubleshootingOptions=Troubleshooting tools
troubleshoot=Troubleshoot
other=Other
remote=Remote File
addShellStore=Add Shell ...
addShellTitle=Add Shell Connection
savedConnections=Saved Connections
none=None
save=Save
clean=Clean
refresh=Refresh
moveTo=Move to ...
remove=Remove
addDatabase=Database ...
addCluster=Cluster ...
browseInternalStorage=Browse internal storage
addTunnel=Tunnel ...
addScript=Script ...
addHost=Remote Host ...
addShell=Shell Environment ...
addCommand=Custom Command ...
addAutomatically=Search Automatically ...
addOther=Add Other ...
addStreamTitle=Add Stream Store
addConnection=Add Connection
skip=Skip
addConnections=New
selectType=Select Type
selectTypeDescription=Select connection type
selectDatabaseType=Database Type
selectDatabaseTypeDescription=Select Type of the Database
selectShellType=Shell Type
selectShellTypeDescription=Select the Type of the Shell Connection
selectStreamType=Stream Type
selectStreamTypeDescription=Select type of the stream
name=Name
configuration=Configuration
dragAndDropFilesHere=Or just drag and drop a file here
confirmDsCreationAbortTitle=Confirm abort
confirmDsCreationAbortHeader=Do you want to abort the data source creation?
confirmDsCreationAbortContent=Any data source creation progress will be lost.
confirmInvalidStoreTitle=Failed connection
confirmInvalidStoreHeader=Do you want to skip connection validation?
confirmInvalidStoreContent=You can add this connection even if it could not be validated and fix the connection problems later on.

View file

@ -1,21 +0,0 @@
introTitle=Data sources
introDescription=Pipe, manage, and store many different types of data.
introCollection=Data source collections allow you to store and\norganize all your data sources for later use.
introPipe=Pipe data from any origin to any destination\nacross formats while maintaining compatibility.
introDocumentation=In case you prefer a more structured approach to\nfamiliarizing yourself with XPipe, check out the documentation:
introEntry=Once you have done that, you can add a new data source to it.\nThere are different types of data sources to choose from:
introTableDataSource=Tabular data sources, for example a database table, an excel sheet, or a csv file.
dataSourceIntroTitle=Categories of Data Sources
dataSourceIntroDescription=The next step is to add a data sources to this collection (See above). XPipe\ndifferentiates between several categories of data sources for different purposes.
dataSourceIntroTable=Tabular data sources contain data represented by some kind of table.\nExamples are database tables, Excel sheets, or .csv files.
dataSourceIntroStructure=Structure data sources contain some form of object structure.\nExamples are .json files, .xml files, or certain types of NoSQL databases.
dataSourceIntroText=Text data sources contain readable text that can\ncome in a variety of different encodings and simple formats.
dataSourceIntroBinary=Binary data sources contain binary data. They\ncan be used when the data should be handled and preserved byte by byte.
dataSourceIntroCollection=Collection data sources contain multiple sub data sources. \nExamples are zip files or file system directories.
storeIntroTitle=Connection Hub
storeIntroDescription=Here you can manage all your local and remote shell connections in one place. To start off, you can quickly detect available connections automatically and choose which ones to add.
storeStreamDescription=Stream connections produce raw byte data\nthat can be used to construct data sources from.
storeMachineDescription=To start off, here you can quickly detect available\nconnections automatically and choose which ones to add.
detectConnections=Search for connections
storeDatabaseDescription=Database connections allow you to connect to\na database server and interact with its contained data.
storeDocumentation=In case you prefer a more structured approach to\nfamiliarizing yourself with XPipe, check out the documentation:

View file

@ -1,2 +0,0 @@
appearance=Aussehen
uiOptions=UI Optionen

View file

@ -1,35 +0,0 @@
# Interface
addCollection=Add collection
newCollection=New collection
delete=Delete
rename=Rename
properties=Properties
usedDate=Used $DATE$
cols=$COLS$ columns
rowsCols=$ROWS$ rows / $COLS$ columns
lines=$LINES$ lines
objects=$OBJECTS$ objects
bytes=$BYTES$ bytes
entries=$ENTRIES$ entries
unknownLength=Unknown length
temporaryCollection=Temporary
entrySettings=Settings
pipe=Pipe
openDir=Open Directory
failedToLoad=Failed to Load
stores=Stores
# Dialogs
confirmCollectionDeletionTitle=Confirm collection deletion
confirmCollectionDeletionHeader=Do you really want to delete the collection $NAME$?
confirmCollectionDeletionContent=This will delete all ($COUNT$) contained data sources as well.
retrieveDataSource=Retrieve Data Source
# Tooltips
addCollectionFolder=Create new collection folder
collectionOptions=Collection options
addStreamDataSource=Add stream data source
addDatabaseDataSource=Add database data source
displayList=Display as list
displayTiles=Display as tiles
sortLastUsed=Sort by last used date
sortAlphabetical=Sort alphabetical by name
temporaryCollectionNote=All data sources inside the temporary collection are only stored while until the next system restart.

View file

@ -1,3 +1,111 @@
# Interface
addCollection=Add collection
newCollection=New collection
delete=Delete
rename=Rename
properties=Properties
usedDate=Used $DATE$
cols=$COLS$ columns
rowsCols=$ROWS$ rows / $COLS$ columns
lines=$LINES$ lines
objects=$OBJECTS$ objects
bytes=$BYTES$ bytes
entries=$ENTRIES$ entries
unknownLength=Unknown length
temporaryCollection=Temporary
entrySettings=Settings
pipe=Pipe
openDir=Open Directory
failedToLoad=Failed to Load
stores=Stores
# Dialogs
confirmCollectionDeletionTitle=Confirm collection deletion
confirmCollectionDeletionHeader=Do you really want to delete the collection $NAME$?
confirmCollectionDeletionContent=This will delete all ($COUNT$) contained data sources as well.
retrieveDataSource=Retrieve Data Source
# Tooltips
addCollectionFolder=Create new collection folder
collectionOptions=Collection options
addStreamDataSource=Add stream data source
addDatabaseDataSource=Add database data source
displayList=Display as list
displayTiles=Display as tiles
sortLastUsed=Sort by last used date
sortAlphabetical=Sort alphabetical by name
temporaryCollectionNote=All data sources inside the temporary collection are only stored while until the next system restart.
storeForLaterUse=Store for later use
localFile=Local File
network=Network
recentFiles=Recent files
newDataSource=New data source
newDataStore=New data store
selectInput=Select Input
configure=Configure
retrieve=Retrieve
internet=Internet
table=Table
update=Update
selectStreamStore=Select Stream Store
openStreamStoreWizard=Open Stream Store Wizard
updateDataSource=Update Data Source
structure=Structure
text=Text
raw=Raw
collection=Collection
anyFile=Any file
anyStream=Any Stream Type
noMatchingStoreFound=No suitable saved store was found
addStore=Add Store
anyStreamDescription=Or choose specific type
restart=Restart XPipe
restartDescription=A restart can often be a quick fix
reportIssue=Report Issue
reportIssueDescription=Open the integrated issue reporter
usefulActions=Useful actions
stored=Saved
troubleshootingOptions=Troubleshooting tools
troubleshoot=Troubleshoot
remote=Remote File
addShellStore=Add Shell ...
addShellTitle=Add Shell Connection
savedConnections=Saved Connections
save=Save
clean=Clean
refresh=Refresh
moveTo=Move to ...
addDatabase=Database ...
browseInternalStorage=Browse internal storage
addTunnel=Tunnel ...
addScript=Script ...
addHost=Remote Host ...
addShell=Shell Environment ...
addCommand=Custom Command ...
addAutomatically=Search Automatically ...
addOther=Add Other ...
addStreamTitle=Add Stream Store
addConnection=Add Connection
skip=Skip
addConnections=New
selectType=Select Type
selectTypeDescription=Select connection type
selectDatabaseType=Database Type
selectDatabaseTypeDescription=Select Type of the Database
selectShellType=Shell Type
selectShellTypeDescription=Select the Type of the Shell Connection
selectStreamType=Stream Type
selectStreamTypeDescription=Select type of the stream
name=Name
storeIntroTitle=Connection Hub
storeIntroDescription=Here you can manage all your local and remote shell connections in one place. To start off, you can quickly detect available connections automatically and choose which ones to add.
detectConnections=Search for connections
configuration=Configuration
dragAndDropFilesHere=Or just drag and drop a file here
confirmDsCreationAbortTitle=Confirm abort
confirmDsCreationAbortHeader=Do you want to abort the data source creation?
confirmDsCreationAbortContent=Any data source creation progress will be lost.
confirmInvalidStoreTitle=Failed connection
confirmInvalidStoreHeader=Do you want to skip connection validation?
confirmInvalidStoreContent=You can add this connection even if it could not be validated and fix the connection problems later on.
charset=Charset
newLine=Newline
crlf=CRLF (Windows)