diff --git a/app/src/main/java/io/xpipe/app/browser/action/BranchAction.java b/app/src/main/java/io/xpipe/app/browser/action/BranchAction.java index 6d77f5a5..4c722f40 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/BranchAction.java +++ b/app/src/main/java/io/xpipe/app/browser/action/BranchAction.java @@ -2,10 +2,40 @@ package io.xpipe.app.browser.action; import io.xpipe.app.browser.file.BrowserEntry; import io.xpipe.app.browser.fs.OpenFileSystemModel; +import io.xpipe.app.util.LicenseProvider; +import javafx.scene.control.Menu; +import javafx.scene.control.MenuItem; +import org.kordamp.ikonli.javafx.FontIcon; import java.util.List; public interface BranchAction extends BrowserAction { - List getBranchingActions(OpenFileSystemModel model, List entries); + default MenuItem toMenuItem(OpenFileSystemModel model, List selected) { + var m = new Menu(getName(model, selected).getValue() + " ..."); + for (var sub : getBranchingActions(model, selected)) { + var subselected = resolveFilesIfNeeded(selected); + if (!sub.isApplicable(model, subselected)) { + continue; + } + m.getItems().add(sub.toMenuItem(model, subselected)); + } + var graphic = getIcon(model, selected); + if (graphic != null) { + m.setGraphic(graphic); + } + m.setDisable(!isActive(model, selected)); + + if (getProFeatureId() != null + && !LicenseProvider.get() + .getFeature(getProFeatureId()) + .isSupported()) { + m.setDisable(true); + m.setGraphic(new FontIcon("mdi2p-professional-hexagon")); + } + + return m; + } + + List getBranchingActions(OpenFileSystemModel model, List entries); } diff --git a/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java b/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java index 285959aa..5387d3c0 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java +++ b/app/src/main/java/io/xpipe/app/browser/action/BrowserAction.java @@ -7,6 +7,7 @@ import io.xpipe.core.util.ModuleLayerLoader; import javafx.beans.value.ObservableValue; import javafx.scene.Node; +import javafx.scene.control.MenuItem; import javafx.scene.input.KeyCombination; import java.util.ArrayList; @@ -19,13 +20,17 @@ public interface BrowserAction { static List getFlattened(OpenFileSystemModel model, List entries) { return ALL.stream() - .map(browserAction -> browserAction instanceof LeafAction - ? List.of((LeafAction) browserAction) - : ((BranchAction) browserAction).getBranchingActions(model, entries)) + .map(browserAction -> getFlattened(browserAction, model, entries)) .flatMap(List::stream) .toList(); } + static List getFlattened(BrowserAction browserAction, OpenFileSystemModel model, List entries) { + return browserAction instanceof LeafAction + ? List.of((LeafAction) browserAction) + : ((BranchAction) browserAction).getBranchingActions(model, entries).stream().map(action -> getFlattened(action, model, entries)).flatMap(List::stream).toList(); + } + static LeafAction byId(String id, OpenFileSystemModel model, List entries) { return getFlattened(model, entries).stream() .filter(browserAction -> id.equals(browserAction.getId())) @@ -33,6 +38,17 @@ public interface BrowserAction { .orElseThrow(); } + default List resolveFilesIfNeeded(List selected) { + return automaticallyResolveLinks() + ? selected.stream() + .map(browserEntry -> + new BrowserEntry(browserEntry.getRawFileEntry().resolved(), browserEntry.getModel())) + .toList() + : selected; + } + + MenuItem toMenuItem(OpenFileSystemModel model, List selected); + default void init(OpenFileSystemModel model) throws Exception {} default String getProFeatureId() { diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java index 6e33b03b..bca81c85 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java @@ -1,19 +1,12 @@ package io.xpipe.app.browser.file; -import io.xpipe.app.browser.action.BranchAction; import io.xpipe.app.browser.action.BrowserAction; -import io.xpipe.app.browser.action.LeafAction; import io.xpipe.app.browser.fs.OpenFileSystemModel; import io.xpipe.app.core.AppFont; import io.xpipe.app.util.InputHelper; -import io.xpipe.app.util.LicenseProvider; - import javafx.scene.control.ContextMenu; -import javafx.scene.control.Menu; import javafx.scene.control.SeparatorMenuItem; -import org.kordamp.ikonli.javafx.FontIcon; - import java.util.ArrayList; import java.util.List; @@ -30,15 +23,6 @@ public final class BrowserContextMenu extends ContextMenu { createMenu(); } - private static List resolveIfNeeded(BrowserAction action, List selected) { - return action.automaticallyResolveLinks() - ? selected.stream() - .map(browserEntry -> - new BrowserEntry(browserEntry.getRawFileEntry().resolved(), browserEntry.getModel())) - .toList() - : selected; - } - private void createMenu() { InputHelper.onLeft(this, false, e -> { hide(); @@ -60,7 +44,7 @@ public final class BrowserContextMenu extends ContextMenu { var all = BrowserAction.ALL.stream() .filter(browserAction -> browserAction.getCategory() == cat) .filter(browserAction -> { - var used = resolveIfNeeded(browserAction, selected); + var used = browserAction.resolveFilesIfNeeded(selected); if (!browserAction.isApplicable(model, used)) { return false; } @@ -81,36 +65,8 @@ public final class BrowserContextMenu extends ContextMenu { } for (BrowserAction a : all) { - var used = resolveIfNeeded(a, selected); - if (a instanceof LeafAction la) { - getItems().add(la.toMenuItem(model, used)); - } - - if (a instanceof BranchAction la) { - var m = new Menu(a.getName(model, used).getValue() + " ..."); - for (LeafAction sub : la.getBranchingActions(model, used)) { - var subUsed = resolveIfNeeded(sub, selected); - if (!sub.isApplicable(model, subUsed)) { - continue; - } - m.getItems().add(sub.toMenuItem(model, subUsed)); - } - var graphic = a.getIcon(model, used); - if (graphic != null) { - m.setGraphic(graphic); - } - m.setDisable(!a.isActive(model, used)); - - if (la.getProFeatureId() != null - && !LicenseProvider.get() - .getFeature(la.getProFeatureId()) - .isSupported()) { - m.setDisable(true); - m.setGraphic(new FontIcon("mdi2p-professional-hexagon")); - } - - getItems().add(m); - } + var used = a.resolveFilesIfNeeded(selected); + getItems().add(a.toMenuItem(model, used)); } } } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java index bcf71bd9..5bea9645 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java @@ -9,7 +9,6 @@ import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.util.TerminalLauncher; import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.ShellControl; - import javafx.beans.value.ObservableValue; import java.util.List; @@ -28,14 +27,18 @@ public abstract class MultiExecuteAction implements BranchAction { model.withShell( pc -> { for (BrowserEntry entry : entries) { + var cmd = pc.command(createCommand(pc, model, entry)); + if (cmd == null) { + continue; + } + TerminalLauncher.open( model.getEntry().getEntry(), entry.getRawFileEntry().getName(), model.getCurrentDirectory() != null ? model.getCurrentDirectory() .getPath() - : null, - pc.command(createCommand(pc, model, entry))); + : null, cmd); } }, false); @@ -61,7 +64,12 @@ public abstract class MultiExecuteAction implements BranchAction { model.withShell( pc -> { for (BrowserEntry entry : entries) { - pc.command(createCommand(pc, model, entry)) + var cmd = createCommand(pc, model, entry); + if (cmd == null) { + continue; + } + + pc.command(cmd) .withWorkingDirectory(model.getCurrentDirectory() .getPath()) .execute(); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java b/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java index 8b49feca..3154f39c 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java @@ -2,27 +2,23 @@ package io.xpipe.ext.base.script; import io.xpipe.app.browser.action.BranchAction; import io.xpipe.app.browser.action.BrowserAction; -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.browser.session.BrowserSessionModel; import io.xpipe.app.core.AppI18n; -import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.util.ScriptHelper; +import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.ShellControl; -import io.xpipe.core.store.FilePath; - +import io.xpipe.ext.base.browser.MultiExecuteAction; import javafx.beans.property.SimpleStringProperty; import javafx.beans.value.ObservableValue; import javafx.scene.Node; - import org.kordamp.ikonli.javafx.FontIcon; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; public class RunScriptAction implements BrowserAction, BranchAction { @@ -69,43 +65,39 @@ public class RunScriptAction implements BrowserAction, BranchAction { } @Override - public List getBranchingActions(OpenFileSystemModel model, List entries) { + public List getBranchingActions(OpenFileSystemModel model, List entries) { var sc = model.getFileSystem().getShell().orElseThrow(); var scripts = getInstances(sc); - List actions = scripts.entrySet().stream() + List actions = scripts.entrySet().stream() .map(e -> { - return new LeafAction() { - @Override - public void execute(OpenFileSystemModel model, List entries) throws Exception { - var args = entries.stream() - .map(browserEntry -> new FilePath(browserEntry - .getRawFileEntry() - .getPath()) - .quoteIfNecessary()) - .collect(Collectors.joining(" ")); - execute(model, args); - } - - private void execute(OpenFileSystemModel model, String args) throws Exception { - if (model.getBrowserModel() instanceof BrowserSessionModel bm) { - var content = e.getValue().assemble(sc); - var script = ScriptHelper.createExecScript(sc, content); - try { - sc.executeSimpleCommand( - sc.getShellDialect().runScriptCommand(sc, script.toString()) + " " + args); - } catch (Exception ex) { - throw ErrorEvent.expected(ex); - } - } - } + return new MultiExecuteAction() { @Override public ObservableValue getName(OpenFileSystemModel model, List entries) { return new SimpleStringProperty(e.getKey()); } + + @Override + protected CommandBuilder createCommand(ShellControl sc, OpenFileSystemModel model, BrowserEntry entry) { + if (!(model.getBrowserModel() instanceof BrowserSessionModel bm)) { + return null; + } + + var content = e.getValue().assemble(sc); + var script = ScriptHelper.createExecScript(sc, content); + var builder = CommandBuilder.of().add(sc.getShellDialect().runScriptCommand(sc, script.toString())); + entries.stream() + .map(browserEntry -> browserEntry + .getRawFileEntry() + .getPath()) + .forEach(s -> { + builder.addFile(s); + }); + return builder; + } }; }) - .map(leafAction -> (LeafAction) leafAction) + .map(leafAction -> (BranchAction) leafAction) .toList(); return actions; } diff --git a/lang/app/strings/translations_en.properties b/lang/app/strings/translations_en.properties index d19e68f1..77d12ea5 100644 --- a/lang/app/strings/translations_en.properties +++ b/lang/app/strings/translations_en.properties @@ -80,7 +80,6 @@ lockCreationAlertHeader=Set your new master passphrase #context: verb, exit finish=Finish error=An error occurred -#force downloadStageDescription=Moves downloaded files into your system downloads directory and opens it. ok=Ok search=Search diff --git a/lang/base/strings/translations_da.properties b/lang/base/strings/translations_da.properties index 569e0133..0e59d3c6 100644 --- a/lang/base/strings/translations_da.properties +++ b/lang/base/strings/translations_da.properties @@ -154,9 +154,9 @@ serviceHostDescription=Den vært, som tjenesten kører på openWebsite=Åben hjemmeside customServiceGroup.displayName=Service-gruppe customServiceGroup.displayDescription=Gruppér flere tjenester i én kategori -initScript=Kører på shell init -shellScript=Gør script tilgængeligt under shell-session -fileScript=Gør det muligt at kalde et script med filargumenter i filbrowseren +initScript=Init-script - køres ved shell-init +shellScript=Sessionsscript - Gør scriptet tilgængeligt under en shell-session +fileScript=Filscript - Gør det muligt at kalde et script med filargumenter i filbrowseren runScript=Kør script copyUrl=Kopier URL fixedServiceGroup.displayName=Service-gruppe @@ -164,7 +164,7 @@ fixedServiceGroup.displayDescription=Liste over tilgængelige tjenester på et s mappedService.displayName=Service mappedService.displayDescription=Interagere med en tjeneste, der er eksponeret af en container customService.displayName=Service -customService.displayDescription=Tilføj en brugerdefineret tjeneste til tunnel og åben +customService.displayDescription=Tilføj en ekstern serviceport til tunnel til din lokale maskine fixedService.displayName=Service fixedService.displayDescription=Brug en foruddefineret tjeneste noServices=Ingen tilgængelige tjenester diff --git a/lang/base/strings/translations_de.properties b/lang/base/strings/translations_de.properties index 9741c7a2..066c8c6a 100644 --- a/lang/base/strings/translations_de.properties +++ b/lang/base/strings/translations_de.properties @@ -145,9 +145,9 @@ serviceHostDescription=Der Host, auf dem der Dienst läuft openWebsite=Website öffnen customServiceGroup.displayName=Dienstgruppe customServiceGroup.displayDescription=Mehrere Dienste in einer Kategorie zusammenfassen -initScript=Auf der Shell init ausführen -shellScript=Skript während der Shell-Sitzung verfügbar machen -fileScript=Skriptaufruf mit Dateiargumenten im Dateibrowser zulassen +initScript=Init-Skript - Wird beim Shell-Init ausgeführt +shellScript=Sitzungsskript - Skript während der Shell-Sitzung verfügbar machen +fileScript=Dateiskript - Erlaubt den Aufruf eines Skripts mit Dateiargumenten im Dateibrowser runScript=Skript ausführen copyUrl=URL kopieren fixedServiceGroup.displayName=Dienstgruppe @@ -155,7 +155,7 @@ fixedServiceGroup.displayDescription=Liste der verfügbaren Dienste auf einem Sy mappedService.displayName=Dienst mappedService.displayDescription=Interaktion mit einem Dienst, der von einem Container angeboten wird customService.displayName=Dienst -customService.displayDescription=Einen benutzerdefinierten Dienst zum Tunnel hinzufügen und öffnen +customService.displayDescription=Hinzufügen eines Remote Service Ports zum Tunneln zu deinem lokalen Rechner fixedService.displayName=Dienst fixedService.displayDescription=Einen vordefinierten Dienst verwenden noServices=Keine verfügbaren Dienste diff --git a/lang/base/strings/translations_en.properties b/lang/base/strings/translations_en.properties index 64820c51..f78731a6 100644 --- a/lang/base/strings/translations_en.properties +++ b/lang/base/strings/translations_en.properties @@ -143,9 +143,9 @@ serviceHostDescription=The host the service is running on openWebsite=Open website customServiceGroup.displayName=Service group customServiceGroup.displayDescription=Group multiple services into one category -initScript=Run on shell init -shellScript=Make script available during shell session -fileScript=Allow script to be called with file arguments in the file browser +initScript=Init script - Run on shell init +shellScript=Session script - Make script available during shell session +fileScript=File script - Allow script to be called with file arguments in the file browser runScript=Run script copyUrl=Copy URL fixedServiceGroup.displayName=Service group @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=List the available services on a system mappedService.displayName=Service mappedService.displayDescription=Interact with a service exposed by a container customService.displayName=Service -customService.displayDescription=Add a custom service to tunnel and open +customService.displayDescription=Add a remote service port to tunnel to you local machine fixedService.displayName=Service fixedService.displayDescription=Use a predefined service noServices=No available services diff --git a/lang/base/strings/translations_es.properties b/lang/base/strings/translations_es.properties index 7d307d5e..1eb3aea4 100644 --- a/lang/base/strings/translations_es.properties +++ b/lang/base/strings/translations_es.properties @@ -143,9 +143,9 @@ serviceHostDescription=El host en el que se ejecuta el servicio openWebsite=Abrir sitio web customServiceGroup.displayName=Grupo de servicios customServiceGroup.displayDescription=Agrupa varios servicios en una categoría -initScript=Ejecutar en shell init -shellScript=Hacer que el script esté disponible durante la sesión shell -fileScript=Permitir llamar a un script con argumentos de archivo en el explorador de archivos +initScript=Script de init - Se ejecuta en el shell init +shellScript=Script de sesión - Hacer que el script esté disponible durante la sesión shell +fileScript=Script de archivo - Permite llamar al script con argumentos de archivo en el explorador de archivos runScript=Ejecutar script copyUrl=Copiar URL fixedServiceGroup.displayName=Grupo de servicios @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Enumerar los servicios disponibles en un si mappedService.displayName=Servicio mappedService.displayDescription=Interactúa con un servicio expuesto por un contenedor customService.displayName=Servicio -customService.displayDescription=Añade un servicio personalizado para tunelizar y abrir +customService.displayDescription=Añade un puerto de servicio remoto para hacer un túnel hacia tu máquina local fixedService.displayName=Servicio fixedService.displayDescription=Utilizar un servicio predefinido noServices=No hay servicios disponibles diff --git a/lang/base/strings/translations_fr.properties b/lang/base/strings/translations_fr.properties index 6c54623f..bca75d0b 100644 --- a/lang/base/strings/translations_fr.properties +++ b/lang/base/strings/translations_fr.properties @@ -143,9 +143,9 @@ serviceHostDescription=L'hôte sur lequel le service est exécuté openWebsite=Ouvrir un site web customServiceGroup.displayName=Groupe de service customServiceGroup.displayDescription=Regrouper plusieurs services dans une même catégorie -initScript=Exécute sur le shell init -shellScript=Rendre le script disponible pendant la session shell -fileScript=Permet d'appeler un script avec des arguments de fichier dans le navigateur de fichiers +initScript=Script d'initialisation - Exécuté lors de l'initialisation de l'interpréteur de commandes +shellScript=Script de session - Rendre le script disponible pendant la session de l'interpréteur de commandes +fileScript=Script de fichier - Permet d'appeler un script avec des arguments de fichier dans le navigateur de fichiers runScript=Exécuter un script copyUrl=Copier l'URL fixedServiceGroup.displayName=Groupe de service @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Liste les services disponibles sur un syst mappedService.displayName=Service mappedService.displayDescription=Interagir avec un service exposé par un conteneur customService.displayName=Service -customService.displayDescription=Ajouter un service personnalisé au tunnel et à l'ouverture +customService.displayDescription=Ajoute un port de service à distance pour établir un tunnel vers ta machine locale fixedService.displayName=Service fixedService.displayDescription=Utiliser un service prédéfini noServices=Aucun service disponible diff --git a/lang/base/strings/translations_it.properties b/lang/base/strings/translations_it.properties index c9f20c3f..16780c2d 100644 --- a/lang/base/strings/translations_it.properties +++ b/lang/base/strings/translations_it.properties @@ -143,9 +143,9 @@ serviceHostDescription=L'host su cui è in esecuzione il servizio openWebsite=Sito web aperto customServiceGroup.displayName=Gruppo di servizio customServiceGroup.displayDescription=Raggruppa più servizi in un'unica categoria -initScript=Eseguire su shell init -shellScript=Rendere disponibile lo script durante la sessione di shell -fileScript=Consente di richiamare uno script con argomenti di file nel browser di file +initScript=Script di avvio - Eseguito all'avvio della shell +shellScript=Script di sessione - Rendi disponibile lo script durante la sessione della shell +fileScript=File script - Consente di richiamare uno script con argomenti di file nel browser di file runScript=Esegui script copyUrl=Copia URL fixedServiceGroup.displayName=Gruppo di servizio @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Elenco dei servizi disponibili su un sistem mappedService.displayName=Servizio mappedService.displayDescription=Interagire con un servizio esposto da un contenitore customService.displayName=Servizio -customService.displayDescription=Aggiungi un servizio personalizzato per il tunnel e l'apertura +customService.displayDescription=Aggiungi una porta di servizio remoto per creare un tunnel verso la tua macchina locale fixedService.displayName=Servizio fixedService.displayDescription=Utilizzare un servizio predefinito noServices=Nessun servizio disponibile diff --git a/lang/base/strings/translations_ja.properties b/lang/base/strings/translations_ja.properties index 003114b6..8d15b1af 100644 --- a/lang/base/strings/translations_ja.properties +++ b/lang/base/strings/translations_ja.properties @@ -143,9 +143,9 @@ serviceHostDescription=サービスが稼働しているホスト openWebsite=オープンウェブサイト customServiceGroup.displayName=サービスグループ customServiceGroup.displayDescription=複数のサービスを1つのカテゴリーにまとめる -initScript=シェル init で実行する -shellScript=シェルセッション中にスクリプトを利用可能にする -fileScript=ファイルブラウザでファイル引数を指定してスクリプトを呼び出せるようにする +initScript=initスクリプト - シェルのinit時に実行する +shellScript=セッションスクリプト - シェルセッション中にスクリプトを利用可能にする +fileScript=ファイルスクリプト - ファイルブラウザでファイル引数を指定してスクリプトを呼び出せるようにする runScript=スクリプトを実行する copyUrl=URLをコピーする fixedServiceGroup.displayName=サービスグループ @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=システムで利用可能なサービス mappedService.displayName=サービス mappedService.displayDescription=コンテナによって公開されたサービスとやりとりする customService.displayName=サービス -customService.displayDescription=トンネルとオープンにカスタムサービスを追加する +customService.displayDescription=リモートサービスのポートを追加し、ローカルマシンにトンネリングする fixedService.displayName=サービス fixedService.displayDescription=定義済みのサービスを使う noServices=利用可能なサービスはない diff --git a/lang/base/strings/translations_nl.properties b/lang/base/strings/translations_nl.properties index 982011b9..51d590f2 100644 --- a/lang/base/strings/translations_nl.properties +++ b/lang/base/strings/translations_nl.properties @@ -143,9 +143,9 @@ serviceHostDescription=De host waarop de service draait openWebsite=Open website customServiceGroup.displayName=Servicegroep customServiceGroup.displayDescription=Groepeer meerdere diensten in één categorie -initScript=Uitvoeren op shell init -shellScript=Script beschikbaar maken tijdens shellsessie -fileScript=Laat toe dat een script wordt aangeroepen met bestandsargumenten in de bestandsbrowser +initScript=Init script - Uitvoeren op shell init +shellScript=Sessiescript - Script beschikbaar maken tijdens een shellsessie +fileScript=Bestandsscript - Laat toe dat script wordt aangeroepen met bestandsargumenten in de bestandsbrowser runScript=Script uitvoeren copyUrl=URL kopiëren fixedServiceGroup.displayName=Servicegroep @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Een lijst van beschikbare services op een s mappedService.displayName=Service mappedService.displayDescription=Interactie met een service die wordt aangeboden door een container customService.displayName=Service -customService.displayDescription=Een aangepaste service toevoegen aan tunnel en openen +customService.displayDescription=Een servicepoort op afstand toevoegen om te tunnelen naar je lokale machine fixedService.displayName=Service fixedService.displayDescription=Een vooraf gedefinieerde service gebruiken noServices=Geen beschikbare diensten diff --git a/lang/base/strings/translations_pt.properties b/lang/base/strings/translations_pt.properties index 98bbeb97..02ab73a5 100644 --- a/lang/base/strings/translations_pt.properties +++ b/lang/base/strings/translations_pt.properties @@ -143,9 +143,9 @@ serviceHostDescription=O anfitrião em que o serviço está a ser executado openWebsite=Abre o sítio Web customServiceGroup.displayName=Grupo de serviços customServiceGroup.displayDescription=Agrupa vários serviços numa categoria -initScript=Corre no shell init -shellScript=Torna o script disponível durante a sessão da shell -fileScript=Permite que o script seja chamado com argumentos de ficheiro no navegador de ficheiros +initScript=Script de inicialização - Executa na inicialização do shell +shellScript=Script de sessão - Torna o script disponível durante a sessão do shell +fileScript=Script de ficheiro - Permite que o script seja chamado com argumentos de ficheiro no navegador de ficheiros runScript=Executa o script copyUrl=Copia o URL fixedServiceGroup.displayName=Grupo de serviços @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Lista os serviços disponíveis num sistema mappedService.displayName=Serviço mappedService.displayDescription=Interage com um serviço exposto por um contentor customService.displayName=Serviço -customService.displayDescription=Adiciona um serviço personalizado ao túnel e abre +customService.displayDescription=Adiciona uma porta de serviço remoto para fazer um túnel para a tua máquina local fixedService.displayName=Serviço fixedService.displayDescription=Utiliza um serviço predefinido noServices=Não há serviços disponíveis diff --git a/lang/base/strings/translations_ru.properties b/lang/base/strings/translations_ru.properties index adefc507..02ab692a 100644 --- a/lang/base/strings/translations_ru.properties +++ b/lang/base/strings/translations_ru.properties @@ -143,9 +143,9 @@ serviceHostDescription=Хост, на котором запущена служб openWebsite=Открытый сайт customServiceGroup.displayName=Группа услуг customServiceGroup.displayDescription=Сгруппируйте несколько сервисов в одну категорию -initScript=Запуск на shell init -shellScript=Сделать скрипт доступным во время сеанса оболочки -fileScript=Разрешить вызов скрипта с аргументами в виде файлов в браузере файлов +initScript=Init script - скрипт, запускаемый при инициализации оболочки +shellScript=Скрипт сессии - сделай скрипт доступным во время сеанса работы с оболочкой +fileScript=Файловый скрипт - позволяет вызывать скрипт с аргументами файла в файловом браузере runScript=Запуск скрипта copyUrl=Копировать URL fixedServiceGroup.displayName=Группа услуг @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Список доступных серви mappedService.displayName=Сервис mappedService.displayDescription=Взаимодействие с сервисом, открываемым контейнером customService.displayName=Сервис -customService.displayDescription=Добавьте пользовательский сервис для туннелирования и открытия +customService.displayDescription=Добавьте порт удаленного сервиса для туннелирования к локальной машине fixedService.displayName=Сервис fixedService.displayDescription=Использовать предопределенный сервис noServices=Нет доступных сервисов diff --git a/lang/base/strings/translations_tr.properties b/lang/base/strings/translations_tr.properties index 820412a3..f7d24980 100644 --- a/lang/base/strings/translations_tr.properties +++ b/lang/base/strings/translations_tr.properties @@ -143,9 +143,9 @@ serviceHostDescription=Hizmetin üzerinde çalıştığı ana bilgisayar openWebsite=Açık web sitesi customServiceGroup.displayName=Hizmet grubu customServiceGroup.displayDescription=Birden fazla hizmeti tek bir kategoride gruplayın -initScript=Kabuk başlangıcında çalıştır -shellScript=Kabuk oturumu sırasında komut dosyasını kullanılabilir hale getirme -fileScript=Kodun dosya tarayıcısında dosya bağımsız değişkenleriyle çağrılmasına izin ver +initScript=Başlangıç betiği - Kabuk başlangıcında çalıştır +shellScript=Oturum betiği - Betiği kabuk oturumu sırasında kullanılabilir hale getirin +fileScript=Dosya betiği - Dosya tarayıcısında betiğin dosya argümanlarıyla çağrılmasına izin ver runScript=Komut dosyasını çalıştır copyUrl=URL'yi kopyala fixedServiceGroup.displayName=Hizmet grubu @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=Bir sistemdeki mevcut hizmetleri listeleme mappedService.displayName=Hizmet mappedService.displayDescription=Bir konteyner tarafından sunulan bir hizmetle etkileşim customService.displayName=Hizmet -customService.displayDescription=Tünele özel bir hizmet ekleyin ve açın +customService.displayDescription=Yerel makinenize tünel açmak için bir uzak hizmet bağlantı noktası ekleyin fixedService.displayName=Hizmet fixedService.displayDescription=Önceden tanımlanmış bir hizmet kullanın noServices=Mevcut hizmet yok diff --git a/lang/base/strings/translations_zh.properties b/lang/base/strings/translations_zh.properties index 9b059a77..edf5b683 100644 --- a/lang/base/strings/translations_zh.properties +++ b/lang/base/strings/translations_zh.properties @@ -143,9 +143,9 @@ serviceHostDescription=服务运行的主机 openWebsite=打开网站 customServiceGroup.displayName=服务组 customServiceGroup.displayDescription=将多项服务归为一类 -initScript=在 shell init 上运行 -shellScript=在 shell 会话中提供脚本 -fileScript=允许在文件浏览器中使用文件参数调用脚本 +initScript=初始脚本 - 在 shell 启动时运行 +shellScript=会话脚本 - 在 shell 会话期间提供脚本 +fileScript=文件脚本 - 允许在文件浏览器中使用文件参数调用脚本 runScript=运行脚本 copyUrl=复制 URL fixedServiceGroup.displayName=服务组 @@ -153,7 +153,7 @@ fixedServiceGroup.displayDescription=列出系统中可用的服务 mappedService.displayName=服务 mappedService.displayDescription=与容器暴露的服务交互 customService.displayName=服务 -customService.displayDescription=为隧道和开放添加自定义服务 +customService.displayDescription=添加远程服务端口,以隧道方式连接本地计算机 fixedService.displayName=服务 fixedService.displayDescription=使用预定义服务 noServices=无可用服务 diff --git a/lang/base/texts/executionType_en.md b/lang/base/texts/executionType_en.md index 7a0dbec4..513328e3 100644 --- a/lang/base/texts/executionType_en.md +++ b/lang/base/texts/executionType_en.md @@ -2,9 +2,9 @@ You can use a script in multiple different scenarios. -When enabling a script, the execution types dictate what XPipe will do with the script. +When enabling a script via its enable toggle button, the execution types dictate what XPipe will do with the script. -## Init scripts +## Init script type When a script is designated as init script, it can be selected in shell environments. @@ -18,33 +18,37 @@ alias l="ls -CF" ``` you will have access to these aliases in all compatible shell sessions if the script is enabled. -## Shell scripts +## Session script type -A normal shell script is intended to be called in a shell session in your terminal. +A shell session script is intended to be called in a shell session in your terminal. When enabled, the script will be copied to the target system and put into the PATH in all compatible shells. This allows you to call the script from anywhere in a terminal session. The script name will be lowercased and spaces will be replaced with underscores, allowing you to easily call the script. -For example, if you create a simple shell script named `apti` like +For example, if you create a simple shell script named `apti` with ``` sudo apt install "$1" ``` -you can call that on any compatible system with `apti.sh ` if the script is enabled. +you can call the script on any compatible system with `apti.sh ` if the script is enabled. -## File scripts +## File script type Lastly, you can also run custom script with file inputs from the file browser interface. When a file script is enabled, it will show up in the file browser to be run with file inputs. For example, if you create a simple file script like ``` -sudo apt install "$@" +diff "$1" "$2" ``` you can run the script on selected files if the script is enabled. +In this example, the script will only run successfully if you have exactly two files selected. +Otherwise, the diff command will fail. ## Multiple types -As the sample file script is the same as the sample shell script above, -you see that you can also tick multiple boxes for execution types of a script if they should be used in multiple scenarios. +You can also tick multiple boxes for execution types of a script if they should be used in multiple scenarios. + +For example in many cases, you can use file scripts also as normal shell scripts +to bring into your shell sessions to call them with specific arguments manually.