Refine Kubernetes support

This commit is contained in:
crschnick 2023-05-07 22:47:56 +00:00
parent 09f7ebbf45
commit 0845c7e27d
7 changed files with 30 additions and 22 deletions

View file

@ -33,10 +33,15 @@ final class BookmarkList extends SimpleComp {
@Override
protected Region createSimple() {
var observableList = BindingsHelper.filteredContentBinding(StoreEntryFlatMiniSectionComp.ALL, e -> e.getEntry().getStore() instanceof ShellStore);
var observableList = BindingsHelper.filteredContentBinding(StoreEntryFlatMiniSectionComp.ALL, e -> e.getEntry().getState().isUsable());
var list = new ListBoxViewComp<>(observableList, observableList, e -> {
return Comp.of(() -> {
var button = new Button(null, e.createRegion());
if (!(e.getEntry().getStore() instanceof ShellStore)) {
button.setDisable(true);
}
button.setOnAction(event -> {
var fileSystem = ((ShellStore) e.getEntry().getStore());
model.openFileSystem(fileSystem);

View file

@ -1,7 +1,6 @@
package io.xpipe.app.comp.storage.store;
import com.jfoenix.controls.JFXButton;
import io.xpipe.app.comp.base.LazyTextFieldComp;
import io.xpipe.app.comp.base.LoadingOverlayComp;
import io.xpipe.app.core.AppFont;
import io.xpipe.app.core.AppI18n;
@ -11,10 +10,7 @@ import io.xpipe.app.fxcomps.SimpleComp;
import io.xpipe.app.fxcomps.SimpleCompStructure;
import io.xpipe.app.fxcomps.augment.GrowAugment;
import io.xpipe.app.fxcomps.augment.PopupMenuAugment;
import io.xpipe.app.fxcomps.impl.FancyTooltipAugment;
import io.xpipe.app.fxcomps.impl.HorizontalComp;
import io.xpipe.app.fxcomps.impl.IconButtonComp;
import io.xpipe.app.fxcomps.impl.PrettyImageComp;
import io.xpipe.app.fxcomps.impl.*;
import io.xpipe.app.fxcomps.util.PlatformThread;
import io.xpipe.app.fxcomps.util.SimpleChangeListener;
import io.xpipe.app.prefs.AppPrefs;
@ -26,12 +22,10 @@ import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleStringProperty;
import javafx.css.PseudoClass;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.SeparatorMenuItem;
import javafx.scene.control.*;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Region;
@ -89,9 +83,10 @@ public class StoreEntryComp extends SimpleComp {
});
}
private LazyTextFieldComp createName() {
var name = new LazyTextFieldComp(entry.nameProperty());
name.apply(struc -> struc.getTextField().editableProperty().bind(entry.getRenamable()));
private Comp<?> createName() {
var name = new LabelComp(entry.nameProperty())
.apply(struc -> struc.get().setTextOverrun(OverrunStyle.CENTER_ELLIPSIS))
.apply(struc -> struc.get().setPadding(new Insets(5, 5, 5, 0)));
name.apply(s -> AppFont.header(s.get()));
return name;
}

View file

@ -99,15 +99,14 @@ public class DataStoreChoiceComp<T extends DataStore> extends SimpleComp {
}
var s = e.getEntry().getStore();
if (!storeClass.isAssignableFrom(s.getClass()) || !applicableCheck.test((T) s)) {
continue;
}
if (!(mode == Mode.ENVIRONMENT) && s instanceof LeafShellStore) {
continue;
}
comboBox.add((T) e.getEntry().getStore());
var node = comboBox.add((T) e.getEntry().getStore());
if (!storeClass.isAssignableFrom(s.getClass()) || !applicableCheck.test((T) s)) {
comboBox.disable(node);
}
}
ComboBox<Node> cb = comboBox.build();

View file

@ -56,6 +56,10 @@ public class CustomComboBoxBuilder<T> {
actionsMap.put(node, run);
}
public void disable(Node node) {
disabledNodes.add(node);
}
public void setUnknownNode(Function<T, Node> node) {
unknownNode = node;
}

View file

@ -40,6 +40,14 @@
-fx-background-color: -color-success-muted;
}
.bookmark-list .button:disabled {
-fx-opacity: 1.0;
}
.bookmark-list .button:disabled * {
-fx-opacity: 0.9;
}
.browser .bookmark-list {
-fx-border-width: 0 0 1 1;
}

View file

@ -1,4 +1,5 @@
## Changes in 0.5.40
- Add status bar to file browser that shows selected entries and clipboard
- Add copy and paste context menu entries to file browser
- Add native ARM builds for macOS
- Improve Kubernetes support and configuration options

View file

@ -19,10 +19,6 @@ commandLineWrite=Write
wslHost=WSL Host
timeout=Timeout
additionalOptions=Additional Options
wsl.displayName=Windows Subsystem for Linux
wsl.displayDescription=Connect to a WSL machine running on Windows
docker.displayName=Docker Container
docker.displayDescription=Connect to a docker container
rawFileOutput=Raw File Output
dataSourceOutput=Data Source Output
type=Type