diff --git a/docs/configurations/index.md b/docs/configurations/index.md index 5bcf72f73..87da6e14c 100644 --- a/docs/configurations/index.md +++ b/docs/configurations/index.md @@ -29,6 +29,15 @@ proxy configuration, and logging level configuration. | restHandlerClass | string | TBD | | customTab | Object | This property allows you to enable the [custom tab](../custom_ui_extensions/custom_tab.md) feature. | +### Tab components + +Instead of specifying a tab from scratch with above fields, you can add a predefined +tab. + +Currently available tab components: + +- [Logging tab](./logging.md) + ### Usage ```json @@ -49,6 +58,9 @@ proxy configuration, and logging level configuration. "options": { "saveValidator": "" } + }, + { + "type": "loggingTab" } ] } diff --git a/docs/configurations/logging.md b/docs/configurations/logging.md new file mode 100644 index 000000000..52b8db9ab --- /dev/null +++ b/docs/configurations/logging.md @@ -0,0 +1,62 @@ +The logging tab is a predefined component that allows to create the page for changing +the log level. It is added in the `pages.configuration.tabs` array + +![image](../images/configuration/logging_tab.png) + +### Minimal definition + +```json +{ + "type": "loggingTab" +} +``` + +This creates the tab seen in the image above with log levels: +DEBUG, INFO, WARNING, ERROR, CRITICAL. INFO is the default level. +The value is saved in `loglevel` config parameter. + +### Usage + +It is placed just like every other configuration tab. + +```json +{ + "pages": { + "configuration": { + "tabs": [ + { + "type": "loggingTab" + } + ], + "title": "Configuration", + "description": "..." + } + } +} +``` + +### Optional Fields + +| Field Name | Description | +|--------------|-------------------------------------------------------------------------------------------------| +| name | Tab name. Default is `logging` | +| title | Tab title. Default is `Logging` | +| label | Label text displayed next to the log level dropdown. Default is `Log level` | +| field | Configuration field name. Default is `loglevel` | +| levels | List of all possible log levels. Default is `["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]` | +| defaultLevel | Default log level at the beginning. Default is `INFO` | + +### Example + +```json +{ + "type": "loggingTab", + "name": "logging_other", + "title": "Logging other", + "label": "Log level", + "field": "loglevel", + "levels": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], + "defaultLevel": "INFO" +} +``` + diff --git a/docs/images/configuration/logging_tab.png b/docs/images/configuration/logging_tab.png new file mode 100644 index 000000000..cedd19e31 Binary files /dev/null and b/docs/images/configuration/logging_tab.png differ diff --git a/mkdocs.yml b/mkdocs.yml index f3f5de211..887268a3f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,7 @@ nav: - Configuration: - "configurations/index.md" - Introduction: "configurations/index.md" + - Logging: "configurations/logging.md" - Proxy: "configurations/proxy.md" - Dashboard: "dashboard.md" - Entity: