2017-02-25 11:21:55 +00:00
|
|
|
angular.module('portainer.filters', []);
|
|
|
|
angular.module('portainer.rest', ['ngResource']);
|
|
|
|
angular.module('portainer.services', []);
|
|
|
|
angular.module('portainer.helpers', []);
|
|
|
|
angular.module('portainer', [
|
|
|
|
'ui.bootstrap',
|
|
|
|
'ui.router',
|
2017-05-23 18:56:10 +00:00
|
|
|
'isteven-multi-select',
|
2017-02-25 11:21:55 +00:00
|
|
|
'ngCookies',
|
|
|
|
'ngSanitize',
|
|
|
|
'ngFileUpload',
|
|
|
|
'angularUtils.directives.dirPagination',
|
|
|
|
'LocalStorageModule',
|
|
|
|
'angular-jwt',
|
|
|
|
'angular-google-analytics',
|
|
|
|
'portainer.templates',
|
|
|
|
'portainer.filters',
|
|
|
|
'portainer.rest',
|
|
|
|
'portainer.helpers',
|
|
|
|
'portainer.services',
|
|
|
|
'auth',
|
|
|
|
'dashboard',
|
|
|
|
'container',
|
|
|
|
'containerConsole',
|
|
|
|
'containerLogs',
|
2017-09-09 16:49:21 +00:00
|
|
|
'containerStats',
|
2017-07-08 09:34:21 +00:00
|
|
|
'serviceLogs',
|
2017-02-25 11:21:55 +00:00
|
|
|
'containers',
|
|
|
|
'createContainer',
|
|
|
|
'createNetwork',
|
2017-06-20 11:00:32 +00:00
|
|
|
'createRegistry',
|
2017-05-27 07:23:49 +00:00
|
|
|
'createSecret',
|
2017-02-25 11:21:55 +00:00
|
|
|
'createService',
|
|
|
|
'createVolume',
|
2017-09-20 06:23:36 +00:00
|
|
|
'engine',
|
2017-02-25 11:21:55 +00:00
|
|
|
'endpoint',
|
2017-03-12 16:24:15 +00:00
|
|
|
'endpointAccess',
|
2017-02-25 11:21:55 +00:00
|
|
|
'endpoints',
|
|
|
|
'events',
|
|
|
|
'image',
|
|
|
|
'images',
|
2017-08-28 18:59:13 +00:00
|
|
|
'initAdmin',
|
|
|
|
'initEndpoint',
|
2017-02-25 11:21:55 +00:00
|
|
|
'main',
|
|
|
|
'network',
|
|
|
|
'networks',
|
|
|
|
'node',
|
2017-06-20 11:00:32 +00:00
|
|
|
'registries',
|
|
|
|
'registry',
|
|
|
|
'registryAccess',
|
2017-05-27 07:23:49 +00:00
|
|
|
'secrets',
|
|
|
|
'secret',
|
2017-02-25 11:21:55 +00:00
|
|
|
'service',
|
|
|
|
'services',
|
|
|
|
'settings',
|
2017-08-10 08:35:23 +00:00
|
|
|
'settingsAuthentication',
|
2017-02-25 11:21:55 +00:00
|
|
|
'sidebar',
|
|
|
|
'swarm',
|
2017-09-14 06:04:59 +00:00
|
|
|
'swarmVisualizer',
|
2017-02-25 11:21:55 +00:00
|
|
|
'task',
|
2017-05-23 18:56:10 +00:00
|
|
|
'team',
|
|
|
|
'teams',
|
2017-02-25 11:21:55 +00:00
|
|
|
'templates',
|
2017-03-12 16:24:15 +00:00
|
|
|
'user',
|
|
|
|
'users',
|
2017-06-01 08:14:55 +00:00
|
|
|
'userSettings',
|
2017-05-23 18:56:10 +00:00
|
|
|
'volume',
|
2017-02-25 11:21:55 +00:00
|
|
|
'volumes'])
|
2017-05-19 15:48:03 +00:00
|
|
|
.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', 'localStorageServiceProvider', 'jwtOptionsProvider', 'AnalyticsProvider', '$uibTooltipProvider', '$compileProvider', function ($stateProvider, $urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, AnalyticsProvider, $uibTooltipProvider, $compileProvider) {
|
2017-02-25 11:21:55 +00:00
|
|
|
'use strict';
|
|
|
|
|
2017-05-19 15:48:03 +00:00
|
|
|
var environment = '@@ENVIRONMENT';
|
|
|
|
if (environment === 'production') {
|
|
|
|
$compileProvider.debugInfoEnabled(false);
|
|
|
|
}
|
|
|
|
|
2017-02-25 11:21:55 +00:00
|
|
|
localStorageServiceProvider
|
|
|
|
.setPrefix('portainer');
|
|
|
|
|
|
|
|
jwtOptionsProvider.config({
|
|
|
|
tokenGetter: ['LocalStorage', function(LocalStorage) {
|
|
|
|
return LocalStorage.getJWT();
|
|
|
|
}],
|
|
|
|
unauthenticatedRedirector: ['$state', function($state) {
|
|
|
|
$state.go('auth', {error: 'Your session has expired'});
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
$httpProvider.interceptors.push('jwtInterceptor');
|
|
|
|
|
|
|
|
AnalyticsProvider.setAccount('@@CONFIG_GA_ID');
|
|
|
|
AnalyticsProvider.startOffline(true);
|
|
|
|
|
|
|
|
$urlRouterProvider.otherwise('/auth');
|
|
|
|
|
2017-04-12 19:47:22 +00:00
|
|
|
toastr.options.timeOut = 3000;
|
|
|
|
|
2017-03-27 12:44:39 +00:00
|
|
|
$uibTooltipProvider.setTriggers({
|
|
|
|
'mouseenter': 'mouseleave',
|
|
|
|
'click': 'click',
|
|
|
|
'focus': 'blur',
|
|
|
|
'outsideClick': 'outsideClick'
|
|
|
|
});
|
|
|
|
|
2016-06-08 06:34:26 +00:00
|
|
|
$stateProvider
|
2017-02-01 09:13:48 +00:00
|
|
|
.state('root', {
|
|
|
|
abstract: true,
|
|
|
|
resolve: {
|
|
|
|
requiresLogin: ['StateManager', function (StateManager) {
|
|
|
|
var applicationState = StateManager.getState();
|
|
|
|
return applicationState.application.authentication;
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
})
|
2016-12-15 03:33:47 +00:00
|
|
|
.state('auth', {
|
2017-02-01 09:13:48 +00:00
|
|
|
parent: 'root',
|
|
|
|
url: '/auth',
|
2017-02-25 11:21:55 +00:00
|
|
|
params: {
|
|
|
|
logout: false,
|
|
|
|
error: ''
|
|
|
|
},
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/auth/auth.html',
|
|
|
|
controller: 'AuthenticationController'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
requiresLogin: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('containers', {
|
|
|
|
parent: 'root',
|
|
|
|
url: '/containers/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/containers/containers.html',
|
|
|
|
controller: 'ContainersController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('container', {
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '^/containers/:id',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/container/container.html',
|
|
|
|
controller: 'ContainerController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('stats', {
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '^/containers/:id/stats',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-09-09 16:49:21 +00:00
|
|
|
templateUrl: 'app/components/containerStats/containerStats.html',
|
|
|
|
controller: 'ContainerStatsController'
|
2017-02-25 11:21:55 +00:00
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-07-08 09:34:21 +00:00
|
|
|
.state('containerlogs', {
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '^/containers/:id/logs',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/containerLogs/containerlogs.html',
|
|
|
|
controller: 'ContainerLogsController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-07-08 09:34:21 +00:00
|
|
|
.state('servicelogs', {
|
|
|
|
url: '^/services/:id/logs',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/serviceLogs/servicelogs.html',
|
|
|
|
controller: 'ServiceLogsController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-02-25 11:21:55 +00:00
|
|
|
.state('console', {
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '^/containers/:id/console',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/containerConsole/containerConsole.html',
|
|
|
|
controller: 'ContainerConsoleController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('dashboard', {
|
|
|
|
parent: 'root',
|
|
|
|
url: '/dashboard',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/dashboard/dashboard.html',
|
|
|
|
controller: 'DashboardController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('actions', {
|
|
|
|
abstract: true,
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '/actions',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
template: '<div ui-view="content@"></div>'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-05-19 15:51:01 +00:00
|
|
|
template: '<div ui-view="sidebar@"></div>'
|
2017-02-25 11:21:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('actions.create', {
|
|
|
|
abstract: true,
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '/create',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
template: '<div ui-view="content@"></div>'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-05-19 15:51:01 +00:00
|
|
|
template: '<div ui-view="sidebar@"></div>'
|
2017-02-25 11:21:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('actions.create.container', {
|
2017-08-13 10:17:41 +00:00
|
|
|
url: '/container/:from',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/createContainer/createcontainer.html',
|
|
|
|
controller: 'CreateContainerController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('actions.create.network', {
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '/network',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/createNetwork/createnetwork.html',
|
|
|
|
controller: 'CreateNetworkController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-06-20 11:00:32 +00:00
|
|
|
.state('actions.create.registry', {
|
|
|
|
url: '/registry',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/createRegistry/createregistry.html',
|
|
|
|
controller: 'CreateRegistryController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-05-27 07:23:49 +00:00
|
|
|
.state('actions.create.secret', {
|
|
|
|
url: '/secret',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/createSecret/createsecret.html',
|
|
|
|
controller: 'CreateSecretController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-02-25 11:21:55 +00:00
|
|
|
.state('actions.create.service', {
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '/service',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/createService/createservice.html',
|
|
|
|
controller: 'CreateServiceController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('actions.create.volume', {
|
2017-05-19 15:48:03 +00:00
|
|
|
url: '/volume',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/createVolume/createvolume.html',
|
|
|
|
controller: 'CreateVolumeController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-08-28 18:59:13 +00:00
|
|
|
.state('init', {
|
|
|
|
abstract: true,
|
|
|
|
url: '/init',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
template: '<div ui-view="content@"></div>'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('init.endpoint', {
|
|
|
|
url: '/endpoint',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/initEndpoint/initEndpoint.html',
|
|
|
|
controller: 'InitEndpointController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('init.admin', {
|
|
|
|
url: '/admin',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/initAdmin/initAdmin.html',
|
|
|
|
controller: 'InitAdminController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-09-20 06:23:36 +00:00
|
|
|
.state('engine', {
|
|
|
|
url: '/engine/',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-09-20 06:23:36 +00:00
|
|
|
templateUrl: 'app/components/engine/engine.html',
|
|
|
|
controller: 'EngineController'
|
2017-02-25 11:21:55 +00:00
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('endpoints', {
|
|
|
|
url: '/endpoints/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/endpoints/endpoints.html',
|
|
|
|
controller: 'EndpointsController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('endpoint', {
|
|
|
|
url: '^/endpoints/:id',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/endpoint/endpoint.html',
|
|
|
|
controller: 'EndpointController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-03-12 16:24:15 +00:00
|
|
|
.state('endpoint.access', {
|
|
|
|
url: '^/endpoints/:id/access',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-03-12 16:24:15 +00:00
|
|
|
templateUrl: 'app/components/endpointAccess/endpointAccess.html',
|
|
|
|
controller: 'EndpointAccessController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-03-12 16:24:15 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-02-25 11:21:55 +00:00
|
|
|
.state('events', {
|
|
|
|
url: '/events/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/events/events.html',
|
|
|
|
controller: 'EventsController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('images', {
|
|
|
|
url: '/images/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/images/images.html',
|
|
|
|
controller: 'ImagesController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('image', {
|
|
|
|
url: '^/images/:id/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/image/image.html',
|
|
|
|
controller: 'ImageController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('networks', {
|
|
|
|
url: '/networks/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/networks/networks.html',
|
|
|
|
controller: 'NetworksController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('network', {
|
|
|
|
url: '^/networks/:id/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/network/network.html',
|
|
|
|
controller: 'NetworkController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('node', {
|
|
|
|
url: '^/nodes/:id/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/node/node.html',
|
|
|
|
controller: 'NodeController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-06-20 11:00:32 +00:00
|
|
|
.state('registries', {
|
|
|
|
url: '/registries/',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/registries/registries.html',
|
|
|
|
controller: 'RegistriesController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('registry', {
|
|
|
|
url: '^/registries/:id',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/registry/registry.html',
|
|
|
|
controller: 'RegistryController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('registry.access', {
|
|
|
|
url: '^/registries/:id/access',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/registryAccess/registryAccess.html',
|
|
|
|
controller: 'RegistryAccessController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-05-27 07:23:49 +00:00
|
|
|
.state('secrets', {
|
|
|
|
url: '^/secrets/',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/secrets/secrets.html',
|
|
|
|
controller: 'SecretsController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('secret', {
|
|
|
|
url: '^/secret/:id/',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/secret/secret.html',
|
|
|
|
controller: 'SecretController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-02-25 11:21:55 +00:00
|
|
|
.state('services', {
|
|
|
|
url: '/services/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/services/services.html',
|
|
|
|
controller: 'ServicesController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('service', {
|
|
|
|
url: '^/service/:id/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/service/service.html',
|
|
|
|
controller: 'ServiceController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('settings', {
|
|
|
|
url: '/settings/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/settings/settings.html',
|
|
|
|
controller: 'SettingsController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-08-10 08:35:23 +00:00
|
|
|
.state('settings_authentication', {
|
|
|
|
url: '^/settings/authentication',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/settingsAuthentication/settingsAuthentication.html',
|
|
|
|
controller: 'SettingsAuthenticationController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-02-25 11:21:55 +00:00
|
|
|
.state('task', {
|
|
|
|
url: '^/task/:id',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/task/task.html',
|
|
|
|
controller: 'TaskController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('templates', {
|
|
|
|
url: '/templates/',
|
2017-04-05 08:13:32 +00:00
|
|
|
params: {
|
|
|
|
key: 'containers',
|
|
|
|
hide_descriptions: false
|
|
|
|
},
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-04-05 08:13:32 +00:00
|
|
|
templateUrl: 'app/components/templates/templates.html',
|
|
|
|
controller: 'TemplatesController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-04-05 08:13:32 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('templates_linuxserver', {
|
|
|
|
url: '^/templates/linuxserver.io',
|
|
|
|
params: {
|
|
|
|
key: 'linuxserver.io',
|
|
|
|
hide_descriptions: true
|
|
|
|
},
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/templates/templates.html',
|
|
|
|
controller: 'TemplatesController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('volumes', {
|
|
|
|
url: '/volumes/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/volumes/volumes.html',
|
|
|
|
controller: 'VolumesController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-05-23 18:56:10 +00:00
|
|
|
.state('volume', {
|
|
|
|
url: '^/volumes/:id',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/volume/volume.html',
|
|
|
|
controller: 'VolumeController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-03-12 16:24:15 +00:00
|
|
|
.state('users', {
|
|
|
|
url: '/users/',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-03-12 16:24:15 +00:00
|
|
|
templateUrl: 'app/components/users/users.html',
|
|
|
|
controller: 'UsersController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-03-12 16:24:15 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('user', {
|
|
|
|
url: '^/users/:id',
|
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-03-12 16:24:15 +00:00
|
|
|
templateUrl: 'app/components/user/user.html',
|
|
|
|
controller: 'UserController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-03-12 16:24:15 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-06-01 08:14:55 +00:00
|
|
|
.state('userSettings', {
|
|
|
|
url: '/userSettings/',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/userSettings/userSettings.html',
|
|
|
|
controller: 'UserSettingsController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-05-23 18:56:10 +00:00
|
|
|
.state('teams', {
|
|
|
|
url: '/teams/',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/teams/teams.html',
|
|
|
|
controller: 'TeamsController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.state('team', {
|
|
|
|
url: '^/teams/:id',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/team/team.html',
|
|
|
|
controller: 'TeamController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2017-02-25 11:21:55 +00:00
|
|
|
.state('swarm', {
|
2017-09-14 06:04:59 +00:00
|
|
|
url: '/swarm',
|
2017-02-25 11:21:55 +00:00
|
|
|
views: {
|
2017-05-19 15:48:03 +00:00
|
|
|
'content@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/swarm/swarm.html',
|
|
|
|
controller: 'SwarmController'
|
|
|
|
},
|
2017-05-19 15:48:03 +00:00
|
|
|
'sidebar@': {
|
2017-02-25 11:21:55 +00:00
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
2017-09-14 06:04:59 +00:00
|
|
|
})
|
|
|
|
.state('swarm.visualizer', {
|
|
|
|
url: '/visualizer',
|
|
|
|
views: {
|
|
|
|
'content@': {
|
|
|
|
templateUrl: 'app/components/swarmVisualizer/swarmVisualizer.html',
|
|
|
|
controller: 'SwarmVisualizerController'
|
|
|
|
},
|
|
|
|
'sidebar@': {
|
|
|
|
templateUrl: 'app/components/sidebar/sidebar.html',
|
|
|
|
controller: 'SidebarController'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
;
|
2017-02-25 11:21:55 +00:00
|
|
|
}])
|
2017-04-12 19:47:22 +00:00
|
|
|
.run(['$rootScope', '$state', 'Authentication', 'authManager', 'StateManager', 'EndpointProvider', 'Notifications', 'Analytics', function ($rootScope, $state, Authentication, authManager, StateManager, EndpointProvider, Notifications, Analytics) {
|
2017-03-12 16:24:15 +00:00
|
|
|
EndpointProvider.initialize();
|
2017-02-25 11:21:55 +00:00
|
|
|
StateManager.initialize().then(function success(state) {
|
|
|
|
if (state.application.authentication) {
|
|
|
|
authManager.checkAuthOnRefresh();
|
|
|
|
authManager.redirectWhenUnauthenticated();
|
|
|
|
Authentication.init();
|
|
|
|
$rootScope.$on('tokenHasExpired', function($state) {
|
|
|
|
$state.go('auth', {error: 'Your session has expired'});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (state.application.analytics) {
|
|
|
|
Analytics.offline(false);
|
|
|
|
Analytics.registerScriptTags();
|
|
|
|
Analytics.registerTrackers();
|
|
|
|
$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
|
|
|
|
Analytics.trackPage(toState.url);
|
|
|
|
Analytics.pageView();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, function error(err) {
|
2017-05-19 15:48:03 +00:00
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve application settings');
|
2017-02-25 11:21:55 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
$rootScope.$state = $state;
|
|
|
|
}])
|
|
|
|
// This is your docker url that the api will use to make requests
|
|
|
|
// You need to set this to the api endpoint without the port i.e. http://192.168.1.9
|
2017-06-01 08:14:55 +00:00
|
|
|
// .constant('DOCKER_PORT', '') // Docker port, leave as an empty string if no port is required. If you have a port, prefix it with a ':' i.e. :4243
|
2017-07-20 14:22:27 +00:00
|
|
|
.constant('API_ENDPOINT_AUTH', 'api/auth')
|
|
|
|
.constant('API_ENDPOINT_DOCKERHUB', 'api/dockerhub')
|
|
|
|
.constant('API_ENDPOINT_ENDPOINTS', 'api/endpoints')
|
|
|
|
.constant('API_ENDPOINT_REGISTRIES', 'api/registries')
|
|
|
|
.constant('API_ENDPOINT_RESOURCE_CONTROLS', 'api/resource_controls')
|
|
|
|
.constant('API_ENDPOINT_SETTINGS', 'api/settings')
|
|
|
|
.constant('API_ENDPOINT_STATUS', 'api/status')
|
|
|
|
.constant('API_ENDPOINT_USERS', 'api/users')
|
|
|
|
.constant('API_ENDPOINT_TEAMS', 'api/teams')
|
|
|
|
.constant('API_ENDPOINT_TEAM_MEMBERSHIPS', 'api/team_memberships')
|
|
|
|
.constant('API_ENDPOINT_TEMPLATES', 'api/templates')
|
2017-06-01 08:14:55 +00:00
|
|
|
.constant('DEFAULT_TEMPLATES_URL', 'https://raw.githubusercontent.com/portainer/templates/master/templates.json')
|
|
|
|
.constant('PAGINATION_MAX_ITEMS', 10);
|