1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

chore(project): add prettier for code format (#3645)

* chore(project): install prettier and lint-staged

* chore(project): apply prettier to html too

* chore(project): git ignore eslintcache

* chore(project): add a comment about format script

* chore(prettier): update printWidth

* chore(prettier): remove useTabs option

* chore(prettier): add HTML validation

* refactor(prettier): fix closing tags

* feat(prettier): define angular parser for html templates

* style(prettier): run prettier on codebase

Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
Chaim Lev-Ari 2020-04-11 00:54:53 +03:00 committed by GitHub
parent 6663073be1
commit cf5056d9c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
714 changed files with 31228 additions and 28305 deletions

View file

@ -1,82 +1,115 @@
import {genericHandler, logsHandler} from './response/handlers';
import { genericHandler, logsHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('Container', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', 'ContainersInterceptor',
function ContainerFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, ContainersInterceptor) {
'use strict';
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/containers/:id/:action', {
name: '@name',
endpointId: EndpointProvider.endpointID
angular.module('portainer.docker').factory('Container', [
'$resource',
'API_ENDPOINT_ENDPOINTS',
'EndpointProvider',
'ContainersInterceptor',
function ContainerFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, ContainersInterceptor) {
'use strict';
return $resource(
API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/containers/:id/:action',
{
name: '@name',
endpointId: EndpointProvider.endpointID,
},
{
query: {
method: 'GET',
params: { all: 0, action: 'json', filters: '@filters' },
isArray: true,
interceptor: ContainersInterceptor,
timeout: 15000,
},
get: {
method: 'GET',
params: { action: 'json' },
},
stop: {
method: 'POST',
params: { id: '@id', action: 'stop' },
},
restart: {
method: 'POST',
params: { id: '@id', action: 'restart' },
},
kill: {
method: 'POST',
params: { id: '@id', action: 'kill' },
},
pause: {
method: 'POST',
params: { id: '@id', action: 'pause' },
},
unpause: {
method: 'POST',
params: { id: '@id', action: 'unpause' },
},
logs: {
method: 'GET',
params: { id: '@id', action: 'logs' },
timeout: 4500,
ignoreLoadingBar: true,
transformResponse: logsHandler,
},
stats: {
method: 'GET',
params: { id: '@id', stream: false, action: 'stats' },
timeout: 4500,
ignoreLoadingBar: true,
},
top: {
method: 'GET',
params: { id: '@id', action: 'top' },
timeout: 4500,
ignoreLoadingBar: true,
},
start: {
method: 'POST',
params: { id: '@id', action: 'start' },
transformResponse: genericHandler,
},
create: {
method: 'POST',
params: { action: 'create' },
transformResponse: genericHandler,
ignoreLoadingBar: true,
},
remove: {
method: 'DELETE',
params: { id: '@id', v: '@v', force: '@force' },
transformResponse: genericHandler,
},
rename: {
method: 'POST',
params: { id: '@id', action: 'rename', name: '@name' },
transformResponse: genericHandler,
},
exec: {
method: 'POST',
params: { id: '@id', action: 'exec' },
transformResponse: genericHandler,
ignoreLoadingBar: true,
},
inspect: {
method: 'GET',
params: { id: '@id', action: 'json' },
},
update: {
method: 'POST',
params: { id: '@id', action: 'update' },
},
prune: {
method: 'POST',
params: { action: 'prune', filters: '@filters' },
},
resize: {
method: 'POST',
params: { id: '@id', action: 'resize', h: '@height', w: '@width' },
transformResponse: genericHandler,
ignoreLoadingBar: true,
},
}
);
},
{
query: {
method: 'GET', params: { all: 0, action: 'json', filters: '@filters' },
isArray: true, interceptor: ContainersInterceptor, timeout: 15000
},
get: {
method: 'GET', params: { action: 'json' }
},
stop: {
method: 'POST', params: { id: '@id', action: 'stop' }
},
restart: {
method: 'POST', params: { id: '@id', action: 'restart' }
},
kill: {
method: 'POST', params: { id: '@id', action: 'kill' }
},
pause: {
method: 'POST', params: { id: '@id', action: 'pause' }
},
unpause: {
method: 'POST', params: { id: '@id', action: 'unpause' }
},
logs: {
method: 'GET', params: { id: '@id', action: 'logs' },
timeout: 4500, ignoreLoadingBar: true,
transformResponse: logsHandler
},
stats: {
method: 'GET', params: { id: '@id', stream: false, action: 'stats' },
timeout: 4500, ignoreLoadingBar: true
},
top: {
method: 'GET', params: { id: '@id', action: 'top' },
timeout: 4500, ignoreLoadingBar: true
},
start: {
method: 'POST', params: {id: '@id', action: 'start'},
transformResponse: genericHandler
},
create: {
method: 'POST', params: {action: 'create'},
transformResponse: genericHandler,
ignoreLoadingBar: true
},
remove: {
method: 'DELETE', params: {id: '@id', v: '@v', force: '@force'},
transformResponse: genericHandler
},
rename: {
method: 'POST', params: { id: '@id', action: 'rename', name: '@name' },
transformResponse: genericHandler
},
exec: {
method: 'POST', params: {id: '@id', action: 'exec'},
transformResponse: genericHandler, ignoreLoadingBar: true
},
inspect: {
method: 'GET', params: { id: '@id', action: 'json' }
},
update: {
method: 'POST', params: { id: '@id', action: 'update'}
},
prune: {
method: 'POST', params: { action: 'prune', filters: '@filters' }
},
resize: {
method: 'POST', params: {id: '@id', action: 'resize', h: '@height', w: '@width'},
transformResponse: genericHandler, ignoreLoadingBar: true
}
});
}]);
]);