Skip to content

Commit 9cfb679

Browse files
authored
feat(taglist): add new option TAGLIST_PAGE_SIZE (#318)
1 parent 4091baa commit 9cfb679

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Some env options are available for use this interface for **only one server** (w
102102
- `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
103103
- `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
104104
- `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
105+
- `TAGLIST_PAGE_SIZE`: Set the number of tags to display in one page. (default: `100`). Since 2.5.0
105106

106107
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/).
107108

bin/90-docker-registry-ui.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ sed -i "s~\${TAGLIST_ORDER}~${TAGLIST_ORDER}~" index.html
1515
sed -i "s~\${CATALOG_DEFAULT_EXPANDED}~${CATALOG_DEFAULT_EXPANDED}~" index.html
1616
sed -i "s~\${CATALOG_MIN_BRANCHES}~${CATALOG_MIN_BRANCHES}~" index.html
1717
sed -i "s~\${CATALOG_MAX_BRANCHES}~${CATALOG_MAX_BRANCHES}~" index.html
18+
sed -i "s~\${TAGLIST_PAGE_SIZE}~${TAGLIST_PAGE_SIZE}~" index.html
1819

1920
grep -o 'THEME[A-Z_]*' index.html | while read e; do
2021
sed -i "s~\${$e}~$(printenv $e)~" index.html

src/components/docker-registry-ui.riot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
7474
on-authentication="{ onAuthentication }"
7575
use-control-cache-header="{ truthy(props.useControlCacheHeader) }"
7676
taglist-order="{ props.taglistOrder }"
77+
tags-per-page="{ props.tagsPerPage }"
7778
></tag-list>
7879
</route>
7980
<route path="{baseRoute}taghistory/(.*)">

src/components/tag-list/tag-list.riot

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3939
<material-spinner></material-spinner>
4040
</div>
4141

42-
<pagination pages="{ getPageLabels(state.page, getNumPages(state.tags)) }" onPageUpdate="{onPageUpdate}"></pagination>
42+
<pagination
43+
pages="{ getPageLabels(state.page, getNumPages(state.tags, props.tagsPerPage)) }"
44+
onPageUpdate="{onPageUpdate}"
45+
></pagination>
4346

4447
<tag-table
4548
if="{ state.loadend }"
@@ -54,10 +57,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
5457
on-notify="{ props.onNotify }"
5558
filter-results="{ props.filterResults }"
5659
on-authentication="{ props.onAuthentication }"
60+
tags-per-page="{ props.tagsPerPage }"
5761
>
5862
</tag-table>
5963

60-
<pagination pages="{ getPageLabels(state.page, getNumPages(state.tags)) }" onPageUpdate="{onPageUpdate}"></pagination>
64+
<pagination
65+
pages="{ getPageLabels(state.page, getNumPages(state.tags, props.tagsPerPage)) }"
66+
onPageUpdate="{onPageUpdate}"
67+
></pagination>
6168

6269
<script>
6370
import { Http } from '../../scripts/http';

src/components/tag-list/tag-table.riot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
267267
});
268268
},
269269
getPage(tags, page) {
270-
const sortedTags = getPage(tags, page);
270+
const sortedTags = getPage(tags, page, this.props.tagsPerPage);
271271
if (this.state.orderType === 'date') {
272272
sortedTags.sort((e1, e2) =>
273273
!this.state.desc

src/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
theme-footer-text="${THEME_FOOTER_TEXT}"
6363
theme-footer-neutra-text="${THEME_FOOTER_NEUTRAL_TEXT}"
6464
theme-footer-background="${THEME_FOOTER_BACKGROUND}"
65+
tags-per-page="${TAGLIST_PAGE_SIZE}"
6566
>
6667
</docker-registry-ui>
6768
<!-- endbuild -->
@@ -92,6 +93,7 @@
9293
theme-footer-text=""
9394
theme-footer-neutra-text=""
9495
theme-footer-background=""
96+
tags-per-page=""
9597
>
9698
</docker-registry-ui>
9799
<!-- endbuild -->

0 commit comments

Comments
 (0)