Various fixes

This commit is contained in:
crschnick 2024-08-25 23:27:00 +00:00
parent 6c21529789
commit 030faaa601
21 changed files with 33 additions and 32 deletions

View file

@ -194,11 +194,9 @@ public final class BrowserFileListComp extends SimpleComp {
? unix.getGroup() ? unix.getGroup()
: m.getCache().getGroups().get(unix.getGid()); : m.getCache().getGroups().get(unix.getGid());
var uid = String.valueOf( var uid = String.valueOf(
unix.getUid() != null ? unix.getUid() : m.getCache().getUidForUser(user)) unix.getUid() != null ? unix.getUid() : m.getCache().getUidForUser(user));
.replaceAll("000$", "k");
var gid = String.valueOf( var gid = String.valueOf(
unix.getGid() != null ? unix.getGid() : m.getCache().getGidForGroup(group)) unix.getGid() != null ? unix.getGid() : m.getCache().getGidForGroup(group));
.replaceAll("000$", "k");
if (uid.equals(gid)) { if (uid.equals(gid)) {
return user + " [" + uid + "]"; return user + " [" + uid + "]";
} }

View file

@ -37,7 +37,7 @@ public class BrowserAbstractSessionModel<T extends BrowserSessionTab<?>> {
} }
} }
void closeSync(BrowserSessionTab<?> e) { public void closeSync(BrowserSessionTab<?> e) {
e.close(); e.close();
synchronized (BrowserAbstractSessionModel.this) { synchronized (BrowserAbstractSessionModel.this) {
this.sessionEntries.remove(e); this.sessionEntries.remove(e);

View file

@ -35,10 +35,8 @@ public class StoreCreationMenu {
menu.getItems() menu.getItems()
.add(category("addScript", "mdi2s-script-text-outline", DataStoreCreationCategory.SCRIPT, "script")); .add(category("addScript", "mdi2s-script-text-outline", DataStoreCreationCategory.SCRIPT, "script"));
menu.getItems().add(category("addService", "mdi2c-cloud-braces", DataStoreCreationCategory.SERVICE, null));
menu.getItems() menu.getItems()
.add(category("addTunnel", "mdi2v-vector-polyline-plus", DataStoreCreationCategory.TUNNEL, null)); .add(category("addTunnel", "mdi2v-vector-polyline-plus", DataStoreCreationCategory.TUNNEL, "customService"));
menu.getItems().add(category("addCommand", "mdi2c-code-greater-than", DataStoreCreationCategory.COMMAND, null)); menu.getItems().add(category("addCommand", "mdi2c-code-greater-than", DataStoreCreationCategory.COMMAND, null));
@ -82,8 +80,10 @@ public class StoreCreationMenu {
category); category);
event.consume(); event.consume();
}); });
// Ugly sorting
var providers = sub.stream() var providers = sub.stream()
.sorted((o1, o2) -> -o1.getModuleName().compareTo(o2.getModuleName())) .sorted((o1, o2) -> category == DataStoreCreationCategory.DESKTOP ?
-o1.getModuleName().compareTo(o2.getModuleName()) : o1.getModuleName().compareTo(o2.getModuleName()))
.toList(); .toList();
for (int i = 0; i < providers.size(); i++) { for (int i = 0; i < providers.size(); i++) {
var dataStoreProvider = providers.get(i); var dataStoreProvider = providers.get(i);

View file

@ -4,7 +4,6 @@ public enum DataStoreCreationCategory {
HOST, HOST,
DATABASE, DATABASE,
SHELL, SHELL,
SERVICE,
COMMAND, COMMAND,
TUNNEL, TUNNEL,
SCRIPT, SCRIPT,

View file

@ -520,7 +520,7 @@ public class DataStoreEntry extends StorageElement {
try { try {
incrementBusyCounter(); incrementBusyCounter();
notifyUpdate(false, false); notifyUpdate(false, false);
lifecycleStore.initializeValidate(); lifecycleStore.initializeStore();
} catch (Exception e) { } catch (Exception e) {
ErrorEvent.fromThrowable(e).handle(); ErrorEvent.fromThrowable(e).handle();
} finally { } finally {
@ -536,7 +536,7 @@ public class DataStoreEntry extends StorageElement {
try { try {
incrementBusyCounter(); incrementBusyCounter();
notifyUpdate(false, false); notifyUpdate(false, false);
lifecycleStore.finalizeValidate(); lifecycleStore.finalizeStore();
} catch (Exception e) { } catch (Exception e) {
ErrorEvent.fromThrowable(e).handle(); ErrorEvent.fromThrowable(e).handle();
} finally { } finally {

View file

@ -2,6 +2,7 @@ package io.xpipe.core.process;
import io.xpipe.core.store.FileNames; import io.xpipe.core.store.FileNames;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -96,14 +97,18 @@ public interface OsType {
@Override @Override
public List<String> determineInterestingPaths(ShellControl pc) throws Exception { public List<String> determineInterestingPaths(ShellControl pc) throws Exception {
var home = getUserHomeDirectory(pc); var home = getUserHomeDirectory(pc);
return List.of( var list = new ArrayList<>(List.of(
home, home,
FileNames.getParent(home),
FileNames.join(home, "Downloads"), FileNames.join(home, "Downloads"),
FileNames.join(home, "Documents"), FileNames.join(home, "Documents"),
"/etc", "/etc",
"/tmp", "/tmp",
"/var"); "/var"));
var parentHome = FileNames.getParent(home);
if (parentHome != null && !parentHome.equals("/")) {
list.add(3, parentHome);
}
return list;
} }
@Override @Override

View file

@ -2,7 +2,7 @@ package io.xpipe.core.store;
public interface ExpandedLifecycleStore extends DataStore { public interface ExpandedLifecycleStore extends DataStore {
default void initializeValidate() {} default void initializeStore() {}
default void finalizeValidate() throws Exception {} default void finalizeStore() throws Exception {}
} }

View file

@ -4,7 +4,7 @@ public interface SingletonSessionStore<T extends Session>
extends ExpandedLifecycleStore, InternalCacheDataStore, SessionListener { extends ExpandedLifecycleStore, InternalCacheDataStore, SessionListener {
@Override @Override
default void finalizeValidate() throws Exception { default void finalizeStore() throws Exception {
stopSessionIfNeeded(); stopSessionIfNeeded();
} }

View file

@ -8,7 +8,6 @@ import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.app.util.OptionsBuilder; import io.xpipe.app.util.OptionsBuilder;
import io.xpipe.core.store.DataStore; import io.xpipe.core.store.DataStore;
import io.xpipe.core.store.NetworkTunnelStore; import io.xpipe.core.store.NetworkTunnelStore;
import javafx.beans.property.Property; import javafx.beans.property.Property;
import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleObjectProperty;
@ -18,7 +17,7 @@ public class CustomServiceStoreProvider extends AbstractServiceStoreProvider {
@Override @Override
public DataStoreCreationCategory getCreationCategory() { public DataStoreCreationCategory getCreationCategory() {
return DataStoreCreationCategory.SERVICE; return DataStoreCreationCategory.TUNNEL;
} }
@Override @Override

View file

@ -164,7 +164,7 @@ fixedServiceGroup.displayDescription=Liste over tilgængelige tjenester på et s
mappedService.displayName=Service 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 ekstern serviceport til tunnel til din lokale maskine customService.displayDescription=Tunneler automatisk en ekstern serviceport til din lokale maskine
fixedService.displayName=Service fixedService.displayName=Service
fixedService.displayDescription=Brug en foruddefineret tjeneste fixedService.displayDescription=Brug en foruddefineret tjeneste
noServices=Ingen tilgængelige tjenester noServices=Ingen tilgængelige tjenester

View file

@ -155,7 +155,7 @@ fixedServiceGroup.displayDescription=Liste der verfügbaren Dienste auf einem Sy
mappedService.displayName=Dienst 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=Füge einen Remote Service Port hinzu, um einen Tunnel zu deinem lokalen Rechner zu erstellen customService.displayDescription=Automatisches Tunneln eines entfernten Service-Ports zu deinem lokalen Rechner
fixedService.displayName=Dienst fixedService.displayName=Dienst
fixedService.displayDescription=Einen vordefinierten Dienst verwenden fixedService.displayDescription=Einen vordefinierten Dienst verwenden
noServices=Keine verfügbaren Dienste noServices=Keine verfügbaren Dienste

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=List the available services on a system
mappedService.displayName=Service 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 remote service port to tunnel to your local machine customService.displayDescription=Automatically tunnel a remote service port to your local machine
fixedService.displayName=Service fixedService.displayName=Service
fixedService.displayDescription=Use a predefined service fixedService.displayDescription=Use a predefined service
noServices=No available services noServices=No available services

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Enumerar los servicios disponibles en un si
mappedService.displayName=Servicio 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 puerto de servicio remoto para hacer un túnel a tu máquina local customService.displayDescription=Tuneliza automáticamente un puerto de servicio remoto a tu máquina local
fixedService.displayName=Servicio fixedService.displayName=Servicio
fixedService.displayDescription=Utilizar un servicio predefinido fixedService.displayDescription=Utilizar un servicio predefinido
noServices=No hay servicios disponibles noServices=No hay servicios disponibles

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Liste les services disponibles sur un syst
mappedService.displayName=Service 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=Ajoute un port de service à distance pour établir un tunnel vers ta machine locale customService.displayDescription=Tunnelise automatiquement un port de service distant vers ta machine locale
fixedService.displayName=Service fixedService.displayName=Service
fixedService.displayDescription=Utiliser un service prédéfini fixedService.displayDescription=Utiliser un service prédéfini
noServices=Aucun service disponible noServices=Aucun service disponible

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Elenco dei servizi disponibili su un sistem
mappedService.displayName=Servizio 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 una porta di servizio remoto per creare un tunnel verso la tua macchina locale customService.displayDescription=Esegui automaticamente il tunnel di una porta di servizio remota verso la tua macchina locale
fixedService.displayName=Servizio fixedService.displayName=Servizio
fixedService.displayDescription=Utilizzare un servizio predefinito fixedService.displayDescription=Utilizzare un servizio predefinito
noServices=Nessun servizio disponibile noServices=Nessun servizio disponibile

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=システムで利用可能なサービス
mappedService.displayName=サービス mappedService.displayName=サービス
mappedService.displayDescription=コンテナによって公開されたサービスとやりとりする mappedService.displayDescription=コンテナによって公開されたサービスとやりとりする
customService.displayName=サービス customService.displayName=サービス
customService.displayDescription=リモートサービスのポートを追加してローカルマシンにトンネリングする customService.displayDescription=リモートサービスのポートをローカルマシンに自動的にトンネリングする
fixedService.displayName=サービス fixedService.displayName=サービス
fixedService.displayDescription=定義済みのサービスを使う fixedService.displayDescription=定義済みのサービスを使う
noServices=利用可能なサービスはない noServices=利用可能なサービスはない

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Een lijst van beschikbare services op een s
mappedService.displayName=Service 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 servicepoort op afstand toevoegen om te tunnelen naar je lokale machine customService.displayDescription=Automatisch een servicepoort op afstand tunnelen naar je lokale machine
fixedService.displayName=Service fixedService.displayName=Service
fixedService.displayDescription=Een vooraf gedefinieerde service gebruiken fixedService.displayDescription=Een vooraf gedefinieerde service gebruiken
noServices=Geen beschikbare diensten noServices=Geen beschikbare diensten

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Lista os serviços disponíveis num sistema
mappedService.displayName=Serviço 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 uma porta de serviço remoto para criar um túnel para a tua máquina local customService.displayDescription=Faz o tunelamento automático de uma porta de serviço remoto para a tua máquina local
fixedService.displayName=Serviço fixedService.displayName=Serviço
fixedService.displayDescription=Utiliza um serviço predefinido fixedService.displayDescription=Utiliza um serviço predefinido
noServices=Não há serviços disponíveis noServices=Não há serviços disponíveis

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Список доступных серви
mappedService.displayName=Сервис mappedService.displayName=Сервис
mappedService.displayDescription=Взаимодействие с сервисом, открываемым контейнером mappedService.displayDescription=Взаимодействие с сервисом, открываемым контейнером
customService.displayName=Сервис customService.displayName=Сервис
customService.displayDescription=Добавьте порт удаленного сервиса для туннелирования к вашей локальной машине customService.displayDescription=Автоматическое туннелирование порта удаленного сервиса на твою локальную машину
fixedService.displayName=Сервис fixedService.displayName=Сервис
fixedService.displayDescription=Использовать предопределенный сервис fixedService.displayDescription=Использовать предопределенный сервис
noServices=Нет доступных сервисов noServices=Нет доступных сервисов

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Bir sistemdeki mevcut hizmetleri listeleme
mappedService.displayName=Hizmet 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=Yerel makinenize tünel açmak için bir uzak hizmet bağlantı noktası ekleyin customService.displayDescription=Uzaktaki bir hizmet portunu otomatik olarak yerel makinenize tünelleme
fixedService.displayName=Hizmet fixedService.displayName=Hizmet
fixedService.displayDescription=Önceden tanımlanmış bir hizmet kullanın fixedService.displayDescription=Önceden tanımlanmış bir hizmet kullanın
noServices=Mevcut hizmet yok noServices=Mevcut hizmet yok

View file

@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=列出系统中可用的服务
mappedService.displayName=服务 mappedService.displayName=服务
mappedService.displayDescription=与容器暴露的服务交互 mappedService.displayDescription=与容器暴露的服务交互
customService.displayName=服务 customService.displayName=服务
customService.displayDescription=添加远程服务端口,以隧道方式连接本地计算机 customService.displayDescription=自动将远程服务端口传输到本地计算机
fixedService.displayName=服务 fixedService.displayName=服务
fixedService.displayDescription=使用预定义服务 fixedService.displayDescription=使用预定义服务
noServices=无可用服务 noServices=无可用服务