diff --git a/src/js/client.js b/src/js/client.js index a325d7006..d0316b3d4 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -2665,6 +2665,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; + Client.prototype.getVolumeStatus = function (volume, callback) { + get('/api/v1/volumes/' + volume + '/status', null, function (error, data, status) { + if (error) return callback(error); + if (status !== 200) return callback(new ClientError(status, data)); + + callback(null, data); + }); + }; + Client.prototype.addVolume = function (name, hostPath, mountType, mountOptions, callback) { var data = { name: name, diff --git a/src/views/volumes.html b/src/views/volumes.html index e7c7c9b7e..d7130d6a5 100644 --- a/src/views/volumes.html +++ b/src/views/volumes.html @@ -10,6 +10,7 @@

{{ volumeConfigure.error }}

+

{{ volumeConfigure.volume.status.message }}

@@ -106,13 +107,18 @@ - - - + + + + + diff --git a/src/views/volumes.js b/src/views/volumes.js index b6421b3d6..4f88d301b 100644 --- a/src/views/volumes.js +++ b/src/views/volumes.js @@ -23,6 +23,15 @@ angular.module('Application').controller('VolumesController', ['$scope', '$locat if (error) return console.error(error); $scope.volumes = results; + + $scope.volumes.forEach(function (volume) { + Client.getVolumeStatus(volume.id, function (error, result) { + if (error) return console.error('Failed to fetch volume status', volume.name, error); + + volume.status = result; + }); + }); + if (callback) callback(); }); }
{{ 'volumes.name' | tr }}{{ 'volumes.hostPath' | tr }}{{ 'main.actions' | tr }}{{ 'volumes.name' | tr }}{{ 'volumes.hostPath' | tr }}{{ 'main.actions' | tr }}
+ + + {{ volume.name }}