mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-29 16:39:54 +03:00
Release v1.1.0: Add PULL_URL
option for docker pull customisation
Closes: #71
This commit is contained in:
parent
14ca668d7f
commit
8ac91180d7
7 changed files with 9 additions and 5 deletions
|
@ -31,6 +31,7 @@ This web user interface uses [Riot](https://github.com/Riot/riot) the react-like
|
||||||
- Display image history (see #58)
|
- Display image history (see #58)
|
||||||
- Display image/tag count
|
- Display image/tag count
|
||||||
- Image aggregation (see #56)
|
- Image aggregation (see #56)
|
||||||
|
- Customise docker pull command on static registry UI (see #71)
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
@ -108,7 +109,8 @@ Some env options are available for use this interface for only one server.
|
||||||
- `URL`: set the static URL to use (You will need CORS configuration). Example: `http://127.0.0.1:5000`. (`Required`)
|
- `URL`: set the static URL to use (You will need CORS configuration). Example: `http://127.0.0.1:5000`. (`Required`)
|
||||||
- `REGISTRY_URL`: your docker registry URL to contact (CORS configuration is not needed). Example: `http://my-docker-container:5000`. (Can't be used with `URL`, since 0.3.2).
|
- `REGISTRY_URL`: your docker registry URL to contact (CORS configuration is not needed). Example: `http://my-docker-container:5000`. (Can't be used with `URL`, since 0.3.2).
|
||||||
- `DELETE_IMAGES`: if this variable is empty or `false`, delete feature is deactivated. It is activated otherwise.
|
- `DELETE_IMAGES`: if this variable is empty or `false`, delete feature is deactivated. It is activated otherwise.
|
||||||
- `REGISTRY_TITLE`: Set a custom title for your user interface when using `REGISTRY_URL` (since 0.3.4)
|
- `REGISTRY_TITLE`: Set a custom title for your user interface when using `REGISTRY_URL` (since 0.3.4).
|
||||||
|
- `PULL_URL`: Set a custom url for the docker pull command, this is useful when you use `REGISTRY_URL` and your registry is on a different host (since 1.1.0).
|
||||||
|
|
||||||
Example with `URL` option.
|
Example with `URL` option.
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
$@
|
$@
|
||||||
sed -i "s,\${URL},${URL}," scripts/docker-registry-ui.js
|
sed -i "s,\${URL},${URL}," scripts/docker-registry-ui.js
|
||||||
sed -i "s,\${REGISTRY_TITLE},${REGISTRY_TITLE}," scripts/docker-registry-ui.js
|
sed -i "s,\${REGISTRY_TITLE},${REGISTRY_TITLE}," scripts/docker-registry-ui.js
|
||||||
|
sed -i "s,\${PULL_URL},${PULL_URL}," scripts/docker-registry-ui.js
|
||||||
|
|
||||||
if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then
|
if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then
|
||||||
sed -i -r "s/(isImageRemoveActivated[:=])[^,;]*/\1false/" scripts/docker-registry-ui.js
|
sed -i -r "s/(isImageRemoveActivated[:=])[^,;]*/\1false/" scripts/docker-registry-ui.js
|
||||||
|
|
2
dist/scripts/docker-registry-ui-static.js
vendored
2
dist/scripts/docker-registry-ui-static.js
vendored
File diff suppressed because one or more lines are too long
2
dist/scripts/docker-registry-ui.js
vendored
2
dist/scripts/docker-registry-ui.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docker-registry-ui",
|
"name": "docker-registry-ui",
|
||||||
"version": "1.0.2",
|
"version": "1.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "./node_modules/gulp/bin/gulp.js build"
|
"build": "./node_modules/gulp/bin/gulp.js build"
|
||||||
},
|
},
|
||||||
|
|
|
@ -21,6 +21,7 @@ registryUI.url = function() {
|
||||||
registryUI.name = function() {
|
registryUI.name = function() {
|
||||||
return '${REGISTRY_TITLE}' || registryUI.url();
|
return '${REGISTRY_TITLE}' || registryUI.url();
|
||||||
};
|
};
|
||||||
|
registryUI.pullUrl = '${PULL_URL}';
|
||||||
registryUI.isImageRemoveActivated = true;
|
registryUI.isImageRemoveActivated = true;
|
||||||
registryUI.catalog = {};
|
registryUI.catalog = {};
|
||||||
registryUI.taglist = {};
|
registryUI.taglist = {};
|
||||||
|
|
|
@ -93,7 +93,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
return registryUI.snackbar(message, true);
|
return registryUI.snackbar(message, true);
|
||||||
};
|
};
|
||||||
registryUI.cleanName = function() {
|
registryUI.cleanName = function() {
|
||||||
const url = (registryUI.url() && registryUI.url().length > 0 && registryUI.url()) || window.location.host;
|
const url = registryUI.pullUrl || (registryUI.url() && registryUI.url().length > 0 && registryUI.url()) || window.location.host;
|
||||||
if (url) {
|
if (url) {
|
||||||
return url.startsWith('http') ? url.replace(/https?:\/\//, '') : url;
|
return url.startsWith('http') ? url.replace(/https?:\/\//, '') : url;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue