tags per page

This commit is contained in:
Artur Mostowski 2023-05-29 14:08:05 +02:00
parent 4091baa341
commit 6038106063
5 changed files with 14 additions and 3 deletions

View File

@ -102,6 +102,7 @@ Some env options are available for use this interface for **only one server** (w
- `CATALOG_DEFAULT_EXPANDED`: Expand by default all repositories in catalog (see [#302](https://github.com/Joxit/docker-registry-ui/issues/302)). (default: `false`). Since 2.5.0
- `CATALOG_MIN_BRANCHES`: Set the minimum repository/namespace to expand (e.g. `joxit/docker-registry-ui` `joxit/` is the repository/namespace). Can be 0 to disable branching. (see [#319](https://github.com/Joxit/docker-registry-ui/pull/319)). (default: `1`). Since 2.5.0
- `CATALOG_MAX_BRANCHES`: Set the maximum repository/namespace to expand (e.g. `joxit/docker-registry-ui` `joxit/` is the repository/namespace). Can be 0 to disable branching. (see [#319](https://github.com/Joxit/docker-registry-ui/pull/319)). (default: `1`). Since 2.5.0
- `TAGS_PER_PAGE`: Number of specific image tags shown per page. (default: `100`).
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/).

View File

@ -74,6 +74,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
on-authentication="{ onAuthentication }"
use-control-cache-header="{ truthy(props.useControlCacheHeader) }"
taglist-order="{ props.taglistOrder }"
tags-per-page="{ props.tagsPerPage }"
></tag-list>
</route>
<route path="{baseRoute}taghistory/(.*)">

View File

@ -39,7 +39,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<material-spinner></material-spinner>
</div>
<pagination pages="{ getPageLabels(state.page, getNumPages(state.tags)) }" onPageUpdate="{onPageUpdate}"></pagination>
<pagination
pages="{ getPageLabels(state.page, getNumPages(state.tags, props.tagsPerPage)) }"
onPageUpdate="{onPageUpdate}"
></pagination>
<tag-table
if="{ state.loadend }"
@ -54,10 +57,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
on-notify="{ props.onNotify }"
filter-results="{ props.filterResults }"
on-authentication="{ props.onAuthentication }"
tags-per-page="{ props.tagsPerPage }"
>
</tag-table>
<pagination pages="{ getPageLabels(state.page, getNumPages(state.tags)) }" onPageUpdate="{onPageUpdate}"></pagination>
<pagination
pages="{ getPageLabels(state.page, getNumPages(state.tags, props.tagsPerPage)) }"
onPageUpdate="{onPageUpdate}"
></pagination>
<script>
import { Http } from '../../scripts/http';

View File

@ -267,7 +267,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
});
},
getPage(tags, page) {
const sortedTags = getPage(tags, page);
const sortedTags = getPage(tags, page, this.props.tagsPerPage);
if (this.state.orderType === 'date') {
sortedTags.sort((e1, e2) =>
!this.state.desc

View File

@ -62,6 +62,7 @@
theme-footer-text="${THEME_FOOTER_TEXT}"
theme-footer-neutra-text="${THEME_FOOTER_NEUTRAL_TEXT}"
theme-footer-background="${THEME_FOOTER_BACKGROUND}"
tags-per-page="${TAGS_PER_PAGE}"
>
</docker-registry-ui>
<!-- endbuild -->
@ -92,6 +93,7 @@
theme-footer-text=""
theme-footer-neutra-text=""
theme-footer-background=""
tags-per-page="10"
>
</docker-registry-ui>
<!-- endbuild -->