mirror of https://github.com/portainer/portainer
fix(images): show image usage only if endpoint API version >= 1.25 (#1067)
parent
aca4f5c286
commit
3919ad3ccf
|
@ -70,7 +70,7 @@
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<input type="text" id="filter" ng-model="state.filter" placeholder="Filter..." class="form-control input-sm" />
|
<input type="text" id="filter" ng-model="state.filter" placeholder="Filter..." class="form-control input-sm" />
|
||||||
</div>
|
</div>
|
||||||
<span class="btn-group btn-group-sm pull-right" style="margin-right: 20px;" ng-if="applicationState.endpoint.mode.provider !== 'DOCKER_SWARM'">
|
<span class="btn-group btn-group-sm pull-right" style="margin-right: 20px;" ng-if="applicationState.endpoint.mode.provider !== 'DOCKER_SWARM' && applicationState.endpoint.apiVersion >= 1.25">
|
||||||
<label class="btn btn-primary" ng-model="state.containersCountFilter" uib-btn-radio="undefined">
|
<label class="btn btn-primary" ng-model="state.containersCountFilter" uib-btn-radio="undefined">
|
||||||
All
|
All
|
||||||
</label>
|
</label>
|
||||||
|
@ -125,7 +125,11 @@
|
||||||
<td><input type="checkbox" ng-model="image.Checked" ng-change="selectItem(image)" /></td>
|
<td><input type="checkbox" ng-model="image.Checked" ng-change="selectItem(image)" /></td>
|
||||||
<td>
|
<td>
|
||||||
<a class="monospaced" ui-sref="image({id: image.Id})">{{ image.Id|truncate:20}}</a>
|
<a class="monospaced" ui-sref="image({id: image.Id})">{{ image.Id|truncate:20}}</a>
|
||||||
<span style="margin-left: 10px;" class="label label-warning image-tag" ng-if="::image.Containers === 0 && applicationState.endpoint.mode.provider !== 'DOCKER_SWARM'">Unused</span></td>
|
<span style="margin-left: 10px;" class="label label-warning image-tag"
|
||||||
|
ng-if="::image.Containers === 0 && applicationState.endpoint.mode.provider !== 'DOCKER_SWARM' && applicationState.endpoint.apiVersion >= 1.25">
|
||||||
|
Unused
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="label label-primary image-tag" ng-repeat="tag in (image|repotags)">{{ tag }}</span>
|
<span class="label label-primary image-tag" ng-repeat="tag in (image|repotags)">{{ tag }}</span>
|
||||||
</td>
|
</td>
|
||||||
|
@ -135,7 +139,7 @@
|
||||||
<tr ng-if="!images">
|
<tr ng-if="!images">
|
||||||
<td colspan="5" class="text-center text-muted">Loading...</td>
|
<td colspan="5" class="text-center text-muted">Loading...</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr ng-if="images.length == 0">
|
<tr ng-if="state.filteredImages.length === 0">
|
||||||
<td colspan="5" class="text-center text-muted">No images available.</td>
|
<td colspan="5" class="text-center text-muted">No images available.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -94,7 +94,8 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService)
|
||||||
function fetchImages() {
|
function fetchImages() {
|
||||||
$('#loadImagesSpinner').show();
|
$('#loadImagesSpinner').show();
|
||||||
var endpointProvider = $scope.applicationState.endpoint.mode.provider;
|
var endpointProvider = $scope.applicationState.endpoint.mode.provider;
|
||||||
ImageService.images(endpointProvider !== 'DOCKER_SWARM')
|
var apiVersion = $scope.applicationState.endpoint.apiVersion;
|
||||||
|
ImageService.images(apiVersion >= 1.25 && endpointProvider !== 'DOCKER_SWARM')
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
$scope.images = data;
|
$scope.images = data;
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue