feature: allow the customization of the title shown in the logo section

we already have REGISTRY_TITLE, but it is used as a reference to where the images come from: "Repositories of …". The UI however does not need to be used in a 1:1 context of the registry. Therefore, the project would benefit from this feature:

We therefore introduce "UI_TITLE" as a new option, that optionally allows to change the title for more advanced customization and to enable more use cases for this software.

If it is not set, everything will stay the same as prior to this commit and the title will remain "Docker Registry UI"

Note, that the footer will always contain a reference to this project. I think it doesn't need to referenced twice, and makes room for some more customization.
This commit is contained in:
Lukas Engelter 2024-03-13 18:27:53 +01:00
parent c2b7f415de
commit fbd33bf00b
4 changed files with 5 additions and 1 deletions

View File

@ -121,6 +121,7 @@ Some env options are available for use this interface for **only one server** (w
- `REGISTRY_SECURED`: By default, the UI will check on every requests if your registry is secured or not (you will see `401` responses in your console). Set to `true` if your registry uses Basic Authentication and divide by two the number of call to your registry. (default `false`). Since 2.5.0
There are some examples with [docker-compose](https://docs.docker.com/compose/) and docker-registry-ui as proxy [here](https://github.com/Joxit/docker-registry-ui/tree/main/examples/ui-as-proxy/) or docker-registry-ui as standalone [here](https://github.com/Joxit/docker-registry-ui/tree/main/examples/ui-as-standalone/).
- `UI_TITLE`: Set a custom title displayed in the header bar. (default: `Docker Registry UI`).
### Theme options

View File

@ -1,5 +1,6 @@
#!/bin/sh
sed -i "s~\${UI_TITLE}~${UI_TITLE}~" index.html
sed -i "s~\${REGISTRY_URL}~${REGISTRY_URL}~" index.html
sed -i "s~\${REGISTRY_TITLE}~${REGISTRY_TITLE}~" index.html
sed -i "s~\${PULL_URL}~${PULL_URL}~" index.html

View File

@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<header>
<material-navbar>
<span class="logo">
<span><a href="">Docker Registry UI</a></span>
<span><a href="">{ props.title || "Docker Registry UI"}</a></span>
<version-notification version="{ latest }" on-notify="{ notifySnackbar }"></version-notification>
</span>
<div class="menu">

View File

@ -35,6 +35,7 @@
<body>
<!-- build:keep production -->
<docker-registry-ui
title="${UI_TITLE}"
registry-url="${REGISTRY_URL}"
name="${REGISTRY_TITLE}"
pull-url="${PULL_URL}"
@ -70,6 +71,7 @@
<!-- endbuild -->
<!-- build:keep developement -->
<docker-registry-ui
title=""
registry-url=""
name="Development Registry"
pull-url=""