mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
Add container size
This commit is contained in:
parent
b069616da2
commit
2d199eec5d
3 changed files with 15 additions and 1 deletions
|
@ -53,10 +53,20 @@ angular.module('dockerui.filters', [])
|
|||
return '';
|
||||
};
|
||||
})
|
||||
.filter('humansize', function() {
|
||||
return function(bytes) {
|
||||
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||
if (bytes == 0) {
|
||||
return 'n/a';
|
||||
}
|
||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
|
||||
};
|
||||
})
|
||||
.filter('getdate', function() {
|
||||
return function(data) {
|
||||
//Multiply by 1000 for the unix format
|
||||
var date = new Date(data * 1000);
|
||||
return date.toDateString();
|
||||
};
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue