orangeqs.juice.dashboard.dashboard_load#
Logic for loading entrypoints from the dashboard config file.
Module Contents#
Classes#
Dashboard page entry. Appears on the homepage and the navigation bar. |
|
Dashboard category. Appears on the home page and the navigation bar. |
|
An extra location for static files to be served by the StaticFileHandler. |
|
Container for extra handlers registered by extensions. |
|
Configuration for the dashboard. |
Functions#
Collect all dashboard applications defined by extensions. |
Data#
API#
- orangeqs.juice.dashboard.dashboard_load.TORNADO_APPLICATIONS#
‘collect_entry_points(…)’
- orangeqs.juice.dashboard.dashboard_load.collect_dashboard_applications() tuple[list[tuple[str, type[tornado.web.RequestHandler], dict[str, Any]]], dict[str, collections.abc.Callable[..., panel.template.Template] | bokeh.application.Application]]#
Collect all dashboard applications defined by extensions.
Returns#
(dict[str, type[web.RequestHandler], dict[str, Any]]): A dictionary mapping URL paths to Tornado request handlers and their initialization arguments.
(dict[str, Application]): A dictionary mapping URL paths to Bokeh applications.
- class orangeqs.juice.dashboard.dashboard_load.DashboardEntry(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableDashboard page entry. Appears on the homepage and the navigation bar.
- url: str | None#
None
URL path of the entry, or None if not a link.
If
entry_pointis defined, this will be the URL the page will be served at. If not provided, will be determined automatically by using the key of the category and page, i.e.{category_key}/{page_key}.Otherwise this can be any URL pointing to an internal or external resource. In that case it applies the following rules to determine how to handle the URL:
If the URL starts with
http://orhttps://, it’s considered an absolute URL.If the URL starts with a
/, it’s considered an absolute path on the current domain.Otherwise the URL is considered relative to the dashboard base URL, which is useful for linking to specific dashboard pages.
The URL supports the following placeholders. All placeholders have a leading
/, but no trailing/.{base_url}: Base URL for the JupyterHub user, e.g./user/<username>.{dashboard_base_url}: Seedashboard_base_url().{filebrowser_base_url}: Seefilebrowser_base_url().{jupyterlab_base_url}: Seejupyterlab_base_url().{vscode_base_url}: Seevscode_base_url().{influxdb2_base_url}: Seeinfluxdb2_base_url().
- image: str | None#
None
Optional image for the entry.
Must be of the form
importable.module:filepath, wherefilepathis the path to the image file relative to the module. For example,my_module.static:images/my_image.png.Don’t forget to include the image file in the package data of your package, see for example https://setuptools.pypa.io/en/latest/userguide/datafiles.html for how to do this using
setuptools.
- entry_point: str | None#
None
Object reference to the function that instantiates the page this entry links to.
Also referred to as the “entry point”. This function will be called to instantiate the page that this entry refers to. Must be of the form
importable.module:callable.
- order: int#
‘Field(…)’
Order of the entry in the navigation bar and home page.
Lower numbers appear first.
- highlight: Literal[off, once, always]#
‘off’
Whether/how to show this entry highlighted on the home page.
"off"(default): never highlighted."once": highlighted the first time a given browser visits the home page, then never again on that browser. Useful for drawing attention to a new or important entry without it becoming permanent background noise."always": always highlighted. Useful on a demo installation to permanently draw attention to a specific entry.
- class orangeqs.juice.dashboard.dashboard_load.DashboardCategory(/, **data: Any)#
Bases:
orangeqs.juice.dashboard.dashboard_load.DashboardEntryDashboard category. Appears on the home page and the navigation bar.
Note that a category entry also supports linking to a page. However, this link will only show up in the navigation bar, not on the homepage.
- pages: dict[str, orangeqs.juice.dashboard.dashboard_load.DashboardEntry]#
‘Field(…)’
Sub-pages under this category, keyed by unique keys.
- class orangeqs.juice.dashboard.dashboard_load.DashboardHandler(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableAn extra location for static files to be served by the StaticFileHandler.
- class orangeqs.juice.dashboard.dashboard_load.HandlersConfig(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableContainer for extra handlers registered by extensions.
- class orangeqs.juice.dashboard.dashboard_load.DashboardConfig(/, **data: Any)#
Bases:
orangeqs.juice.settings.ConfigurableConfiguration for the dashboard.
Defines the pages and categories that appears on the home page and navigation bar.
- categories: dict[str, orangeqs.juice.dashboard.dashboard_load.DashboardCategory]#
‘Field(…)’
Categories for the dashboard pages, keyed by unique keys.
- handlers: orangeqs.juice.dashboard.dashboard_load.HandlersConfig#
‘Field(…)’
Extra handlers registered by extensions.