From d750089b5270d4bb424393cb5ad6b0171ea0aea8 Mon Sep 17 00:00:00 2001 From: crschnick Date: Fri, 9 Aug 2024 07:31:03 +0000 Subject: [PATCH] Tty state fixes --- .../main/java/io/xpipe/app/beacon/BeaconRequestHandler.java | 3 ++- beacon/src/main/java/io/xpipe/beacon/BeaconInterface.java | 4 ++++ .../src/main/java/io/xpipe/beacon/api/AskpassExchange.java | 5 +++++ .../src/main/java/io/xpipe/beacon/api/HandshakeExchange.java | 5 +++++ lang/proc/strings/translations_da.properties | 1 + lang/proc/strings/translations_de.properties | 1 + lang/proc/strings/translations_en.properties | 1 + lang/proc/strings/translations_es.properties | 1 + lang/proc/strings/translations_fr.properties | 1 + lang/proc/strings/translations_it.properties | 1 + lang/proc/strings/translations_ja.properties | 1 + lang/proc/strings/translations_nl.properties | 1 + lang/proc/strings/translations_pt.properties | 1 + lang/proc/strings/translations_ru.properties | 1 + lang/proc/strings/translations_tr.properties | 1 + lang/proc/strings/translations_zh.properties | 1 + 16 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java b/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java index 2d6f98b11..019b70096 100644 --- a/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java +++ b/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java @@ -28,7 +28,8 @@ public class BeaconRequestHandler implements HttpHandler { @Override public void handle(HttpExchange exchange) { - if (OperationMode.isInShutdown()) { + if (OperationMode.isInShutdown() && !beaconInterface.acceptInShutdown()) { + writeError(exchange, new BeaconClientErrorResponse("Daemon is currently in shutdown"), 400); return; } diff --git a/beacon/src/main/java/io/xpipe/beacon/BeaconInterface.java b/beacon/src/main/java/io/xpipe/beacon/BeaconInterface.java index 0e28a2f03..91742971c 100644 --- a/beacon/src/main/java/io/xpipe/beacon/BeaconInterface.java +++ b/beacon/src/main/java/io/xpipe/beacon/BeaconInterface.java @@ -62,6 +62,10 @@ public abstract class BeaconInterface { return (Class) Class.forName(name); } + public boolean acceptInShutdown() { + return false; + } + public boolean requiresCompletedStartup() { return true; } diff --git a/beacon/src/main/java/io/xpipe/beacon/api/AskpassExchange.java b/beacon/src/main/java/io/xpipe/beacon/api/AskpassExchange.java index a2674cc76..eb7587ef1 100644 --- a/beacon/src/main/java/io/xpipe/beacon/api/AskpassExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/api/AskpassExchange.java @@ -12,6 +12,11 @@ import java.util.UUID; public class AskpassExchange extends BeaconInterface { + @Override + public boolean acceptInShutdown() { + return true; + } + @Override public String getPath() { return "/askpass"; diff --git a/beacon/src/main/java/io/xpipe/beacon/api/HandshakeExchange.java b/beacon/src/main/java/io/xpipe/beacon/api/HandshakeExchange.java index ccd7cd38b..3ccadce8a 100644 --- a/beacon/src/main/java/io/xpipe/beacon/api/HandshakeExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/api/HandshakeExchange.java @@ -11,6 +11,11 @@ import lombok.extern.jackson.Jacksonized; public class HandshakeExchange extends BeaconInterface { + @Override + public boolean acceptInShutdown() { + return true; + } + @Override public String getPath() { return "/handshake"; diff --git a/lang/proc/strings/translations_da.properties b/lang/proc/strings/translations_da.properties index 3b6128180..e7cb903b3 100644 --- a/lang/proc/strings/translations_da.properties +++ b/lang/proc/strings/translations_da.properties @@ -375,3 +375,4 @@ serialHostDescription=Systemet til at få adgang til den serielle port på serialPortConfiguration=Konfiguration af seriel port serialPortConfigurationDescription=Konfigurationsparametre for den tilsluttede serielle enhed serialInformation=Seriel information +openXShell=Åbn i XShell diff --git a/lang/proc/strings/translations_de.properties b/lang/proc/strings/translations_de.properties index eea2a7d81..1bd78ad61 100644 --- a/lang/proc/strings/translations_de.properties +++ b/lang/proc/strings/translations_de.properties @@ -353,3 +353,4 @@ serialHostDescription=Das System für den Zugriff auf die serielle Schnittstelle serialPortConfiguration=Konfiguration der seriellen Schnittstelle serialPortConfigurationDescription=Konfigurationsparameter des angeschlossenen seriellen Geräts serialInformation=Serielle Informationen +openXShell=In XShell öffnen diff --git a/lang/proc/strings/translations_en.properties b/lang/proc/strings/translations_en.properties index 747aa3b31..537040fb9 100644 --- a/lang/proc/strings/translations_en.properties +++ b/lang/proc/strings/translations_en.properties @@ -351,3 +351,4 @@ serialHostDescription=The system to access the serial port on serialPortConfiguration=Serial port configuration serialPortConfigurationDescription=Configuration parameters of the connected serial device serialInformation=Serial information +openXShell=Open in XShell diff --git a/lang/proc/strings/translations_es.properties b/lang/proc/strings/translations_es.properties index 66957c373..d4375e084 100644 --- a/lang/proc/strings/translations_es.properties +++ b/lang/proc/strings/translations_es.properties @@ -349,3 +349,4 @@ serialHostDescription=El sistema para acceder al puerto serie en serialPortConfiguration=Configuración del puerto serie serialPortConfigurationDescription=Parámetros de configuración del dispositivo serie conectado serialInformation=Información en serie +openXShell=Abrir en XShell diff --git a/lang/proc/strings/translations_fr.properties b/lang/proc/strings/translations_fr.properties index d647b600a..83cfeafbb 100644 --- a/lang/proc/strings/translations_fr.properties +++ b/lang/proc/strings/translations_fr.properties @@ -349,3 +349,4 @@ serialHostDescription=Le système pour accéder au port série sur serialPortConfiguration=Configuration du port série serialPortConfigurationDescription=Paramètres de configuration de l'appareil en série connecté serialInformation=Informations en série +openXShell=Ouvrir dans XShell diff --git a/lang/proc/strings/translations_it.properties b/lang/proc/strings/translations_it.properties index 79665143b..8ef7d529c 100644 --- a/lang/proc/strings/translations_it.properties +++ b/lang/proc/strings/translations_it.properties @@ -349,3 +349,4 @@ serialHostDescription=Il sistema per accedere alla porta seriale su serialPortConfiguration=Configurazione della porta seriale serialPortConfigurationDescription=Parametri di configurazione del dispositivo seriale collegato serialInformation=Informazioni di serie +openXShell=Apri in XShell diff --git a/lang/proc/strings/translations_ja.properties b/lang/proc/strings/translations_ja.properties index 169a08617..236ce5cb8 100644 --- a/lang/proc/strings/translations_ja.properties +++ b/lang/proc/strings/translations_ja.properties @@ -349,3 +349,4 @@ serialHostDescription=のシリアルポートにアクセスするシステム serialPortConfiguration=シリアルポートの設定 serialPortConfigurationDescription=接続されたシリアル・デバイスの設定パラメーター serialInformation=シリアル情報 +openXShell=XShellで開く diff --git a/lang/proc/strings/translations_nl.properties b/lang/proc/strings/translations_nl.properties index 01330d2df..3a7f312f0 100644 --- a/lang/proc/strings/translations_nl.properties +++ b/lang/proc/strings/translations_nl.properties @@ -349,3 +349,4 @@ serialHostDescription=Het systeem om toegang te krijgen tot de seriële poort op serialPortConfiguration=Seriële poort configuratie serialPortConfigurationDescription=Configuratieparameters van het aangesloten seriële apparaat serialInformation=Seriële informatie +openXShell=Openen in XShell diff --git a/lang/proc/strings/translations_pt.properties b/lang/proc/strings/translations_pt.properties index 2db462b80..74e238f0f 100644 --- a/lang/proc/strings/translations_pt.properties +++ b/lang/proc/strings/translations_pt.properties @@ -349,3 +349,4 @@ serialHostDescription=O sistema para aceder à porta série em serialPortConfiguration=Configuração da porta de série serialPortConfigurationDescription=Parâmetros de configuração do dispositivo de série ligado serialInformation=Informação de série +openXShell=Abre no XShell diff --git a/lang/proc/strings/translations_ru.properties b/lang/proc/strings/translations_ru.properties index 501fc989d..78db52cac 100644 --- a/lang/proc/strings/translations_ru.properties +++ b/lang/proc/strings/translations_ru.properties @@ -349,3 +349,4 @@ serialHostDescription=Система для доступа к последова serialPortConfiguration=Конфигурация последовательного порта serialPortConfigurationDescription=Параметры конфигурации подключенного последовательного устройства serialInformation=Серийная информация +openXShell=Открыть в XShell diff --git a/lang/proc/strings/translations_tr.properties b/lang/proc/strings/translations_tr.properties index 23e8d557a..a0f85cb1a 100644 --- a/lang/proc/strings/translations_tr.properties +++ b/lang/proc/strings/translations_tr.properties @@ -349,3 +349,4 @@ serialHostDescription=Seri porta erişmek için sistem serialPortConfiguration=Seri bağlantı noktası yapılandırması serialPortConfigurationDescription=Bağlı seri cihazın konfigürasyon parametreleri serialInformation=Seri bilgileri +openXShell=XShell'de Aç diff --git a/lang/proc/strings/translations_zh.properties b/lang/proc/strings/translations_zh.properties index f58045b0e..a98b09ccd 100644 --- a/lang/proc/strings/translations_zh.properties +++ b/lang/proc/strings/translations_zh.properties @@ -349,3 +349,4 @@ serialHostDescription=访问串行端口的系统 serialPortConfiguration=串行端口配置 serialPortConfigurationDescription=所连接串行设备的配置参数 serialInformation=序列信息 +openXShell=在 XShell 中打开