feat: show the number of images and repositories in catalog

This commit is contained in:
Joxit 2021-04-14 23:22:00 +02:00
parent 7a35d61359
commit 7eed05ae50
No known key found for this signature in database
GPG key ID: F526592B8E012263

View file

@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="material-card-title-action"> <div class="material-card-title-action">
<h2> <h2>
Repositories of { state.registryName } Repositories of { state.registryName }
<div class="item-count">{ state.length } images</div> <div class="item-count">{ state.nImages } images in { state.nRepositories } repositories</div>
</h2> </h2>
</div> </div>
</material-card> </material-card>
@ -90,7 +90,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
oReq.addEventListener('loadend', function () { oReq.addEventListener('loadend', function () {
self.update({ self.update({
repositories, repositories,
length: repositories.length, nRepositories: repositories.length,
nImages: repositories.reduce((acc, e) => acc + (e.images && e.images.length || 1), 0),
loadend: true loadend: true
}); });
}); });