mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-27 23:50:01 +03:00
[fix-image-history] Sort elements attributes (os, id, created...)
This commit is contained in:
parent
5aaedfb0aa
commit
cb50dd42d8
2 changed files with 20 additions and 2 deletions
|
@ -208,7 +208,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
return !e.empty_layer;
|
||||
}).forEach(function(e, i) {
|
||||
e.size = self.layers[i].size;
|
||||
e.id = self.layers[i].digest;
|
||||
e.id = self.layers[i].digest.replace('sha256:', '');
|
||||
});
|
||||
self.trigger('creation-date', self.creationDate);
|
||||
self.trigger('blobs', self.blobs);
|
||||
|
|
|
@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
</div>
|
||||
|
||||
<material-card each="{ guiElement in registryUI.taghistory.elements }" class="tag-history-element">
|
||||
<div each="{ entry in guiElement }" class="{ entry.key }">
|
||||
<div each="{ entry in guiElement.sort(registryUI.taghistory.eltSort) }" class="{ entry.key }">
|
||||
<div class="headline"><i class="material-icons"></i>
|
||||
<p>{ entry.key.replace('_', ' ') }</p>
|
||||
</div>
|
||||
|
@ -40,6 +40,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
</material-card>
|
||||
<script type="text/javascript">
|
||||
registryUI.taghistory.instance = this;
|
||||
registryUI.taghistory.eltIdx = function(e) {
|
||||
switch (e) {
|
||||
case 'id': return 1;
|
||||
case 'created': return 2;
|
||||
case 'created_by': return 3;
|
||||
case 'size': return 4;
|
||||
case 'os': return 5;
|
||||
case 'architecture': return 6;
|
||||
case 'linux': return 7;
|
||||
case 'docker_version': return 8;
|
||||
case 'config': return 9;
|
||||
case 'container_config': return 10;
|
||||
default: return 10;
|
||||
}
|
||||
};
|
||||
registryUI.taghistory.eltSort = function(e1, e2) {
|
||||
return registryUI.taghistory.eltIdx(e1.key) - registryUI.taghistory.eltIdx(e2.key);
|
||||
};
|
||||
registryUI.taghistory.display = function() {
|
||||
registryUI.taghistory.elements = []
|
||||
let oReq = new Http();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue