mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +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:
parent
6663073be1
commit
cf5056d9c0
714 changed files with 31228 additions and 28305 deletions
|
@ -2,8 +2,15 @@ import toastr from 'toastr';
|
|||
import { Terminal } from 'xterm';
|
||||
import * as fit from 'xterm/lib/addons/fit/fit';
|
||||
|
||||
angular.module('portainer')
|
||||
.config(['$urlRouterProvider', '$httpProvider', 'localStorageServiceProvider', 'jwtOptionsProvider', 'AnalyticsProvider', '$uibTooltipProvider', '$compileProvider', 'cfpLoadingBarProvider',
|
||||
angular.module('portainer').config([
|
||||
'$urlRouterProvider',
|
||||
'$httpProvider',
|
||||
'localStorageServiceProvider',
|
||||
'jwtOptionsProvider',
|
||||
'AnalyticsProvider',
|
||||
'$uibTooltipProvider',
|
||||
'$compileProvider',
|
||||
'cfpLoadingBarProvider',
|
||||
function ($urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, AnalyticsProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) {
|
||||
'use strict';
|
||||
|
||||
|
@ -12,13 +19,15 @@ angular.module('portainer')
|
|||
$compileProvider.debugInfoEnabled(false);
|
||||
}
|
||||
|
||||
localStorageServiceProvider
|
||||
.setPrefix('portainer');
|
||||
localStorageServiceProvider.setPrefix('portainer');
|
||||
|
||||
jwtOptionsProvider.config({
|
||||
tokenGetter: ['LocalStorage', function(LocalStorage) {
|
||||
return LocalStorage.getJWT();
|
||||
}]
|
||||
tokenGetter: [
|
||||
'LocalStorage',
|
||||
function (LocalStorage) {
|
||||
return LocalStorage.getJWT();
|
||||
},
|
||||
],
|
||||
});
|
||||
$httpProvider.interceptors.push('jwtInterceptor');
|
||||
$httpProvider.interceptors.push('EndpointStatusInterceptor');
|
||||
|
@ -26,19 +35,22 @@ angular.module('portainer')
|
|||
$httpProvider.defaults.headers.put['Content-Type'] = 'application/json';
|
||||
$httpProvider.defaults.headers.patch['Content-Type'] = 'application/json';
|
||||
|
||||
$httpProvider.interceptors.push(['HttpRequestHelper', function(HttpRequestHelper) {
|
||||
return {
|
||||
request: function(config) {
|
||||
if (config.url.indexOf('/docker/') > -1) {
|
||||
config.headers['X-PortainerAgent-Target'] = HttpRequestHelper.portainerAgentTargetHeader();
|
||||
if (HttpRequestHelper.portainerAgentManagerOperation()) {
|
||||
config.headers['X-PortainerAgent-ManagerOperation'] = '1';
|
||||
$httpProvider.interceptors.push([
|
||||
'HttpRequestHelper',
|
||||
function (HttpRequestHelper) {
|
||||
return {
|
||||
request: function (config) {
|
||||
if (config.url.indexOf('/docker/') > -1) {
|
||||
config.headers['X-PortainerAgent-Target'] = HttpRequestHelper.portainerAgentTargetHeader();
|
||||
if (HttpRequestHelper.portainerAgentManagerOperation()) {
|
||||
config.headers['X-PortainerAgent-ManagerOperation'] = '1';
|
||||
}
|
||||
}
|
||||
}
|
||||
return config;
|
||||
}
|
||||
};
|
||||
}]);
|
||||
return config;
|
||||
},
|
||||
};
|
||||
},
|
||||
]);
|
||||
|
||||
AnalyticsProvider.setAccount({ tracker: __CONFIG_GA_ID, set: { anonymizeIp: true } });
|
||||
AnalyticsProvider.startOffline(true);
|
||||
|
@ -48,10 +60,10 @@ angular.module('portainer')
|
|||
Terminal.applyAddon(fit);
|
||||
|
||||
$uibTooltipProvider.setTriggers({
|
||||
'mouseenter': 'mouseleave',
|
||||
'click': 'click',
|
||||
'focus': 'blur',
|
||||
'outsideClick': 'outsideClick'
|
||||
mouseenter: 'mouseleave',
|
||||
click: 'click',
|
||||
focus: 'blur',
|
||||
outsideClick: 'outsideClick',
|
||||
});
|
||||
|
||||
cfpLoadingBarProvider.includeSpinner = false;
|
||||
|
@ -59,4 +71,5 @@ angular.module('portainer')
|
|||
cfpLoadingBarProvider.latencyThreshold = 600;
|
||||
|
||||
$urlRouterProvider.otherwise('/auth');
|
||||
}]);
|
||||
},
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue