diff --git a/app/directives/ui/datatables/teams-datatable/teamsDatatable.js b/app/portainer/components/datatables/teams-datatable/teamsDatatable.js
similarity index 59%
rename from app/directives/ui/datatables/teams-datatable/teamsDatatable.js
rename to app/portainer/components/datatables/teams-datatable/teamsDatatable.js
index 7993ccde9fe84..d031ed45928f2 100644
--- a/app/directives/ui/datatables/teams-datatable/teamsDatatable.js
+++ b/app/portainer/components/datatables/teams-datatable/teamsDatatable.js
@@ -1,5 +1,5 @@
-angular.module('ui').component('teamsDatatable', {
- templateUrl: 'app/directives/ui/datatables/teams-datatable/teamsDatatable.html',
+angular.module('portainer.app').component('teamsDatatable', {
+ templateUrl: 'app/portainer/components/datatables/teams-datatable/teamsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
title: '@',
diff --git a/app/directives/ui/datatables/users-datatable/usersDatatable.html b/app/portainer/components/datatables/users-datatable/usersDatatable.html
similarity index 98%
rename from app/directives/ui/datatables/users-datatable/usersDatatable.html
rename to app/portainer/components/datatables/users-datatable/usersDatatable.html
index 9e5d5c40f29ed..3df05728ac6ff 100644
--- a/app/directives/ui/datatables/users-datatable/usersDatatable.html
+++ b/app/portainer/components/datatables/users-datatable/usersDatatable.html
@@ -59,7 +59,7 @@
- {{ item.Username }}
+ {{ item.Username }}
diff --git a/app/directives/ui/datatables/users-datatable/usersDatatable.js b/app/portainer/components/datatables/users-datatable/usersDatatable.js
similarity index 62%
rename from app/directives/ui/datatables/users-datatable/usersDatatable.js
rename to app/portainer/components/datatables/users-datatable/usersDatatable.js
index 565cf3da55c13..ac46508593554 100644
--- a/app/directives/ui/datatables/users-datatable/usersDatatable.js
+++ b/app/portainer/components/datatables/users-datatable/usersDatatable.js
@@ -1,5 +1,5 @@
-angular.module('ui').component('usersDatatable', {
- templateUrl: 'app/directives/ui/datatables/users-datatable/usersDatatable.html',
+angular.module('portainer.app').component('usersDatatable', {
+ templateUrl: 'app/portainer/components/datatables/users-datatable/usersDatatable.html',
controller: 'GenericDatatableController',
bindings: {
title: '@',
diff --git a/app/directives/endpointSecurity/por-endpoint-security.js b/app/portainer/components/endpointSecurity/por-endpoint-security.js
similarity index 66%
rename from app/directives/endpointSecurity/por-endpoint-security.js
rename to app/portainer/components/endpointSecurity/por-endpoint-security.js
index 51567dc183478..068494635be2a 100644
--- a/app/directives/endpointSecurity/por-endpoint-security.js
+++ b/app/portainer/components/endpointSecurity/por-endpoint-security.js
@@ -1,5 +1,5 @@
-angular.module('portainer').component('porEndpointSecurity', {
- templateUrl: 'app/directives/endpointSecurity/porEndpointSecurity.html',
+angular.module('portainer.app').component('porEndpointSecurity', {
+ templateUrl: 'app/portainer/components/endpointSecurity/porEndpointSecurity.html',
controller: 'porEndpointSecurityController',
bindings: {
// This object will be populated with the form data.
diff --git a/app/directives/endpointSecurity/porEndpointSecurity.html b/app/portainer/components/endpointSecurity/porEndpointSecurity.html
similarity index 100%
rename from app/directives/endpointSecurity/porEndpointSecurity.html
rename to app/portainer/components/endpointSecurity/porEndpointSecurity.html
diff --git a/app/directives/endpointSecurity/porEndpointSecurityController.js b/app/portainer/components/endpointSecurity/porEndpointSecurityController.js
similarity index 96%
rename from app/directives/endpointSecurity/porEndpointSecurityController.js
rename to app/portainer/components/endpointSecurity/porEndpointSecurityController.js
index 059903047c5e6..4a9bb6754b1ef 100644
--- a/app/directives/endpointSecurity/porEndpointSecurityController.js
+++ b/app/portainer/components/endpointSecurity/porEndpointSecurityController.js
@@ -1,4 +1,4 @@
-angular.module('portainer')
+angular.module('portainer.app')
.controller('porEndpointSecurityController', [function () {
var ctrl = this;
diff --git a/app/directives/endpointSecurity/porEndpointSecurityModel.js b/app/portainer/components/endpointSecurity/porEndpointSecurityModel.js
similarity index 100%
rename from app/directives/endpointSecurity/porEndpointSecurityModel.js
rename to app/portainer/components/endpointSecurity/porEndpointSecurityModel.js
diff --git a/app/directives/header-content.js b/app/portainer/components/header-content.js
similarity index 57%
rename from app/directives/header-content.js
rename to app/portainer/components/header-content.js
index ecb52136dc321..cb9de8f6e3818 100644
--- a/app/directives/header-content.js
+++ b/app/portainer/components/header-content.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdHeaderContent', ['Authentication', function rdHeaderContent(Authentication) {
var directive = {
requires: '^rdHeader',
@@ -7,7 +6,7 @@ angular
link: function (scope, iElement, iAttrs) {
scope.username = Authentication.getUserDetails().username;
},
- template: '',
+ template: '',
restrict: 'E'
};
return directive;
diff --git a/app/directives/header-title.js b/app/portainer/components/header-title.js
similarity index 75%
rename from app/directives/header-title.js
rename to app/portainer/components/header-title.js
index 167c09ef1da79..3b4f88665dfb1 100644
--- a/app/directives/header-title.js
+++ b/app/portainer/components/header-title.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdHeaderTitle', ['Authentication', 'StateManager', function rdHeaderTitle(Authentication, StateManager) {
var directive = {
requires: '^rdHeader',
@@ -11,7 +10,7 @@ angular
scope.displayDonationHeader = StateManager.getState().application.displayDonationHeader;
},
transclude: true,
- template: '{{title}} {{username}} Help support portainer ',
+ template: '{{title}} {{username}} Help support portainer ',
restrict: 'E'
};
return directive;
diff --git a/app/directives/header.js b/app/portainer/components/header.js
similarity index 91%
rename from app/directives/header.js
rename to app/portainer/components/header.js
index a2facd4e67e4e..f73ada0fd9f76 100644
--- a/app/directives/header.js
+++ b/app/portainer/components/header.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdHeader', function rdHeader() {
var directive = {
scope: {
diff --git a/app/directives/loading.js b/app/portainer/components/loading.js
similarity index 87%
rename from app/directives/loading.js
rename to app/portainer/components/loading.js
index f2d9a371a729d..bf97ddb53ebf2 100644
--- a/app/directives/loading.js
+++ b/app/portainer/components/loading.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdLoading', function rdLoading() {
var directive = {
restrict: 'AE',
diff --git a/app/directives/onEnterKey.js b/app/portainer/components/onEnterKey.js
similarity index 92%
rename from app/directives/onEnterKey.js
rename to app/portainer/components/onEnterKey.js
index 1d13e8d22ad8d..3d367d33f9759 100644
--- a/app/directives/onEnterKey.js
+++ b/app/portainer/components/onEnterKey.js
@@ -1,4 +1,4 @@
-angular.module('portainer')
+angular.module('portainer.app')
.directive('onEnterKey', [function porOnEnterKey() {
var directive = {
restrict: 'A',
diff --git a/app/directives/ui/slider/slider.html b/app/portainer/components/slider/slider.html
similarity index 100%
rename from app/directives/ui/slider/slider.html
rename to app/portainer/components/slider/slider.html
diff --git a/app/directives/ui/slider/slider.js b/app/portainer/components/slider/slider.js
similarity index 57%
rename from app/directives/ui/slider/slider.js
rename to app/portainer/components/slider/slider.js
index 03d8fe3370c1d..ff8747a639f3b 100644
--- a/app/directives/ui/slider/slider.js
+++ b/app/portainer/components/slider/slider.js
@@ -1,5 +1,5 @@
-angular.module('ui').component('slider', {
- templateUrl: 'app/directives/ui/slider/slider.html',
+angular.module('portainer.app').component('slider', {
+ templateUrl: 'app/portainer/components/slider/slider.html',
controller: 'SliderController',
bindings: {
model: '=',
diff --git a/app/directives/ui/slider/sliderController.js b/app/portainer/components/slider/sliderController.js
similarity index 93%
rename from app/directives/ui/slider/sliderController.js
rename to app/portainer/components/slider/sliderController.js
index 6445007a8e2d7..21175579dde85 100644
--- a/app/directives/ui/slider/sliderController.js
+++ b/app/portainer/components/slider/sliderController.js
@@ -1,4 +1,4 @@
-angular.module('ui')
+angular.module('portainer.app')
.controller('SliderController', function () {
var ctrl = this;
diff --git a/app/directives/template-widget.js b/app/portainer/components/template-widget.js
similarity index 89%
rename from app/directives/template-widget.js
rename to app/portainer/components/template-widget.js
index 51f902cbf03fb..e31685cf7c6a0 100644
--- a/app/directives/template-widget.js
+++ b/app/portainer/components/template-widget.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdTemplateWidget', function rdWidget() {
var directive = {
scope: {
diff --git a/app/directives/tooltip.js b/app/portainer/components/tooltip.js
similarity index 93%
rename from app/directives/tooltip.js
rename to app/portainer/components/tooltip.js
index b4a6960909ce7..0d4a67bc4895a 100644
--- a/app/directives/tooltip.js
+++ b/app/portainer/components/tooltip.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('portainerTooltip', [function portainerTooltip() {
var directive = {
scope: {
diff --git a/app/directives/widget-body.js b/app/portainer/components/widget-body.js
similarity index 92%
rename from app/directives/widget-body.js
rename to app/portainer/components/widget-body.js
index ad8de2e1554c9..83cdc9db0d717 100644
--- a/app/directives/widget-body.js
+++ b/app/portainer/components/widget-body.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdWidgetBody', function rdWidgetBody() {
var directive = {
requires: '^rdWidget',
diff --git a/app/directives/widget-custom-header.js b/app/portainer/components/widget-custom-header.js
similarity index 94%
rename from app/directives/widget-custom-header.js
rename to app/portainer/components/widget-custom-header.js
index 54150f1f00a0e..ab4aa8827143e 100644
--- a/app/directives/widget-custom-header.js
+++ b/app/portainer/components/widget-custom-header.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdWidgetCustomHeader', function rdWidgetCustomHeader() {
var directive = {
requires: '^rdWidget',
diff --git a/app/directives/widget-footer.js b/app/portainer/components/widget-footer.js
similarity index 88%
rename from app/directives/widget-footer.js
rename to app/portainer/components/widget-footer.js
index 9cb1dda960082..7ebab1eba6f94 100644
--- a/app/directives/widget-footer.js
+++ b/app/portainer/components/widget-footer.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdWidgetFooter', function rdWidgetFooter() {
var directive = {
requires: '^rdWidget',
diff --git a/app/directives/widget-header.js b/app/portainer/components/widget-header.js
similarity index 93%
rename from app/directives/widget-header.js
rename to app/portainer/components/widget-header.js
index 9e047aaa17307..0755341dcaa9c 100644
--- a/app/directives/widget-header.js
+++ b/app/portainer/components/widget-header.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdWidgetHeader', function rdWidgetTitle() {
var directive = {
requires: '^rdWidget',
diff --git a/app/directives/widget-taskbar.js b/app/portainer/components/widget-taskbar.js
similarity index 91%
rename from app/directives/widget-taskbar.js
rename to app/portainer/components/widget-taskbar.js
index 4b39bcc37b32d..e5950979808eb 100644
--- a/app/directives/widget-taskbar.js
+++ b/app/portainer/components/widget-taskbar.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdWidgetTaskbar', function rdWidgetTaskbar() {
var directive = {
requires: '^rdWidget',
diff --git a/app/directives/widget.js b/app/portainer/components/widget.js
similarity index 87%
rename from app/directives/widget.js
rename to app/portainer/components/widget.js
index 6426fe147ea3a..4560850786dc2 100644
--- a/app/directives/widget.js
+++ b/app/portainer/components/widget.js
@@ -1,5 +1,4 @@
-angular
-.module('portainer')
+angular.module('portainer.app')
.directive('rdWidget', function rdWidget() {
var directive = {
scope: {
diff --git a/app/portainer/filters/filters.js b/app/portainer/filters/filters.js
new file mode 100644
index 0000000000000..a72ab82cc7d71
--- /dev/null
+++ b/app/portainer/filters/filters.js
@@ -0,0 +1,119 @@
+angular.module('portainer.app')
+.filter('truncate', function () {
+ 'use strict';
+ return function (text, length, end) {
+ if (isNaN(length)) {
+ length = 10;
+ }
+
+ if (end === undefined) {
+ end = '...';
+ }
+
+ if (text.length <= length || text.length - end.length <= length) {
+ return text;
+ } else {
+ return String(text).substring(0, length - end.length) + end;
+ }
+ };
+})
+.filter('truncatelr', function () {
+ 'use strict';
+ return function (text, max, left, right) {
+ max = isNaN(max) ? 50 : max;
+ left = isNaN(left) ? 25 : left;
+ right = isNaN(right) ? 25 : right;
+
+ if (text.length <= max) {
+ return text;
+ } else {
+ return text.substring(0, left) + '[...]' + text.substring(text.length - right, text.length);
+ }
+ };
+})
+.filter('capitalize', function () {
+ 'use strict';
+ return function (text) {
+ return _.capitalize(text);
+ };
+})
+.filter('stripprotocol', function() {
+ 'use strict';
+ return function (url) {
+ return url.replace(/.*?:\/\//g, '');
+ };
+})
+.filter('humansize', function () {
+ 'use strict';
+ return function (bytes, round, base) {
+ if (!round) {
+ round = 1;
+ }
+ if (!base) {
+ base = 10;
+ }
+ if (bytes || bytes === 0) {
+ return filesize(bytes, {base: base, round: round});
+ }
+ };
+})
+.filter('getisodatefromtimestamp', function () {
+ 'use strict';
+ return function (timestamp) {
+ return moment.unix(timestamp).format('YYYY-MM-DD HH:mm:ss');
+ };
+})
+.filter('getisodate', function () {
+ 'use strict';
+ return function (date) {
+ return moment(date).format('YYYY-MM-DD HH:mm:ss');
+ };
+})
+.filter('key', function () {
+ 'use strict';
+ return function (pair, separator) {
+ return pair.slice(0, pair.indexOf(separator));
+ };
+})
+.filter('value', function () {
+ 'use strict';
+ return function (pair, separator) {
+ return pair.slice(pair.indexOf(separator) + 1);
+ };
+})
+.filter('emptyobject', function () {
+ 'use strict';
+ return function (obj) {
+ return _.isEmpty(obj);
+ };
+})
+.filter('ipaddress', function () {
+ 'use strict';
+ return function (ip) {
+ return ip.slice(0, ip.indexOf('/'));
+ };
+})
+.filter('arraytostr', function () {
+ 'use strict';
+ return function (arr, separator) {
+ if (arr) {
+ return _.join(arr, separator);
+ }
+ return '';
+ };
+})
+.filter('ownershipicon', function () {
+ 'use strict';
+ return function (ownership) {
+ switch (ownership) {
+ case 'private':
+ return 'fa fa-eye-slash';
+ case 'administrators':
+ return 'fa fa-eye-slash';
+ case 'restricted':
+ return 'fa fa-users';
+ default:
+ return 'fa fa-eye';
+ }
+ };
+});
diff --git a/app/helpers/formHelper.js b/app/portainer/helpers/formHelper.js
similarity index 90%
rename from app/helpers/formHelper.js
rename to app/portainer/helpers/formHelper.js
index 7cb3456f1c701..db733b12fb5c0 100644
--- a/app/helpers/formHelper.js
+++ b/app/portainer/helpers/formHelper.js
@@ -1,4 +1,4 @@
-angular.module('portainer.helpers')
+angular.module('portainer.app')
.factory('FormHelper', [function FormHelperFactory() {
'use strict';
var helper = {};
diff --git a/app/helpers/registryHelper.js b/app/portainer/helpers/registryHelper.js
similarity index 89%
rename from app/helpers/registryHelper.js
rename to app/portainer/helpers/registryHelper.js
index 90a582b2aee28..bef569f6df416 100644
--- a/app/helpers/registryHelper.js
+++ b/app/portainer/helpers/registryHelper.js
@@ -1,4 +1,4 @@
-angular.module('portainer.helpers')
+angular.module('portainer.app')
.factory('RegistryHelper', [function RegistryHelperFactory() {
'use strict';
@@ -13,6 +13,6 @@ angular.module('portainer.helpers')
return null;
};
-
+
return helper;
}]);
diff --git a/app/helpers/resourceControlHelper.js b/app/portainer/helpers/resourceControlHelper.js
similarity index 97%
rename from app/helpers/resourceControlHelper.js
rename to app/portainer/helpers/resourceControlHelper.js
index 49901b2aa3989..be668f5d624a0 100644
--- a/app/helpers/resourceControlHelper.js
+++ b/app/portainer/helpers/resourceControlHelper.js
@@ -1,4 +1,4 @@
-angular.module('portainer.helpers')
+angular.module('portainer.app')
.factory('ResourceControlHelper', [function ResourceControlHelperFactory() {
'use strict';
var helper = {};
diff --git a/app/helpers/stackHelper.js b/app/portainer/helpers/stackHelper.js
similarity index 93%
rename from app/helpers/stackHelper.js
rename to app/portainer/helpers/stackHelper.js
index 8701d9d4fe363..439efeb22c333 100644
--- a/app/helpers/stackHelper.js
+++ b/app/portainer/helpers/stackHelper.js
@@ -1,4 +1,4 @@
-angular.module('portainer.helpers')
+angular.module('portainer.app')
.factory('StackHelper', [function StackHelperFactory() {
'use strict';
var helper = {};
diff --git a/app/helpers/templateHelper.js b/app/portainer/helpers/templateHelper.js
similarity index 99%
rename from app/helpers/templateHelper.js
rename to app/portainer/helpers/templateHelper.js
index 288bed5774e6e..2922b91fee309 100644
--- a/app/helpers/templateHelper.js
+++ b/app/portainer/helpers/templateHelper.js
@@ -1,4 +1,4 @@
-angular.module('portainer.helpers')
+angular.module('portainer.app')
.factory('TemplateHelper', ['$filter', function TemplateHelperFactory($filter) {
'use strict';
var helper = {};
diff --git a/app/helpers/userHelper.js b/app/portainer/helpers/userHelper.js
similarity index 88%
rename from app/helpers/userHelper.js
rename to app/portainer/helpers/userHelper.js
index 5962b1bb5f607..77b439bfb9f71 100644
--- a/app/helpers/userHelper.js
+++ b/app/portainer/helpers/userHelper.js
@@ -1,4 +1,4 @@
-angular.module('portainer.helpers')
+angular.module('portainer.app')
.factory('UserHelper', [function UserHelperFactory() {
'use strict';
var helper = {};
diff --git a/app/models/api/access.js b/app/portainer/models/access.js
similarity index 100%
rename from app/models/api/access.js
rename to app/portainer/models/access.js
diff --git a/app/models/api/dockerhub.js b/app/portainer/models/dockerhub.js
similarity index 100%
rename from app/models/api/dockerhub.js
rename to app/portainer/models/dockerhub.js
diff --git a/app/models/api/registry.js b/app/portainer/models/registry.js
similarity index 100%
rename from app/models/api/registry.js
rename to app/portainer/models/registry.js
diff --git a/app/models/api/resourceControl.js b/app/portainer/models/resourceControl.js
similarity index 100%
rename from app/models/api/resourceControl.js
rename to app/portainer/models/resourceControl.js
diff --git a/app/models/api/settings/ldapSettings.js b/app/portainer/models/settings/ldapSettings.js
similarity index 100%
rename from app/models/api/settings/ldapSettings.js
rename to app/portainer/models/settings/ldapSettings.js
diff --git a/app/models/api/settings/settings.js b/app/portainer/models/settings/settings.js
similarity index 100%
rename from app/models/api/settings/settings.js
rename to app/portainer/models/settings/settings.js
diff --git a/app/models/api/status.js b/app/portainer/models/status.js
similarity index 100%
rename from app/models/api/status.js
rename to app/portainer/models/status.js
diff --git a/app/models/api/team.js b/app/portainer/models/team.js
similarity index 100%
rename from app/models/api/team.js
rename to app/portainer/models/team.js
diff --git a/app/models/api/teamMembership.js b/app/portainer/models/teamMembership.js
similarity index 100%
rename from app/models/api/teamMembership.js
rename to app/portainer/models/teamMembership.js
diff --git a/app/models/api/user.js b/app/portainer/models/user.js
similarity index 100%
rename from app/models/api/user.js
rename to app/portainer/models/user.js
diff --git a/app/rest/api/auth.js b/app/portainer/rest/auth.js
similarity index 87%
rename from app/rest/api/auth.js
rename to app/portainer/rest/auth.js
index 179225cd2e4fc..0503b830e0530 100644
--- a/app/rest/api/auth.js
+++ b/app/portainer/rest/auth.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Auth', ['$resource', 'API_ENDPOINT_AUTH', function AuthFactory($resource, API_ENDPOINT_AUTH) {
'use strict';
return $resource(API_ENDPOINT_AUTH, {}, {
diff --git a/app/rest/api/dockerhub.js b/app/portainer/rest/dockerhub.js
similarity index 88%
rename from app/rest/api/dockerhub.js
rename to app/portainer/rest/dockerhub.js
index 5572be7f770cd..319eb2053d011 100644
--- a/app/rest/api/dockerhub.js
+++ b/app/portainer/rest/dockerhub.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('DockerHub', ['$resource', 'API_ENDPOINT_DOCKERHUB', function DockerHubFactory($resource, API_ENDPOINT_DOCKERHUB) {
'use strict';
return $resource(API_ENDPOINT_DOCKERHUB, {}, {
diff --git a/app/rest/api/endpoint.js b/app/portainer/rest/endpoint.js
similarity index 94%
rename from app/rest/api/endpoint.js
rename to app/portainer/rest/endpoint.js
index f4a0e76ce84c9..34c3ac8552e8a 100644
--- a/app/rest/api/endpoint.js
+++ b/app/portainer/rest/endpoint.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Endpoints', ['$resource', 'API_ENDPOINT_ENDPOINTS', function EndpointsFactory($resource, API_ENDPOINT_ENDPOINTS) {
'use strict';
return $resource(API_ENDPOINT_ENDPOINTS + '/:id/:action', {}, {
diff --git a/app/rest/api/registry.js b/app/portainer/rest/registry.js
similarity index 94%
rename from app/rest/api/registry.js
rename to app/portainer/rest/registry.js
index cbeec9f7ce1ba..56c46a3d02da2 100644
--- a/app/rest/api/registry.js
+++ b/app/portainer/rest/registry.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Registries', ['$resource', 'API_ENDPOINT_REGISTRIES', function RegistriesFactory($resource, API_ENDPOINT_REGISTRIES) {
'use strict';
return $resource(API_ENDPOINT_REGISTRIES + '/:id/:action', {}, {
diff --git a/app/rest/api/resourceControl.js b/app/portainer/rest/resourceControl.js
similarity index 93%
rename from app/rest/api/resourceControl.js
rename to app/portainer/rest/resourceControl.js
index 22a5af6b45a78..e883f57ee39d7 100644
--- a/app/rest/api/resourceControl.js
+++ b/app/portainer/rest/resourceControl.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('ResourceControl', ['$resource', 'API_ENDPOINT_RESOURCE_CONTROLS', function ResourceControlFactory($resource, API_ENDPOINT_RESOURCE_CONTROLS) {
'use strict';
return $resource(API_ENDPOINT_RESOURCE_CONTROLS + '/:id', {}, {
diff --git a/app/rest/api/settings.js b/app/portainer/rest/settings.js
similarity index 93%
rename from app/rest/api/settings.js
rename to app/portainer/rest/settings.js
index 184504f540a5c..da4d92ba881f1 100644
--- a/app/rest/api/settings.js
+++ b/app/portainer/rest/settings.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Settings', ['$resource', 'API_ENDPOINT_SETTINGS', function SettingsFactory($resource, API_ENDPOINT_SETTINGS) {
'use strict';
return $resource(API_ENDPOINT_SETTINGS + '/:subResource/:action', {}, {
diff --git a/app/rest/api/stack.js b/app/portainer/rest/stack.js
similarity index 95%
rename from app/rest/api/stack.js
rename to app/portainer/rest/stack.js
index 9899b0043cde6..1ebda7274a583 100644
--- a/app/rest/api/stack.js
+++ b/app/portainer/rest/stack.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Stack', ['$resource', 'EndpointProvider', 'API_ENDPOINT_ENDPOINTS', function StackFactory($resource, EndpointProvider, API_ENDPOINT_ENDPOINTS) {
'use strict';
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/stacks/:id/:action', {
diff --git a/app/rest/api/status.js b/app/portainer/rest/status.js
similarity index 86%
rename from app/rest/api/status.js
rename to app/portainer/rest/status.js
index 285c67ef58ff4..888a948bf9162 100644
--- a/app/rest/api/status.js
+++ b/app/portainer/rest/status.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Status', ['$resource', 'API_ENDPOINT_STATUS', function StatusFactory($resource, API_ENDPOINT_STATUS) {
'use strict';
return $resource(API_ENDPOINT_STATUS, {}, {
diff --git a/app/rest/api/team.js b/app/portainer/rest/team.js
similarity index 94%
rename from app/rest/api/team.js
rename to app/portainer/rest/team.js
index 85537f70ff96e..18c3bfc64fbfa 100644
--- a/app/rest/api/team.js
+++ b/app/portainer/rest/team.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Teams', ['$resource', 'API_ENDPOINT_TEAMS', function TeamsFactory($resource, API_ENDPOINT_TEAMS) {
'use strict';
return $resource(API_ENDPOINT_TEAMS + '/:id/:entity/:entityId', {}, {
diff --git a/app/rest/api/teamMembership.js b/app/portainer/rest/teamMembership.js
similarity index 93%
rename from app/rest/api/teamMembership.js
rename to app/portainer/rest/teamMembership.js
index f7293d5914a3b..7514de8c8e244 100644
--- a/app/rest/api/teamMembership.js
+++ b/app/portainer/rest/teamMembership.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('TeamMemberships', ['$resource', 'API_ENDPOINT_TEAM_MEMBERSHIPS', function TeamMembershipsFactory($resource, API_ENDPOINT_TEAM_MEMBERSHIPS) {
'use strict';
return $resource(API_ENDPOINT_TEAM_MEMBERSHIPS + '/:id/:action', {}, {
diff --git a/app/rest/api/template.js b/app/portainer/rest/template.js
similarity index 87%
rename from app/rest/api/template.js
rename to app/portainer/rest/template.js
index b01a9557537bd..22a8542de2abc 100644
--- a/app/rest/api/template.js
+++ b/app/portainer/rest/template.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Template', ['$resource', 'API_ENDPOINT_TEMPLATES', function TemplateFactory($resource, API_ENDPOINT_TEMPLATES) {
return $resource(API_ENDPOINT_TEMPLATES, {}, {
get: {method: 'GET', isArray: true}
diff --git a/app/rest/api/user.js b/app/portainer/rest/user.js
similarity index 96%
rename from app/rest/api/user.js
rename to app/portainer/rest/user.js
index 6337d29499b35..c6cb0b47e478a 100644
--- a/app/rest/api/user.js
+++ b/app/portainer/rest/user.js
@@ -1,4 +1,4 @@
-angular.module('portainer.rest')
+angular.module('portainer.app')
.factory('Users', ['$resource', 'API_ENDPOINT_USERS', function UsersFactory($resource, API_ENDPOINT_USERS) {
'use strict';
return $resource(API_ENDPOINT_USERS + '/:id/:entity/:entityId', {}, {
diff --git a/app/services/api/accessService.js b/app/portainer/services/api/accessService.js
similarity index 97%
rename from app/services/api/accessService.js
rename to app/portainer/services/api/accessService.js
index 2182a8b21ff18..65382a4ba8660 100644
--- a/app/services/api/accessService.js
+++ b/app/portainer/services/api/accessService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('AccessService', ['$q', 'UserService', 'TeamService', function AccessServiceFactory($q, UserService, TeamService) {
'use strict';
var service = {};
diff --git a/app/services/api/dockerhubService.js b/app/portainer/services/api/dockerhubService.js
similarity index 94%
rename from app/services/api/dockerhubService.js
rename to app/portainer/services/api/dockerhubService.js
index 10f213d68874c..aeb291082ca3f 100644
--- a/app/services/api/dockerhubService.js
+++ b/app/portainer/services/api/dockerhubService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('DockerHubService', ['$q', 'DockerHub', function DockerHubServiceFactory($q, DockerHub) {
'use strict';
var service = {};
diff --git a/app/services/api/endpointService.js b/app/portainer/services/api/endpointService.js
similarity index 98%
rename from app/services/api/endpointService.js
rename to app/portainer/services/api/endpointService.js
index 742b2fc3cb4ff..2a1976e4fce93 100644
--- a/app/services/api/endpointService.js
+++ b/app/portainer/services/api/endpointService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('EndpointService', ['$q', 'Endpoints', 'FileUploadService', function EndpointServiceFactory($q, Endpoints, FileUploadService) {
'use strict';
var service = {};
diff --git a/app/services/api/registryService.js b/app/portainer/services/api/registryService.js
similarity index 98%
rename from app/services/api/registryService.js
rename to app/portainer/services/api/registryService.js
index a71d024039fcc..b6193f89bfcb5 100644
--- a/app/services/api/registryService.js
+++ b/app/portainer/services/api/registryService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('RegistryService', ['$q', 'Registries', 'DockerHubService', 'RegistryHelper', 'ImageHelper', function RegistryServiceFactory($q, Registries, DockerHubService, RegistryHelper, ImageHelper) {
'use strict';
var service = {};
diff --git a/app/services/api/resourceControlService.js b/app/portainer/services/api/resourceControlService.js
similarity index 99%
rename from app/services/api/resourceControlService.js
rename to app/portainer/services/api/resourceControlService.js
index 6f7ae11a09864..1ee0b148c56be 100644
--- a/app/services/api/resourceControlService.js
+++ b/app/portainer/services/api/resourceControlService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('ResourceControlService', ['$q', 'ResourceControl', 'UserService', 'TeamService', 'ResourceControlHelper', function ResourceControlServiceFactory($q, ResourceControl, UserService, TeamService, ResourceControlHelper) {
'use strict';
var service = {};
diff --git a/app/services/api/settingsService.js b/app/portainer/services/api/settingsService.js
similarity index 96%
rename from app/services/api/settingsService.js
rename to app/portainer/services/api/settingsService.js
index 4455abb97af6f..a725ce09cc6e4 100644
--- a/app/services/api/settingsService.js
+++ b/app/portainer/services/api/settingsService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('SettingsService', ['$q', 'Settings', function SettingsServiceFactory($q, Settings) {
'use strict';
var service = {};
diff --git a/app/services/api/statusService.js b/app/portainer/services/api/statusService.js
similarity index 93%
rename from app/services/api/statusService.js
rename to app/portainer/services/api/statusService.js
index 0989514ab3c00..bede72339c382 100644
--- a/app/services/api/statusService.js
+++ b/app/portainer/services/api/statusService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('StatusService', ['$q', 'Status', function StatusServiceFactory($q, Status) {
'use strict';
var service = {};
diff --git a/app/services/api/teamMembershipService.js b/app/portainer/services/api/teamMembershipService.js
similarity index 96%
rename from app/services/api/teamMembershipService.js
rename to app/portainer/services/api/teamMembershipService.js
index 4b2c43ebd0eec..add4d6fcace3f 100644
--- a/app/services/api/teamMembershipService.js
+++ b/app/portainer/services/api/teamMembershipService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('TeamMembershipService', ['$q', 'TeamMemberships', function TeamMembershipFactory($q, TeamMemberships) {
'use strict';
var service = {};
diff --git a/app/services/api/teamService.js b/app/portainer/services/api/teamService.js
similarity index 98%
rename from app/services/api/teamService.js
rename to app/portainer/services/api/teamService.js
index 3b21f2bf6042f..d13ff8ffdaf45 100644
--- a/app/services/api/teamService.js
+++ b/app/portainer/services/api/teamService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('TeamService', ['$q', 'Teams', 'TeamMembershipService', function TeamServiceFactory($q, Teams, TeamMembershipService) {
'use strict';
var service = {};
diff --git a/app/services/api/userService.js b/app/portainer/services/api/userService.js
similarity index 99%
rename from app/services/api/userService.js
rename to app/portainer/services/api/userService.js
index 50680d7df8a62..1c3d0c2ff4208 100644
--- a/app/services/api/userService.js
+++ b/app/portainer/services/api/userService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('UserService', ['$q', 'Users', 'UserHelper', 'TeamService', 'TeamMembershipService', function UserServiceFactory($q, Users, UserHelper, TeamService, TeamMembershipService) {
'use strict';
var service = {};
diff --git a/app/services/authentication.js b/app/portainer/services/authentication.js
similarity index 97%
rename from app/services/authentication.js
rename to app/portainer/services/authentication.js
index 9fee8e7de96ef..e0fb48cc1582a 100644
--- a/app/services/authentication.js
+++ b/app/portainer/services/authentication.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('Authentication', ['$q', 'Auth', 'jwtHelper', 'LocalStorage', 'StateManager', 'EndpointProvider', function AuthenticationFactory($q, Auth, jwtHelper, LocalStorage, StateManager, EndpointProvider) {
'use strict';
diff --git a/app/services/chartService.js b/app/portainer/services/chartService.js
similarity index 99%
rename from app/services/chartService.js
rename to app/portainer/services/chartService.js
index 6510f2f5d937c..7fb1e21a1b103 100644
--- a/app/services/chartService.js
+++ b/app/portainer/services/chartService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('ChartService', [function ChartService() {
'use strict';
diff --git a/app/services/codeMirror.js b/app/portainer/services/codeMirror.js
similarity index 94%
rename from app/services/codeMirror.js
rename to app/portainer/services/codeMirror.js
index e4cf3b821a1a3..0148500a1e0f1 100644
--- a/app/services/codeMirror.js
+++ b/app/portainer/services/codeMirror.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('CodeMirrorService', function CodeMirrorService() {
'use strict';
diff --git a/app/directives/ui/datatables/datatableService.js b/app/portainer/services/datatableService.js
similarity index 96%
rename from app/directives/ui/datatables/datatableService.js
rename to app/portainer/services/datatableService.js
index ff4e9448d80dc..67f7233497c2f 100644
--- a/app/directives/ui/datatables/datatableService.js
+++ b/app/portainer/services/datatableService.js
@@ -1,4 +1,4 @@
-angular.module('ui')
+angular.module('portainer.app')
.factory('DatatableService', ['LocalStorage',
function DatatableServiceFactory(LocalStorage) {
'use strict';
diff --git a/app/services/endpointProvider.js b/app/portainer/services/endpointProvider.js
similarity index 96%
rename from app/services/endpointProvider.js
rename to app/portainer/services/endpointProvider.js
index cc1afc4da230a..21d635d64e638 100644
--- a/app/services/endpointProvider.js
+++ b/app/portainer/services/endpointProvider.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('EndpointProvider', ['LocalStorage', function EndpointProviderFactory(LocalStorage) {
'use strict';
var service = {};
diff --git a/app/services/extensionManager.js b/app/portainer/services/extensionManager.js
similarity index 95%
rename from app/services/extensionManager.js
rename to app/portainer/services/extensionManager.js
index 9e8b77ae4db8f..4fdbf8cc0ca6f 100644
--- a/app/services/extensionManager.js
+++ b/app/portainer/services/extensionManager.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('ExtensionManager', ['$q', 'PluginService', 'StoridgeManager', function ExtensionManagerFactory($q, PluginService, StoridgeManager) {
'use strict';
var service = {};
diff --git a/app/services/fileUpload.js b/app/portainer/services/fileUpload.js
similarity index 97%
rename from app/services/fileUpload.js
rename to app/portainer/services/fileUpload.js
index 4efc3b5cd1a82..5ac738884929a 100644
--- a/app/services/fileUpload.js
+++ b/app/portainer/services/fileUpload.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('FileUploadService', ['$q', 'Upload', 'EndpointProvider', function FileUploadFactory($q, Upload, EndpointProvider) {
'use strict';
diff --git a/app/services/formValidator.js b/app/portainer/services/formValidator.js
similarity index 95%
rename from app/services/formValidator.js
rename to app/portainer/services/formValidator.js
index cfd513d08ac60..6692bb9145a88 100644
--- a/app/services/formValidator.js
+++ b/app/portainer/services/formValidator.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('FormValidator', [function FormValidatorFactory() {
'use strict';
diff --git a/app/services/httpRequestHelper.js b/app/portainer/services/httpRequestHelper.js
similarity index 90%
rename from app/services/httpRequestHelper.js
rename to app/portainer/services/httpRequestHelper.js
index f6582b5a0a15b..857d47d7f3dea 100644
--- a/app/services/httpRequestHelper.js
+++ b/app/portainer/services/httpRequestHelper.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('HttpRequestHelper', [function HttpRequestHelper() {
'use strict';
diff --git a/app/services/localStorage.js b/app/portainer/services/localStorage.js
similarity index 98%
rename from app/services/localStorage.js
rename to app/portainer/services/localStorage.js
index 144ea551e2d8e..24b7be1cf2432 100644
--- a/app/services/localStorage.js
+++ b/app/portainer/services/localStorage.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('LocalStorage', ['localStorageService', function LocalStorageFactory(localStorageService) {
'use strict';
return {
diff --git a/app/services/modalService.js b/app/portainer/services/modalService.js
similarity index 99%
rename from app/services/modalService.js
rename to app/portainer/services/modalService.js
index 4c81bdcc64847..0edd374f28540 100644
--- a/app/services/modalService.js
+++ b/app/portainer/services/modalService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('ModalService', [function ModalServiceFactory() {
'use strict';
var service = {};
diff --git a/app/services/notifications.js b/app/portainer/services/notifications.js
similarity index 96%
rename from app/services/notifications.js
rename to app/portainer/services/notifications.js
index d124f2deb26cf..6ebff6ba1c20a 100644
--- a/app/services/notifications.js
+++ b/app/portainer/services/notifications.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('Notifications', ['$sanitize', function NotificationsFactory($sanitize) {
'use strict';
var service = {};
diff --git a/app/services/pagination.js b/app/portainer/services/pagination.js
similarity index 94%
rename from app/services/pagination.js
rename to app/portainer/services/pagination.js
index e6866a0f03c43..34bc9f5a91e68 100644
--- a/app/services/pagination.js
+++ b/app/portainer/services/pagination.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('PaginationService', ['LocalStorage', 'PAGINATION_MAX_ITEMS',
function PaginationServiceFactory(LocalStorage, PAGINATION_MAX_ITEMS) {
'use strict';
diff --git a/app/services/stateManager.js b/app/portainer/services/stateManager.js
similarity index 99%
rename from app/services/stateManager.js
rename to app/portainer/services/stateManager.js
index c2f358375078b..ca9b8aebef501 100644
--- a/app/services/stateManager.js
+++ b/app/portainer/services/stateManager.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('StateManager', ['$q', 'SystemService', 'InfoHelper', 'LocalStorage', 'SettingsService', 'StatusService', 'ExtensionManager', 'APPLICATION_CACHE_VALIDITY', function StateManagerFactory($q, SystemService, InfoHelper, LocalStorage, SettingsService, StatusService, ExtensionManager, APPLICATION_CACHE_VALIDITY) {
'use strict';
diff --git a/app/services/templateService.js b/app/portainer/services/templateService.js
similarity index 98%
rename from app/services/templateService.js
rename to app/portainer/services/templateService.js
index ca08f756c7df2..d6518a6fab5a6 100644
--- a/app/services/templateService.js
+++ b/app/portainer/services/templateService.js
@@ -1,4 +1,4 @@
-angular.module('portainer.services')
+angular.module('portainer.app')
.factory('TemplateService', ['$q', 'Template', 'TemplateHelper', 'ImageHelper', 'ContainerHelper', function TemplateServiceFactory($q, Template, TemplateHelper, ImageHelper, ContainerHelper) {
'use strict';
var service = {};
diff --git a/app/components/about/about.html b/app/portainer/views/about/about.html
similarity index 100%
rename from app/components/about/about.html
rename to app/portainer/views/about/about.html
diff --git a/app/components/userSettings/userSettings.html b/app/portainer/views/account/account.html
similarity index 100%
rename from app/components/userSettings/userSettings.html
rename to app/portainer/views/account/account.html
diff --git a/app/components/userSettings/userSettingsController.js b/app/portainer/views/account/accountController.js
similarity index 87%
rename from app/components/userSettings/userSettingsController.js
rename to app/portainer/views/account/accountController.js
index 50501eb4cf559..b842b73179f63 100644
--- a/app/components/userSettings/userSettingsController.js
+++ b/app/portainer/views/account/accountController.js
@@ -1,5 +1,5 @@
-angular.module('userSettings', [])
-.controller('UserSettingsController', ['$scope', '$state', '$sanitize', 'Authentication', 'UserService', 'Notifications', 'SettingsService',
+angular.module('portainer.app')
+.controller('AccountController', ['$scope', '$state', '$sanitize', 'Authentication', 'UserService', 'Notifications', 'SettingsService',
function ($scope, $state, $sanitize, Authentication, UserService, Notifications, SettingsService) {
$scope.formValues = {
currentPassword: '',
diff --git a/app/components/auth/auth.html b/app/portainer/views/auth/auth.html
similarity index 100%
rename from app/components/auth/auth.html
rename to app/portainer/views/auth/auth.html
diff --git a/app/components/auth/authController.js b/app/portainer/views/auth/authController.js
similarity index 93%
rename from app/components/auth/authController.js
rename to app/portainer/views/auth/authController.js
index 81a7fc05d0e57..e1b1164a22e83 100644
--- a/app/components/auth/authController.js
+++ b/app/portainer/views/auth/authController.js
@@ -1,4 +1,4 @@
-angular.module('auth', [])
+angular.module('portainer.app')
.controller('AuthenticationController', ['$scope', '$state', '$transition$', '$window', '$timeout', '$sanitize', 'Authentication', 'Users', 'UserService', 'EndpointService', 'StateManager', 'EndpointProvider', 'Notifications', 'SettingsService',
function ($scope, $state, $transition$, $window, $timeout, $sanitize, Authentication, Users, UserService, EndpointService, StateManager, EndpointProvider, Notifications, SettingsService) {
@@ -20,7 +20,7 @@ function ($scope, $state, $transition$, $window, $timeout, $sanitize, Authentica
}
StateManager.updateEndpointState(true)
.then(function success(data) {
- $state.go('dashboard');
+ $state.go('docker.dashboard');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to connect to the Docker endpoint');
@@ -34,7 +34,7 @@ function ($scope, $state, $transition$, $window, $timeout, $sanitize, Authentica
if (endpoints.length > 0) {
setActiveEndpointAndRedirectToDashboard(endpoints[0]);
} else {
- $state.go('init.endpoint');
+ $state.go('portainer.init.endpoint');
}
})
.catch(function error(err) {
@@ -46,7 +46,7 @@ function ($scope, $state, $transition$, $window, $timeout, $sanitize, Authentica
UserService.administratorExists()
.then(function success(exists) {
if (!exists) {
- $state.go('init.admin');
+ $state.go('portainer.init.admin');
}
})
.catch(function error(err) {
@@ -76,7 +76,7 @@ function ($scope, $state, $transition$, $window, $timeout, $sanitize, Authentica
if (endpoints.length > 0) {
setActiveEndpointAndRedirectToDashboard(endpoints[0]);
} else if (endpoints.length === 0 && userDetails.role === 1) {
- $state.go('init.endpoint');
+ $state.go('portainer.init.endpoint');
} else if (endpoints.length === 0 && userDetails.role === 2) {
Authentication.logout();
$scope.state.AuthenticationError = 'User not allowed. Please contact your administrator.';
@@ -95,7 +95,7 @@ function ($scope, $state, $transition$, $window, $timeout, $sanitize, Authentica
}
if (Authentication.isAuthenticated()) {
- $state.go('dashboard');
+ $state.go('docker.dashboard');
}
var authenticationEnabled = $scope.applicationState.application.authentication;
diff --git a/app/components/endpointAccess/endpointAccess.html b/app/portainer/views/endpoints/access/endpointAccess.html
similarity index 88%
rename from app/components/endpointAccess/endpointAccess.html
rename to app/portainer/views/endpoints/access/endpointAccess.html
index fcf65c3c4f9aa..32d111856d871 100644
--- a/app/components/endpointAccess/endpointAccess.html
+++ b/app/portainer/views/endpoints/access/endpointAccess.html
@@ -1,7 +1,7 @@
- Endpoints > {{ endpoint.Name }} > Access management
+ Endpoints > {{ endpoint.Name }} > Access management
diff --git a/app/components/endpointAccess/endpointAccessController.js b/app/portainer/views/endpoints/access/endpointAccessController.js
similarity index 94%
rename from app/components/endpointAccess/endpointAccessController.js
rename to app/portainer/views/endpoints/access/endpointAccessController.js
index f4d96710bdaca..b2de91a2267d7 100644
--- a/app/components/endpointAccess/endpointAccessController.js
+++ b/app/portainer/views/endpoints/access/endpointAccessController.js
@@ -1,4 +1,4 @@
-angular.module('endpointAccess', [])
+angular.module('portainer.app')
.controller('EndpointAccessController', ['$scope', '$transition$', 'EndpointService', 'Notifications',
function ($scope, $transition$, EndpointService, Notifications) {
diff --git a/app/components/endpoint/endpoint.html b/app/portainer/views/endpoints/edit/endpoint.html
similarity index 94%
rename from app/components/endpoint/endpoint.html
rename to app/portainer/views/endpoints/edit/endpoint.html
index 76f1188bd3b3c..0a4eba6829b17 100644
--- a/app/components/endpoint/endpoint.html
+++ b/app/portainer/views/endpoints/edit/endpoint.html
@@ -1,7 +1,7 @@
- Endpoints > {{ endpoint.Name }}
+ Endpoints > {{ endpoint.Name }}
@@ -57,7 +57,7 @@
Update endpoint
Updating endpoint...
- Cancel
+ Cancel
diff --git a/app/components/endpoint/endpointController.js b/app/portainer/views/endpoints/edit/endpointController.js
similarity index 95%
rename from app/components/endpoint/endpointController.js
rename to app/portainer/views/endpoints/edit/endpointController.js
index 63316489bc094..cc9a89004846b 100644
--- a/app/components/endpoint/endpointController.js
+++ b/app/portainer/views/endpoints/edit/endpointController.js
@@ -1,9 +1,9 @@
-angular.module('endpoint', [])
+angular.module('portainer.app')
.controller('EndpointController', ['$scope', '$state', '$transition$', '$filter', 'EndpointService', 'Notifications',
function ($scope, $state, $transition$, $filter, EndpointService, Notifications) {
if (!$scope.applicationState.application.endpointManagement) {
- $state.go('endpoints');
+ $state.go('portainer.endpoints');
}
$scope.state = {
@@ -40,7 +40,7 @@ function ($scope, $state, $transition$, $filter, EndpointService, Notifications)
EndpointService.updateEndpoint(endpoint.Id, endpointParams)
.then(function success(data) {
Notifications.success('Endpoint updated', $scope.endpoint.Name);
- $state.go('endpoints');
+ $state.go('portainer.endpoints');
}, function error(err) {
Notifications.error('Failure', err, 'Unable to update endpoint');
$scope.state.actionInProgress = false;
diff --git a/app/components/endpoints/endpoints.html b/app/portainer/views/endpoints/endpoints.html
similarity index 97%
rename from app/components/endpoints/endpoints.html
rename to app/portainer/views/endpoints/endpoints.html
index 743befc91b92d..b27569673fab7 100644
--- a/app/components/endpoints/endpoints.html
+++ b/app/portainer/views/endpoints/endpoints.html
@@ -1,6 +1,6 @@
-
+
diff --git a/app/components/endpoints/endpointsController.js b/app/portainer/views/endpoints/endpointsController.js
similarity index 98%
rename from app/components/endpoints/endpointsController.js
rename to app/portainer/views/endpoints/endpointsController.js
index 01c2056630e85..76910cd4b5121 100644
--- a/app/components/endpoints/endpointsController.js
+++ b/app/portainer/views/endpoints/endpointsController.js
@@ -1,4 +1,4 @@
-angular.module('endpoints', [])
+angular.module('portainer.app')
.controller('EndpointsController', ['$scope', '$state', '$filter', 'EndpointService', 'Notifications',
function ($scope, $state, $filter, EndpointService, Notifications) {
$scope.state = {
diff --git a/app/components/initAdmin/initAdmin.html b/app/portainer/views/init/admin/initAdmin.html
similarity index 100%
rename from app/components/initAdmin/initAdmin.html
rename to app/portainer/views/init/admin/initAdmin.html
diff --git a/app/components/initAdmin/initAdminController.js b/app/portainer/views/init/admin/initAdminController.js
similarity index 92%
rename from app/components/initAdmin/initAdminController.js
rename to app/portainer/views/init/admin/initAdminController.js
index 0b0bcfee78e90..c7a915f1801f6 100644
--- a/app/components/initAdmin/initAdminController.js
+++ b/app/portainer/views/init/admin/initAdminController.js
@@ -1,4 +1,4 @@
-angular.module('initAdmin', [])
+angular.module('portainer.app')
.controller('InitAdminController', ['$scope', '$state', '$sanitize', 'Notifications', 'Authentication', 'StateManager', 'UserService', 'EndpointService', 'EndpointProvider',
function ($scope, $state, $sanitize, Notifications, Authentication, StateManager, UserService, EndpointService, EndpointProvider) {
@@ -28,13 +28,13 @@ function ($scope, $state, $sanitize, Notifications, Authentication, StateManager
})
.then(function success(data) {
if (data.length === 0) {
- $state.go('init.endpoint');
+ $state.go('portainer.init.endpoint');
} else {
var endpointID = data[0].Id;
EndpointProvider.setEndpointID(endpointID);
StateManager.updateEndpointState(false)
.then(function success() {
- $state.go('dashboard');
+ $state.go('docker.dashboard');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to connect to Docker environment');
diff --git a/app/components/initEndpoint/initEndpoint.html b/app/portainer/views/init/endpoint/initEndpoint.html
similarity index 100%
rename from app/components/initEndpoint/initEndpoint.html
rename to app/portainer/views/init/endpoint/initEndpoint.html
diff --git a/app/components/initEndpoint/initEndpointController.js b/app/portainer/views/init/endpoint/initEndpointController.js
similarity index 94%
rename from app/components/initEndpoint/initEndpointController.js
rename to app/portainer/views/init/endpoint/initEndpointController.js
index cbca5c66bfa6d..e26236e69099d 100644
--- a/app/components/initEndpoint/initEndpointController.js
+++ b/app/portainer/views/init/endpoint/initEndpointController.js
@@ -1,9 +1,9 @@
-angular.module('initEndpoint', [])
+angular.module('portainer.app')
.controller('InitEndpointController', ['$scope', '$state', 'EndpointService', 'StateManager', 'EndpointProvider', 'Notifications',
function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notifications) {
if (!_.isEmpty($scope.applicationState.endpoint)) {
- $state.go('dashboard');
+ $state.go('docker.dashboard');
}
$scope.logo = StateManager.getState().application.logo;
@@ -38,7 +38,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif
return StateManager.updateEndpointState(false);
})
.then(function success(data) {
- $state.go('dashboard');
+ $state.go('docker.dashboard');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to connect to the Docker environment');
@@ -69,7 +69,7 @@ function ($scope, $state, EndpointService, StateManager, EndpointProvider, Notif
return StateManager.updateEndpointState(false);
})
.then(function success(data) {
- $state.go('dashboard');
+ $state.go('docker.dashboard');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to connect to the Docker environment');
diff --git a/app/components/main/mainController.js b/app/portainer/views/main/mainController.js
similarity index 96%
rename from app/components/main/mainController.js
rename to app/portainer/views/main/mainController.js
index 3bfd981716779..3af2a6d952762 100644
--- a/app/components/main/mainController.js
+++ b/app/portainer/views/main/mainController.js
@@ -1,4 +1,4 @@
-angular.module('main', [])
+angular.module('portainer.app')
.controller('MainController', ['$scope', '$cookieStore', 'StateManager',
function ($scope, $cookieStore, StateManager) {
diff --git a/app/components/registryAccess/registryAccess.html b/app/portainer/views/registries/access/registryAccess.html
similarity index 88%
rename from app/components/registryAccess/registryAccess.html
rename to app/portainer/views/registries/access/registryAccess.html
index 7fc8ac972843e..18758a7ab2c0b 100644
--- a/app/components/registryAccess/registryAccess.html
+++ b/app/portainer/views/registries/access/registryAccess.html
@@ -1,7 +1,7 @@
- Registries > {{ registry.Name }} > Access management
+ Registries > {{ registry.Name }} > Access management
diff --git a/app/components/registryAccess/registryAccessController.js b/app/portainer/views/registries/access/registryAccessController.js
similarity index 94%
rename from app/components/registryAccess/registryAccessController.js
rename to app/portainer/views/registries/access/registryAccessController.js
index 25bd9f4831f6b..81e3d45a6eb10 100644
--- a/app/components/registryAccess/registryAccessController.js
+++ b/app/portainer/views/registries/access/registryAccessController.js
@@ -1,4 +1,4 @@
-angular.module('registryAccess', [])
+angular.module('portainer.app')
.controller('RegistryAccessController', ['$scope', '$transition$', 'RegistryService', 'Notifications',
function ($scope, $transition$, RegistryService, Notifications) {
diff --git a/app/components/createRegistry/createRegistryController.js b/app/portainer/views/registries/create/createRegistryController.js
similarity index 95%
rename from app/components/createRegistry/createRegistryController.js
rename to app/portainer/views/registries/create/createRegistryController.js
index 370c62e720b3d..2dd0f021a061a 100644
--- a/app/components/createRegistry/createRegistryController.js
+++ b/app/portainer/views/registries/create/createRegistryController.js
@@ -1,4 +1,4 @@
-angular.module('createRegistry', [])
+angular.module('portainer.app')
.controller('CreateRegistryController', ['$scope', '$state', 'RegistryService', 'Notifications',
function ($scope, $state, RegistryService, Notifications) {
@@ -38,7 +38,7 @@ function ($scope, $state, RegistryService, Notifications) {
RegistryService.createRegistry(registryName, registryURL, authentication, username, password)
.then(function success(data) {
Notifications.success('Registry successfully created');
- $state.go('registries');
+ $state.go('portainer.registries');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to create registry');
diff --git a/app/components/createRegistry/createregistry.html b/app/portainer/views/registries/create/createregistry.html
similarity index 98%
rename from app/components/createRegistry/createregistry.html
rename to app/portainer/views/registries/create/createregistry.html
index 2593bd91dc7d0..632a09d12f658 100644
--- a/app/components/createRegistry/createregistry.html
+++ b/app/portainer/views/registries/create/createregistry.html
@@ -1,7 +1,7 @@
- Registries > Add registry
+ Registries > Add registry
diff --git a/app/components/registry/registry.html b/app/portainer/views/registries/edit/registry.html
similarity index 95%
rename from app/components/registry/registry.html
rename to app/portainer/views/registries/edit/registry.html
index 1cb8002d8cef3..24f519ac9d86b 100644
--- a/app/components/registry/registry.html
+++ b/app/portainer/views/registries/edit/registry.html
@@ -1,7 +1,7 @@
- Registries > {{ registry.Name }}
+ Registries > {{ registry.Name }}
@@ -68,7 +68,7 @@
Update registry
Updating registry...
- Cancel
+ Cancel
diff --git a/app/components/registry/registryController.js b/app/portainer/views/registries/edit/registryController.js
similarity index 93%
rename from app/components/registry/registryController.js
rename to app/portainer/views/registries/edit/registryController.js
index 03b672320c934..dffb77b70e959 100644
--- a/app/components/registry/registryController.js
+++ b/app/portainer/views/registries/edit/registryController.js
@@ -1,4 +1,4 @@
-angular.module('registry', [])
+angular.module('portainer.app')
.controller('RegistryController', ['$scope', '$state', '$transition$', '$filter', 'RegistryService', 'Notifications',
function ($scope, $state, $transition$, $filter, RegistryService, Notifications) {
@@ -12,7 +12,7 @@ function ($scope, $state, $transition$, $filter, RegistryService, Notifications)
RegistryService.updateRegistry(registry)
.then(function success(data) {
Notifications.success('Registry successfully updated');
- $state.go('registries');
+ $state.go('portainer.registries');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to update registry');
diff --git a/app/components/registries/registries.html b/app/portainer/views/registries/registries.html
similarity index 96%
rename from app/components/registries/registries.html
rename to app/portainer/views/registries/registries.html
index 946f84d4acf80..7d5096897d490 100644
--- a/app/components/registries/registries.html
+++ b/app/portainer/views/registries/registries.html
@@ -1,6 +1,6 @@
-
+
diff --git a/app/components/registries/registriesController.js b/app/portainer/views/registries/registriesController.js
similarity index 98%
rename from app/components/registries/registriesController.js
rename to app/portainer/views/registries/registriesController.js
index b5b65f5c1f52a..e6e32c7908812 100644
--- a/app/components/registries/registriesController.js
+++ b/app/portainer/views/registries/registriesController.js
@@ -1,4 +1,4 @@
-angular.module('registries', [])
+angular.module('portainer.app')
.controller('RegistriesController', ['$q', '$scope', '$state', 'RegistryService', 'DockerHubService', 'ModalService', 'Notifications', 'PaginationService',
function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, Notifications, PaginationService) {
diff --git a/app/components/settingsAuthentication/settingsAuthentication.html b/app/portainer/views/settings/authentication/settingsAuthentication.html
similarity index 99%
rename from app/components/settingsAuthentication/settingsAuthentication.html
rename to app/portainer/views/settings/authentication/settingsAuthentication.html
index b1a4917cf4b6f..2d655dea3ea9f 100644
--- a/app/components/settingsAuthentication/settingsAuthentication.html
+++ b/app/portainer/views/settings/authentication/settingsAuthentication.html
@@ -1,7 +1,7 @@
- Settings > Authentication
+ Settings > Authentication
diff --git a/app/components/settingsAuthentication/settingsAuthenticationController.js b/app/portainer/views/settings/authentication/settingsAuthenticationController.js
similarity index 94%
rename from app/components/settingsAuthentication/settingsAuthenticationController.js
rename to app/portainer/views/settings/authentication/settingsAuthenticationController.js
index bf282f155260f..f47d01a8fa83b 100644
--- a/app/components/settingsAuthentication/settingsAuthenticationController.js
+++ b/app/portainer/views/settings/authentication/settingsAuthenticationController.js
@@ -1,4 +1,4 @@
-angular.module('settingsAuthentication', [])
+angular.module('portainer.app')
.controller('SettingsAuthenticationController', ['$q', '$scope', 'Notifications', 'SettingsService', 'FileUploadService',
function ($q, $scope, Notifications, SettingsService, FileUploadService) {
@@ -22,8 +22,8 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
$scope.LDAPSettings.SearchSettings.splice(index, 1);
};
- $scope.LDAPConnectivityCheck = function() {
- var settings = $scope.settings;
+ $scope.LDAPConnectivityCheck = function() {
+ var settings = $scope.settings;
var TLSCAFile = $scope.formValues.TLSCACert !== settings.LDAPSettings.TLSConfig.TLSCACert ? $scope.formValues.TLSCACert : null;
var uploadRequired = ($scope.LDAPSettings.TLSConfig.TLS || $scope.LDAPSettings.StartTLS) && !$scope.LDAPSettings.TLSConfig.TLSSkipVerify;
@@ -78,8 +78,8 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
// Add default port if :port is not defined in URL
function addLDAPDefaultPort(settings, tlsEnabled) {
- if (settings.LDAPSettings.URL.indexOf(':') === -1) {
- settings.LDAPSettings.URL += tlsEnabled ? ':636' : ':389';
+ if (settings.LDAPSettings.URL.indexOf(':') === -1) {
+ settings.LDAPSettings.URL += tlsEnabled ? ':636' : ':389';
}
}
diff --git a/app/components/settings/settings.html b/app/portainer/views/settings/settings.html
similarity index 100%
rename from app/components/settings/settings.html
rename to app/portainer/views/settings/settings.html
diff --git a/app/components/settings/settingsController.js b/app/portainer/views/settings/settingsController.js
similarity index 89%
rename from app/components/settings/settingsController.js
rename to app/portainer/views/settings/settingsController.js
index a9ee117fac5dd..bc0623bc9f8d8 100644
--- a/app/components/settings/settingsController.js
+++ b/app/portainer/views/settings/settingsController.js
@@ -1,4 +1,4 @@
-angular.module('settings', [])
+angular.module('portainer.app')
.controller('SettingsController', ['$scope', '$state', 'Notifications', 'SettingsService', 'StateManager', 'DEFAULT_TEMPLATES_URL',
function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_TEMPLATES_URL) {
@@ -21,7 +21,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_
var settings = $scope.settings;
settings.BlackListedLabels.splice(index, 1);
- updateSettings(settings, false);
+ updateSettings(settings);
};
$scope.addFilteredContainerLabel = function() {
@@ -32,7 +32,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_
};
settings.BlackListedLabels.push(label);
- updateSettings(settings, true);
+ updateSettings(settings);
};
$scope.saveApplicationSettings = function() {
@@ -52,24 +52,17 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_
settings.AllowPrivilegedModeForRegularUsers = !$scope.formValues.restrictPrivilegedMode;
$scope.state.actionInProgress = true;
- updateSettings(settings, false);
+ updateSettings(settings);
};
- function resetFormValues() {
- $scope.formValues.labelName = '';
- $scope.formValues.labelValue = '';
- }
-
- function updateSettings(settings, resetForm) {
+ function updateSettings(settings) {
SettingsService.update(settings)
.then(function success(data) {
Notifications.success('Settings updated');
StateManager.updateLogo(settings.LogoURL);
StateManager.updateDonationHeader(settings.DisplayDonationHeader);
StateManager.updateExternalContributions(settings.DisplayExternalContributors);
- if (resetForm) {
- resetFormValues();
- }
+ $state.reload();
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to update settings');
diff --git a/app/portainer/views/sidebar/sidebar.html b/app/portainer/views/sidebar/sidebar.html
new file mode 100644
index 0000000000000..f1e3dfa6af557
--- /dev/null
+++ b/app/portainer/views/sidebar/sidebar.html
@@ -0,0 +1,69 @@
+
+
+
diff --git a/app/components/sidebar/sidebarController.js b/app/portainer/views/sidebar/sidebarController.js
similarity index 87%
rename from app/components/sidebar/sidebarController.js
rename to app/portainer/views/sidebar/sidebarController.js
index 5b708945066fd..fa60cf2e2ff68 100644
--- a/app/components/sidebar/sidebarController.js
+++ b/app/portainer/views/sidebar/sidebarController.js
@@ -1,12 +1,7 @@
-angular.module('sidebar', [])
+angular.module('portainer.app')
.controller('SidebarController', ['$q', '$scope', '$state', 'Settings', 'EndpointService', 'StateManager', 'EndpointProvider', 'Notifications', 'Authentication', 'UserService', 'ExtensionManager',
function ($q, $scope, $state, Settings, EndpointService, StateManager, EndpointProvider, Notifications, Authentication, UserService, ExtensionManager) {
- $scope.uiVersion = StateManager.getState().application.version;
- $scope.displayExternalContributors = StateManager.getState().application.displayExternalContributors;
- $scope.logo = StateManager.getState().application.logo;
- $scope.endpoints = [];
-
$scope.switchEndpoint = function(endpoint) {
var activeEndpointID = EndpointProvider.endpointID();
var activeEndpointPublicURL = EndpointProvider.endpointPublicURL();
@@ -16,7 +11,7 @@ function ($q, $scope, $state, Settings, EndpointService, StateManager, EndpointP
StateManager.updateEndpointState(true)
.then(function success() {
ExtensionManager.reset();
- $state.go('dashboard');
+ $state.go('docker.dashboard');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to connect to the Docker endpoint');
@@ -48,6 +43,11 @@ function ($q, $scope, $state, Settings, EndpointService, StateManager, EndpointP
}
function initView() {
+ $scope.uiVersion = StateManager.getState().application.version;
+ $scope.displayExternalContributors = StateManager.getState().application.displayExternalContributors;
+ $scope.logo = StateManager.getState().application.logo;
+ $scope.endpoints = [];
+
EndpointService.endpoints()
.then(function success(data) {
var endpoints = data;
diff --git a/app/components/team/team.html b/app/portainer/views/teams/edit/team.html
similarity index 98%
rename from app/components/team/team.html
rename to app/portainer/views/teams/edit/team.html
index f933f87864356..a2942b38e73e7 100644
--- a/app/components/team/team.html
+++ b/app/portainer/views/teams/edit/team.html
@@ -1,7 +1,7 @@
- Teams > {{ team.Name }}
+ Teams > {{ team.Name }}
diff --git a/app/components/team/teamController.js b/app/portainer/views/teams/edit/teamController.js
similarity index 98%
rename from app/components/team/teamController.js
rename to app/portainer/views/teams/edit/teamController.js
index faf152e2ed9e5..15079b83468f1 100644
--- a/app/components/team/teamController.js
+++ b/app/portainer/views/teams/edit/teamController.js
@@ -1,4 +1,4 @@
-angular.module('team', [])
+angular.module('portainer.app')
.controller('TeamController', ['$q', '$scope', '$state', '$transition$', 'TeamService', 'UserService', 'TeamMembershipService', 'ModalService', 'Notifications', 'PaginationService', 'Authentication',
function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMembershipService, ModalService, Notifications, PaginationService, Authentication) {
@@ -135,7 +135,7 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember
TeamService.deleteTeam($scope.team.Id)
.then(function success(data) {
Notifications.success('Team successfully deleted', $scope.team.Name);
- $state.go('teams');
+ $state.go('portainer.teams');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to remove team');
diff --git a/app/components/teams/teams.html b/app/portainer/views/teams/teams.html
similarity index 96%
rename from app/components/teams/teams.html
rename to app/portainer/views/teams/teams.html
index f672f9be2bb36..6da96c691af28 100644
--- a/app/components/teams/teams.html
+++ b/app/portainer/views/teams/teams.html
@@ -1,6 +1,6 @@
-
+
diff --git a/app/components/teams/teamsController.js b/app/portainer/views/teams/teamsController.js
similarity index 98%
rename from app/components/teams/teamsController.js
rename to app/portainer/views/teams/teamsController.js
index 986a09e3d5ded..b90e6844737a5 100644
--- a/app/components/teams/teamsController.js
+++ b/app/portainer/views/teams/teamsController.js
@@ -1,4 +1,4 @@
-angular.module('teams', [])
+angular.module('portainer.app')
.controller('TeamsController', ['$q', '$scope', '$state', 'TeamService', 'UserService', 'ModalService', 'Notifications', 'Authentication',
function ($q, $scope, $state, TeamService, UserService, ModalService, Notifications, Authentication) {
$scope.state = {
diff --git a/app/components/user/user.html b/app/portainer/views/users/edit/user.html
similarity index 96%
rename from app/components/user/user.html
rename to app/portainer/views/users/edit/user.html
index 95bb95561204e..e8a41746111e3 100644
--- a/app/components/user/user.html
+++ b/app/portainer/views/users/edit/user.html
@@ -1,7 +1,7 @@
- Users > {{ user.Username }}
+ Users > {{ user.Username }}
diff --git a/app/components/user/userController.js b/app/portainer/views/users/edit/userController.js
similarity index 97%
rename from app/components/user/userController.js
rename to app/portainer/views/users/edit/userController.js
index 9a2d7385a43c2..01c41109e8505 100644
--- a/app/components/user/userController.js
+++ b/app/portainer/views/users/edit/userController.js
@@ -1,4 +1,4 @@
-angular.module('user', [])
+angular.module('portainer.app')
.controller('UserController', ['$q', '$scope', '$state', '$transition$', 'UserService', 'ModalService', 'Notifications', 'SettingsService',
function ($q, $scope, $state, $transition$, UserService, ModalService, Notifications, SettingsService) {
@@ -50,7 +50,7 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat
UserService.deleteUser($scope.user.Id)
.then(function success(data) {
Notifications.success('User successfully deleted', $scope.user.Username);
- $state.go('users');
+ $state.go('portainer.users');
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to remove user');
diff --git a/app/components/users/users.html b/app/portainer/views/users/users.html
similarity index 96%
rename from app/components/users/users.html
rename to app/portainer/views/users/users.html
index ad69ff9b722f1..b1801f1dbd898 100644
--- a/app/components/users/users.html
+++ b/app/portainer/views/users/users.html
@@ -1,6 +1,6 @@
-
+
@@ -71,7 +71,7 @@
Add to team(s)
- You have not yet created any team. Head over the teams view to manage user teams.
+ You have not yet created any team. Head over the teams view to manage user teams.
- Note: non-administrator users with no team do not have access to any endpoint by default. Head over the endpoints view to manage their accesses.
+ Note: non-administrator users with no team do not have access to any endpoint by default. Head over the endpoints view to manage their accesses.
diff --git a/app/components/users/usersController.js b/app/portainer/views/users/usersController.js
similarity index 99%
rename from app/components/users/usersController.js
rename to app/portainer/views/users/usersController.js
index c96d34effddb8..a01ac14c8bcd6 100644
--- a/app/components/users/usersController.js
+++ b/app/portainer/views/users/usersController.js
@@ -1,4 +1,4 @@
-angular.module('users', [])
+angular.module('portainer.app')
.controller('UsersController', ['$q', '$scope', '$state', '$sanitize', 'UserService', 'TeamService', 'TeamMembershipService', 'ModalService', 'Notifications', 'Authentication', 'SettingsService',
function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershipService, ModalService, Notifications, Authentication, SettingsService) {
$scope.state = {
diff --git a/app/rest/__module.js b/app/rest/__module.js
deleted file mode 100644
index 2c8129eb69181..0000000000000
--- a/app/rest/__module.js
+++ /dev/null
@@ -1 +0,0 @@
-angular.module('portainer.rest', ['ngResource']);
diff --git a/app/routes.js b/app/routes.js
deleted file mode 100644
index 210bb0db3f474..0000000000000
--- a/app/routes.js
+++ /dev/null
@@ -1,771 +0,0 @@
-function configureRoutes($stateProvider) {
- $stateProvider
- .state('root', {
- abstract: true,
- resolve: {
- requiresLogin: ['StateManager', function (StateManager) {
- var applicationState = StateManager.getState();
- return applicationState.application.authentication;
- }]
- }
- })
- .state('auth', {
- parent: 'root',
- url: '/auth',
- params: {
- logout: false,
- error: ''
- },
- views: {
- 'content@': {
- templateUrl: 'app/components/auth/auth.html',
- controller: 'AuthenticationController'
- }
- },
- data: {
- requiresLogin: false
- }
- })
- .state('configs', {
- url: '^/configs/',
- views: {
- 'content@': {
- templateUrl: 'app/components/configs/configs.html',
- controller: 'ConfigsController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('config', {
- url: '^/config/:id/',
- views: {
- 'content@': {
- templateUrl: 'app/components/config/config.html',
- controller: 'ConfigController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('containers', {
- parent: 'root',
- url: '/containers/',
- params: {
- selectedContainers: []
- },
- views: {
- 'content@': {
- templateUrl: 'app/components/containers/containers.html',
- controller: 'ContainersController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('container', {
- url: '^/containers/:id',
- views: {
- 'content@': {
- templateUrl: 'app/components/container/container.html',
- controller: 'ContainerController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('stats', {
- url: '^/containers/:id/stats',
- views: {
- 'content@': {
- templateUrl: 'app/components/containerStats/containerStats.html',
- controller: 'ContainerStatsController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('containerlogs', {
- url: '^/containers/:id/logs',
- views: {
- 'content@': {
- templateUrl: 'app/components/containerLogs/containerlogs.html',
- controller: 'ContainerLogsController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .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'
- }
- }
- })
- .state('console', {
- url: '^/containers/:id/console',
- views: {
- 'content@': {
- templateUrl: 'app/components/containerConsole/containerConsole.html',
- controller: 'ContainerConsoleController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('inspect', {
- url: '^/containers/:id/inspect',
- views: {
- 'content@': {
- templateUrl: 'app/components/containerInspect/containerInspect.html',
- controller: 'ContainerInspectController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('dashboard', {
- parent: 'root',
- url: '/dashboard',
- views: {
- 'content@': {
- templateUrl: 'app/components/dashboard/dashboard.html',
- controller: 'DashboardController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('actions', {
- abstract: true,
- url: '/actions',
- views: {
- 'content@': {
- template: ''
- },
- 'sidebar@': {
- template: ''
- }
- }
- })
- .state('actions.create', {
- abstract: true,
- url: '/create',
- views: {
- 'content@': {
- template: ''
- },
- 'sidebar@': {
- template: ''
- }
- }
- })
- .state('actions.create.config', {
- url: '/config',
- views: {
- 'content@': {
- templateUrl: 'app/components/createConfig/createconfig.html',
- controller: 'CreateConfigController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('actions.create.container', {
- url: '/container/:from',
- views: {
- 'content@': {
- templateUrl: 'app/components/createContainer/createcontainer.html',
- controller: 'CreateContainerController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- },
- params: {
- from: ''
- }
- })
- .state('actions.create.network', {
- url: '/network',
- views: {
- 'content@': {
- templateUrl: 'app/components/createNetwork/createnetwork.html',
- controller: 'CreateNetworkController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .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'
- }
- }
- })
- .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'
- }
- }
- })
- .state('actions.create.service', {
- url: '/service',
- views: {
- 'content@': {
- templateUrl: 'app/components/createService/createservice.html',
- controller: 'CreateServiceController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('actions.create.volume', {
- url: '/volume',
- views: {
- 'content@': {
- templateUrl: 'app/components/createVolume/createvolume.html',
- controller: 'CreateVolumeController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('init', {
- abstract: true,
- url: '/init',
- views: {
- 'content@': {
- template: ''
- }
- }
- })
- .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'
- }
- }
- })
- .state('engine', {
- url: '/engine/',
- views: {
- 'content@': {
- templateUrl: 'app/components/engine/engine.html',
- controller: 'EngineController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('endpoints', {
- url: '/endpoints/',
- views: {
- 'content@': {
- templateUrl: 'app/components/endpoints/endpoints.html',
- controller: 'EndpointsController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('endpoint', {
- url: '^/endpoints/:id',
- views: {
- 'content@': {
- templateUrl: 'app/components/endpoint/endpoint.html',
- controller: 'EndpointController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('endpoint.access', {
- url: '^/endpoints/:id/access',
- views: {
- 'content@': {
- templateUrl: 'app/components/endpointAccess/endpointAccess.html',
- controller: 'EndpointAccessController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('events', {
- url: '/events/',
- views: {
- 'content@': {
- templateUrl: 'app/components/events/events.html',
- controller: 'EventsController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('images', {
- url: '/images/',
- views: {
- 'content@': {
- templateUrl: 'app/components/images/images.html',
- controller: 'ImagesController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('image', {
- url: '^/images/:id/',
- views: {
- 'content@': {
- templateUrl: 'app/components/image/image.html',
- controller: 'ImageController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('networks', {
- url: '/networks/',
- views: {
- 'content@': {
- templateUrl: 'app/components/networks/networks.html',
- controller: 'NetworksController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('network', {
- url: '^/networks/:id/',
- views: {
- 'content@': {
- templateUrl: 'app/components/network/network.html',
- controller: 'NetworkController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('node', {
- url: '^/nodes/:id/',
- views: {
- 'content@': {
- templateUrl: 'app/components/node/node.html',
- controller: 'NodeController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .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'
- }
- }
- })
- .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'
- }
- }
- })
- .state('services', {
- url: '/services/',
- views: {
- 'content@': {
- templateUrl: 'app/components/services/services.html',
- controller: 'ServicesController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('service', {
- url: '^/service/:id/',
- views: {
- 'content@': {
- templateUrl: 'app/components/service/service.html',
- controller: 'ServiceController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('settings', {
- url: '/settings/',
- views: {
- 'content@': {
- templateUrl: 'app/components/settings/settings.html',
- controller: 'SettingsController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('settings_about', {
- url: '^/settings/about',
- views: {
- 'content@': {
- templateUrl: 'app/components/about/about.html'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .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'
- }
- }
- })
- .state('task', {
- url: '^/task/:id',
- views: {
- 'content@': {
- templateUrl: 'app/components/task/task.html',
- controller: 'TaskController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('templates', {
- url: '/templates/',
- params: {
- key: 'containers',
- hide_descriptions: false
- },
- views: {
- 'content@': {
- templateUrl: 'app/components/templates/templates.html',
- controller: 'TemplatesController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('templates_linuxserver', {
- url: '^/templates/linuxserver.io',
- params: {
- key: 'linuxserver.io',
- hide_descriptions: true
- },
- views: {
- 'content@': {
- templateUrl: 'app/components/templates/templates.html',
- controller: 'TemplatesController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('volumes', {
- url: '/volumes/',
- views: {
- 'content@': {
- templateUrl: 'app/components/volumes/volumes.html',
- controller: 'VolumesController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('volume', {
- url: '^/volumes/:id',
- views: {
- 'content@': {
- templateUrl: 'app/components/volume/volume.html',
- controller: 'VolumeController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('users', {
- url: '/users/',
- views: {
- 'content@': {
- templateUrl: 'app/components/users/users.html',
- controller: 'UsersController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('user', {
- url: '^/users/:id',
- views: {
- 'content@': {
- templateUrl: 'app/components/user/user.html',
- controller: 'UserController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('userSettings', {
- url: '/userSettings/',
- views: {
- 'content@': {
- templateUrl: 'app/components/userSettings/userSettings.html',
- controller: 'UserSettingsController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .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'
- }
- }
- })
- .state('swarm', {
- url: '/swarm',
- views: {
- 'content@': {
- templateUrl: 'app/components/swarm/swarm.html',
- controller: 'SwarmController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('swarm.visualizer', {
- url: '/visualizer',
- views: {
- 'content@': {
- templateUrl: 'app/components/swarmVisualizer/swarmVisualizer.html',
- controller: 'SwarmVisualizerController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('actions.create.stack', {
- url: '/stack',
- views: {
- 'content@': {
- templateUrl: 'app/components/createStack/createstack.html',
- controller: 'CreateStackController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('stacks', {
- url: '/stacks/',
- views: {
- 'content@': {
- templateUrl: 'app/components/stacks/stacks.html',
- controller: 'StacksController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- })
- .state('stack', {
- url: '^/stacks/:id/',
- views: {
- 'content@': {
- templateUrl: 'app/components/stack/stack.html',
- controller: 'StackController'
- },
- 'sidebar@': {
- templateUrl: 'app/components/sidebar/sidebar.html',
- controller: 'SidebarController'
- }
- }
- });
-}
diff --git a/app/services/__module.js b/app/services/__module.js
deleted file mode 100644
index dc0c26e72f4c8..0000000000000
--- a/app/services/__module.js
+++ /dev/null
@@ -1 +0,0 @@
-angular.module('portainer.services', []);
diff --git a/gruntfile.js b/gruntfile.js
index 6974ef8702be0..c957b3eb7ed26 100644
--- a/gruntfile.js
+++ b/gruntfile.js
@@ -116,7 +116,7 @@ gruntfile_cfg.src = {
js: ['app/**/__module.js', 'app/**/*.js', '!app/**/*.spec.js'],
jsTpl: ['<%= distdir %>/templates/**/*.js'],
html: ['index.html'],
- tpl: ['app/components/**/*.html', 'app/directives/**/*.html', 'app/extensions/**/*.html'],
+ tpl: ['app/**/*.html'],
css: ['assets/css/app.css', 'app/**/*.css']
};
diff --git a/index.html b/index.html
index 1949e54596dd5..cb5540b9ae190 100644
--- a/index.html
+++ b/index.html
@@ -36,8 +36,8 @@
|