* fix(containers): display a subset of the sha images name in the containers datatable

* Removed unnecessary filter

* refactor(common): improve trimshasum  filter

* refactor(common): improve trimshasum filter
pull/1545/head
Yassir Hannoun 2017-12-22 19:39:06 +01:00 committed by Anthony Lapenna
parent 8bf3f669d0
commit 1da64f2e75
2 changed files with 12 additions and 2 deletions

View File

@ -202,7 +202,7 @@
</div>
</td>
<td>{{ item.StackName ? item.StackName : '-' }}</td>
<td><a ui-sref="image({ id: item.Image })">{{ item.Image | hideshasum }}</a></td>
<td><a ui-sref="image({ id: item.Image })">{{ item.Image | trimshasum }}</a></td>
<td>{{ item.IP ? item.IP : '-' }}</td>
<td ng-if="$ctrl.swarmContainers">{{ item.hostIP }}</td>
<td>

View File

@ -345,4 +345,14 @@ angular.module('portainer.filters')
return function (createdBy) {
return createdBy.replace('/bin/sh -c #(nop) ', '').replace('/bin/sh -c ', 'RUN ');
};
});
})
.filter('trimshasum', function () {
'use strict';
return function (imageName) {
if (imageName.indexOf('sha256:') === 0) {
return imageName.substring(7, 19);
}
return imageName;
};
})
;