diff --git a/README.md b/README.md index 67a9254b..65402908 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ Some env options are available for use this interface for **only one server**. - `DEFAULT_REGISTRIES`: List of comma separated registry URLs (e.g `http://registry.example.com,http://registry:5000`), available only when `SINGLE_REGISTRY=false`. (default: ` `). - `READ_ONLY_REGISTRIES`: Desactivate dialog for remove and add new registries, available only when `SINGLE_REGISTRY=false`. (default: `false`). - `SHOW_CATALOG_NB_TAGS`: Show number of tags per images on catalog page. This will produce + nb images requests, not recommended on large registries. (default: `false`). +- `HISTORY_CUSTOM_LABELS`: Expose custom labels in history page, custom labels will be processed like maintainer label. 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/). diff --git a/bin/entrypoint b/bin/entrypoint index ca0b934b..81a00314 100755 --- a/bin/entrypoint +++ b/bin/entrypoint @@ -9,6 +9,7 @@ sed -i "s~\${SHOW_CONTENT_DIGEST}~${SHOW_CONTENT_DIGEST}~" index.html sed -i "s~\${DEFAULT_REGISTRIES}~${DEFAULT_REGISTRIES}~" index.html sed -i "s~\${READ_ONLY_REGISTRIES}~${READ_ONLY_REGISTRIES}~" index.html sed -i "s~\${SHOW_CATALOG_NB_TAGS}~${SHOW_CATALOG_NB_TAGS}~" index.html +sed -i "s~\${HISTORY_CUSTOM_LABELS}~${HISTORY_CUSTOM_LABELS}~" index.html if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then sed -i "s/\${DELETE_IMAGES}/false/" index.html @@ -64,4 +65,4 @@ if [ "$(whoami)" != "root" ]; then sed -i "s,/var/run/nginx.pid,/tmp/nginx.pid," /etc/nginx/nginx.conf fi -sed -i "s,listen 80;,listen $NGINX_LISTEN_PORT;," /etc/nginx/conf.d/default.conf \ No newline at end of file +sed -i "s,listen 80;,listen $NGINX_LISTEN_PORT;," /etc/nginx/conf.d/default.conf diff --git a/src/components/docker-registry-ui.riot b/src/components/docker-registry-ui.riot index 094efeda..dc2e3f46 100644 --- a/src/components/docker-registry-ui.riot +++ b/src/components/docker-registry-ui.riot @@ -42,7 +42,7 @@ along with this program. If not, see . + on-authentication="{ onAuthentication }" history-custom-labels="{ stringToArray(props.historyCustomLabels) }"> . stripHttps, getRegistryServers, setRegistryServers, - truthy + truthy, + stringToArray } from '../scripts/utils'; import router from '../scripts/router'; @@ -175,7 +176,8 @@ along with this program. If not, see . baseRoute: '([^#]*?)/(\\?[^#]*?)?(#!)?(/?)', router, version, - truthy + truthy, + stringToArray } \ No newline at end of file diff --git a/src/components/tag-history/tag-history-element.riot b/src/components/tag-history/tag-history-element.riot index f25720e3..cd3050ae 100644 --- a/src/components/tag-history/tag-history-element.riot +++ b/src/components/tag-history/tag-history-element.riot @@ -15,17 +15,16 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
{ state.icon } +
+ { state.icon }

{ state.name }

-
{ state.value }
-
{ value }
+
{ state.value }
+
{ value }
- \ No newline at end of file + diff --git a/src/components/tag-history/tag-history.riot b/src/components/tag-history/tag-history.riot index 2ce8c1ed..1fc659f5 100644 --- a/src/components/tag-history/tag-history.riot +++ b/src/components/tag-history/tag-history.riot @@ -20,33 +20,35 @@ along with this program. If not, see . arrow_back -

- History of { props.image }:{ props.tag } history -

+

History of { props.image }:{ props.tag } history

- +
- + - + - \ No newline at end of file + diff --git a/src/index.html b/src/index.html index 9a96ddb8..d8364297 100644 --- a/src/index.html +++ b/src/index.html @@ -16,63 +16,78 @@ --> + + + + + + + + + + + + + + Docker Registry UI + - - - - - - - - - - - - - - Docker Registry UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/scripts/utils.js b/src/scripts/utils.js index ac820900..cd617015 100644 --- a/src/scripts/utils.js +++ b/src/scripts/utils.js @@ -76,7 +76,10 @@ export function getHistoryIcon(attribute) { case 'ExposedPorts': return 'router'; default: - ''; + if (attribute.startsWith('custom-label-')) { + return 'label'; + } + return ''; } } @@ -201,3 +204,7 @@ export function decodeURI(url) { export function truthy(value) { return value === true || value === 'true'; } + +export function stringToArray(value) { + return value && typeof value === 'string' ? value.split(',') : []; +}