mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
feat(settings): add settings management (#906)
This commit is contained in:
parent
5e74a3993b
commit
c7e306841a
93 changed files with 1086 additions and 457 deletions
9
app/rest/api/auth.js
Normal file
9
app/rest/api/auth.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('Auth', ['$resource', 'AUTH_ENDPOINT', function AuthFactory($resource, AUTH_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(AUTH_ENDPOINT, {}, {
|
||||
login: {
|
||||
method: 'POST'
|
||||
}
|
||||
});
|
||||
}]);
|
12
app/rest/api/endpoint.js
Normal file
12
app/rest/api/endpoint.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('Endpoints', ['$resource', 'ENDPOINTS_ENDPOINT', function EndpointsFactory($resource, ENDPOINTS_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(ENDPOINTS_ENDPOINT + '/:id/:action', {}, {
|
||||
create: { method: 'POST' },
|
||||
query: { method: 'GET', isArray: true },
|
||||
get: { method: 'GET', params: { id: '@id' } },
|
||||
update: { method: 'PUT', params: { id: '@id' } },
|
||||
updateAccess: { method: 'PUT', params: { id: '@id', action: 'access' } },
|
||||
remove: { method: 'DELETE', params: { id: '@id'} }
|
||||
});
|
||||
}]);
|
10
app/rest/api/resourceControl.js
Normal file
10
app/rest/api/resourceControl.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('ResourceControl', ['$resource', 'RESOURCE_CONTROL_ENDPOINT', function ResourceControlFactory($resource, RESOURCE_CONTROL_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(RESOURCE_CONTROL_ENDPOINT + '/:id', {}, {
|
||||
create: { method: 'POST' },
|
||||
get: { method: 'GET', params: { id: '@id' } },
|
||||
update: { method: 'PUT', params: { id: '@id' } },
|
||||
remove: { method: 'DELETE', params: { id: '@id'} }
|
||||
});
|
||||
}]);
|
8
app/rest/api/settings.js
Normal file
8
app/rest/api/settings.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('Settings', ['$resource', 'SETTINGS_ENDPOINT', function SettingsFactory($resource, SETTINGS_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(SETTINGS_ENDPOINT, {}, {
|
||||
get: { method: 'GET' },
|
||||
update: { method: 'PUT' }
|
||||
});
|
||||
}]);
|
7
app/rest/api/status.js
Normal file
7
app/rest/api/status.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('Status', ['$resource', 'STATUS_ENDPOINT', function StatusFactory($resource, STATUS_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(STATUS_ENDPOINT, {}, {
|
||||
get: { method: 'GET' }
|
||||
});
|
||||
}]);
|
12
app/rest/api/team.js
Normal file
12
app/rest/api/team.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('Teams', ['$resource', 'TEAMS_ENDPOINT', function TeamsFactory($resource, TEAMS_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(TEAMS_ENDPOINT + '/:id/:entity/:entityId', {}, {
|
||||
create: { method: 'POST' },
|
||||
query: { method: 'GET', isArray: true },
|
||||
get: { method: 'GET', params: { id: '@id' } },
|
||||
update: { method: 'PUT', params: { id: '@id' } },
|
||||
remove: { method: 'DELETE', params: { id: '@id'} },
|
||||
queryMemberships: { method: 'GET', isArray: true, params: { id: '@id', entity: 'memberships' } }
|
||||
});
|
||||
}]);
|
10
app/rest/api/teamMembership.js
Normal file
10
app/rest/api/teamMembership.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('TeamMemberships', ['$resource', 'TEAM_MEMBERSHIPS_ENDPOINT', function TeamMembershipsFactory($resource, TEAM_MEMBERSHIPS_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(TEAM_MEMBERSHIPS_ENDPOINT + '/:id/:action', {}, {
|
||||
create: { method: 'POST' },
|
||||
query: { method: 'GET', isArray: true },
|
||||
update: { method: 'PUT', params: { id: '@id' } },
|
||||
remove: { method: 'DELETE', params: { id: '@id'} }
|
||||
});
|
||||
}]);
|
6
app/rest/api/template.js
Normal file
6
app/rest/api/template.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('Template', ['$resource', 'TEMPLATES_ENDPOINT', function TemplateFactory($resource, TEMPLATES_ENDPOINT) {
|
||||
return $resource(TEMPLATES_ENDPOINT, {}, {
|
||||
get: {method: 'GET', isArray: true}
|
||||
});
|
||||
}]);
|
17
app/rest/api/user.js
Normal file
17
app/rest/api/user.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
angular.module('portainer.rest')
|
||||
.factory('Users', ['$resource', 'USERS_ENDPOINT', function UsersFactory($resource, USERS_ENDPOINT) {
|
||||
'use strict';
|
||||
return $resource(USERS_ENDPOINT + '/:id/:entity/:entityId', {}, {
|
||||
create: { method: 'POST' },
|
||||
query: { method: 'GET', isArray: true },
|
||||
get: { method: 'GET', params: { id: '@id' } },
|
||||
update: { method: 'PUT', params: { id: '@id' } },
|
||||
remove: { method: 'DELETE', params: { id: '@id'} },
|
||||
queryMemberships: { method: 'GET', isArray: true, params: { id: '@id', entity: 'memberships' } },
|
||||
queryTeams: { method: 'GET', isArray: true, params: { id: '@id', entity: 'teams' } },
|
||||
// RPCs should be moved to a specific endpoint
|
||||
checkPassword: { method: 'POST', params: { id: '@id', entity: 'passwd' } },
|
||||
checkAdminUser: { method: 'GET', params: { id: 'admin', entity: 'check' }, isArray: true },
|
||||
initAdminUser: { method: 'POST', params: { id: 'admin', entity: 'init' } }
|
||||
});
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue