From 317303fc43b3a0ac22bf90e871fca735c6120bce Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Sat, 8 Jul 2017 09:21:30 +0200 Subject: [PATCH] feat(image-details): image layer enhancements --- app/components/image/image.html | 40 +++++++++++++++++-------- app/components/image/imageController.js | 8 +++++ app/filters/filters.js | 4 +-- assets/css/app.css | 8 +++++ 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/app/components/image/image.html b/app/components/image/image.html index e8a780cb7..65a188905 100644 --- a/app/components/image/image.html +++ b/app/components/image/image.html @@ -175,29 +175,45 @@ - - - - + + - - + + diff --git a/app/components/image/imageController.js b/app/components/image/imageController.js index 0e4552532..f5c0c6142 100644 --- a/app/components/image/imageController.js +++ b/app/components/image/imageController.js @@ -6,6 +6,14 @@ function ($scope, $stateParams, $state, $timeout, ImageService, RegistryService, Registry: '' }; + $scope.sortType = 'Size'; + $scope.sortReverse = true; + + $scope.order = function(sortType) { + $scope.sortReverse = ($scope.sortType === sortType) ? !$scope.sortReverse : false; + $scope.sortType = sortType; + }; + $scope.toggleLayerCommand = function(layerId) { $('#layer-command-expander'+layerId+' span').toggleClass('glyphicon-plus-sign glyphicon-minus-sign'); $('#layer-command-'+layerId+'-short').toggle(); diff --git a/app/filters/filters.js b/app/filters/filters.js index 57096d633..b1201dcf7 100644 --- a/app/filters/filters.js +++ b/app/filters/filters.js @@ -272,9 +272,9 @@ angular.module('portainer.filters', []) return ''; }; }) -.filter('createdby', function () { +.filter('imagelayercommand', function () { 'use strict'; return function (createdBy) { - return createdBy.replace('/bin/sh -c #(nop) ','').replace('/bin/sh -c ', 'RUN '); + return createdBy.replace('/bin/sh -c #(nop) ', '').replace('/bin/sh -c ', 'RUN '); }; }); diff --git a/assets/css/app.css b/assets/css/app.css index 7be1a7fbb..3eb9b9c4e 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -281,6 +281,14 @@ a[ng-click]{ margin: 0 auto; } +ul.sidebar { + bottom: 40px; +} + +ul.sidebar .sidebar-title { + height: auto; +} + ul.sidebar .sidebar-list a.active { color: #fff; text-indent: 22px;
SizeLayer
+ + Size + + + + + + Layer + + + +
{{layer.Size|humansize}}
+ {{ layer.Size | humansize }} + -
+
- {{layer.CreatedBy|createdby|limitTo:100}}{{layer.CreatedBy.length > 100 ? '...' : ''}} + {{ layer.CreatedBy | imagelayercommand | truncate:130 }} + + + + +
-
+
- {{layer.CreatedBy|createdby}} + {{ layer.CreatedBy | imagelayercommand }}
-