1818 comparison_signature_for ,
1919 label_signature_for ,
2020)
21- from e3sm_compareview .components import drawers , file_browser , toolbars
21+ from e3sm_compareview .components import doc , drawers , file_browser , toolbars
2222from e3sm_compareview .pipeline import EAMVisSource
2323from e3sm_compareview .view_manager import ViewManager
24- from e3sm_quickview .components import css , dialogs , doc
24+ from e3sm_quickview .components import css , dialogs
2525from e3sm_quickview import module as qv_module
2626from e3sm_quickview .utils import cli , compute
2727
@@ -44,7 +44,7 @@ def __init__(self, server=None):
4444 # Initial UI state
4545 self .state .update (
4646 {
47- "trame__title" : "CompareView " ,
47+ "trame__title" : "QuickCompare " ,
4848 "trame__favicon" : ASSETS .icon ,
4949 "is_tauri" : False ,
5050 "animation_play" : False ,
@@ -111,12 +111,27 @@ async def wait_for_import(**_):
111111
112112 @life_cycle .server_ready
113113 def _tauri_ready (self , ** _ ):
114- os .write (1 , f"tauri-server-port={ self .server .port } \n " .encode ())
114+ jupyter_url_prefix = os .environ .get ("JUPYTERHUB_SERVICE_PREFIX" )
115+ jupyter_url_api = os .environ .get ("JUPYTERHUB_API_URL" )
116+ if jupyter_url_prefix :
117+ base_url = "https://jupyter.nersc.gov"
118+ if jupyter_url_api :
119+ base_url = jupyter_url_api [:- 8 ]
120+
121+ os .write (
122+ 1 ,
123+ "\n Use URL below to connect to the application:\n \n => "
124+ f"{ base_url } { jupyter_url_prefix } proxy/{ self .server .port } "
125+ "/index.html?ui=main&reconnect=auto\n \n " .encode (),
126+ )
127+ else :
128+ os .write (1 , f"tauri-server-port={ self .server .port } \n " .encode ())
115129
116130 @life_cycle .client_connected
117131 def _tauri_show (self , ** _ ):
118- os .write (1 , "tauri-client-ready\n " .encode ())
119-
132+ jupyter_url_prefix = os .environ .get ("JUPYTERHUB_SERVICE_PREFIX" )
133+ if not jupyter_url_prefix :
134+ os .write (1 , "tauri-client-ready\n " .encode ())
120135 # -------------------------------------------------------------------------
121136 # UI definition
122137 # -------------------------------------------------------------------------
@@ -700,7 +715,7 @@ def toggle_toolbar(self, toolbar_name=None):
700715# -------------------------------------------------------------------------
701716def main ():
702717 app = EAMApp ()
703- app .server .start ()
718+ app .server .start (show_connection_info = False , open_browser = False )
704719
705720
706721if __name__ == "__main__" :
0 commit comments