Small fixes

This commit is contained in:
crschnick 2024-06-23 21:57:27 +00:00
parent 382532efb3
commit 65fbe13113
19 changed files with 62 additions and 17 deletions

View file

@ -4,6 +4,7 @@ import com.sun.net.httpserver.HttpExchange;
import io.xpipe.app.beacon.AppBeaconServer; import io.xpipe.app.beacon.AppBeaconServer;
import io.xpipe.app.beacon.BlobManager; import io.xpipe.app.beacon.BlobManager;
import io.xpipe.app.util.FixedSizeInputStream; import io.xpipe.app.util.FixedSizeInputStream;
import io.xpipe.beacon.BeaconClientException;
import io.xpipe.beacon.api.FsReadExchange; import io.xpipe.beacon.api.FsReadExchange;
import io.xpipe.core.store.ConnectionFileSystem; import io.xpipe.core.store.ConnectionFileSystem;
import lombok.SneakyThrows; import lombok.SneakyThrows;
@ -20,6 +21,10 @@ public class FsReadExchangeImpl extends FsReadExchange {
var shell = AppBeaconServer.get().getCache().getShellSession(msg.getConnection()); var shell = AppBeaconServer.get().getCache().getShellSession(msg.getConnection());
var fs = new ConnectionFileSystem(shell.getControl()); var fs = new ConnectionFileSystem(shell.getControl());
if (!fs.fileExists(msg.getPath().toString())) {
throw new BeaconClientException("File does not exist");
}
var size = fs.getFileSize(msg.getPath().toString()); var size = fs.getFileSize(msg.getPath().toString());
if (size > 100_000_000) { if (size > 100_000_000) {
var file = BlobManager.get().newBlobFile(); var file = BlobManager.get().newBlobFile();

View file

@ -16,7 +16,7 @@ public class ShellStartExchangeImpl extends ShellStartExchange {
public Object handle(HttpExchange exchange, Request msg) { public Object handle(HttpExchange exchange, Request msg) {
var e = DataStorage.get() var e = DataStorage.get()
.getStoreEntryIfPresent(msg.getConnection()) .getStoreEntryIfPresent(msg.getConnection())
.orElseThrow(() -> new IllegalArgumentException("Unknown connection")); .orElseThrow(() -> new BeaconClientException("Unknown connection"));
if (!(e.getStore() instanceof ShellStore s)) { if (!(e.getStore() instanceof ShellStore s)) {
throw new BeaconClientException("Not a shell connection"); throw new BeaconClientException("Not a shell connection");
} }

View file

@ -30,6 +30,7 @@ import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane; import javafx.scene.layout.StackPane;
import atlantafx.base.theme.Styles; import atlantafx.base.theme.Styles;
import javafx.scene.shape.Rectangle;
import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.javafx.FontIcon;
public class BrowserNavBar extends Comp<BrowserNavBar.Structure> { public class BrowserNavBar extends Comp<BrowserNavBar.Structure> {
@ -127,10 +128,19 @@ public class BrowserNavBar extends Comp<BrowserNavBar.Structure> {
pathRegion.focusedProperty(), pathRegion.focusedProperty(),
model.getInOverview())); model.getInOverview()));
var stack = new StackPane(pathRegion, breadcrumbsRegion); var stack = new StackPane(pathRegion, breadcrumbsRegion);
pathRegion.prefHeightProperty().bind(stack.heightProperty());
// Prevent overflow
var clip = new Rectangle();
clip.widthProperty().bind(stack.widthProperty());
clip.heightProperty().bind(stack.heightProperty());
breadcrumbsRegion.setClip(clip);
stack.setAlignment(Pos.CENTER_LEFT); stack.setAlignment(Pos.CENTER_LEFT);
HBox.setHgrow(stack, Priority.ALWAYS); HBox.setHgrow(stack, Priority.ALWAYS);
var topBox = new HBox(homeButton, stack, historyButton); var topBox = new HBox(homeButton, stack, historyButton);
topBox.setFillHeight(true);
topBox.setAlignment(Pos.CENTER); topBox.setAlignment(Pos.CENTER);
homeButton.minWidthProperty().bind(pathRegion.heightProperty()); homeButton.minWidthProperty().bind(pathRegion.heightProperty());
homeButton.maxWidthProperty().bind(pathRegion.heightProperty().multiply(1.3)); homeButton.maxWidthProperty().bind(pathRegion.heightProperty().multiply(1.3));
@ -161,10 +171,6 @@ public class BrowserNavBar extends Comp<BrowserNavBar.Structure> {
} }
private ContextMenu createContextMenu() { private ContextMenu createContextMenu() {
if (model.getCurrentDirectory() == null) {
return null;
}
var cm = new ContextMenu(); var cm = new ContextMenu();
var f = model.getHistory().getForwardHistory(8).stream().toList(); var f = model.getHistory().getForwardHistory(8).stream().toList();

View file

@ -84,6 +84,7 @@ public class OpenFileSystemComp extends SimpleComp {
var filter = new BrowserFilterComp(model, model.getFilter()).createStructure(); var filter = new BrowserFilterComp(model, model.getFilter()).createStructure();
var topBar = new HBox(); var topBar = new HBox();
filter.textField().prefHeightProperty().bind(topBar.heightProperty());
topBar.setAlignment(Pos.CENTER); topBar.setAlignment(Pos.CENTER);
topBar.getStyleClass().add("top-bar"); topBar.getStyleClass().add("top-bar");
var navBar = new BrowserNavBar(model).createStructure(); var navBar = new BrowserNavBar(model).createStructure();

View file

@ -70,7 +70,8 @@ public class ScriptHelper {
content += nl + postInit.stream().flatMap(s -> s.lines()).collect(Collectors.joining(nl)) + nl; content += nl + postInit.stream().flatMap(s -> s.lines()).collect(Collectors.joining(nl)) + nl;
if (exit) { if (exit) {
content += nl + t.getPassthroughExitCommand(); // Assign exit code 0 to prevent terminals from doing their own pause error handling for failed commands
content += nl + t.getNormalExitCommand();
} }
return createExecScript(t, processControl, new FilePath(t.initFileName(processControl)), content); return createExecScript(t, processControl, new FilePath(t.initFileName(processControl)), content);

View file

@ -175,12 +175,6 @@
-fx-background-color: -color-neutral-muted; -fx-background-color: -color-neutral-muted;
} }
.browser .tab-content-area {
-fx-border-width: 0.1em 0 0 0;
-fx-border-color: -color-border-default;
-fx-padding: -0.05em 0 0 0;
}
.browser .singular { .browser .singular {
-fx-tab-max-height: 0; -fx-tab-max-height: 0;
} }
@ -193,12 +187,16 @@
-fx-min-height: 2.65em; -fx-min-height: 2.65em;
-fx-pref-height: 2.65em; -fx-pref-height: 2.65em;
-fx-max-height: 2.65em; -fx-max-height: 2.65em;
}
}
.browser .tab-header-area {
-fx-border-width: 0 0 0.05em 0;
-fx-border-color: -color-border-default;
}
.browser .left { .browser .left {
-fx-border-color: -color-border-default, -color-bg-inset; -fx-border-color: -color-border-default, -color-bg-inset;
-fx-border-width: 2.75em 0 0 0, 2.7em 0 0 0; -fx-border-width: 2.7em 0 0 0, 2.65em 0 0 0;
-fx-background-color: transparent; -fx-background-color: transparent;
} }
@ -215,14 +213,24 @@
} }
.browser .browser-content { .browser .browser-content {
-fx-padding: 10 0 0 0; -fx-padding: 6 0 0 0;
-fx-border-radius: 10 0 0 0; -fx-border-radius: 10 0 0 0;
-fx-background-radius: 10 0 0 0; -fx-background-radius: 10 0 0 0;
-fx-background-color: -color-bg-subtle; -fx-background-color: -color-bg-subtle, -color-bg-default;
-fx-background-insets: 0, 7 0 0 0;
-fx-border-width: 1 0 0 1; -fx-border-width: 1 0 0 1;
-fx-border-color: -color-border-default; -fx-border-color: -color-border-default;
} }
.root.cupertino .browser .browser-content {
-fx-background-color: -color-bg-default, -color-bg-default;
}
.root.nord .browser .browser-content {
-fx-border-radius: 0;
-fx-background-radius: 0;
}
.browser .table-view { .browser .table-view {
-fx-border-width: 0 0 0 0px; -fx-border-width: 0 0 0 0px;
-fx-border-color: -color-border-default; -fx-border-color: -color-border-default;
@ -231,7 +239,7 @@
.browser .split-pane-divider { .browser .split-pane-divider {
-fx-border-color: -color-border-default, -color-bg-inset; -fx-border-color: -color-border-default, -color-bg-inset;
-fx-padding: 0 3; -fx-padding: 0 3;
-fx-border-width: 2.75em 0 0 0, 2.7em 0 0 0; -fx-border-width: 2.7em 0 0 0, 2.65em 0 0 0;
-fx-opacity: 1.0; -fx-opacity: 1.0;
-fx-background-color: transparent; -fx-background-color: transparent;
} }

View file

@ -165,3 +165,5 @@ mappedService.displayName=Service
mappedService.displayDescription=Interagere med en tjeneste, der er eksponeret af en container mappedService.displayDescription=Interagere med en tjeneste, der er eksponeret af en container
customService.displayName=Service customService.displayName=Service
customService.displayDescription=Tilføj en brugerdefineret tjeneste til tunnel og åben customService.displayDescription=Tilføj en brugerdefineret tjeneste til tunnel og åben
fixedService.displayName=Service
fixedService.displayDescription=Brug en foruddefineret tjeneste

View file

@ -156,3 +156,5 @@ mappedService.displayName=Dienst
mappedService.displayDescription=Interaktion mit einem Dienst, der von einem Container angeboten wird mappedService.displayDescription=Interaktion mit einem Dienst, der von einem Container angeboten wird
customService.displayName=Dienst customService.displayName=Dienst
customService.displayDescription=Einen benutzerdefinierten Dienst zum Tunnel hinzufügen und öffnen customService.displayDescription=Einen benutzerdefinierten Dienst zum Tunnel hinzufügen und öffnen
fixedService.displayName=Dienst
fixedService.displayDescription=Einen vordefinierten Dienst verwenden

View file

@ -154,5 +154,7 @@ mappedService.displayName=Service
mappedService.displayDescription=Interact with a service exposed by a container mappedService.displayDescription=Interact with a service exposed by a container
customService.displayName=Service customService.displayName=Service
customService.displayDescription=Add a custom service to tunnel and open customService.displayDescription=Add a custom service to tunnel and open
fixedService.displayName=Service
fixedService.displayDescription=Use a predefined service

View file

@ -154,3 +154,5 @@ mappedService.displayName=Servicio
mappedService.displayDescription=Interactúa con un servicio expuesto por un contenedor mappedService.displayDescription=Interactúa con un servicio expuesto por un contenedor
customService.displayName=Servicio customService.displayName=Servicio
customService.displayDescription=Añade un servicio personalizado para tunelizar y abrir customService.displayDescription=Añade un servicio personalizado para tunelizar y abrir
fixedService.displayName=Servicio
fixedService.displayDescription=Utilizar un servicio predefinido

View file

@ -154,3 +154,5 @@ mappedService.displayName=Service
mappedService.displayDescription=Interagir avec un service exposé par un conteneur mappedService.displayDescription=Interagir avec un service exposé par un conteneur
customService.displayName=Service customService.displayName=Service
customService.displayDescription=Ajouter un service personnalisé au tunnel et à l'ouverture customService.displayDescription=Ajouter un service personnalisé au tunnel et à l'ouverture
fixedService.displayName=Service
fixedService.displayDescription=Utiliser un service prédéfini

View file

@ -154,3 +154,5 @@ mappedService.displayName=Servizio
mappedService.displayDescription=Interagire con un servizio esposto da un contenitore mappedService.displayDescription=Interagire con un servizio esposto da un contenitore
customService.displayName=Servizio customService.displayName=Servizio
customService.displayDescription=Aggiungi un servizio personalizzato per il tunnel e l'apertura customService.displayDescription=Aggiungi un servizio personalizzato per il tunnel e l'apertura
fixedService.displayName=Servizio
fixedService.displayDescription=Utilizzare un servizio predefinito

View file

@ -154,3 +154,5 @@ mappedService.displayName=サービス
mappedService.displayDescription=コンテナによって公開されたサービスとやりとりする mappedService.displayDescription=コンテナによって公開されたサービスとやりとりする
customService.displayName=サービス customService.displayName=サービス
customService.displayDescription=トンネルとオープンにカスタムサービスを追加する customService.displayDescription=トンネルとオープンにカスタムサービスを追加する
fixedService.displayName=サービス
fixedService.displayDescription=定義済みのサービスを使う

View file

@ -154,3 +154,5 @@ mappedService.displayName=Service
mappedService.displayDescription=Interactie met een service die wordt aangeboden door een container mappedService.displayDescription=Interactie met een service die wordt aangeboden door een container
customService.displayName=Service customService.displayName=Service
customService.displayDescription=Een aangepaste service toevoegen aan tunnel en openen customService.displayDescription=Een aangepaste service toevoegen aan tunnel en openen
fixedService.displayName=Service
fixedService.displayDescription=Een vooraf gedefinieerde service gebruiken

View file

@ -154,3 +154,5 @@ mappedService.displayName=Serviço
mappedService.displayDescription=Interage com um serviço exposto por um contentor mappedService.displayDescription=Interage com um serviço exposto por um contentor
customService.displayName=Serviço customService.displayName=Serviço
customService.displayDescription=Adiciona um serviço personalizado ao túnel e abre customService.displayDescription=Adiciona um serviço personalizado ao túnel e abre
fixedService.displayName=Serviço
fixedService.displayDescription=Utiliza um serviço predefinido

View file

@ -154,3 +154,5 @@ mappedService.displayName=Сервис
mappedService.displayDescription=Взаимодействие с сервисом, открываемым контейнером mappedService.displayDescription=Взаимодействие с сервисом, открываемым контейнером
customService.displayName=Сервис customService.displayName=Сервис
customService.displayDescription=Добавьте пользовательский сервис для туннелирования и открытия customService.displayDescription=Добавьте пользовательский сервис для туннелирования и открытия
fixedService.displayName=Сервис
fixedService.displayDescription=Использовать предопределенный сервис

View file

@ -154,3 +154,5 @@ mappedService.displayName=Hizmet
mappedService.displayDescription=Bir konteyner tarafından sunulan bir hizmetle etkileşim mappedService.displayDescription=Bir konteyner tarafından sunulan bir hizmetle etkileşim
customService.displayName=Hizmet customService.displayName=Hizmet
customService.displayDescription=Tünele özel bir hizmet ekleyin ve açın customService.displayDescription=Tünele özel bir hizmet ekleyin ve açın
fixedService.displayName=Hizmet
fixedService.displayDescription=Önceden tanımlanmış bir hizmet kullanın

View file

@ -154,3 +154,5 @@ mappedService.displayName=服务
mappedService.displayDescription=与容器暴露的服务交互 mappedService.displayDescription=与容器暴露的服务交互
customService.displayName=服务 customService.displayName=服务
customService.displayDescription=为隧道和开放添加自定义服务 customService.displayDescription=为隧道和开放添加自定义服务
fixedService.displayName=服务
fixedService.displayDescription=使用预定义服务