2059a9e064
This PR solves the issue that the Portainer instance will be always accessible in certain cases, like `restart: always` setting with docker run, even if the administrator is not created in the first 5 minutes. The solution is that the user will be redirected to a timeout page when any actions, such as refresh the page and click button, are made after administrator initialisation window(5 minutes) timeout.
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
import { Terminal } from 'xterm';
|
|
import * as fit from 'xterm/lib/addons/fit/fit';
|
|
import { agentInterceptor } from './portainer/services/axios';
|
|
|
|
/* @ngInject */
|
|
export function configApp($urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) {
|
|
if (process.env.NODE_ENV === 'testing') {
|
|
$compileProvider.debugInfoEnabled(false);
|
|
}
|
|
|
|
localStorageServiceProvider.setPrefix('portainer');
|
|
|
|
jwtOptionsProvider.config({
|
|
tokenGetter: /* @ngInject */ function tokenGetter(LocalStorage) {
|
|
return LocalStorage.getJWT();
|
|
},
|
|
});
|
|
|
|
$httpProvider.interceptors.push('jwtInterceptor');
|
|
$httpProvider.interceptors.push('EndpointStatusInterceptor');
|
|
$httpProvider.defaults.headers.post['Content-Type'] = 'application/json';
|
|
$httpProvider.defaults.headers.put['Content-Type'] = 'application/json';
|
|
$httpProvider.defaults.headers.patch['Content-Type'] = 'application/json';
|
|
|
|
$httpProvider.interceptors.push(() => ({
|
|
request: agentInterceptor,
|
|
}));
|
|
|
|
Terminal.applyAddon(fit);
|
|
|
|
$uibTooltipProvider.setTriggers({
|
|
mouseenter: 'mouseleave',
|
|
click: 'click',
|
|
focus: 'blur',
|
|
outsideClick: 'outsideClick',
|
|
});
|
|
|
|
cfpLoadingBarProvider.includeSpinner = false;
|
|
cfpLoadingBarProvider.parentSelector = '#loadingbar-placeholder';
|
|
cfpLoadingBarProvider.latencyThreshold = 600;
|
|
|
|
$urlRouterProvider.otherwise('/auth');
|
|
}
|