diff --git a/app/__module.js b/app/__module.js
index 843fe2239..45dfe4e31 100644
--- a/app/__module.js
+++ b/app/__module.js
@@ -20,6 +20,7 @@ angular.module('portainer', [
'containerConsole',
'containerLogs',
'containerStats',
+ 'containerInspect',
'serviceLogs',
'containers',
'createContainer',
diff --git a/app/components/container/container.html b/app/components/container/container.html
index 34590f292..f3dd69639 100644
--- a/app/components/container/container.html
+++ b/app/components/container/container.html
@@ -83,6 +83,7 @@
Stats
Logs
Console
+ Inspect
diff --git a/app/components/containerInspect/containerInspect.html b/app/components/containerInspect/containerInspect.html
new file mode 100644
index 000000000..200b7cd58
--- /dev/null
+++ b/app/components/containerInspect/containerInspect.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Containers > {{ containerInfo.Name|trimcontainername }} > Inspect
+
+
+
+
+
+
+
+
+
+ {{ containerInfo|json:4 }}
+
+
+
+
diff --git a/app/components/containerInspect/containerInspectController.js b/app/components/containerInspect/containerInspectController.js
new file mode 100644
index 000000000..ae1740630
--- /dev/null
+++ b/app/components/containerInspect/containerInspectController.js
@@ -0,0 +1,20 @@
+angular.module('containerInspect', [])
+.controller('ContainerInspectController', ['$scope', '$transition$', 'Notifications', 'ContainerService',
+function ($scope, $transition$, Notifications, ContainerService) {
+ function initView() {
+ $('#loadingViewSpinner').show();
+
+ ContainerService.inspect($transition$.params().id)
+ .then(function success(d) {
+ $scope.containerInfo = d;
+ })
+ .catch(function error(e) {
+ Notifications.error('Failure', e, 'Unable to inspect container');
+ })
+ .finally(function final() {
+ $('#loadingViewSpinner').hide();
+ });
+ }
+
+ initView();
+}]);
diff --git a/app/rest/docker/container.js b/app/rest/docker/container.js
index d8786cb03..25ab3b2da 100644
--- a/app/rest/docker/container.js
+++ b/app/rest/docker/container.js
@@ -40,6 +40,9 @@ angular.module('portainer.rest')
exec: {
method: 'POST', params: {id: '@id', action: 'exec'},
transformResponse: genericHandler
+ },
+ inspect: {
+ method: 'GET', params: { id: '@id', action: 'json' }
}
});
}]);
diff --git a/app/routes.js b/app/routes.js
index 0232c3d6d..87adbf0f6 100644
--- a/app/routes.js
+++ b/app/routes.js
@@ -105,6 +105,19 @@ function configureRoutes($stateProvider) {
}
}
})
+ .state('inspect', {
+ url: '^/containers/:id/inspect',
+ views: {
+ 'content@': {
+ templateUrl: 'app/components/containerInspect/containerInspect.html',
+ controller: 'ContainerInspectController'
+ },
+ 'sidebar@': {
+ templateUrl: 'app/components/sidebar/sidebar.html',
+ controller: 'SidebarController'
+ }
+ }
+ })
.state('dashboard', {
parent: 'root',
url: '/dashboard',
diff --git a/app/services/docker/containerService.js b/app/services/docker/containerService.js
index 33daf016d..4065046b0 100644
--- a/app/services/docker/containerService.js
+++ b/app/services/docker/containerService.js
@@ -140,18 +140,11 @@ angular.module('portainer.services')
};
service.containerTop = function(id) {
- var deferred = $q.defer();
-
- Container.top({id: id}).$promise
- .then(function success(data) {
- var containerTop = data;
- deferred.resolve(containerTop);
- })
- .catch(function error(err) {
- deferred.reject(err);
- });
-
- return deferred.promise;
+ return Container.top({id: id}).$promise;
+ };
+
+ service.inspect = function(id) {
+ return Container.inspect({id: id}).$promise;
};
return service;