webui.adoc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. [#customize-webui]
  2. = Customize the web UI
  3. The OliveTin web UI is reasonably customizable - parts of the page that you don't need can be hidden when they're not needed.
  4. == Page Title
  5. You can customize the page title;
  6. image::advanced_configuration/webui/page-title/page-title.png[]
  7. .`config.yaml`
  8. [source,yaml]
  9. ----
  10. pageTitle: My OliveTin Instance
  11. ----
  12. [#show-nav]
  13. == Navigation - show / hide
  14. You can choose to hide the navigation elements in OliveTin, to present a simplified user interface.
  15. .The default user interface with the sidebar shown
  16. image::advanced_configuration/webui/with-navigation/with-navigation.png[]
  17. To have OliveTin hide these buttons, add `showNavigation: false` to your config.yaml;
  18. .`config.yaml`
  19. [source,yaml]
  20. ----
  21. logLevel: "INFO"
  22. showNavigation: false
  23. actions:
  24. ....
  25. ----
  26. .The same user interface, but with the sidebar hidden (`showNavigation: false`)
  27. image::advanced_configuration/webui/hide-navigation/hide-navigation.png[]
  28. [#show-navigate-on-start-icons]
  29. == Navigate-on-start icons on action buttons
  30. When enabled (the default), each action button can show a small icon indicating what happens when the action is started:
  31. * **Popup dialog** — the action opens a popup (e.g. `onclick: execution-dialog`)
  32. * **Action history** — the action opens the action details page (e.g. `onclick: history`)
  33. * **Argument form** — the action opens an argument form on start
  34. * **Run in background** — the action runs without opening a dialog
  35. Set `showNavigateOnStartIcons: false` in your `config.yaml` to hide these indicator icons for a cleaner look.
  36. .`config.yaml`
  37. [source,yaml]
  38. ----
  39. showNavigateOnStartIcons: false
  40. ----
  41. [#section-navgiation-style]
  42. == Section Navigation Style
  43. `sectionNavigationStyle` - You can choose to have the section navigation buttons displayed as a Sidebar (`sidebar` - default), or along the top (`topbar`).
  44. === Sidebar navigation style (default)
  45. `sectionNavigationStyle: sidebar` looks like this;
  46. image::advanced_configuration/webui/sidebar/sidebar.png[]
  47. Root dashboards can optionally set a `category` field so the sidebar groups them under collapsible headings. See xref:dashboards/intro.adoc#categorize-dashboards-in-the-sidebar[Categorize dashboards in the sidebar].
  48. === Topbar navigation style
  49. `sectionNavigationStyle: topbar` looks like this;
  50. image::advanced_configuration/webui/topbar/topbar.png[]
  51. [#show-version-number]
  52. == Version number in the footer
  53. You can control whether the installed OliveTin version is shown in the web interface. When enabled (the default), the footer displays text like **OliveTin 2024.06.02**. When disabled, the footer shows only **OliveTin** with no version number.
  54. This is controlled by the **showVersionNumber** policy (in `defaultPolicy` or per user/group in ACLs). Hiding the version also hides any "new version available" link in the footer and redacts the version in xref:troubleshooting/server-diagnostics.adoc[server diagnostics] output, which can be useful for privacy when sharing reports.
  55. * xref:reference/version_display.adoc[Version display] — full configuration and policy examples
  56. [#show-new-versions]
  57. == New version available - show/hide
  58. You can disable the "new version" information in the footer - the default for `showNewVersions` is `true`;
  59. .`config.yaml`
  60. [source,yaml]
  61. ----
  62. logLevel: "INFO"
  63. showNewVersions: false
  64. ----
  65. OliveTin does not check for updates by default. To enable it, see xref:reference/updateChecks.adoc[enable update checking].
  66. [#show-footer]
  67. == Footer visibility - show / hide
  68. You can disable the entire footer, if you would like a really minimal interface. The default for `showFooter` is `true`.
  69. .`config.yaml`
  70. [source,yaml]
  71. ----
  72. logLevel: "INFO"
  73. showFooter: false
  74. ----
  75. This means the <<show-new-versions,`showNewVersions`>> configuration option will automatically be `false` as well.
  76. == Additional section navigation links
  77. You can add custom links to the OliveTin navigation bar. This is useful if you want to link to other OliveTin instances, or other web applications.
  78. [source,yaml]
  79. ----
  80. additionalNavigationLinks:
  81. - title: Duck Duck Go
  82. url: https://duckduckgo.com
  83. target: _blank
  84. ----
  85. This will render like this;
  86. image::additionalNavigationLinks.png[]
  87. [#custom-js]
  88. == Custom JavaScript
  89. This is considered an advanced feature, and is not recommended unless you like writing your own code.
  90. You can add custom JavaScript to OliveTin, which will be executed on every page load. This can be useful for adding custom functionality to the web UI.
  91. 1. The custom javascript should be in a file called `custom.js` and saved in `custom-webui/`, which should be in the same directory as your `config.yaml`.
  92. 2. You can put whatever code you like really in your `custom.js` file.
  93. 3. Set `enableCustomJs: true` in your `config.yaml` to enable this feature.
  94. 4. Restart OliveTin. Note that the custom JavaScript will only be loaded once on startup, so if you are changing the custom JavaScript while OliveTin is running, you will need to restart OliveTin to see the changes.
  95. If the browser blocks your script or network calls with Content Security Policy errors, see xref:security/content_security_policy.adoc[Content Security Policy headers] for how to adjust or disable the CSP sent by OliveTin.
  96. [#header-search]
  97. == Header search
  98. Header QuickSearch is an **alpha / experimental** opt-in feature. All `features.*` flags default to **off**. Enabling a flag is an explicit operator choice; see the project https://github.com/OliveTin/OliveTin/blob/main/SECURITY.md[security policy] (feature flags are out of scope for CVEs and security advisories until graduated).
  99. Enable it in `config.yaml`:
  100. [source,yaml]
  101. ----
  102. features:
  103. headerSearch: true
  104. ----
  105. When enabled, the header shows a search control that can jump to actions, dashboards, entities, and system navigation pages the user is already allowed to see. Refresh the browser after changing the flag so Init picks up the new value.
  106. Other `features.*` flags follow the same pattern: typed booleans under `features`, default false, exposed on Init for the web UI, and treated as alpha until graduated.
  107. == Custom CSS (with a custom theme)
  108. You can customize OliveTin with themes, but it's also possible to write your on very simple theme that contains just a few CSS rules to change the look and feel of OliveTin. This is very useful if you just want to change the colours of OliveTin, or hide a few elements.
  109. === Writing a simple theme with a CSS change
  110. You'll need to create a new theme, and let's assume our theme name is going to be called `uihack`. OliveTin themes are simply a directory of CSS and other assets. OliveTin looks for a directory called `custom-webui/themes/<theme-folder-name>` in the same directory as your `config.yaml` file.
  111. Start by creating a directory called `custom-webui/themes/uihack` relative to the same directory as your `config.yaml` file. In this directory, create a file called `theme.css`.
  112. [source,yaml]
  113. ----
  114. ├── config.yaml
  115. └── custom-webui
  116. └── themes
  117. └── uihack
  118. └── theme.css
  119. ----
  120. Here's an example of what your `theme.css` should contain;
  121. ```css
  122. body {
  123. background-color: red;
  124. }
  125. ```
  126. === Setup OliveTin config to use your theme
  127. Now you need to tell OliveTin to use your new theme. To do this, set `themeName: uihack` in your OliveTin config.yaml and restart OliveTin.
  128. ```yaml
  129. logLevel: "INFO"
  130. themeName: uihack
  131. ```
  132. [WARNING]
  133. OliveTin will by default only read theme.css once on startup. If you are intending to change theme.css while OliveTin is running, set `themeCacheDisabled: true` in your config.yaml. This will make OliveTin read theme.css on every request, and is useful for development.
  134. Restart OliveTin for the theme change to take effect. Beware of the theme cache mentioned above, if you are making changes to the CCS and refreshing the page a few times.
  135. * xref:reference/reference_themes_for_developers.adoc[More information on theme development]