From 3cb053250b9e8746a1e74cb0259adbe56e2c4427 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Thu, 11 Oct 2018 17:55:43 +0300 Subject: [PATCH] feat(webpack): add missing imports --- app/agent/rest/browse.js | 3 +++ app/agent/rest/response/browse.js | 2 +- app/azure/models/provider.js | 2 ++ .../create/createContainerInstanceController.js | 3 +++ .../serviceTasksDatatableController.js | 3 +++ .../network-macvlan-form/networkMacvlanFormModel.js | 2 +- app/docker/filters/filters.js | 4 +++- app/docker/helpers/constraintsHelper.js | 2 ++ app/docker/helpers/containerHelper.js | 2 ++ app/docker/helpers/imageHelper.js | 3 +++ app/docker/models/config.js | 2 ++ app/docker/models/containerCapabilities.js | 2 +- .../views/containers/create/createContainerController.js | 5 +++++ app/docker/views/images/edit/imageController.js | 3 +++ .../views/networks/create/createNetworkController.js | 4 ++++ .../views/services/create/createServiceController.js | 6 +++++- app/docker/views/swarm/swarmController.js | 4 +++- app/extensions/storidge/models/events.js | 2 +- app/extensions/storidge/models/info.js | 2 +- app/extensions/storidge/models/profile.js | 8 ++++---- app/extensions/storidge/services/clusterService.js | 4 ++++ .../storidge/views/profiles/profilesController.js | 3 +++ .../accessControlForm/porAccessControlFormController.js | 3 +++ .../accessControlPanel/porAccessControlPanelController.js | 3 +++ .../accessManagement/porAccessManagementController.js | 3 +++ .../components/endpoint-list/endpoint-list-controller.js | 3 +++ .../endpoint-selector/endpointSelectorController.js | 3 +++ .../endpointSecurity/porEndpointSecurityModel.js | 2 +- app/portainer/components/forms/group-form/group-form.js | 3 +++ .../components/tag-selector/tagSelectorController.js | 3 +++ app/portainer/components/template-list/template-list.js | 3 +++ app/portainer/filters/filters.js | 5 +++++ app/portainer/helpers/stackHelper.js | 3 +++ app/portainer/helpers/templateHelper.js | 3 +++ app/portainer/models/group.js | 8 ++++---- app/portainer/models/template.js | 2 +- app/portainer/services/api/accessService.js | 5 +++++ app/portainer/services/api/resourceControlService.js | 3 +++ app/portainer/services/api/stackService.js | 4 ++++ app/portainer/services/api/tagService.js | 3 +++ app/portainer/services/api/teamService.js | 4 ++++ app/portainer/services/api/templateService.js | 7 +++++++ app/portainer/services/api/userService.js | 5 +++++ app/portainer/services/api/webhookService.js | 3 +++ app/portainer/services/chartService.js | 3 +++ app/portainer/services/codeMirror.js | 4 ++++ app/portainer/services/extensionManager.js | 3 +++ app/portainer/services/modalService.js | 2 ++ .../views/endpoints/create/createEndpointController.js | 3 +++ app/portainer/views/endpoints/edit/endpointController.js | 3 +++ .../views/groups/create/createGroupController.js | 3 +++ .../views/init/endpoint/initEndpointController.js | 3 +++ .../views/stacks/create/createStackController.js | 3 +++ app/portainer/views/templates/edit/templateController.js | 3 +++ 54 files changed, 164 insertions(+), 18 deletions(-) diff --git a/app/agent/rest/browse.js b/app/agent/rest/browse.js index 9496768eb..166e1da59 100644 --- a/app/agent/rest/browse.js +++ b/app/agent/rest/browse.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { browseGetResponse } from './response/browse'; + angular.module('portainer.agent') .factory('Browse', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) { 'use strict'; diff --git a/app/agent/rest/response/browse.js b/app/agent/rest/response/browse.js index 7047777a6..32e454305 100644 --- a/app/agent/rest/response/browse.js +++ b/app/agent/rest/response/browse.js @@ -2,7 +2,7 @@ // ngResource will transform it as an array of chars. // This functions simply creates a response object and assign // the data to a field. -function browseGetResponse(data) { +export function browseGetResponse(data) { var response = {}; response.file = data; return response; diff --git a/app/azure/models/provider.js b/app/azure/models/provider.js index 616caccd2..8b2355c4f 100644 --- a/app/azure/models/provider.js +++ b/app/azure/models/provider.js @@ -1,3 +1,5 @@ +import _ from 'lodash'; + export function ContainerInstanceProviderViewModel(data) { this.Id = data.id; this.Namespace = data.namespace; diff --git a/app/azure/views/containerinstances/create/createContainerInstanceController.js b/app/azure/views/containerinstances/create/createContainerInstanceController.js index a7ecab9e8..369f15d9f 100644 --- a/app/azure/views/containerinstances/create/createContainerInstanceController.js +++ b/app/azure/views/containerinstances/create/createContainerInstanceController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { ContainerGroupDefaultModel } from '../../../models/container_group'; + angular.module('portainer.azure') .controller('AzureCreateContainerInstanceController', ['$q', '$scope', '$state', 'AzureService', 'Notifications', function ($q, $scope, $state, AzureService, Notifications) { diff --git a/app/docker/components/datatables/service-tasks-datatable/serviceTasksDatatableController.js b/app/docker/components/datatables/service-tasks-datatable/serviceTasksDatatableController.js index b0a8da0b2..407094262 100644 --- a/app/docker/components/datatables/service-tasks-datatable/serviceTasksDatatableController.js +++ b/app/docker/components/datatables/service-tasks-datatable/serviceTasksDatatableController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.docker') .controller('ServiceTasksDatatableController', ['DatatableService', function (DatatableService) { diff --git a/app/docker/components/network-macvlan-form/networkMacvlanFormModel.js b/app/docker/components/network-macvlan-form/networkMacvlanFormModel.js index 10ed60510..ebc88e524 100644 --- a/app/docker/components/network-macvlan-form/networkMacvlanFormModel.js +++ b/app/docker/components/network-macvlan-form/networkMacvlanFormModel.js @@ -1,4 +1,4 @@ -function MacvlanFormData() { +export function MacvlanFormData() { this.Scope = 'local'; this.SelectedNetworkConfig = ''; this.DatatableState = { diff --git a/app/docker/filters/filters.js b/app/docker/filters/filters.js index 03872b529..72193122f 100644 --- a/app/docker/filters/filters.js +++ b/app/docker/filters/filters.js @@ -1,3 +1,5 @@ +import _ from 'lodash'; + function includeString(text, values) { return values.some(function(val){ return text.indexOf(val) !== -1; @@ -258,7 +260,7 @@ angular.module('portainer.docker') .filter('imagelayercommand', function () { 'use strict'; return function (createdBy) { - return createdBy.replace('/bin/sh -c #(nop) ', '').replace('/bin/sh -c ', 'RUN '); + return createdBy.replace('/bin/sh -c #(nop) ', '').replace('/bin/sh -c ', 'RUN '); }; }) .filter('trimshasum', function () { diff --git a/app/docker/helpers/constraintsHelper.js b/app/docker/helpers/constraintsHelper.js index b2700deba..c89b7fb0c 100644 --- a/app/docker/helpers/constraintsHelper.js +++ b/app/docker/helpers/constraintsHelper.js @@ -1,3 +1,5 @@ +import _ from 'lodash'; + function ConstraintModel(op, key, value) { this.op = op; this.value = value; diff --git a/app/docker/helpers/containerHelper.js b/app/docker/helpers/containerHelper.js index 1e5d45ff6..759162b72 100644 --- a/app/docker/helpers/containerHelper.js +++ b/app/docker/helpers/containerHelper.js @@ -1,3 +1,5 @@ +import splitargs from 'splitargs/src/splitargs' + angular.module('portainer.docker') .factory('ContainerHelper', [function ContainerHelperFactory() { 'use strict'; diff --git a/app/docker/helpers/imageHelper.js b/app/docker/helpers/imageHelper.js index df3b76fd9..68aa3d450 100644 --- a/app/docker/helpers/imageHelper.js +++ b/app/docker/helpers/imageHelper.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.docker') .factory('ImageHelper', [function ImageHelperFactory() { 'use strict'; diff --git a/app/docker/models/config.js b/app/docker/models/config.js index 5ab7e483b..8f1d83873 100644 --- a/app/docker/models/config.js +++ b/app/docker/models/config.js @@ -1,3 +1,5 @@ +import { ResourceControlViewModel } from '../../portainer/models/resourceControl'; + export function ConfigViewModel(data) { this.Id = data.ID; this.CreatedAt = data.CreatedAt; diff --git a/app/docker/models/containerCapabilities.js b/app/docker/models/containerCapabilities.js index 0ff22239e..5826d65bf 100644 --- a/app/docker/models/containerCapabilities.js +++ b/app/docker/models/containerCapabilities.js @@ -38,7 +38,7 @@ var capDesc = { 'BLOCK_SUSPEND': 'Employ features that can block system suspend.' }; -function ContainerCapabilities() { +export function ContainerCapabilities() { // all capabilities can be found at https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities return [ new ContainerCapability('SETPCAP', true), diff --git a/app/docker/views/containers/create/createContainerController.js b/app/docker/views/containers/create/createContainerController.js index 83b153e44..70f510e52 100644 --- a/app/docker/views/containers/create/createContainerController.js +++ b/app/docker/views/containers/create/createContainerController.js @@ -1,3 +1,8 @@ +import angular from 'angular'; +import _ from 'lodash'; +import { ContainerCapabilities } from '../../../models/containerCapabilities'; +import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel'; + angular.module('portainer.docker') .controller('CreateContainerController', ['$q', '$scope', '$state', '$timeout', '$transition$', '$filter', 'Container', 'ContainerHelper', 'Image', 'ImageHelper', 'Volume', 'NetworkService', 'ResourceControlService', 'Authentication', 'Notifications', 'ContainerService', 'ImageService', 'FormValidator', 'ModalService', 'RegistryService', 'SystemService', 'SettingsService', 'HttpRequestHelper', function ($q, $scope, $state, $timeout, $transition$, $filter, Container, ContainerHelper, Image, ImageHelper, Volume, NetworkService, ResourceControlService, Authentication, Notifications, ContainerService, ImageService, FormValidator, ModalService, RegistryService, SystemService, SettingsService, HttpRequestHelper) { diff --git a/app/docker/views/images/edit/imageController.js b/app/docker/views/images/edit/imageController.js index 29d91d8da..c8ef5873d 100644 --- a/app/docker/views/images/edit/imageController.js +++ b/app/docker/views/images/edit/imageController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.docker') .controller('ImageController', ['$q', '$scope', '$transition$', '$state', '$timeout', 'ImageService', 'RegistryService', 'Notifications', 'HttpRequestHelper', 'ModalService', 'FileSaver', 'Blob', function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryService, Notifications, HttpRequestHelper, ModalService, FileSaver, Blob) { diff --git a/app/docker/views/networks/create/createNetworkController.js b/app/docker/views/networks/create/createNetworkController.js index 9f5dd6493..a1f3fbf5e 100644 --- a/app/docker/views/networks/create/createNetworkController.js +++ b/app/docker/views/networks/create/createNetworkController.js @@ -1,3 +1,7 @@ +import angular from 'angular'; +import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel'; +import { MacvlanFormData } from '../../../components/network-macvlan-form/networkMacvlanFormModel'; + angular.module('portainer.docker') .controller('CreateNetworkController', ['$q', '$scope', '$state', 'PluginService', 'Notifications', 'NetworkService', 'LabelHelper', 'Authentication', 'ResourceControlService', 'FormValidator', 'HttpRequestHelper', function ($q, $scope, $state, PluginService, Notifications, NetworkService, LabelHelper, Authentication, ResourceControlService, FormValidator, HttpRequestHelper) { diff --git a/app/docker/views/services/create/createServiceController.js b/app/docker/views/services/create/createServiceController.js index 9f69ad0b5..13f44ee0b 100644 --- a/app/docker/views/services/create/createServiceController.js +++ b/app/docker/views/services/create/createServiceController.js @@ -1,4 +1,8 @@ - angular.module('portainer.docker') +import angular from 'angular'; +import _ from 'lodash'; +import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel'; + +angular.module('portainer.docker') .controller('CreateServiceController', ['$q', '$scope', '$state', '$timeout', 'Service', 'ServiceHelper', 'ConfigService', 'ConfigHelper', 'SecretHelper', 'SecretService', 'VolumeService', 'NetworkService', 'ImageHelper', 'LabelHelper', 'Authentication', 'ResourceControlService', 'Notifications', 'FormValidator', 'PluginService', 'RegistryService', 'HttpRequestHelper', 'NodeService', 'SettingsService', 'WebhookService','EndpointProvider', function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, ConfigHelper, SecretHelper, SecretService, VolumeService, NetworkService, ImageHelper, LabelHelper, Authentication, ResourceControlService, Notifications, FormValidator, PluginService, RegistryService, HttpRequestHelper, NodeService, SettingsService, WebhookService,EndpointProvider) { diff --git a/app/docker/views/swarm/swarmController.js b/app/docker/views/swarm/swarmController.js index 7a27f0ca6..defe550f7 100644 --- a/app/docker/views/swarm/swarmController.js +++ b/app/docker/views/swarm/swarmController.js @@ -1,3 +1,5 @@ +import angular from 'angular'; + angular.module('portainer.docker') .controller('SwarmController', ['$q', '$scope', 'SystemService', 'NodeService', 'Notifications', 'StateManager', 'Authentication', function ($q, $scope, SystemService, NodeService, Notifications, StateManager, Authentication) { @@ -28,7 +30,7 @@ function ($q, $scope, SystemService, NodeService, Notifications, StateManager, A // If connected to a replica, information for node1 is available at element #5 // The next 10 elements are information related to the node var node_offset = info[0][1] === 'primary' ? 4 : 5; - for (i = 0; i < node_count; i++) { + for (let i = 0; i < node_count; i++) { extractNodeInfo(info, node_offset); node_offset += 9; } diff --git a/app/extensions/storidge/models/events.js b/app/extensions/storidge/models/events.js index 3fab0d639..b056e7484 100644 --- a/app/extensions/storidge/models/events.js +++ b/app/extensions/storidge/models/events.js @@ -1,4 +1,4 @@ -function StoridgeEventModel(data) { +export function StoridgeEventModel(data) { this.Time = data.time; this.Category = data.category; this.Module = data.module; diff --git a/app/extensions/storidge/models/info.js b/app/extensions/storidge/models/info.js index 2db3299ca..7d0f2f92f 100644 --- a/app/extensions/storidge/models/info.js +++ b/app/extensions/storidge/models/info.js @@ -1,4 +1,4 @@ -function StoridgeInfoModel(data) { +export function StoridgeInfoModel(data) { this.Domain = data.domain; this.Nodes = data.nodes; this.Status = data.status; diff --git a/app/extensions/storidge/models/profile.js b/app/extensions/storidge/models/profile.js index 6effb98cf..b451d4bc8 100644 --- a/app/extensions/storidge/models/profile.js +++ b/app/extensions/storidge/models/profile.js @@ -1,4 +1,4 @@ -function StoridgeProfileDefaultModel() { +export function StoridgeProfileDefaultModel() { this.Directory = '/cio/'; this.Capacity = 20; this.Redundancy = 2; @@ -10,12 +10,12 @@ function StoridgeProfileDefaultModel() { this.MaxBandwidth = 100; } -function StoridgeProfileListModel(data) { +export function StoridgeProfileListModel(data) { this.Name = data; this.Checked = false; } -function StoridgeProfileModel(name, data) { +export function StoridgeProfileModel(name, data) { this.Name = name; this.Directory = data.directory; this.Capacity = data.capacity; @@ -34,7 +34,7 @@ function StoridgeProfileModel(name, data) { } } -function StoridgeCreateProfileRequest(model) { +export function StoridgeCreateProfileRequest(model) { this.name = model.Name; this.capacity = model.Capacity; this.directory = model.Directory; diff --git a/app/extensions/storidge/services/clusterService.js b/app/extensions/storidge/services/clusterService.js index 97dfa2514..3d6916d5d 100644 --- a/app/extensions/storidge/services/clusterService.js +++ b/app/extensions/storidge/services/clusterService.js @@ -1,3 +1,7 @@ +import angular from 'angular'; +import { StoridgeInfoModel } from '../models/info'; +import { StoridgeEventModel } from '../models/events'; + angular.module('extension.storidge') .factory('StoridgeClusterService', ['$q', 'Storidge', function StoridgeClusterServiceFactory($q, Storidge) { 'use strict'; diff --git a/app/extensions/storidge/views/profiles/profilesController.js b/app/extensions/storidge/views/profiles/profilesController.js index 25276b1f5..e8c4ac842 100644 --- a/app/extensions/storidge/views/profiles/profilesController.js +++ b/app/extensions/storidge/views/profiles/profilesController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { StoridgeProfileDefaultModel } from '../../models/profile'; + angular.module('extension.storidge') .controller('StoridgeProfilesController', ['$q', '$scope', '$state', 'Notifications', 'StoridgeProfileService', function ($q, $scope, $state, Notifications, StoridgeProfileService) { diff --git a/app/portainer/components/accessControlForm/porAccessControlFormController.js b/app/portainer/components/accessControlForm/porAccessControlFormController.js index f26dea47c..8f13dd810 100644 --- a/app/portainer/components/accessControlForm/porAccessControlFormController.js +++ b/app/portainer/components/accessControlForm/porAccessControlFormController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .controller('porAccessControlFormController', ['$q', 'UserService', 'TeamService', 'Notifications', 'Authentication', 'ResourceControlService', function ($q, UserService, TeamService, Notifications, Authentication, ResourceControlService) { diff --git a/app/portainer/components/accessControlPanel/porAccessControlPanelController.js b/app/portainer/components/accessControlPanel/porAccessControlPanelController.js index eab4a8960..f299bdba9 100644 --- a/app/portainer/components/accessControlPanel/porAccessControlPanelController.js +++ b/app/portainer/components/accessControlPanel/porAccessControlPanelController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .controller('porAccessControlPanelController', ['$q', '$state', 'UserService', 'TeamService', 'ResourceControlService', 'Notifications', 'Authentication', 'ModalService', 'FormValidator', function ($q, $state, UserService, TeamService, ResourceControlService, Notifications, Authentication, ModalService, FormValidator) { diff --git a/app/portainer/components/accessManagement/porAccessManagementController.js b/app/portainer/components/accessManagement/porAccessManagementController.js index 666ec3628..baab69c0a 100644 --- a/app/portainer/components/accessManagement/porAccessManagementController.js +++ b/app/portainer/components/accessManagement/porAccessManagementController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .controller('porAccessManagementController', ['AccessService', 'Notifications', function (AccessService, Notifications) { diff --git a/app/portainer/components/endpoint-list/endpoint-list-controller.js b/app/portainer/components/endpoint-list/endpoint-list-controller.js index aab801410..06843c417 100644 --- a/app/portainer/components/endpoint-list/endpoint-list-controller.js +++ b/app/portainer/components/endpoint-list/endpoint-list-controller.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app').controller('EndpointListController', [ function EndpointListController() { var ctrl = this; diff --git a/app/portainer/components/endpoint-selector/endpointSelectorController.js b/app/portainer/components/endpoint-selector/endpointSelectorController.js index 23770e71f..c6817d6f6 100644 --- a/app/portainer/components/endpoint-selector/endpointSelectorController.js +++ b/app/portainer/components/endpoint-selector/endpointSelectorController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .controller('EndpointSelectorController', function () { var ctrl = this; diff --git a/app/portainer/components/endpointSecurity/porEndpointSecurityModel.js b/app/portainer/components/endpointSecurity/porEndpointSecurityModel.js index 94f6b0be2..795bdb754 100644 --- a/app/portainer/components/endpointSecurity/porEndpointSecurityModel.js +++ b/app/portainer/components/endpointSecurity/porEndpointSecurityModel.js @@ -1,4 +1,4 @@ -function EndpointSecurityFormData() { +export function EndpointSecurityFormData() { this.TLS = false; this.TLSMode = 'tls_client_ca'; this.TLSCACert = null; diff --git a/app/portainer/components/forms/group-form/group-form.js b/app/portainer/components/forms/group-form/group-form.js index ffc623217..aee9a5588 100644 --- a/app/portainer/components/forms/group-form/group-form.js +++ b/app/portainer/components/forms/group-form/group-form.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app').component('groupForm', { templateUrl: './groupForm.html', controller: function() { diff --git a/app/portainer/components/tag-selector/tagSelectorController.js b/app/portainer/components/tag-selector/tagSelectorController.js index 2bf96d105..ea5a450be 100644 --- a/app/portainer/components/tag-selector/tagSelectorController.js +++ b/app/portainer/components/tag-selector/tagSelectorController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .controller('TagSelectorController', function () { diff --git a/app/portainer/components/template-list/template-list.js b/app/portainer/components/template-list/template-list.js index f74f675ac..f0c54e055 100644 --- a/app/portainer/components/template-list/template-list.js +++ b/app/portainer/components/template-list/template-list.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app').component('templateList', { templateUrl: './templateList.html', controller: function() { diff --git a/app/portainer/filters/filters.js b/app/portainer/filters/filters.js index b7d0eef52..9985a67f4 100644 --- a/app/portainer/filters/filters.js +++ b/app/portainer/filters/filters.js @@ -1,3 +1,8 @@ +import angular from 'angular'; +import moment from 'moment'; +import _ from 'lodash'; +import filesize from 'filesize'; + angular.module('portainer.app') .filter('truncate', function () { 'use strict'; diff --git a/app/portainer/helpers/stackHelper.js b/app/portainer/helpers/stackHelper.js index 0469a882a..a4aeeb3ec 100644 --- a/app/portainer/helpers/stackHelper.js +++ b/app/portainer/helpers/stackHelper.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .factory('StackHelper', [function StackHelperFactory() { 'use strict'; diff --git a/app/portainer/helpers/templateHelper.js b/app/portainer/helpers/templateHelper.js index 9c07dd661..9e7dfb67a 100644 --- a/app/portainer/helpers/templateHelper.js +++ b/app/portainer/helpers/templateHelper.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .factory('TemplateHelper', [function TemplateHelperFactory() { 'use strict'; diff --git a/app/portainer/models/group.js b/app/portainer/models/group.js index b16d825f7..300e66bed 100644 --- a/app/portainer/models/group.js +++ b/app/portainer/models/group.js @@ -1,10 +1,10 @@ -function EndpointGroupDefaultModel() { +export function EndpointGroupDefaultModel() { this.Name = ''; this.Description = ''; this.Tags = []; } -function EndpointGroupModel(data) { +export function EndpointGroupModel(data) { this.Id = data.Id; this.Name = data.Name; this.Description = data.Description; @@ -13,14 +13,14 @@ function EndpointGroupModel(data) { this.AuthorizedTeams = data.AuthorizedTeams; } -function EndpointGroupCreateRequest(model, endpoints) { +export function EndpointGroupCreateRequest(model, endpoints) { this.Name = model.Name; this.Description = model.Description; this.Tags = model.Tags; this.AssociatedEndpoints = endpoints; } -function EndpointGroupUpdateRequest(model, endpoints) { +export function EndpointGroupUpdateRequest(model, endpoints) { this.id = model.Id; this.Name = model.Name; this.Description = model.Description; diff --git a/app/portainer/models/template.js b/app/portainer/models/template.js index 43e446050..a6a4cf38b 100644 --- a/app/portainer/models/template.js +++ b/app/portainer/models/template.js @@ -14,7 +14,7 @@ export function TemplateDefaultModel() { this.Registry = {}; } -function TemplateCreateRequest(model) { +export function TemplateCreateRequest(model) { this.Type = model.Type; this.Name = model.Name; this.Hostname = model.Hostname; diff --git a/app/portainer/services/api/accessService.js b/app/portainer/services/api/accessService.js index 2db034baa..913a1c112 100644 --- a/app/portainer/services/api/accessService.js +++ b/app/portainer/services/api/accessService.js @@ -1,3 +1,8 @@ +import angular from 'angular'; +import _ from 'lodash'; +import { UserAccessViewModel } from '../../models/access'; +import { TeamAccessViewModel } from '../../models/access'; + angular.module('portainer.app') .factory('AccessService', ['$q', 'UserService', 'TeamService', function AccessServiceFactory($q, UserService, TeamService) { 'use strict'; diff --git a/app/portainer/services/api/resourceControlService.js b/app/portainer/services/api/resourceControlService.js index ff4e60107..e86cf43de 100644 --- a/app/portainer/services/api/resourceControlService.js +++ b/app/portainer/services/api/resourceControlService.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .factory('ResourceControlService', ['$q', 'ResourceControl', 'UserService', 'TeamService', 'ResourceControlHelper', function ResourceControlServiceFactory($q, ResourceControl, UserService, TeamService, ResourceControlHelper) { 'use strict'; diff --git a/app/portainer/services/api/stackService.js b/app/portainer/services/api/stackService.js index 37b7c10a9..9c68ab6cb 100644 --- a/app/portainer/services/api/stackService.js +++ b/app/portainer/services/api/stackService.js @@ -1,3 +1,7 @@ +import angular from 'angular'; +import _ from 'lodash'; +import { StackViewModel, ExternalStackViewModel } from '../../models/stack'; + angular.module('portainer.app') .factory('StackService', ['$q', 'Stack', 'ResourceControlService', 'FileUploadService', 'StackHelper', 'ServiceService', 'ContainerService', 'SwarmService', 'EndpointProvider', function StackServiceFactory($q, Stack, ResourceControlService, FileUploadService, StackHelper, ServiceService, ContainerService, SwarmService, EndpointProvider) { diff --git a/app/portainer/services/api/tagService.js b/app/portainer/services/api/tagService.js index a73b9f932..8d30ee98a 100644 --- a/app/portainer/services/api/tagService.js +++ b/app/portainer/services/api/tagService.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { TagViewModel } from '../../models/tag'; + angular.module('portainer.app') .factory('TagService', ['$q', 'Tags', function TagServiceFactory($q, Tags) { 'use strict'; diff --git a/app/portainer/services/api/teamService.js b/app/portainer/services/api/teamService.js index 4a78931d3..541592213 100644 --- a/app/portainer/services/api/teamService.js +++ b/app/portainer/services/api/teamService.js @@ -1,3 +1,7 @@ +import angular from 'angular'; +import { TeamViewModel } from '../../models/team'; +import { TeamMembershipModel } from '../../models/teamMembership'; + angular.module('portainer.app') .factory('TeamService', ['$q', 'Teams', 'TeamMembershipService', function TeamServiceFactory($q, Teams, TeamMembershipService) { 'use strict'; diff --git a/app/portainer/services/api/templateService.js b/app/portainer/services/api/templateService.js index 4d82bf5db..ddbdb2048 100644 --- a/app/portainer/services/api/templateService.js +++ b/app/portainer/services/api/templateService.js @@ -1,3 +1,10 @@ +import angular from 'angular'; +import { + TemplateViewModel, + TemplateCreateRequest, + TemplateUpdateRequest +} from '../../models/template'; + angular.module('portainer.app') .factory('TemplateService', ['$q', 'Templates', 'TemplateHelper', 'ImageHelper', 'ContainerHelper', function TemplateServiceFactory($q, Templates, TemplateHelper, ImageHelper, ContainerHelper) { diff --git a/app/portainer/services/api/userService.js b/app/portainer/services/api/userService.js index 47decaf85..bc2115a64 100644 --- a/app/portainer/services/api/userService.js +++ b/app/portainer/services/api/userService.js @@ -1,3 +1,8 @@ +import angular from 'angular'; +import _ from 'lodash'; +import { UserViewModel } from '../../models/user'; +import { TeamMembershipModel } from '../../models/teamMembership'; + angular.module('portainer.app') .factory('UserService', ['$q', 'Users', 'UserHelper', 'TeamService', 'TeamMembershipService', function UserServiceFactory($q, Users, UserHelper, TeamService, TeamMembershipService) { 'use strict'; diff --git a/app/portainer/services/api/webhookService.js b/app/portainer/services/api/webhookService.js index dcdfc6a40..fbf4c1eec 100644 --- a/app/portainer/services/api/webhookService.js +++ b/app/portainer/services/api/webhookService.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { WebhookViewModel } from '../../models/webhook'; + angular.module('portainer.app') .factory('WebhookService', ['$q', 'Webhooks', function WebhookServiceFactory($q, Webhooks) { 'use strict'; diff --git a/app/portainer/services/chartService.js b/app/portainer/services/chartService.js index 4b10c9a83..db28ad8cb 100644 --- a/app/portainer/services/chartService.js +++ b/app/portainer/services/chartService.js @@ -1,3 +1,6 @@ +import Chart from 'chart.js'; +import filesize from 'filesize'; + angular.module('portainer.app') .factory('ChartService', [function ChartService() { 'use strict'; diff --git a/app/portainer/services/codeMirror.js b/app/portainer/services/codeMirror.js index a6e43f11e..fb265e1b6 100644 --- a/app/portainer/services/codeMirror.js +++ b/app/portainer/services/codeMirror.js @@ -1,3 +1,7 @@ +import angular from 'angular'; +import _ from 'lodash'; +import CodeMirror from 'codemirror'; + angular.module('portainer.app') .factory('CodeMirrorService', function CodeMirrorService() { 'use strict'; diff --git a/app/portainer/services/extensionManager.js b/app/portainer/services/extensionManager.js index b0cde467e..43c26ac20 100644 --- a/app/portainer/services/extensionManager.js +++ b/app/portainer/services/extensionManager.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .factory('ExtensionManager', ['$q', 'PluginService', 'SystemService', 'ExtensionService', function ExtensionManagerFactory($q, PluginService, SystemService, ExtensionService) { diff --git a/app/portainer/services/modalService.js b/app/portainer/services/modalService.js index f08a02962..90cd046f2 100644 --- a/app/portainer/services/modalService.js +++ b/app/portainer/services/modalService.js @@ -1,3 +1,5 @@ +import bootbox from 'bootbox'; + angular.module('portainer.app') .factory('ModalService', [function ModalServiceFactory() { 'use strict'; diff --git a/app/portainer/views/endpoints/create/createEndpointController.js b/app/portainer/views/endpoints/create/createEndpointController.js index c682bee1b..39587a984 100644 --- a/app/portainer/views/endpoints/create/createEndpointController.js +++ b/app/portainer/views/endpoints/create/createEndpointController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { EndpointSecurityFormData } from '../../../components/endpointSecurity/porEndpointSecurityModel'; + angular.module('portainer.app') .controller('CreateEndpointController', ['$q', '$scope', '$state', '$filter', 'clipboard', 'EndpointService', 'GroupService', 'TagService', 'Notifications', function ($q, $scope, $state, $filter, clipboard, EndpointService, GroupService, TagService, Notifications) { diff --git a/app/portainer/views/endpoints/edit/endpointController.js b/app/portainer/views/endpoints/edit/endpointController.js index d091bf635..689ceb3f6 100644 --- a/app/portainer/views/endpoints/edit/endpointController.js +++ b/app/portainer/views/endpoints/edit/endpointController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { EndpointSecurityFormData } from '../../../components/endpointSecurity/porEndpointSecurityModel'; + angular.module('portainer.app') .controller('EndpointController', ['$q', '$scope', '$state', '$transition$', '$filter', 'EndpointService', 'GroupService', 'TagService', 'EndpointProvider', 'Notifications', function ($q, $scope, $state, $transition$, $filter, EndpointService, GroupService, TagService, EndpointProvider, Notifications) { diff --git a/app/portainer/views/groups/create/createGroupController.js b/app/portainer/views/groups/create/createGroupController.js index 9fcf47c84..560a97ca4 100644 --- a/app/portainer/views/groups/create/createGroupController.js +++ b/app/portainer/views/groups/create/createGroupController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { EndpointGroupDefaultModel } from '../../../models/group'; + angular.module('portainer.app') .controller('CreateGroupController', ['$q', '$scope', '$state', 'GroupService', 'EndpointService', 'TagService', 'Notifications', function ($q, $scope, $state, GroupService, EndpointService, TagService, Notifications) { diff --git a/app/portainer/views/init/endpoint/initEndpointController.js b/app/portainer/views/init/endpoint/initEndpointController.js index a621d014e..945397210 100644 --- a/app/portainer/views/init/endpoint/initEndpointController.js +++ b/app/portainer/views/init/endpoint/initEndpointController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .controller('InitEndpointController', ['$scope', '$state', 'EndpointService', 'StateManager', 'Notifications', function ($scope, $state, EndpointService, StateManager, Notifications) { diff --git a/app/portainer/views/stacks/create/createStackController.js b/app/portainer/views/stacks/create/createStackController.js index 5f7d1a892..9dada78d8 100644 --- a/app/portainer/views/stacks/create/createStackController.js +++ b/app/portainer/views/stacks/create/createStackController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import { AccessControlFormData } from '../../../components/accessControlForm/porAccessControlFormModel'; + angular.module('portainer.app') .controller('CreateStackController', ['$scope', '$state', 'StackService', 'Authentication', 'Notifications', 'FormValidator', 'ResourceControlService', 'FormHelper', 'EndpointProvider', function ($scope, $state, StackService, Authentication, Notifications, FormValidator, ResourceControlService, FormHelper, EndpointProvider) { diff --git a/app/portainer/views/templates/edit/templateController.js b/app/portainer/views/templates/edit/templateController.js index 352764e43..f20b9c9f6 100644 --- a/app/portainer/views/templates/edit/templateController.js +++ b/app/portainer/views/templates/edit/templateController.js @@ -1,3 +1,6 @@ +import angular from 'angular'; +import _ from 'lodash'; + angular.module('portainer.app') .controller('TemplateController', ['$q', '$scope', '$state', '$transition$', 'TemplateService', 'TemplateHelper', 'NetworkService', 'Notifications', function ($q, $scope, $state, $transition$, TemplateService, TemplateHelper, NetworkService, Notifications) {