Coverage for /usr/local/lib/python3.12/site-packages/prefect/settings/models/server/ui.py: 100%
11 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 11:21 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 11:21 +0000
1from typing import ClassVar, Optional 1a
3from pydantic import AliasChoices, AliasPath, Field 1a
4from pydantic_settings import SettingsConfigDict 1a
6from prefect.settings.base import PrefectBaseSettings, build_settings_config 1a
9class ServerUISettings(PrefectBaseSettings): 1a
10 model_config: ClassVar[SettingsConfigDict] = build_settings_config(("server", "ui")) 1a
12 enabled: bool = Field( 1a
13 default=True,
14 description="Whether or not to serve the Prefect UI.",
15 validation_alias=AliasChoices(
16 AliasPath("enabled"),
17 "prefect_server_ui_enabled",
18 "prefect_ui_enabled",
19 ),
20 )
22 api_url: Optional[str] = Field( 1a
23 default=None,
24 description="The connection url for communication from the UI to the API. Defaults to `PREFECT_API_URL` if set. Otherwise, the default URL is generated from `PREFECT_SERVER_API_HOST` and `PREFECT_SERVER_API_PORT`.",
25 validation_alias=AliasChoices(
26 AliasPath("api_url"),
27 "prefect_server_ui_api_url",
28 "prefect_ui_api_url",
29 ),
30 )
32 serve_base: str = Field( 1a
33 default="/",
34 description="The base URL path to serve the Prefect UI from.",
35 validation_alias=AliasChoices(
36 AliasPath("serve_base"),
37 "prefect_server_ui_serve_base",
38 "prefect_ui_serve_base",
39 ),
40 )
42 static_directory: Optional[str] = Field( 1a
43 default=None,
44 description="The directory to serve static files from. This should be used when running into permissions issues when attempting to serve the UI from the default directory (for example when running in a Docker container).",
45 validation_alias=AliasChoices(
46 AliasPath("static_directory"),
47 "prefect_server_ui_static_directory",
48 "prefect_ui_static_directory",
49 ),
50 )
52 show_promotional_content: bool = Field( 1a
53 default=True,
54 description="Whether or not to display promotional content in the UI, including upgrade prompts and marketing banners.",
55 )