mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-26 23:19:54 +03:00
feat: add support to THEME* options
This commit is contained in:
parent
3693662d98
commit
ef240ccf1d
4 changed files with 41 additions and 5 deletions
|
@ -12,6 +12,10 @@ sed -i "s~\${SHOW_CATALOG_NB_TAGS}~${SHOW_CATALOG_NB_TAGS}~" index.html
|
||||||
sed -i "s~\${HISTORY_CUSTOM_LABELS}~${HISTORY_CUSTOM_LABELS}~" index.html
|
sed -i "s~\${HISTORY_CUSTOM_LABELS}~${HISTORY_CUSTOM_LABELS}~" index.html
|
||||||
sed -i "s~\${USE_CONTROL_CACHE_HEADER}~${USE_CONTROL_CACHE_HEADER}~" index.html
|
sed -i "s~\${USE_CONTROL_CACHE_HEADER}~${USE_CONTROL_CACHE_HEADER}~" index.html
|
||||||
|
|
||||||
|
grep -o 'THEME[A-Z_]*' index.html | while read e; do
|
||||||
|
sed -i "s~\${$e}~$(printenv $e)~" index.html
|
||||||
|
done
|
||||||
|
|
||||||
if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then
|
if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then
|
||||||
sed -i "s/\${DELETE_IMAGES}/false/" index.html
|
sed -i "s/\${DELETE_IMAGES}/false/" index.html
|
||||||
else
|
else
|
||||||
|
|
11
dist/index.html
vendored
11
dist/index.html
vendored
|
@ -26,4 +26,15 @@
|
||||||
show-catalog-nb-tags="${SHOW_CATALOG_NB_TAGS}"
|
show-catalog-nb-tags="${SHOW_CATALOG_NB_TAGS}"
|
||||||
history-custom-labels="${HISTORY_CUSTOM_LABELS}"
|
history-custom-labels="${HISTORY_CUSTOM_LABELS}"
|
||||||
use-control-cache-header="${USE_CONTROL_CACHE_HEADER}"
|
use-control-cache-header="${USE_CONTROL_CACHE_HEADER}"
|
||||||
|
theme="${THEME}"
|
||||||
|
theme-primary-text="${THEME_PRIMARY_TEXT}"
|
||||||
|
theme-neutral-text="${THEME_NEUTRAL_TEXT}"
|
||||||
|
theme-background="${THEME_BACKGROUND}"
|
||||||
|
theme-hover-background="${THEME_HOVER_BACKGROUND}"
|
||||||
|
theme-accent-text="${THEME_ACCENT_TEXT}"
|
||||||
|
theme-header-text="${THEME_HEADER_TEXT}"
|
||||||
|
theme-header-background="${THEME_HEADER_BACKGROUND}"
|
||||||
|
theme-footer-text="${THEME_FOOTER_TEXT}"
|
||||||
|
theme-footer-neutra-text="${THEME_FOOTER_NEUTRAL_TEXT}"
|
||||||
|
theme-footer-background="${THEME_FOOTER_BACKGROUND}"
|
||||||
></docker-registry-ui><script src="docker-registry-ui.js"></script></body></html>
|
></docker-registry-ui><script src="docker-registry-ui.js"></script></body></html>
|
|
@ -1,10 +1,10 @@
|
||||||
import {extname} from 'path';
|
import { extname } from 'path';
|
||||||
|
|
||||||
const injectNode = (svg) => (`
|
const injectNode = (svg) => `
|
||||||
export default function() {
|
export default function() {
|
||||||
return (new DOMParser().parseFromString(${svg}, 'image/svg+xml'));
|
return (new DOMParser().parseFromString(${svg}, 'image/svg+xml'));
|
||||||
};
|
};
|
||||||
`);
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param options
|
* @param options
|
||||||
|
@ -13,7 +13,6 @@ export default function() {
|
||||||
* @param options.stringify - if true returns String, otherwise returns DOM Node
|
* @param options.stringify - if true returns String, otherwise returns DOM Node
|
||||||
*/
|
*/
|
||||||
export default function () {
|
export default function () {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: 'import-svg',
|
name: 'import-svg',
|
||||||
transform: (code, id) => {
|
transform: (code, id) => {
|
||||||
|
@ -26,4 +25,4 @@ export default function () {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -47,6 +47,17 @@
|
||||||
show-catalog-nb-tags="${SHOW_CATALOG_NB_TAGS}"
|
show-catalog-nb-tags="${SHOW_CATALOG_NB_TAGS}"
|
||||||
history-custom-labels="${HISTORY_CUSTOM_LABELS}"
|
history-custom-labels="${HISTORY_CUSTOM_LABELS}"
|
||||||
use-control-cache-header="${USE_CONTROL_CACHE_HEADER}"
|
use-control-cache-header="${USE_CONTROL_CACHE_HEADER}"
|
||||||
|
theme="${THEME}"
|
||||||
|
theme-primary-text="${THEME_PRIMARY_TEXT}"
|
||||||
|
theme-neutral-text="${THEME_NEUTRAL_TEXT}"
|
||||||
|
theme-background="${THEME_BACKGROUND}"
|
||||||
|
theme-hover-background="${THEME_HOVER_BACKGROUND}"
|
||||||
|
theme-accent-text="${THEME_ACCENT_TEXT}"
|
||||||
|
theme-header-text="${THEME_HEADER_TEXT}"
|
||||||
|
theme-header-background="${THEME_HEADER_BACKGROUND}"
|
||||||
|
theme-footer-text="${THEME_FOOTER_TEXT}"
|
||||||
|
theme-footer-neutra-text="${THEME_FOOTER_NEUTRAL_TEXT}"
|
||||||
|
theme-footer-background="${THEME_FOOTER_BACKGROUND}"
|
||||||
>
|
>
|
||||||
</docker-registry-ui>
|
</docker-registry-ui>
|
||||||
<!-- endbuild -->
|
<!-- endbuild -->
|
||||||
|
@ -62,6 +73,17 @@
|
||||||
show-catalog-nb-tags="true"
|
show-catalog-nb-tags="true"
|
||||||
history-custom-labels="first_custom_labels,second_custom_labels"
|
history-custom-labels="first_custom_labels,second_custom_labels"
|
||||||
use-control-cache-header="false"
|
use-control-cache-header="false"
|
||||||
|
theme="auto"
|
||||||
|
theme-primary-text=""
|
||||||
|
theme-neutral-text=""
|
||||||
|
theme-background=""
|
||||||
|
theme-hover-background=""
|
||||||
|
theme-accent-text=""
|
||||||
|
theme-header-text=""
|
||||||
|
theme-header-background=""
|
||||||
|
theme-footer-text=""
|
||||||
|
theme-footer-neutra-text=""
|
||||||
|
theme-footer-background=""
|
||||||
>
|
>
|
||||||
</docker-registry-ui>
|
</docker-registry-ui>
|
||||||
<!-- endbuild -->
|
<!-- endbuild -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue