1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 13:55:21 +02:00

Implement volumes, hide networks and volumes tabs for APIs older than v1.21.

This commit is contained in:
Kevan Ahlquist 2015-12-20 21:17:01 -06:00
parent 8a900254ae
commit eede27e263
7 changed files with 218 additions and 4 deletions

View file

@ -117,7 +117,7 @@ angular.module('dockerui.services', ['ngResource'])
get: {method: 'GET'}
});
}])
.factory('Network', ['$resource', 'Settings', function NetworksFactory($resource, Settings) {
.factory('Network', ['$resource', 'Settings', function NetworkFactory($resource, Settings) {
'use strict';
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#2-5-networks
return $resource(Settings.url + '/networks/:id/:action', {id: '@id'}, {
@ -129,6 +129,16 @@ angular.module('dockerui.services', ['ngResource'])
disconnect: {method: 'POST', params: {action: 'disconnect'}}
});
}])
.factory('Volume', ['$resource', 'Settings', function VolumeFactory($resource, Settings) {
'use strict';
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#2-5-networks
return $resource(Settings.url + '/volumes/:name/:action', {name: '@name'}, {
query: {method: 'GET'},
get: {method: 'GET'},
create: {method: 'POST', params: {action: 'create'}},
remove: {method: 'DELETE'}
});
}])
.factory('Settings', ['DOCKER_ENDPOINT', 'DOCKER_PORT', 'UI_VERSION', function SettingsFactory(DOCKER_ENDPOINT, DOCKER_PORT, UI_VERSION) {
'use strict';
var url = DOCKER_ENDPOINT;