|
@@ -11,7 +11,6 @@ from uvicorn.supervisors import ChangeReload, Multiprocess
|
|
|
|
|
|
from . import air, core, helpers
|
|
|
from . import native as native_module
|
|
|
-from . import welcome
|
|
|
from .client import Client
|
|
|
from .language import Language
|
|
|
from .logging import log
|
|
@@ -45,6 +44,7 @@ def run(*,
|
|
|
prod_js: bool = True,
|
|
|
endpoint_documentation: Literal['none', 'internal', 'page', 'all'] = 'none',
|
|
|
storage_secret: Optional[str] = None,
|
|
|
+ show_welcome_message: bool = True,
|
|
|
**kwargs: Any,
|
|
|
) -> None:
|
|
|
"""ui.run
|
|
@@ -76,6 +76,7 @@ def run(*,
|
|
|
:param prod_js: whether to use the production version of Vue and Quasar dependencies (default: `True`)
|
|
|
:param endpoint_documentation: control what endpoints appear in the autogenerated OpenAPI docs (default: 'none', options: 'none', 'internal', 'page', 'all')
|
|
|
:param storage_secret: secret key for browser-based storage (default: `None`, a value is required to enable ui.storage.individual and ui.storage.browser)
|
|
|
+ :param show_welcome_message: whether to show the welcome message (default: `True`)
|
|
|
:param kwargs: additional keyword arguments are passed to `uvicorn.run`
|
|
|
"""
|
|
|
core.app.config.add_run_config(
|
|
@@ -89,6 +90,7 @@ def run(*,
|
|
|
reconnect_timeout=reconnect_timeout,
|
|
|
tailwind=tailwind,
|
|
|
prod_js=prod_js,
|
|
|
+ show_welcome_message=show_welcome_message,
|
|
|
)
|
|
|
core.app.config.endpoint_documentation = endpoint_documentation
|
|
|
|
|
@@ -103,8 +105,6 @@ def run(*,
|
|
|
if on_air:
|
|
|
air.instance = air.Air('' if on_air is True else on_air)
|
|
|
|
|
|
- core.app.on_startup(welcome.print_message)
|
|
|
-
|
|
|
if multiprocessing.current_process().name != 'MainProcess':
|
|
|
return
|
|
|
|
|
@@ -125,9 +125,10 @@ def run(*,
|
|
|
width, height = window_size or (800, 600)
|
|
|
native_module.activate(host, port, title, width, height, fullscreen, frameless)
|
|
|
else:
|
|
|
- port = port or 8080
|
|
|
+ port = port or 8080
|
|
|
host = host or '0.0.0.0'
|
|
|
assert host is not None
|
|
|
+ assert port is not None
|
|
|
|
|
|
# NOTE: We save host and port in environment variables so the subprocess started in reload mode can access them.
|
|
|
os.environ['NICEGUI_HOST'] = host
|