diff --git a/api/http/proxy/transport.go b/api/http/proxy/transport.go
index 35ee6cf2d..11d98c3d6 100644
--- a/api/http/proxy/transport.go
+++ b/api/http/proxy/transport.go
@@ -66,6 +66,8 @@ func (p *proxyTransport) proxyDockerRequest(request *http.Request) (*http.Respon
return p.proxySecretRequest(request)
case strings.HasPrefix(path, "/swarm"):
return p.proxySwarmRequest(request)
+ case strings.HasPrefix(path, "/nodes"):
+ return p.proxyNodeRequest(request)
default:
return p.executeDockerRequest(request)
}
@@ -186,6 +188,17 @@ func (p *proxyTransport) proxySecretRequest(request *http.Request) (*http.Respon
}
}
+func (p *proxyTransport) proxyNodeRequest(request *http.Request) (*http.Response, error) {
+ requestPath := request.URL.Path
+
+ // assume /nodes/{id}
+ if path.Base(requestPath) != "nodes" {
+ return p.administratorOperation(request)
+ }
+
+ return p.executeDockerRequest(request)
+}
+
func (p *proxyTransport) proxySwarmRequest(request *http.Request) (*http.Response, error) {
return p.administratorOperation(request)
}
diff --git a/app/components/swarm/swarm.html b/app/components/swarm/swarm.html
index c585b0cb3..bb243ef32 100644
--- a/app/components/swarm/swarm.html
+++ b/app/components/swarm/swarm.html
@@ -223,7 +223,10 @@
- {{ node.Hostname }} |
+
+ {{ node.Hostname }}
+ {{ node.Hostname }}
+ |
{{ node.Role }} |
{{ node.CPUs / 1000000000 }} |
{{ node.Memory|humansize }} |
diff --git a/app/components/swarm/swarmController.js b/app/components/swarm/swarmController.js
index 99cdbf31c..131345df1 100644
--- a/app/components/swarm/swarmController.js
+++ b/app/components/swarm/swarmController.js
@@ -1,6 +1,6 @@
angular.module('swarm', [])
-.controller('SwarmController', ['$q', '$scope', 'SystemService', 'NodeService', 'Pagination', 'Notifications',
-function ($q, $scope, SystemService, NodeService, Pagination, Notifications) {
+.controller('SwarmController', ['$q', '$scope', 'SystemService', 'NodeService', 'Pagination', 'Notifications', 'StateManager', 'Authentication',
+function ($q, $scope, SystemService, NodeService, Pagination, Notifications, StateManager, Authentication) {
$scope.state = {};
$scope.state.pagination_count = Pagination.getPaginationCount('swarm_nodes');
$scope.sortType = 'Spec.Role';
@@ -73,6 +73,13 @@ function ($q, $scope, SystemService, NodeService, Pagination, Notifications) {
function initView() {
$('#loadingViewSpinner').show();
+
+ if (StateManager.getState().application.authentication) {
+ var userDetails = Authentication.getUserDetails();
+ var isAdmin = userDetails.role === 1 ? true: false;
+ $scope.isAdmin = isAdmin;
+ }
+
var provider = $scope.applicationState.endpoint.mode.provider;
$q.all({
version: SystemService.version(),