mirror of https://github.com/portainer/portainer
feat(build): import all globals
parent
2565d4ed62
commit
dde82f3d96
|
@ -4,7 +4,7 @@ env:
|
|||
node: true
|
||||
|
||||
globals:
|
||||
angular: true
|
||||
# angular: true
|
||||
# $: true
|
||||
# _: true
|
||||
# moment: true
|
||||
|
|
|
@ -2,13 +2,6 @@ import '../assets/css/vendor.css';
|
|||
import '../assets/css/app.css';
|
||||
|
||||
import angular from 'angular';
|
||||
window.angular = angular; // FIX
|
||||
|
||||
import moment from 'moment';
|
||||
window.moment = moment;
|
||||
|
||||
import filesize from 'filesize';
|
||||
window.filesize = filesize;
|
||||
|
||||
import 'angular-ui-bootstrap';
|
||||
import '@uirouter/angularjs';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { SubscriptionViewModel } from '../models/subscription';
|
||||
|
||||
angular.module('portainer.azure')
|
||||
.factory('SubscriptionService', ['$q', 'Subscription', function SubscriptionServiceFactory($q, Subscription) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ContainersDatatableController', ['PaginationService', 'DatatableService', 'EndpointProvider',
|
||||
function (PaginationService, DatatableService, EndpointProvider) {
|
||||
|
@ -193,7 +197,7 @@ function (PaginationService, DatatableService, EndpointProvider) {
|
|||
|
||||
for (var i = 0; i < datasetFilters.length; i++) {
|
||||
var filter = datasetFilters[i];
|
||||
existingFilter = _.find(storedFilters, ['label', filter.label]);
|
||||
var existingFilter = _.find(storedFilters, ['label', filter.label]);
|
||||
if (existingFilter && !existingFilter.display) {
|
||||
filter.display = existingFilter.display;
|
||||
this.filters.state.enabled = true;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ServicesDatatableController', ['PaginationService', 'DatatableService', 'EndpointProvider',
|
||||
function (PaginationService, DatatableService, EndpointProvider) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('porImageRegistryController', ['$q', 'RegistryService', 'DockerHubService', 'ImageService', 'Notifications',
|
||||
function ($q, RegistryService, DockerHubService, ImageService, Notifications) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function VolumesNFSFormData() {
|
||||
export function VolumesNFSFormData() {
|
||||
this.useNFS = false;
|
||||
this.serverAddress = '';
|
||||
this.mountPoint = '';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.factory('InfoHelper', [function InfoHelperFactory() {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
import { ResourceControlViewModel } from '../../portainer/models/resourceControl';
|
||||
|
||||
function createStatus(statusText) {
|
||||
var status = _.toLower(statusText);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ export function ContainerCapabilities() {
|
|||
});
|
||||
}
|
||||
|
||||
function ContainerCapability(cap, allowed) {
|
||||
export function ContainerCapability(cap, allowed) {
|
||||
this.capability = cap;
|
||||
this.allowed = allowed;
|
||||
this.description = capDesc[cap];
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { ResourceControlViewModel } from '../../portainer/models/resourceControl';
|
||||
|
||||
export function ServiceViewModel(data, runningTasks, allTasks) {
|
||||
this.Model = data;
|
||||
this.Id = data.ID;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
function isJSONArray(jsonString) {
|
||||
return Object.prototype.toString.call(jsonString) === '[object Array]';
|
||||
}
|
||||
|
@ -9,7 +11,9 @@ function isJSON(jsonString) {
|
|||
return o;
|
||||
}
|
||||
}
|
||||
catch (e) { }
|
||||
catch (e) {
|
||||
//empty
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { SecretViewModel } from '../models/secret';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.factory('SecretService', ['$q', 'Secret', function SecretServiceFactory($q, Secret) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import angular from 'angular';
|
||||
import { ServiceViewModel } from '../models/service';
|
||||
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.factory('ServiceService', ['$q', 'Service', 'ServiceHelper', 'TaskService', 'ResourceControlService', 'LogHelper',
|
||||
function ServiceServiceFactory($q, Service, ServiceHelper, TaskService, ResourceControlService, LogHelper) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { SwarmViewModel } from '../models/swarm';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.factory('SwarmService', ['$q', 'Swarm', function SwarmServiceFactory($q, Swarm) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { EventViewModel } from '../models/event';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.factory('SystemService', ['$q', 'System', function SystemServiceFactory($q, System) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('CreateConfigController', ['$scope', '$state', '$transition$', 'Notifications', 'ConfigService', 'Authentication', 'FormValidator', 'ResourceControlService',
|
||||
function ($scope, $state, $transition$, Notifications, ConfigService, Authentication, FormValidator, ResourceControlService) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { Terminal } from 'xterm';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ContainerConsoleController', ['$scope', '$transition$', 'ContainerService', 'ImageService', 'EndpointProvider', 'Notifications', 'ContainerHelper', 'ExecService', 'HttpRequestHelper', 'LocalStorage', 'CONSOLE_COMMANDS_LABEL_PREFIX',
|
||||
function ($scope, $transition$, ContainerService, ImageService, EndpointProvider, Notifications, ContainerHelper, ExecService, HttpRequestHelper, LocalStorage, CONSOLE_COMMANDS_LABEL_PREFIX) {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import { ContainerCapabilities } from '../../../models/containerCapabilities';
|
||||
import { ContainerCapabilities, ContainerCapability } from '../../../models/containerCapabilities';
|
||||
import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel';
|
||||
import { ContainerDetailsViewModel } from '../../../models/container';
|
||||
|
||||
|
||||
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',
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import moment from 'moment';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ContainerStatsController', ['$q', '$scope', '$transition$', '$document', '$interval', 'ContainerService', 'ChartService', 'Notifications', 'HttpRequestHelper',
|
||||
function ($q, $scope, $transition$, $document, $interval, ContainerService, ChartService, Notifications, HttpRequestHelper) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ImagesController', ['$scope', '$state', 'ImageService', 'Notifications', 'ModalService', 'HttpRequestHelper', 'FileSaver', 'Blob',
|
||||
function ($scope, $state, ImageService, Notifications, ModalService, HttpRequestHelper, FileSaver, Blob) {
|
||||
|
@ -51,7 +54,7 @@ function ($scope, $state, ImageService, Notifications, ModalService, HttpRequest
|
|||
|
||||
if (untagged) {
|
||||
Notifications.warning('', 'Cannot download a untagged image');
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ServiceController', ['$q', '$scope', '$transition$', '$state', '$location', '$timeout', '$anchorScroll', 'ServiceService', 'ConfigService', 'ConfigHelper', 'SecretService', 'ImageService', 'SecretHelper', 'Service', 'ServiceHelper', 'LabelHelper', 'TaskService', 'NodeService', 'ContainerService', 'TaskHelper', 'Notifications', 'ModalService', 'PluginService', 'Authentication', 'SettingsService', 'VolumeService', 'ImageHelper', 'WebhookService', 'EndpointProvider', 'clipboard','WebhookHelper',
|
||||
function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, ServiceService, ConfigService, ConfigHelper, SecretService, ImageService, SecretHelper, Service, ServiceHelper, LabelHelper, TaskService, NodeService, ContainerService, TaskHelper, Notifications, ModalService, PluginService, Authentication, SettingsService, VolumeService, ImageHelper, WebhookService, EndpointProvider, clipboard, WebhookHelper) {
|
||||
|
@ -542,12 +544,13 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
});
|
||||
}
|
||||
|
||||
$scope.updateServiceAttribute = function updateServiceAttribute(service, name) {
|
||||
$scope.updateServiceAttribute = updateServiceAttribute;
|
||||
function updateServiceAttribute(service, name) {
|
||||
if (service[name] !== originalService[name] || !(name in originalService)) {
|
||||
service.hasChanges = true;
|
||||
}
|
||||
previousServiceValues.push(name);
|
||||
};
|
||||
}
|
||||
|
||||
function updateServiceArray(service, name) {
|
||||
previousServiceValues.push(name);
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import angular from 'angular';
|
||||
import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel';
|
||||
import { VolumesNFSFormData } from '../../../components/volumesNFSForm/volumesNFSFormModel';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('CreateVolumeController', ['$q', '$scope', '$state', 'VolumeService', 'PluginService', 'ResourceControlService', 'Authentication', 'Notifications', 'FormValidator', 'HttpRequestHelper',
|
||||
function ($q, $scope, $state, VolumeService, PluginService, ResourceControlService, Authentication, Notifications, FormValidator, HttpRequestHelper) {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import angular from 'angular';
|
||||
import Chart from 'chart.js';
|
||||
import filesize from 'filesize';
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.factory('StoridgeChartService', [function StoridgeChartService() {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
import angular from 'angular';
|
||||
import {
|
||||
StoridgeCreateProfileRequest,
|
||||
StoridgeProfileListModel,
|
||||
StoridgeProfileModel
|
||||
} from '../models/profile';
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.factory('StoridgeProfileService', ['$q', 'Storidge', function StoridgeProfileServiceFactory($q, Storidge) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { StoridgeProfileDefaultModel } from '../../../models/profile';
|
||||
|
||||
angular.module('extension.storidge')
|
||||
.controller('StoridgeCreateProfileController', ['$scope', '$state', '$transition$', 'Notifications', 'StoridgeProfileService',
|
||||
function ($scope, $state, $transition$, Notifications, StoridgeProfileService) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { ResourceControlViewModel } from '../../portainer/models/resourceControl';
|
||||
|
||||
export function StackViewModel(data) {
|
||||
this.Id = data.Id;
|
||||
this.Type = data.Type;
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
import angular from 'angular';
|
||||
import {
|
||||
EndpointGroupModel,
|
||||
EndpointGroupCreateRequest,
|
||||
EndpointGroupUpdateRequest
|
||||
} from '../../models/group';
|
||||
|
||||
angular.module('portainer.app')
|
||||
.factory('GroupService', ['$q', 'EndpointGroups',
|
||||
function GroupService($q, EndpointGroups) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { MotdViewModel } from '../../models/motd';
|
||||
|
||||
angular.module('portainer.app')
|
||||
.factory('MotdService', ['$q', 'Motd', function MotdServiceFactory($q, Motd) {
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import angular from 'angular';
|
||||
import { RegistryViewModel } from '../../models/registry';
|
||||
|
||||
angular.module('portainer.app')
|
||||
.factory('RegistryService', ['$q', 'Registries', 'DockerHubService', 'RegistryHelper', 'ImageHelper', function RegistryServiceFactory($q, Registries, DockerHubService, RegistryHelper, ImageHelper) {
|
||||
'use strict';
|
||||
|
|
Loading…
Reference in New Issue