mirror of https://github.com/portainer/portainer
				
				
				
			* 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 filterpull/1545/head
							parent
							
								
									8bf3f669d0
								
							
						
					
					
						commit
						1da64f2e75
					
				| 
						 | 
				
			
			@ -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>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
  };
 | 
			
		||||
})
 | 
			
		||||
;
 | 
			
		||||
		Loading…
	
		Reference in New Issue