mirror of https://github.com/portainer/portainer
Add container naming to container display
parent
2946a97f41
commit
e3f804ef88
|
@ -14,5 +14,5 @@ angular.module('dockerui', ['dockerui.services', 'dockerui.filters'])
|
||||||
// You need to set this to the api endpoint without the port i.e. http://192.168.1.9
|
// You need to set this to the api endpoint without the port i.e. http://192.168.1.9
|
||||||
.constant('DOCKER_ENDPOINT', '/dockerapi')
|
.constant('DOCKER_ENDPOINT', '/dockerapi')
|
||||||
.constant('DOCKER_PORT', '') // Docker port, leave as an empty string if no port is requred. If you have a port, prefix it with a ':' i.e. :4243
|
.constant('DOCKER_PORT', '') // Docker port, leave as an empty string if no port is requred. If you have a port, prefix it with a ':' i.e. :4243
|
||||||
.constant('UI_VERSION', 'v0.3')
|
.constant('UI_VERSION', 'v0.4')
|
||||||
.constant('DOCKER_API_VERSION', 'v1.4');
|
.constant('DOCKER_API_VERSION', 'v1.4');
|
||||||
|
|
|
@ -62,6 +62,12 @@ angular.module('dockerui.filters', [])
|
||||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
||||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
|
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
|
||||||
};
|
};
|
||||||
|
})
|
||||||
|
.filter('containername', function() {
|
||||||
|
return function(container) {
|
||||||
|
var name = container.Names[0];
|
||||||
|
return name.substring(1, name.length);
|
||||||
|
};
|
||||||
})
|
})
|
||||||
.filter('getdate', function() {
|
.filter('getdate', function() {
|
||||||
return function(data) {
|
return function(data) {
|
||||||
|
|
|
@ -15,4 +15,5 @@ function ContainerViewModel(data) {
|
||||||
this.SizeRw = data.SizeRw;
|
this.SizeRw = data.SizeRw;
|
||||||
this.Status = data.Status;
|
this.Status = data.Status;
|
||||||
this.Checked = false;
|
this.Checked = false;
|
||||||
|
this.Names = data.Names;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,22 +22,20 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" ng-model="toggle" ng-click="toggleSelectAll()" /> Action</th>
|
<th><input type="checkbox" ng-model="toggle" ng-click="toggleSelectAll()" /> Action</th>
|
||||||
<th>Id</th>
|
<th>Name</th>
|
||||||
<th>Image</th>
|
<th>Image</th>
|
||||||
<th>Command</th>
|
<th>Command</th>
|
||||||
<th>Created</th>
|
<th>Created</th>
|
||||||
<th>Size</th>
|
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="container in containers|orderBy:predicate">
|
<tr ng-repeat="container in containers|orderBy:predicate">
|
||||||
<td><input type="checkbox" ng-model="container.Checked" /></td>
|
<td><input type="checkbox" ng-model="container.Checked" /></td>
|
||||||
<td><a href="/#/containers/{{ container.Id }}/">{{ container.Id|truncate:10}}</a></td>
|
<td><a href="/#/containers/{{ container|containername }}/">{{ container|containername}}</a></td>
|
||||||
<td><a href="/#/images/{{ container.Image }}/">{{ container.Image }}</a></td>
|
<td><a href="/#/images/{{ container.Image }}/">{{ container.Image }}</a></td>
|
||||||
<td>{{ container.Command|truncate:40 }}</td>
|
<td>{{ container.Command|truncate:40 }}</td>
|
||||||
<td>{{ container.Created|getdate }}</td>
|
<td>{{ container.Created|getdate }}</td>
|
||||||
<td>{{ container.SizeRw|humansize }}</td>
|
|
||||||
<td><span class="label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span></td>
|
<td><span class="label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue