From bc078034f8d5e7c014b2f7e7ca6d658749bbba7c Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Tue, 14 Jan 2025 15:32:52 +0000 Subject: [PATCH 1/2] gui: always allow starting a standalone GUI with --new --- changes.d/661.feat.md | 1 + cylc/uiserver/app.py | 4 +++- cylc/uiserver/scripts/gui.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changes.d/661.feat.md diff --git a/changes.d/661.feat.md b/changes.d/661.feat.md new file mode 100644 index 00000000..ec1e4d93 --- /dev/null +++ b/changes.d/661.feat.md @@ -0,0 +1 @@ +The GUI can now be launched in standalone mode even if `[hub]url` is configured using the `--new` option. diff --git a/cylc/uiserver/app.py b/cylc/uiserver/app.py index 46abeab4..afe9aa3c 100644 --- a/cylc/uiserver/app.py +++ b/cylc/uiserver/app.py @@ -142,7 +142,9 @@ class CylcUIServer(ExtensionApp): cylc gui # Start the Cylc GUI (at the dashboard page) cylc gui [workflow] # Start the Cylc GUI (at the workflow page) cylc gui --new [workflow] # Start a new Cylc server instance if an old one - # has become unresponsive. + # has become unresponsive, or, if the GUI has + # been configured to launch via a centralised + # hub. cylc gui --no-browser # Start the server but don't open the browser ''') # type: ignore[assignment] diff --git a/cylc/uiserver/scripts/gui.py b/cylc/uiserver/scripts/gui.py index 6aa86ca1..40a12c4c 100644 --- a/cylc/uiserver/scripts/gui.py +++ b/cylc/uiserver/scripts/gui.py @@ -75,7 +75,7 @@ def main(*argv): ''')) return if not {'--help', '--help-all'} & set(sys.argv): - if hub_url: + if hub_url and not new_gui: print(f"Running on {hub_url } as specified in global config.") webbrowser.open( update_url(hub_url, workflow_id), autoraise=True From a4c944bb70162681a9d636abbd7028d5a3046431 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Wed, 15 Jan 2025 10:24:44 +0000 Subject: [PATCH 2/2] Update changes.d/661.feat.md Co-authored-by: Hilary James Oliver --- changes.d/661.feat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes.d/661.feat.md b/changes.d/661.feat.md index ec1e4d93..62fa704b 100644 --- a/changes.d/661.feat.md +++ b/changes.d/661.feat.md @@ -1 +1 @@ -The GUI can now be launched in standalone mode even if `[hub]url` is configured using the `--new` option. +The GUI can now be launched in standalone mode even if `[hub]url` is configured, using the `--new` option.