VNC improvements

This commit is contained in:
crschnick 2024-05-01 17:01:36 +00:00
parent 7176f4dd0a
commit c7f6bcf7d7
32 changed files with 154 additions and 35 deletions

View file

@ -65,8 +65,7 @@ public class StoreToggleComp extends SimpleComp {
return false;
}
return section.getWrapper().getValidity().getValue() == DataStoreEntry.Validity.COMPLETE
&& section.getShowDetails().get();
return section.getWrapper().getValidity().getValue() == DataStoreEntry.Validity.COMPLETE;
},
section.getWrapper().getValidity(),
section.getShowDetails(),

View file

@ -379,7 +379,7 @@ public abstract class StoreEntryComp extends SimpleComp {
if (AppPrefs.get().developerMode().getValue()) {
var browse = new MenuItem(AppI18n.get("browseInternalStorage"), new FontIcon("mdi2f-folder-open-outline"));
browse.setOnAction(
event -> DesktopHelper.browsePath(wrapper.getEntry().getDirectory()));
event -> DesktopHelper.browsePathLocal(wrapper.getEntry().getDirectory()));
contextMenu.getItems().add(browse);
}

View file

@ -68,6 +68,10 @@ public class StoreQuickAccessButtonComp extends Comp<CompStructure<Button>> {
m.getItems().setAll(items);
m.setOnAction(event -> {
if (event.getTarget() == m) {
if (m.getItems().isEmpty()) {
return;
}
action.accept(w);
contextMenu.hide();
event.consume();

View file

@ -27,7 +27,7 @@ public class SyncCategory extends AppPrefsCategory {
.addComp(prefs.getCustomComp("gitVaultIdentityStrategy"))
.nameAndDescription("openDataDir")
.addComp(new ButtonComp(AppI18n.observable("openDataDirButton"), () -> {
DesktopHelper.browsePath(DataStorage.get().getDataDir());
DesktopHelper.browsePathLocal(DataStorage.get().getDataDir());
})));
return builder.buildComp();
}

View file

@ -79,7 +79,7 @@ public class TroubleshootCategory extends AppPrefsCategory {
"openInstallationDirectoryDescription",
"mdomz-snippet_folder",
e -> {
DesktopHelper.browsePath(
DesktopHelper.browsePathLocal(
XPipeInstallation.getCurrentInstallationBasePath());
e.consume();
})

View file

@ -726,7 +726,7 @@ public abstract class DataStorage {
return children;
}
private List<DataStoreEntry> getHierarchy(DataStoreEntry entry) {
public List<DataStoreEntry> getStoreParentHierarchy(DataStoreEntry entry) {
var es = new ArrayList<DataStoreEntry>();
es.add(entry);
@ -743,7 +743,7 @@ public abstract class DataStorage {
}
public DataStoreId getId(DataStoreEntry entry) {
return DataStoreId.create(getHierarchy(entry).stream()
return DataStoreId.create(getStoreParentHierarchy(entry).stream()
.filter(e -> !(e.getStore() instanceof LocalStore))
.map(e -> e.getName().replaceAll(":", "_"))
.toArray(String[]::new));

View file

@ -2,6 +2,8 @@ package io.xpipe.app.util;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.core.process.OsType;
import io.xpipe.core.process.ShellControl;
import io.xpipe.core.store.FileKind;
import java.awt.*;
import java.nio.file.Files;
@ -26,7 +28,38 @@ public class DesktopHelper {
return Path.of(System.getProperty("user.home") + "/Desktop");
}
public static void browsePath(Path file) {
public static void browsePathRemote(ShellControl sc, String path, FileKind kind) throws Exception {
var d = sc.getShellDialect();
switch (sc.getOsType()) {
case OsType.Windows windows -> {
// Explorer does not support single quotes, so use normal quotes
if (kind == FileKind.DIRECTORY) {
sc.executeSimpleCommand("explorer " + d.quoteArgument(path));
} else {
sc.executeSimpleCommand("explorer /select," + d.quoteArgument(path));
}
}
case OsType.Linux linux -> {
var action = kind == FileKind.DIRECTORY ?
"org.freedesktop.FileManager1.ShowFolders" :
"org.freedesktop.FileManager1.ShowItems";
var dbus = String.format("""
dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 --type=method_call /org/freedesktop/FileManager1 %s array:string:"file://%s" string:""
""", action, path);
sc.executeSimpleCommand(dbus);
}
case OsType.MacOs macOs -> {
sc.executeSimpleCommand(
"open " + (kind == FileKind.DIRECTORY ? "" : "-R ") + d.fileArgument(path));
}
case OsType.Bsd bsd -> {
}
case OsType.Solaris solaris -> {
}
}
}
public static void browsePathLocal(Path file) {
if (!Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {
return;
}

View file

@ -4,12 +4,10 @@ import io.xpipe.app.browser.action.LeafAction;
import io.xpipe.app.browser.file.BrowserEntry;
import io.xpipe.app.browser.fs.OpenFileSystemModel;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.util.DesktopHelper;
import io.xpipe.app.util.LocalShell;
import io.xpipe.core.process.OsType;
import io.xpipe.core.process.ShellControl;
import io.xpipe.core.process.ShellDialect;
import io.xpipe.core.store.FileKind;
import javafx.beans.value.ObservableValue;
import java.util.List;
@ -19,34 +17,11 @@ public class BrowseInNativeManagerAction implements LeafAction {
@Override
public void execute(OpenFileSystemModel model, List<BrowserEntry> entries) throws Exception {
ShellControl sc = model.getFileSystem().getShell().orElseThrow();
ShellDialect d = sc.getShellDialect();
for (BrowserEntry entry : entries) {
var e = entry.getRawFileEntry().getPath();
var localFile = sc.getLocalSystemAccess().translateToLocalSystemPath(e);
try (var local = LocalShell.getShell().start()) {
switch (OsType.getLocal()) {
case OsType.Windows windows -> {
// Explorer does not support single quotes, so use normal quotes
if (entry.getRawFileEntry().getKind() == FileKind.DIRECTORY) {
local.executeSimpleCommand("explorer " + d.quoteArgument(localFile));
} else {
local.executeSimpleCommand("explorer /select," + d.quoteArgument(localFile));
}
}
case OsType.Linux linux -> {
var action = entry.getRawFileEntry().getKind() == FileKind.DIRECTORY ?
"org.freedesktop.FileManager1.ShowFolders" :
"org.freedesktop.FileManager1.ShowItems";
var dbus = String.format("""
dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 --type=method_call /org/freedesktop/FileManager1 %s array:string:"file://%s" string:""
""", action, localFile);
local.executeSimpleCommand(dbus);
}
case OsType.MacOs macOs -> {
local.executeSimpleCommand(
"open " + (entry.getRawFileEntry().getKind() == FileKind.DIRECTORY ? "" : "-R ") + d.fileArgument(localFile));
}
}
DesktopHelper.browsePathRemote(local,localFile, entry.getRawFileEntry().getKind());
}
}
}

View file

@ -323,3 +323,7 @@ wslX11SetupHeader=XPipe kan bruge din lokale WSL-distribution til at fungere som
wslX11SetupContent=Dette vil installere de grundlæggende X11-pakker på WSL-distributionen og kan tage et stykke tid. Du kan også ændre, hvilken distribution der bruges, i indstillingsmenuen.
command=Kommando
commandGroup=Kommandogruppe
vncSystem=VNC-målsystem
vncSystemDescription=Det faktiske system, der skal interageres med. Dette er normalt det samme som tunnelværten
vncHost=Fjerntliggende tunnelvært
vncHostDescription=Det system, som VNC-serveren kører på

View file

@ -313,3 +313,7 @@ wslX11SetupHeader=XPipe kann deine lokale WSL-Distribution nutzen, um als X11-An
wslX11SetupContent=Dies installiert die grundlegenden X11-Pakete auf der WSL-Distribution und kann eine Weile dauern. Du kannst auch im Einstellungsmenü ändern, welche Distribution verwendet wird.
command=Befehl
commandGroup=Befehlsgruppe
vncSystem=VNC-Zielsystem
vncSystemDescription=Das eigentliche System, mit dem interagiert werden soll. Dies ist normalerweise dasselbe wie der Tunnel-Host
vncHost=Entfernter Tunnel-Host
vncHostDescription=Das System, auf dem der VNC-Server läuft

View file

@ -311,3 +311,7 @@ wslX11SetupHeader=XPipe can use your local WSL distribution to act as an X11 dis
wslX11SetupContent=This will install the basic X11 packages on the WSL distribution and may take a while. You can also change which distribution is used in the settings menu.
command=Command
commandGroup=Command group
vncSystem=VNC target system
vncSystemDescription=The actual system to interact with. This is usually the same as the tunnel host
vncHost=Remote tunnel host
vncHostDescription=The system on which the VNC server is running on

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipe puede utilizar tu distribución local WSL para actuar co
wslX11SetupContent=Esto instalará los paquetes X11 básicos en la distribución WSL y puede tardar un rato. También puedes cambiar qué distribución se utiliza en el menú de configuración.
command=Comando
commandGroup=Grupo de comandos
vncSystem=Sistema de destino VNC
vncSystemDescription=El sistema real con el que interactuar. Suele ser el mismo que el host del túnel
vncHost=Host de túnel remoto
vncHostDescription=El sistema en el que se ejecuta el servidor VNC

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipe peut utiliser ta distribution WSL locale pour agir en ta
wslX11SetupContent=Cela installera les paquets X11 de base sur la distribution WSL et peut prendre un certain temps. Tu peux aussi changer la distribution utilisée dans le menu des paramètres.
command=Commande
commandGroup=Groupe de commande
vncSystem=Système cible VNC
vncSystemDescription=Le système réel avec lequel interagir. Il s'agit généralement du même que l'hôte du tunnel
vncHost=Hôte du tunnel à distance
vncHostDescription=Le système sur lequel le serveur VNC fonctionne

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipe può utilizzare la tua distribuzione WSL locale per agir
wslX11SetupContent=Questa operazione installerà i pacchetti X11 di base sulla distribuzione WSL e potrebbe richiedere un po' di tempo. Puoi anche cambiare la distribuzione utilizzata nel menu delle impostazioni.
command=Comando
commandGroup=Gruppo di comando
vncSystem=Sistema di destinazione VNC
vncSystemDescription=Il sistema effettivo con cui interagire. Di solito coincide con l'host del tunnel
vncHost=Tunnel host remoto
vncHostDescription=Il sistema su cui viene eseguito il server VNC

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipeは、ローカルのWSLディストリビューション
wslX11SetupContent=WSLディストリビューションに基本的なX11パッケージがインストールされるので、時間がかかるかもしれない。どのディストリビューションを使用するかは、設定メニューで変更することもできる。
command=コマンド
commandGroup=コマンドグループ
vncSystem=VNCターゲットシステム
vncSystemDescription=実際にやりとりするシステム。これは通常トンネルホストと同じである。
vncHost=リモートトンネルホスト
vncHostDescription=VNCサーバーが動作しているシステム

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipe kan je lokale WSL distributie gebruiken om als X11 weerg
wslX11SetupContent=Dit installeert de basis X11 pakketten op de WSL distributie en kan even duren. Je kunt ook in het instellingenmenu wijzigen welke distributie wordt gebruikt.
command=Opdracht
commandGroup=Opdrachtgroep
vncSystem=VNC doelsysteem
vncSystemDescription=Het eigenlijke systeem om mee te communiceren. Dit is meestal hetzelfde als de tunnelhost
vncHost=Remote tunnel host
vncHostDescription=Het systeem waarop de VNC-server draait

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=O XPipe pode utilizar a tua distribuição WSL local para atua
wslX11SetupContent=Isto irá instalar os pacotes básicos do X11 na distribuição WSL e pode demorar um pouco. Podes também alterar a distribuição que é usada no menu de definições.
command=Comanda
commandGroup=Grupo de comandos
vncSystem=Sistema de destino VNC
vncSystemDescription=O sistema real com o qual interage. Geralmente é o mesmo que o host do túnel
vncHost=Anfitrião de túnel remoto
vncHostDescription=O sistema no qual o servidor VNC está sendo executado

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipe может использовать твой локал
wslX11SetupContent=Это приведет к установке основных пакетов X11 на дистрибутив WSL и может занять некоторое время. Ты также можешь изменить, какой дистрибутив используется, в меню настроек.
command=Команда
commandGroup=Группа команд
vncSystem=Целевая система VNC
vncSystemDescription=Фактическая система, с которой нужно взаимодействовать. Обычно это то же самое, что и туннельный хост
vncHost=Удаленный туннельный хост
vncHostDescription=Система, на которой работает VNC-сервер

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipe, yerel WSL dağıtımınızı bir X11 görüntü sunucus
wslX11SetupContent=Bu işlem WSL dağıtımına temel X11 paketlerini yükleyecektir ve biraz zaman alabilir. Hangi dağıtımın kullanılacağını ayarlar menüsünden de değiştirebilirsiniz.
command=Komuta
commandGroup=Komuta grubu
vncSystem=VNC hedef sistemi
vncSystemDescription=Etkileşim kurulacak asıl sistem. Bu genellikle tünel ana bilgisayarıyla aynıdır
vncHost=Uzak tünel ana bilgisayarı
vncHostDescription=VNC sunucusunun üzerinde çalıştığı sistem

View file

@ -309,3 +309,7 @@ wslX11SetupHeader=XPipe 可以使用本地 WSL 发布作为 X11 显示服务器
wslX11SetupContent=这将在 WSL 发行版上安装基本的 X11 软件包,可能需要一些时间。你也可以在设置菜单中更改使用哪个发行版。
command=指令
commandGroup=命令组
vncSystem=VNC 目标系统
vncSystemDescription=实际交互系统。通常与隧道主机相同
vncHost=远程隧道主机
vncHostDescription=运行 VNC 服务器的系统

View file

@ -0,0 +1,5 @@
## VNC-målsystem
Ud over de normale VNC-funktioner tilføjer XPipe også yderligere funktioner gennem interaktion med målsystemets systemskal.
I nogle få tilfælde kan VNC-serverens vært, dvs. det fjernsystem, som VNC-serveren kører på, være forskellig fra det system, du faktisk styrer med VNC. Hvis en VNC-server f.eks. håndteres af en VM-hypervisor som Proxmox, kører serveren på hypervisor-værten, mens det egentlige målsystem, du styrer, f.eks. en VM, er VM-gæsten. For at sikre, at f.eks. filsystemoperationer udføres på det korrekte system, kan du manuelt ændre målsystemet, hvis det er forskelligt fra VNC-serverens vært.

View file

@ -0,0 +1,5 @@
## VNC-Zielsystem
Zusätzlich zu den normalen VNC-Funktionen fügt XPipe durch die Interaktion mit der System-Shell des Zielsystems weitere Funktionen hinzu.
In einigen Fällen kann sich der VNC-Server-Host, d.h. das entfernte System, auf dem der VNC-Server läuft, von dem eigentlichen System unterscheiden, das du mit VNC steuerst. Wenn ein VNC-Server zum Beispiel von einem VM-Hypervisor wie Proxmox verwaltet wird, läuft der Server auf dem Hypervisor-Host, während das eigentliche Zielsystem, das du steuerst, zum Beispiel eine VM, der VM-Gast ist. Um sicherzustellen, dass zum Beispiel Dateisystemoperationen auf dem richtigen System ausgeführt werden, kannst du das Zielsystem manuell ändern, wenn es sich vom VNC-Server-Host unterscheidet.

View file

@ -0,0 +1,5 @@
## VNC target system
In addition to normal VNC features, XPipe also adds additional features through interaction with the system shell of the target system.
In a few cases the VNC server host, i.e. the remote system where the VNC server runs on, might be different from the actual system you are controlling with VNC. For example, if a VNC server is handled by a VM hypervisor like Proxmox, the server runs on the hypervisor host while the actual target system you are controlling, for example a VM, is the VM guest. In order to make sure that for example file system operations are applied on the correct system, you can manually change the target system if it differs from the VNC server host.

View file

@ -0,0 +1,5 @@
## Sistema de destino VNC
Además de las funciones normales de VNC, XPipe también añade funciones adicionales mediante la interacción con el shell del sistema de destino.
En algunos casos, el host del servidor VNC, es decir, el sistema remoto en el que se ejecuta el servidor VNC, puede ser distinto del sistema real que estás controlando con VNC. Por ejemplo, si un servidor VNC está gestionado por un hipervisor VM como Proxmox, el servidor se ejecuta en el host del hipervisor, mientras que el sistema de destino real que estás controlando, por ejemplo una VM, es el invitado de la VM. Para asegurarte de que, por ejemplo, las operaciones del sistema de archivos se aplican en el sistema correcto, puedes cambiar manualmente el sistema de destino si difiere del anfitrión del servidor VNC.

View file

@ -0,0 +1,5 @@
## Système cible VNC
En plus des fonctions VNC normales, XPipe ajoute également des fonctions supplémentaires en interagissant avec le shell du système cible.
Dans certains cas, l'hôte du serveur VNC, c'est-à-dire le système distant sur lequel tourne le serveur VNC, peut être différent du système réel que tu contrôles avec VNC. Par exemple, si un serveur VNC est géré par un hyperviseur VM comme Proxmox, le serveur s'exécute sur l'hôte de l'hyperviseur alors que le système cible réel que tu contrôles, par exemple une VM, est l'invité de la VM. Pour t'assurer que les opérations sur le système de fichiers, par exemple, sont appliquées sur le bon système, tu peux modifier manuellement le système cible s'il diffère de l'hôte du serveur VNC.

View file

@ -0,0 +1,5 @@
## Sistema di destinazione VNC
Oltre alle normali funzioni di VNC, XPipe aggiunge ulteriori funzioni attraverso l'interazione con la shell del sistema di destinazione.
In alcuni casi l'host del server VNC, cioè il sistema remoto su cui viene eseguito il server VNC, potrebbe essere diverso dal sistema effettivo che stai controllando con VNC. Ad esempio, se un server VNC è gestito da un hypervisor VM come Proxmox, il server viene eseguito sull'host dell'hypervisor mentre il sistema di destinazione effettivo che stai controllando, ad esempio una VM, è il guest VM. Per assicurarti che, ad esempio, le operazioni sul file system vengano eseguite sul sistema corretto, puoi cambiare manualmente il sistema di destinazione se è diverso dall'host del server VNC.

View file

@ -0,0 +1,5 @@
## VNCターゲットシステム
通常のVNC機能に加えて、XPipeはターゲットシステムのシステムシェルとのインタラクションによって、さらに機能を追加する。
いくつかのケースでは、VNCサーバーホスト、つまりVNCサーバーが動作するリモートシステムは、VNCでコントロールする実際のシステムとは異なるかもしれない。例えば、VNCサーバーがProxmoxのようなVMハイパーバイザーによって処理される場合、サーバーはハイパーバイザーホスト上で実行され、実際にコントロールするターゲットシステム、例えばVMはVMゲストである。例えばファイルシステム操作が正しいシステム上で適用されることを確認するために、ターゲットシステムがVNCサーバーホストと異なる場合は、手動で変更することができる。

View file

@ -0,0 +1,5 @@
## VNC doelsysteem
Naast de normale VNC functies voegt XPipe ook extra functies toe door interactie met de systeemshell van het doelsysteem.
In een paar gevallen kan de VNC server host, d.w.z. het externe systeem waar de VNC server op draait, anders zijn dan het systeem dat je bestuurt met VNC. Als een VNC-server bijvoorbeeld wordt beheerd door een VM-hypervisor zoals Proxmox, dan draait de server op de hypervisor-host, terwijl het eigenlijke doelsysteem dat je bestuurt, bijvoorbeeld een VM, de VM-gast is. Om er zeker van te zijn dat bijvoorbeeld bestandssysteembewerkingen op het juiste systeem worden toegepast, kun je het doelsysteem handmatig wijzigen als het verschilt van de VNC server host.

View file

@ -0,0 +1,5 @@
## Sistema de destino VNC
Além dos recursos normais do VNC, o XPipe também adiciona recursos adicionais por meio da interação com o shell do sistema de destino.
Em alguns casos, o host do servidor VNC, ou seja, o sistema remoto onde o servidor VNC é executado, pode ser diferente do sistema real que estás a controlar com o VNC. Por exemplo, se um servidor VNC for gerido por um hipervisor de VM como o Proxmox, o servidor é executado no anfitrião do hipervisor, enquanto o sistema de destino real que estás a controlar, por exemplo uma VM, é o convidado da VM. Para garantir que, por exemplo, as operações do sistema de arquivos sejam aplicadas no sistema correto, é possível alterar manualmente o sistema de destino se ele for diferente do host do servidor VNC.

View file

@ -0,0 +1,5 @@
## Целевая система VNC
Помимо обычных функций VNC, XPipe добавляет дополнительные возможности за счет взаимодействия с системной оболочкой целевой системы.
В некоторых случаях хост VNC-сервера, то есть удаленная система, на которой работает VNC-сервер, может отличаться от реальной системы, которой ты управляешь с помощью VNC. Например, если VNC-сервер управляется гипервизором ВМ, таким как Proxmox, то сервер работает на хосте гипервизора, а реальная целевая система, которой ты управляешь, например ВМ, является гостевой ВМ. Чтобы убедиться, что, например, операции с файловой системой применяются на правильной системе, ты можешь вручную изменить целевую систему, если она отличается от хоста VNC-сервера.

View file

@ -0,0 +1,5 @@
## VNC hedef sistemi
Normal VNC özelliklerine ek olarak XPipe, hedef sistemin sistem kabuğu ile etkileşim yoluyla ek özellikler de ekler.
Bazı durumlarda VNC sunucu ana bilgisayarı, yani VNC sunucusunun üzerinde çalıştığı uzak sistem, VNC ile kontrol ettiğiniz gerçek sistemden farklı olabilir. Örneğin, bir VNC sunucusu Proxmox gibi bir VM hipervizörü tarafından yönetiliyorsa, sunucu hipervizör ana bilgisayarında çalışırken, kontrol ettiğiniz asıl hedef sistem, örneğin bir VM, VM misafiridir. Örneğin dosya sistemi işlemlerinin doğru sisteme uygulandığından emin olmak için, VNC sunucu ana bilgisayarından farklıysa hedef sistemi manuel olarak değiştirebilirsiniz.

View file

@ -0,0 +1,5 @@
## VNC 目标系统
除了正常的 VNC 功能外XPipe 还通过与目标系统的系统外壳交互来增加其他功能。
在某些情况下VNC 服务器主机(即 VNC 服务器运行所在的远程系统)可能与您使用 VNC 控制的实际系统不同。例如,如果 VNC 服务器由 Proxmox 等虚拟机管理程序处理,则服务器在管理程序主机上运行,而实际控制的目标系统(如虚拟机)是虚拟机客户机。为了确保文件系统操作等应用于正确的系统,如果目标系统与 VNC 服务器主机不同,可以手动更改目标系统。