fix: delete button is displayed when DELETE_IMAGES is set to false

fixes #192
This commit is contained in:
Joxit 2021-05-20 18:49:15 +02:00
parent 4fcbea698b
commit 6c8b929e4f
No known key found for this signature in database
GPG key ID: F526592B8E012263
3 changed files with 13 additions and 6 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "docker-registry-ui", "name": "docker-registry-ui",
"version": "2.0.1", "version": "2.0.2",
"scripts": { "scripts": {
"start": "ROLLUP_SERVE=true rollup -c -w", "start": "ROLLUP_SERVE=true rollup -c -w",
"build": "rollup -c", "build": "rollup -c",

View file

@ -32,14 +32,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</route> </route>
<route path="{baseRoute}taglist/(.*)"> <route path="{baseRoute}taglist/(.*)">
<tag-list registry-url="{ state.registryUrl }" registry-name="{ state.name }" pull-url="{ state.pullUrl }" <tag-list registry-url="{ state.registryUrl }" registry-name="{ state.name }" pull-url="{ state.pullUrl }"
image="{ router.getTagListImage() }" show-content-digest="{props.showContentDigest}" image="{ router.getTagListImage() }" show-content-digest="{ truthy(props.showContentDigest) }"
is-image-remove-activated="{props.isImageRemoveActivated}" on-notify="{ notifySnackbar }" is-image-remove-activated="{ truthy(props.isImageRemoveActivated) }" on-notify="{ notifySnackbar }"
filter-results="{ state.filter }" on-authentication="{ onAuthentication }"></tag-list> filter-results="{ state.filter }" on-authentication="{ onAuthentication }"></tag-list>
</route> </route>
<route path="{baseRoute}taghistory/(.*)"> <route path="{baseRoute}taghistory/(.*)">
<tag-history registry-url="{ state.registryUrl }" registry-name="{ state.name }" pull-url="{ state.pullUrl }" <tag-history registry-url="{ state.registryUrl }" registry-name="{ state.name }" pull-url="{ state.pullUrl }"
image="{ router.getTagHistoryImage() }" tag="{ router.getTagHistoryTag() }" image="{ router.getTagHistoryImage() }" tag="{ router.getTagHistoryTag() }"
is-image-remove-activated="{ props.isImageRemoveActivated }" on-notify="{ notifySnackbar }" is-image-remove-activated="{ truthy(props.isImageRemoveActivated) }" on-notify="{ notifySnackbar }"
on-authentication="{ onAuthentication }"></tag-history> on-authentication="{ onAuthentication }"></tag-history>
</route> </route>
</router> </router>
@ -76,7 +76,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import SearchBar from './search-bar.riot' import SearchBar from './search-bar.riot'
import { import {
stripHttps, stripHttps,
getRegistryServers getRegistryServers,
truthy
} from '../scripts/utils'; } from '../scripts/utils';
import router from '../scripts/router'; import router from '../scripts/router';
@ -95,6 +96,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
state.snackbarMessage = undefined; state.snackbarMessage = undefined;
}, },
onBeforeMount(props) { onBeforeMount(props) {
console.log(props)
// props.singleRegistry === 'true' means old static version // props.singleRegistry === 'true' means old static version
this.state.registryUrl = props.registryUrl || this.state.registryUrl = props.registryUrl ||
(props.singleRegistry === 'true' ? undefined : (router.getUrlQueryParam() || getRegistryServers(0))) || (props.singleRegistry === 'true' ? undefined : (router.getUrlQueryParam() || getRegistryServers(0))) ||
@ -164,7 +166,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
}, },
baseRoute: '([^#]*?)/(\\?[^#]*?)?(#!)?(/?)', baseRoute: '([^#]*?)/(\\?[^#]*?)?(#!)?(/?)',
router, router,
version version,
truthy
} }
</script> </script>
</docker-registry-ui> </docker-registry-ui>

View file

@ -172,4 +172,8 @@ export function decodeURI(url) {
return; return;
} }
return url.startsWith('http') ? window.decodeURIComponent(url) : atob(url); return url.startsWith('http') ? window.decodeURIComponent(url) : atob(url);
}
export function truthy(value) {
return value === true || value === "true";
} }