mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2026-04-21 02:06:44 +00:00
feat(pagination): Show only 100 first elements
This commit is contained in:
@@ -65,4 +65,10 @@ registryUI.getHistoryIcon = function(attribute) {
|
||||
default:
|
||||
''
|
||||
}
|
||||
}
|
||||
|
||||
registryUI.getPage = function(elts, page, limit) {
|
||||
if (!limit) { limit = 100; }
|
||||
if (!elts) { return []; }
|
||||
return elts.slice(page * limit, limit);
|
||||
}
|
||||
@@ -130,8 +130,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
return this.fillInfo();
|
||||
});
|
||||
this.on('get-date', function() {
|
||||
if (this.date !== undefined) {
|
||||
return this.trigger('date', this.date);
|
||||
if (this.creationDate !== undefined) {
|
||||
return this.trigger('creation-date', this.creationDate);
|
||||
}
|
||||
return this.fillInfo();
|
||||
});
|
||||
|
||||
@@ -24,5 +24,7 @@
|
||||
self.localDate = date.toLocaleString()
|
||||
self.update();
|
||||
});
|
||||
|
||||
opts.image.trigger('get-date');
|
||||
</script>
|
||||
</image-date>
|
||||
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<taglist>
|
||||
<!-- Begin of tag -->
|
||||
<material-card ref="taglist-tag" class="taglist" multi-delete={ this.multiDelete }>
|
||||
<material-card ref="taglist-tag" class="taglist" multi-delete={ this.multiDelete } tags={ registryUI.getPage(registryUI.taglist.tags, this.page) }>
|
||||
<div class="material-card-title-action">
|
||||
<material-button waves-center="true" rounded="true" waves-color="#ddd" onclick="registryUI.home();">
|
||||
<i class="material-icons">arrow_back</i>
|
||||
@@ -50,7 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr each="{ image in registryUI.taglist.tags }">
|
||||
<tr each="{ image in this.opts.tags }">
|
||||
<td class="material-card-th-left">{ image.name }</td>
|
||||
<td class="copy-to-clipboard">
|
||||
<copy-to-clipboard image={ image }/>
|
||||
@@ -76,6 +76,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</material-card>
|
||||
<script>
|
||||
var self = registryUI.taglist.instance = this;
|
||||
self.page = 0;
|
||||
|
||||
this.multiDelete = false;
|
||||
this.toDelete = 0;
|
||||
|
||||
Reference in New Issue
Block a user