diff --git a/app/components/volume/volume.html b/app/components/volume/volume.html
index 15ebfc41e..2b9d40af4 100644
--- a/app/components/volume/volume.html
+++ b/app/components/volume/volume.html
@@ -73,3 +73,26 @@
+
+
+
+
+
+
+
+ Container Name |
+ Mounted At |
+ Read-only |
+
+
+
+ {{ container | containername }} |
+ {{ container.volumeData.Destination }} |
+ {{ !container.volumeData.RW }} |
+
+
+
+
+
+
+
diff --git a/app/components/volume/volumeController.js b/app/components/volume/volumeController.js
index 16c165980..ac33300de 100644
--- a/app/components/volume/volumeController.js
+++ b/app/components/volume/volumeController.js
@@ -1,6 +1,6 @@
angular.module('volume', [])
-.controller('VolumeController', ['$scope', '$state', '$transition$', 'VolumeService', 'Notifications',
-function ($scope, $state, $transition$, VolumeService, Notifications) {
+.controller('VolumeController', ['$scope', '$state', '$transition$', 'VolumeService', 'ContainerService', 'Notifications',
+function ($scope, $state, $transition$, VolumeService, ContainerService, Notifications) {
$scope.removeVolume = function removeVolume() {
$('#loadingViewSpinner').show();
@@ -16,6 +16,12 @@ function ($scope, $state, $transition$, VolumeService, Notifications) {
$('#loadingViewSpinner').hide();
});
};
+
+ function getVolumeDataFromContainer(container, volumeId) {
+ return container.Mounts.find(function(volume) {
+ return volume.Name === volumeId;
+ });
+ }
function initView() {
$('#loadingViewSpinner').show();
@@ -23,6 +29,18 @@ function ($scope, $state, $transition$, VolumeService, Notifications) {
.then(function success(data) {
var volume = data;
$scope.volume = volume;
+ return ContainerService.containers(1, {
+ filters: {
+ volume: [volume.Id]
+ }
+ });
+ })
+ .then(function success(data) {
+ var containers = data.map(function(container) {
+ container.volumeData = getVolumeDataFromContainer(container, $scope.volume.Id);
+ return container;
+ });
+ $scope.containersUsingVolume = containers;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve volume details');
diff --git a/app/services/docker/containerService.js b/app/services/docker/containerService.js
index 21bd1c295..33daf016d 100644
--- a/app/services/docker/containerService.js
+++ b/app/services/docker/containerService.js
@@ -20,8 +20,8 @@ angular.module('portainer.services')
service.containers = function(all, filters) {
var deferred = $q.defer();
-
- Container.query({ all: all, filters: filters ? filters : {} }).$promise
+ filters.all = all;
+ Container.query(filters).$promise
.then(function success(data) {
var containers = data.map(function (item) {
return new ContainerViewModel(item);