fix(container-details): use container.Mounts instead of container.HostConfig.Binds (#1329)

pull/1315/head
Anthony Lapenna 2017-10-25 17:03:40 +02:00 committed by GitHub
parent 25f325bbaa
commit 77503b448e
2 changed files with 8 additions and 6 deletions

View File

@ -241,7 +241,7 @@
</div> </div>
</div> </div>
<div class="row" ng-if="container.HostConfig.Binds.length > 0"> <div class="row" ng-if="container.Mounts.length > 0">
<div class="col-lg-12 col-md-12 col-xs-12"> <div class="col-lg-12 col-md-12 col-xs-12">
<rd-widget> <rd-widget>
<rd-widget-header icon="fa-cubes" title="Volumes"></rd-widget-header> <rd-widget-header icon="fa-cubes" title="Volumes"></rd-widget-header>
@ -249,14 +249,15 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Host</th> <th>Host/volume</th>
<th>Container</th> <th>Path in container</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="vol in container.HostConfig.Binds"> <tr ng-repeat="vol in container.Mounts">
<td>{{ vol|key: ':' }}</td> <td ng-if="vol.Type === 'bind'">{{ vol.Source }}</td>
<td>{{ vol|value: ':' }}</td> <td ng-if="vol.Type === 'volume'"><a ui-sref="volume({id: vol.Name})">{{ vol.Name }}</a></td>
<td>{{ vol.Destination }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -9,6 +9,7 @@ function ContainerDetailsViewModel(data) {
this.Image = data.Image; this.Image = data.Image;
this.Config = data.Config; this.Config = data.Config;
this.HostConfig = data.HostConfig; this.HostConfig = data.HostConfig;
this.Mounts = data.Mounts;
if (data.Portainer) { if (data.Portainer) {
if (data.Portainer.ResourceControl) { if (data.Portainer.ResourceControl) {
this.ResourceControl = new ResourceControlViewModel(data.Portainer.ResourceControl); this.ResourceControl = new ResourceControlViewModel(data.Portainer.ResourceControl);