feat(build): add webpack build config

pull/2670/head
Chaim Lev-Ari 2018-10-10 11:06:23 +03:00
parent fb6752c143
commit fd3e96735c
142 changed files with 4495 additions and 518 deletions

View File

@ -1,9 +1,10 @@
env:
browser: true
jquery: true
# globals:
# angular: true
node: true
globals:
angular: true
# $: true
# _: true
# moment: true
@ -12,276 +13,282 @@ env:
extends:
- 'eslint:recommended'
# http://eslint.org/docs/rules/
rules:
# Possible Errors
no-await-in-loop: off
no-cond-assign: error
no-console: off
no-constant-condition: error
no-control-regex: error
no-debugger: error
no-dupe-args: error
no-dupe-keys: error
no-duplicate-case: error
no-empty-character-class: error
no-empty: error
no-ex-assign: error
no-extra-boolean-cast: error
no-extra-parens: off
no-extra-semi: error
no-func-assign: error
no-inner-declarations:
- error
- functions
no-invalid-regexp: error
no-irregular-whitespace: error
no-negated-in-lhs: error
no-obj-calls: error
no-prototype-builtins: off
no-regex-spaces: error
no-sparse-arrays: error
no-template-curly-in-string: off
no-unexpected-multiline: error
no-unreachable: error
no-unsafe-finally: off
no-unsafe-negation: off
use-isnan: error
valid-jsdoc: off
valid-typeof: error
parserOptions:
ecmaVersion: 2018
sourceType: module
ecmaFeatures:
modules: true
# Best Practices
accessor-pairs: error
array-callback-return: off
block-scoped-var: off
class-methods-use-this: off
complexity:
- error
- 6
consistent-return: off
curly: off
default-case: off
dot-location: off
dot-notation: off
eqeqeq: error
guard-for-in: error
no-alert: error
no-caller: error
no-case-declarations: error
no-div-regex: error
no-else-return: off
no-empty-function: off
no-empty-pattern: error
no-eq-null: error
no-eval: error
no-extend-native: error
no-extra-bind: error
no-extra-label: off
no-fallthrough: error
no-floating-decimal: off
no-global-assign: off
no-implicit-coercion: off
no-implied-eval: error
no-invalid-this: off
no-iterator: error
no-labels:
- error
- allowLoop: true
allowSwitch: true
no-lone-blocks: error
no-loop-func: error
no-magic-number: off
no-multi-spaces: off
no-multi-str: off
no-native-reassign: error
no-new-func: error
no-new-wrappers: error
no-new: error
no-octal-escape: error
no-octal: error
no-param-reassign: off
no-proto: error
no-redeclare: error
no-restricted-properties: off
no-return-assign: error
no-return-await: off
no-script-url: error
no-self-assign: off
no-self-compare: error
no-sequences: off
no-throw-literal: off
no-unmodified-loop-condition: off
no-unused-expressions: error
no-unused-labels: off
no-useless-call: error
no-useless-concat: error
no-useless-escape: off
no-useless-return: off
no-void: error
no-warning-comments: off
no-with: error
prefer-promise-reject-errors: off
radix: error
require-await: off
vars-on-top: off
wrap-iife: error
yoda: off
# # http://eslint.org/docs/rules/
# rules:
# # Possible Errors
# no-await-in-loop: off
# no-cond-assign: error
# no-console: off
# no-constant-condition: error
# no-control-regex: error
# no-debugger: error
# no-dupe-args: error
# no-dupe-keys: error
# no-duplicate-case: error
# no-empty-character-class: error
# no-empty: error
# no-ex-assign: error
# no-extra-boolean-cast: error
# no-extra-parens: off
# no-extra-semi: error
# no-func-assign: error
# no-inner-declarations:
# - error
# - functions
# no-invalid-regexp: error
# no-irregular-whitespace: error
# no-negated-in-lhs: error
# no-obj-calls: error
# no-prototype-builtins: off
# no-regex-spaces: error
# no-sparse-arrays: error
# no-template-curly-in-string: off
# no-unexpected-multiline: error
# no-unreachable: error
# no-unsafe-finally: off
# no-unsafe-negation: off
# use-isnan: error
# valid-jsdoc: off
# valid-typeof: error
# Strict
strict: off
# # Best Practices
# accessor-pairs: error
# array-callback-return: off
# block-scoped-var: off
# class-methods-use-this: off
# complexity:
# - error
# - 6
# consistent-return: off
# curly: off
# default-case: off
# dot-location: off
# dot-notation: off
# eqeqeq: error
# guard-for-in: error
# no-alert: error
# no-caller: error
# no-case-declarations: error
# no-div-regex: error
# no-else-return: off
# no-empty-function: off
# no-empty-pattern: error
# no-eq-null: error
# no-eval: error
# no-extend-native: error
# no-extra-bind: error
# no-extra-label: off
# no-fallthrough: error
# no-floating-decimal: off
# no-global-assign: off
# no-implicit-coercion: off
# no-implied-eval: error
# no-invalid-this: off
# no-iterator: error
# no-labels:
# - error
# - allowLoop: true
# allowSwitch: true
# no-lone-blocks: error
# no-loop-func: error
# no-magic-number: off
# no-multi-spaces: off
# no-multi-str: off
# no-native-reassign: error
# no-new-func: error
# no-new-wrappers: error
# no-new: error
# no-octal-escape: error
# no-octal: error
# no-param-reassign: off
# no-proto: error
# no-redeclare: error
# no-restricted-properties: off
# no-return-assign: error
# no-return-await: off
# no-script-url: error
# no-self-assign: off
# no-self-compare: error
# no-sequences: off
# no-throw-literal: off
# no-unmodified-loop-condition: off
# no-unused-expressions: error
# no-unused-labels: off
# no-useless-call: error
# no-useless-concat: error
# no-useless-escape: off
# no-useless-return: off
# no-void: error
# no-warning-comments: off
# no-with: error
# prefer-promise-reject-errors: off
# radix: error
# require-await: off
# vars-on-top: off
# wrap-iife: error
# yoda: off
# Variables
init-declarations: off
no-catch-shadow: error
no-delete-var: error
no-label-var: error
no-restricted-globals: off
no-shadow-restricted-names: error
no-shadow: off
no-undef-init: error
no-undef: off
no-undefined: off
no-unused-vars:
- warn
-
vars: local
no-use-before-define: off
# # Strict
# strict: off
# Node.js and CommonJS
callback-return: error
global-require: error
handle-callback-err: error
no-mixed-requires: off
no-new-require: off
no-path-concat: error
no-process-env: off
no-process-exit: error
no-restricted-modules: off
no-sync: off
# # Variables
# init-declarations: off
# no-catch-shadow: error
# no-delete-var: error
# no-label-var: error
# no-restricted-globals: off
# no-shadow-restricted-names: error
# no-shadow: off
# no-undef-init: error
# no-undef: off
# no-undefined: off
# no-unused-vars:
# - warn
# -
# vars: local
# no-use-before-define: off
# Stylistic Issues
array-bracket-spacing: off
block-spacing: off
brace-style: off
camelcase: off
capitalized-comments: off
comma-dangle:
- error
- never
comma-spacing: off
comma-style: off
computed-property-spacing: off
consistent-this: off
eol-last: off
func-call-spacing: off
func-name-matching: off
func-names: off
func-style: off
id-length: off
id-match: off
indent: off
jsx-quotes: off
key-spacing: off
keyword-spacing: off
line-comment-position: off
linebreak-style:
- error
- unix
lines-around-comment: off
lines-around-directive: off
max-depth: off
max-len: off
max-nested-callbacks: off
max-params: off
max-statements-per-line: off
max-statements:
- error
- 30
multiline-ternary: off
new-cap: off
new-parens: off
newline-after-var: off
newline-before-return: off
newline-per-chained-call: off
no-array-constructor: off
no-bitwise: off
no-continue: off
no-inline-comments: off
no-lonely-if: off
no-mixed-operators: off
no-mixed-spaces-and-tabs: off
no-multi-assign: off
no-multiple-empty-lines: off
no-negated-condition: off
no-nested-ternary: off
no-new-object: off
no-plusplus: off
no-restricted-syntax: off
no-spaced-func: off
no-tabs: off
no-ternary: off
no-trailing-spaces: off
no-underscore-dangle: off
no-unneeded-ternary: off
object-curly-newline: off
object-curly-spacing: off
object-property-newline: off
one-var-declaration-per-line: off
one-var: off
operator-assignment: off
operator-linebreak: off
padded-blocks: off
quote-props: off
quotes:
- error
- single
require-jsdoc: off
semi-spacing: off
semi:
- error
- always
sort-keys: off
sort-vars: off
space-before-blocks: off
space-before-function-paren: off
space-in-parens: off
space-infix-ops: off
space-unary-ops: off
spaced-comment: off
template-tag-spacing: off
unicode-bom: off
wrap-regex: off
# # Node.js and CommonJS
# callback-return: error
# global-require: error
# handle-callback-err: error
# no-mixed-requires: off
# no-new-require: off
# no-path-concat: error
# no-process-env: off
# no-process-exit: error
# no-restricted-modules: off
# no-sync: off
# ECMAScript 6
arrow-body-style: off
arrow-parens: off
arrow-spacing: off
constructor-super: off
generator-star-spacing: off
no-class-assign: off
no-confusing-arrow: off
no-const-assign: off
no-dupe-class-members: off
no-duplicate-imports: off
no-new-symbol: off
no-restricted-imports: off
no-this-before-super: off
no-useless-computed-key: off
no-useless-constructor: off
no-useless-rename: off
no-var: off
object-shorthand: off
prefer-arrow-callback: off
prefer-const: off
prefer-destructuring: off
prefer-numeric-literals: off
prefer-rest-params: off
prefer-reflect: off
prefer-spread: off
prefer-template: off
require-yield: off
rest-spread-spacing: off
sort-imports: off
symbol-description: off
template-curly-spacing: off
yield-star-spacing: off
# # Stylistic Issues
# array-bracket-spacing: off
# block-spacing: off
# brace-style: off
# camelcase: off
# capitalized-comments: off
# comma-dangle:
# - error
# - never
# comma-spacing: off
# comma-style: off
# computed-property-spacing: off
# consistent-this: off
# eol-last: off
# func-call-spacing: off
# func-name-matching: off
# func-names: off
# func-style: off
# id-length: off
# id-match: off
# indent: off
# jsx-quotes: off
# key-spacing: off
# keyword-spacing: off
# line-comment-position: off
# linebreak-style:
# - error
# - unix
# lines-around-comment: off
# lines-around-directive: off
# max-depth: off
# max-len: off
# max-nested-callbacks: off
# max-params: off
# max-statements-per-line: off
# max-statements:
# - error
# - 30
# multiline-ternary: off
# new-cap: off
# new-parens: off
# newline-after-var: off
# newline-before-return: off
# newline-per-chained-call: off
# no-array-constructor: off
# no-bitwise: off
# no-continue: off
# no-inline-comments: off
# no-lonely-if: off
# no-mixed-operators: off
# no-mixed-spaces-and-tabs: off
# no-multi-assign: off
# no-multiple-empty-lines: off
# no-negated-condition: off
# no-nested-ternary: off
# no-new-object: off
# no-plusplus: off
# no-restricted-syntax: off
# no-spaced-func: off
# no-tabs: off
# no-ternary: off
# no-trailing-spaces: off
# no-underscore-dangle: off
# no-unneeded-ternary: off
# object-curly-newline: off
# object-curly-spacing: off
# object-property-newline: off
# one-var-declaration-per-line: off
# one-var: off
# operator-assignment: off
# operator-linebreak: off
# padded-blocks: off
# quote-props: off
# quotes:
# - error
# - single
# require-jsdoc: off
# semi-spacing: off
# semi:
# - error
# - always
# sort-keys: off
# sort-vars: off
# space-before-blocks: off
# space-before-function-paren: off
# space-in-parens: off
# space-infix-ops: off
# space-unary-ops: off
# spaced-comment: off
# template-tag-spacing: off
# unicode-bom: off
# wrap-regex: off
# # ECMAScript 6
# arrow-body-style: off
# arrow-parens: off
# arrow-spacing: off
# constructor-super: off
# generator-star-spacing: off
# no-class-assign: off
# no-confusing-arrow: off
# no-const-assign: off
# no-dupe-class-members: off
# no-duplicate-imports: off
# no-new-symbol: off
# no-restricted-imports: off
# no-this-before-super: off
# no-useless-computed-key: off
# no-useless-constructor: off
# no-useless-rename: off
# no-var: off
# object-shorthand: off
# prefer-arrow-callback: off
# prefer-const: off
# prefer-destructuring: off
# prefer-numeric-literals: off
# prefer-rest-params: off
# prefer-reflect: off
# prefer-spread: off
# prefer-template: off
# require-yield: off
# rest-spread-spacing: off
# sort-imports: off
# symbol-description: off
# template-curly-spacing: off
# yield-star-spacing: off

View File

@ -1,3 +1,41 @@
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';
import 'ui-select';
import 'isteven-angular-multiselect/isteven-multi-select.js';
import 'angular-cookies';
import 'angular-sanitize';
import 'ng-file-upload';
import 'angular-messages';
import 'angular-resource';
import 'angular-utils-pagination';
import 'angular-local-storage';
import 'angular-jwt';
import 'angular-google-analytics';
import 'angular-json-tree';
import 'angular-loading-bar';
import 'angular-clipboard';
import 'angular-file-saver';
import 'angularjs-scroll-glue';
import 'angularjs-slider';
import './agent/_module';
import './azure/_module';
import './docker/__module';
import './extensions/storidge/__module';
import './portainer/__module';
angular.module('portainer', [
'ui.bootstrap',
'ui.router',
@ -17,10 +55,18 @@ angular.module('portainer', [
'angular-clipboard',
'ngFileSaver',
'luegg.directives',
'portainer.templates',
// 'portainer.templates',
'portainer.app',
'portainer.agent',
'portainer.azure',
'portainer.docker',
'extension.storidge',
'rzModule']);
'rzModule'
]);
if (require) {
var req = require.context('./', true, /^(.*\.(js$))[^.]*$/im);
req.keys().forEach(function(key) {
req(key);
});
}

View File

@ -1,5 +1,5 @@
angular.module('portainer.agent').component('fileUploader', {
templateUrl: 'app/agent/components/file-uploader/file-uploader.html',
templateUrl: './file-uploader.html',
controller: 'FileUploaderController',
bindings: {
uploadFile: '<onFileSelected'

View File

@ -1,5 +1,5 @@
angular.module('portainer.agent').component('filesDatatable', {
templateUrl: 'app/agent/components/files-datatable/files-datatable.html',
templateUrl: './files-datatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.agent').component('hostBrowser', {
controller: 'HostBrowserController',
templateUrl: 'app/agent/components/host-browser/host-browser.html',
templateUrl: './host-browser.html',
bindings: {}
});

View File

@ -1,5 +1,5 @@
angular.module('portainer.agent').component('nodeSelector', {
templateUrl: 'app/agent/components/node-selector/nodeSelector.html',
templateUrl: './nodeSelector.html',
controller: 'NodeSelectorController',
bindings: {
model: '='

View File

@ -1,5 +1,5 @@
angular.module('portainer.agent').component('volumeBrowser', {
templateUrl: 'app/agent/components/volume-browser/volumeBrowser.html',
templateUrl: './volumeBrowser.html',
controller: 'VolumeBrowserController',
bindings: {
volumeId: '<',

View File

@ -1,4 +1,4 @@
function AgentViewModel(data) {
export function AgentViewModel(data) {
this.IPAddress = data.IPAddress;
this.NodeName = data.NodeName;
this.NodeRole = data.NodeRole;

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { AgentViewModel } from '../models/agent';
angular.module('portainer.agent').factory('AgentService', [
'$q', 'Agent','HttpRequestHelper', 'Host',
function AgentServiceFactory($q, Agent, HttpRequestHelper, Host) {

View File

@ -14,7 +14,7 @@ angular.module('portainer.azure', ['portainer.app'])
url: '/containerinstances',
views: {
'content@': {
templateUrl: 'app/azure/views/containerinstances/containerinstances.html',
templateUrl: './views/containerinstances/containerinstances.html',
controller: 'AzureContainerInstancesController'
}
}
@ -25,7 +25,7 @@ angular.module('portainer.azure', ['portainer.app'])
url: '/new/',
views: {
'content@': {
templateUrl: 'app/azure/views/containerinstances/create/createcontainerinstance.html',
templateUrl: './views/containerinstances/create/createcontainerinstance.html',
controller: 'AzureCreateContainerInstanceController'
}
}
@ -36,7 +36,7 @@ angular.module('portainer.azure', ['portainer.app'])
url: '/dashboard',
views: {
'content@': {
templateUrl: 'app/azure/views/dashboard/dashboard.html',
templateUrl: './views/dashboard/dashboard.html',
controller: 'AzureDashboardController'
}
}

View File

@ -4,5 +4,5 @@ angular.module('portainer.azure').component('azureEndpointConfig', {
tenantId: '=',
authenticationKey: '='
},
templateUrl: 'app/azure/components/azure-endpoint-config/azureEndpointConfig.html'
templateUrl: './azureEndpointConfig.html'
});

View File

@ -1,3 +1,3 @@
angular.module('portainer.azure').component('azureSidebarContent', {
templateUrl: 'app/azure/components/azure-sidebar-content/azureSidebarContent.html'
templateUrl: './azureSidebarContent.html'
});

View File

@ -1,5 +1,5 @@
angular.module('portainer.azure').component('containergroupsDatatable', {
templateUrl: 'app/azure/components/datatables/containergroups-datatable/containerGroupsDatatable.html',
templateUrl: './containerGroupsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
title: '@',

View File

@ -1,4 +1,4 @@
function ContainerGroupDefaultModel() {
export function ContainerGroupDefaultModel() {
this.Location = '';
this.OSType = 'Linux';
this.Name = '';
@ -15,7 +15,7 @@ function ContainerGroupDefaultModel() {
this.Memory = 1;
}
function ContainerGroupViewModel(data) {
export function ContainerGroupViewModel(data) {
this.Id = data.id;
this.Name = data.name;
this.Location = data.location;
@ -23,7 +23,7 @@ function ContainerGroupViewModel(data) {
this.Ports = data.properties.ipAddress.ports;
}
function CreateContainerGroupRequest(model) {
export function CreateContainerGroupRequest(model) {
this.location = model.Location;
var containerPorts = [];

View File

@ -1,4 +1,4 @@
function LocationViewModel(data) {
export function LocationViewModel(data) {
this.Id = data.id;
this.SubscriptionId = data.subscriptionId;
this.DisplayName = data.displayName;

View File

@ -1,4 +1,4 @@
function ContainerInstanceProviderViewModel(data) {
export function ContainerInstanceProviderViewModel(data) {
this.Id = data.id;
this.Namespace = data.namespace;

View File

@ -1,4 +1,4 @@
function ResourceGroupViewModel(data, subscriptionId) {
export function ResourceGroupViewModel(data, subscriptionId) {
this.Id = data.id;
this.SubscriptionId = subscriptionId;
this.Name = data.name;

View File

@ -1,4 +1,4 @@
function SubscriptionViewModel(data) {
export function SubscriptionViewModel(data) {
this.Id = data.subscriptionId;
this.Name = data.displayName;
}

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { ContainerGroupViewModel, CreateContainerGroupRequest } from '../models/container_group';
angular.module('portainer.azure')
.factory('ContainerGroupService', ['$q', 'ContainerGroup', function ContainerGroupServiceFactory($q, ContainerGroup) {
'use strict';

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { LocationViewModel } from '../models/location';
angular.module('portainer.azure')
.factory('LocationService', ['$q', 'Location', function LocationServiceFactory($q, Location) {
'use strict';

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { ContainerInstanceProviderViewModel } from '../models/provider';
angular.module('portainer.azure')
.factory('ProviderService', ['$q', 'Provider', function ProviderServiceFactory($q, Provider) {
'use strict';

View File

@ -1,3 +1,8 @@
import toastr from 'toastr';
import { Terminal } from 'xterm';
import * as fit from 'xterm/lib/addons/fit/fit';
import angular from 'angular';
angular.module('portainer')
.config(['$urlRouterProvider', '$httpProvider', 'localStorageServiceProvider', 'jwtOptionsProvider', 'AnalyticsProvider', '$uibTooltipProvider', '$compileProvider', 'cfpLoadingBarProvider',
function ($urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, AnalyticsProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) {

View File

@ -1,3 +1,5 @@
import angular from 'angular';
angular.module('portainer.docker', ['portainer.app'])
.config(['$stateRegistryProvider', function ($stateRegistryProvider) {
'use strict';
@ -13,7 +15,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/configs',
views: {
'content@': {
templateUrl: 'app/docker/views/configs/configs.html',
templateUrl: './views/configs/configs.html',
controller: 'ConfigsController'
}
}
@ -24,7 +26,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/docker/views/configs/edit/config.html',
templateUrl: './views/configs/edit/config.html',
controller: 'ConfigController'
}
}
@ -35,7 +37,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/new?id',
views: {
'content@': {
templateUrl: 'app/docker/views/configs/create/createconfig.html',
templateUrl: './views/configs/create/createconfig.html',
controller: 'CreateConfigController'
}
}
@ -46,7 +48,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/containers',
views: {
'content@': {
templateUrl: 'app/docker/views/containers/containers.html',
templateUrl: './views/containers/containers.html',
controller: 'ContainersController'
}
}
@ -57,7 +59,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id?nodeName',
views: {
'content@': {
templateUrl: 'app/docker/views/containers/edit/container.html',
templateUrl: './views/containers/edit/container.html',
controller: 'ContainerController'
}
}
@ -68,7 +70,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/console',
views: {
'content@': {
templateUrl: 'app/docker/views/containers/console/containerconsole.html',
templateUrl: './views/containers/console/containerconsole.html',
controller: 'ContainerConsoleController'
}
}
@ -79,7 +81,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/new?nodeName&from',
views: {
'content@': {
templateUrl: 'app/docker/views/containers/create/createcontainer.html',
templateUrl: './views/containers/create/createcontainer.html',
controller: 'CreateContainerController'
}
}
@ -90,7 +92,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/inspect',
views: {
'content@': {
templateUrl: 'app/docker/views/containers/inspect/containerinspect.html',
templateUrl: './views/containers/inspect/containerinspect.html',
controller: 'ContainerInspectController'
}
}
@ -101,7 +103,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/logs',
views: {
'content@': {
templateUrl: 'app/docker/views/containers/logs/containerlogs.html',
templateUrl: './views/containers/logs/containerlogs.html',
controller: 'ContainerLogsController'
}
}
@ -112,7 +114,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/stats',
views: {
'content@': {
templateUrl: 'app/docker/views/containers/stats/containerstats.html',
templateUrl: './views/containers/stats/containerstats.html',
controller: 'ContainerStatsController'
}
}
@ -123,7 +125,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/dashboard',
views: {
'content@': {
templateUrl: 'app/docker/views/dashboard/dashboard.html',
templateUrl: './views/dashboard/dashboard.html',
controller: 'DashboardController'
}
}
@ -144,7 +146,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/events',
views: {
'content@': {
templateUrl: 'app/docker/views/events/events.html',
templateUrl: './views/events/events.html',
controller: 'EventsController'
}
}
@ -155,7 +157,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/images',
views: {
'content@': {
templateUrl: 'app/docker/views/images/images.html',
templateUrl: './views/images/images.html',
controller: 'ImagesController'
}
}
@ -166,7 +168,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id?nodeName',
views: {
'content@': {
templateUrl: 'app/docker/views/images/edit/image.html',
templateUrl: './views/images/edit/image.html',
controller: 'ImageController'
}
}
@ -177,7 +179,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/build',
views: {
'content@': {
templateUrl: 'app/docker/views/images/build/buildimage.html',
templateUrl: './views/images/build/buildimage.html',
controller: 'BuildImageController'
}
}
@ -188,7 +190,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/import',
views: {
'content@': {
templateUrl: 'app/docker/views/images/import/importimage.html',
templateUrl: './views/images/import/importimage.html',
controller: 'ImportImageController'
}
}
@ -199,7 +201,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/networks',
views: {
'content@': {
templateUrl: 'app/docker/views/networks/networks.html',
templateUrl: './views/networks/networks.html',
controller: 'NetworksController'
}
}
@ -210,7 +212,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id?nodeName',
views: {
'content@': {
templateUrl: 'app/docker/views/networks/edit/network.html',
templateUrl: './views/networks/edit/network.html',
controller: 'NetworkController'
}
}
@ -221,7 +223,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/new',
views: {
'content@': {
templateUrl: 'app/docker/views/networks/create/createnetwork.html',
templateUrl: './views/networks/create/createnetwork.html',
controller: 'CreateNetworkController'
}
}
@ -258,7 +260,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/secrets',
views: {
'content@': {
templateUrl: 'app/docker/views/secrets/secrets.html',
templateUrl: './views/secrets/secrets.html',
controller: 'SecretsController'
}
}
@ -269,7 +271,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/docker/views/secrets/edit/secret.html',
templateUrl: './views/secrets/edit/secret.html',
controller: 'SecretController'
}
}
@ -280,7 +282,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/new',
views: {
'content@': {
templateUrl: 'app/docker/views/secrets/create/createsecret.html',
templateUrl: './views/secrets/create/createsecret.html',
controller: 'CreateSecretController'
}
}
@ -291,7 +293,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/services',
views: {
'content@': {
templateUrl: 'app/docker/views/services/services.html',
templateUrl: './views/services/services.html',
controller: 'ServicesController'
}
}
@ -302,7 +304,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/docker/views/services/edit/service.html',
templateUrl: './views/services/edit/service.html',
controller: 'ServiceController'
}
}
@ -313,7 +315,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/new',
views: {
'content@': {
templateUrl: 'app/docker/views/services/create/createservice.html',
templateUrl: './views/services/create/createservice.html',
controller: 'CreateServiceController'
}
}
@ -324,7 +326,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/logs',
views: {
'content@': {
templateUrl: 'app/docker/views/services/logs/servicelogs.html',
templateUrl: './views/services/logs/servicelogs.html',
controller: 'ServiceLogsController'
}
}
@ -335,7 +337,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/swarm',
views: {
'content@': {
templateUrl: 'app/docker/views/swarm/swarm.html',
templateUrl: './views/swarm/swarm.html',
controller: 'SwarmController'
}
}
@ -346,7 +348,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/visualizer',
views: {
'content@': {
templateUrl: 'app/docker/views/swarm/visualizer/swarmvisualizer.html',
templateUrl: './views/swarm/visualizer/swarmvisualizer.html',
controller: 'SwarmVisualizerController'
}
}
@ -363,7 +365,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/docker/views/tasks/edit/task.html',
templateUrl: './views/tasks/edit/task.html',
controller: 'TaskController'
}
}
@ -374,7 +376,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/logs',
views: {
'content@': {
templateUrl: 'app/docker/views/tasks/logs/tasklogs.html',
templateUrl: './views/tasks/logs/tasklogs.html',
controller: 'TaskLogsController'
}
}
@ -385,7 +387,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/volumes',
views: {
'content@': {
templateUrl: 'app/docker/views/volumes/volumes.html',
templateUrl: './views/volumes/volumes.html',
controller: 'VolumesController'
}
}
@ -396,7 +398,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/:id?nodeName',
views: {
'content@': {
templateUrl: 'app/docker/views/volumes/edit/volume.html',
templateUrl: './views/volumes/edit/volume.html',
controller: 'VolumeController'
}
}
@ -407,7 +409,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/browse',
views: {
'content@': {
templateUrl: 'app/docker/views/volumes/browse/browsevolume.html',
templateUrl: './views/volumes/browse/browsevolume.html',
controller: 'BrowseVolumeController'
}
}
@ -418,7 +420,7 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/new',
views: {
'content@': {
templateUrl: 'app/docker/views/volumes/create/createvolume.html',
templateUrl: './views/volumes/create/createvolume.html',
controller: 'CreateVolumeController'
}
}

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('containerCapabilities', {
templateUrl: 'app/docker/components/container-capabilities/containerCapabilities.html',
templateUrl: './containerCapabilities.html',
bindings: {
capabilities: '='
}

View File

@ -1,6 +1,6 @@
angular.module('portainer.docker')
.component('containerRestartPolicy', {
templateUrl: 'app/docker/components/container-restart-policy/container-restart-policy.html',
templateUrl: './container-restart-policy.html',
controller: 'ContainerRestartPolicyController',
bindings: {
'name': '<',

View File

@ -1,4 +1,4 @@
angular.module('portainer.docker').component('dashboardClusterAgentInfo', {
templateUrl: 'app/docker/components/dashboard-cluster-agent-info/dashboardClusterAgentInfo.html',
templateUrl: './dashboardClusterAgentInfo.html',
controller: 'DashboardClusterAgentInfoController'
});

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('configsDatatable', {
templateUrl: 'app/docker/components/datatables/configs-datatable/configsDatatable.html',
templateUrl: './configsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('containerNetworksDatatable', {
templateUrl: 'app/docker/components/datatables/container-networks-datatable/containerNetworksDatatable.html',
templateUrl: './containerNetworksDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('containerProcessesDatatable', {
templateUrl: 'app/docker/components/datatables/container-processes-datatable/containerProcessesDatatable.html',
templateUrl: './containerProcessesDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('containersDatatableActions', {
templateUrl: 'app/docker/components/datatables/containers-datatable/actions/containersDatatableActions.html',
templateUrl: './containersDatatableActions.html',
controller: 'ContainersDatatableActionsController',
bindings: {
selectedItems: '=',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('containersDatatable', {
templateUrl: 'app/docker/components/datatables/containers-datatable/containersDatatable.html',
templateUrl: './containersDatatable.html',
controller: 'ContainersDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('eventsDatatable', {
templateUrl: 'app/docker/components/datatables/events-datatable/eventsDatatable.html',
templateUrl: './eventsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('imagesDatatable', {
templateUrl: 'app/docker/components/datatables/images-datatable/imagesDatatable.html',
templateUrl: './imagesDatatable.html',
controller: 'ImagesDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('macvlanNodesDatatable', {
templateUrl: 'app/docker/components/datatables/macvlan-nodes-datatable/macvlanNodesDatatable.html',
templateUrl: './macvlanNodesDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('networksDatatable', {
templateUrl: 'app/docker/components/datatables/networks-datatable/networksDatatable.html',
templateUrl: './networksDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('nodeTasksDatatable', {
templateUrl: 'app/docker/components/datatables/node-tasks-datatable/nodeTasksDatatable.html',
templateUrl: './nodeTasksDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('nodesDatatable', {
templateUrl: 'app/docker/components/datatables/nodes-datatable/nodesDatatable.html',
templateUrl: './nodesDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('secretsDatatable', {
templateUrl: 'app/docker/components/datatables/secrets-datatable/secretsDatatable.html',
templateUrl: './secretsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('serviceTasksDatatable', {
templateUrl: 'app/docker/components/datatables/service-tasks-datatable/serviceTasksDatatable.html',
templateUrl: './serviceTasksDatatable.html',
controller: 'ServiceTasksDatatableController',
bindings: {
dataset: '<',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('servicesDatatableActions', {
templateUrl: 'app/docker/components/datatables/services-datatable/actions/servicesDatatableActions.html',
templateUrl: './servicesDatatableActions.html',
controller: 'ServicesDatatableActionsController',
bindings: {
selectedItems: '=',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('servicesDatatable', {
templateUrl: 'app/docker/components/datatables/services-datatable/servicesDatatable.html',
templateUrl: './servicesDatatable.html',
controller: 'ServicesDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('tasksDatatable', {
templateUrl: 'app/docker/components/datatables/tasks-datatable/tasksDatatable.html',
templateUrl: './tasksDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('volumesDatatable', {
templateUrl: 'app/docker/components/datatables/volumes-datatable/volumesDatatable.html',
templateUrl: './volumesDatatable.html',
controller: 'VolumesDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('dockerSidebarContent', {
templateUrl: 'app/docker/components/dockerSidebarContent/dockerSidebarContent.html',
templateUrl: './dockerSidebarContent.html',
bindings: {
'endpointApiVersion': '<',
'swarmManagement': '<',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('hostOverview', {
templateUrl: 'app/docker/components/host-overview/host-overview.html',
templateUrl: './host-overview.html',
bindings: {
hostDetails: '<',
engineDetails: '<',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('porImageRegistry', {
templateUrl: 'app/docker/components/imageRegistry/porImageRegistry.html',
templateUrl: './porImageRegistry.html',
controller: 'porImageRegistryController',
bindings: {
'image': '=',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('logViewer', {
templateUrl: 'app/docker/components/log-viewer/logViewer.html',
templateUrl: './logViewer.html',
controller: 'LogViewerController',
bindings: {
data: '=',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('networkMacvlanForm', {
templateUrl: 'app/docker/components/network-macvlan-form/networkMacvlanForm.html',
templateUrl: './networkMacvlanForm.html',
controller: 'NetworkMacvlanFormController',
bindings: {
data: '=',

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('volumesNfsForm', {
templateUrl: 'app/docker/components/volumesNFSForm/volumesnfsForm.html',
templateUrl: './volumesnfsForm.html',
bindings: {
data: '='
}

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import moment from 'moment';
angular.module('portainer.docker')
.factory('ServiceHelper', [function ServiceHelperFactory() {
'use strict';

View File

@ -1,4 +1,4 @@
function ConfigViewModel(data) {
export function ConfigViewModel(data) {
this.Id = data.ID;
this.CreatedAt = data.CreatedAt;
this.UpdatedAt = data.UpdatedAt;

View File

@ -19,7 +19,7 @@ function createStatus(statusText) {
return 'running';
}
function ContainerViewModel(data) {
export function ContainerViewModel(data) {
this.Id = data.Id;
this.Status = createStatus(data.Status);
this.State = data.State;
@ -62,7 +62,7 @@ function ContainerViewModel(data) {
}
}
function ContainerStatsViewModel(data) {
export function ContainerStatsViewModel(data) {
this.Date = data.read;
this.MemoryUsage = data.memory_stats.usage;
this.PreviousCPUTotalUsage = data.precpu_stats.cpu_usage.total_usage;
@ -75,7 +75,7 @@ function ContainerStatsViewModel(data) {
this.Networks = _.values(data.networks);
}
function ContainerDetailsViewModel(data) {
export function ContainerDetailsViewModel(data) {
this.Model = data;
this.Id = data.Id;
this.State = data.State;

View File

@ -149,7 +149,7 @@ function createEventDetails(event) {
return details;
}
function EventViewModel(data) {
export function EventViewModel(data) {
// Type, Action, Actor unavailable in Docker < 1.10
this.Time = data.time;
if (data.Type) {

View File

@ -1,4 +1,4 @@
function ImageViewModel(data) {
export function ImageViewModel(data) {
this.Id = data.Id;
this.Tag = data.Tag;
this.Repository = data.Repository;

View File

@ -1,4 +1,4 @@
function ImageDetailsViewModel(data) {
export function ImageDetailsViewModel(data) {
this.Id = data.Id;
this.Tag = data.Tag;
this.Parent = data.Parent;

View File

@ -1,4 +1,4 @@
function ImageLayerViewModel(order, data) {
export function ImageLayerViewModel(order, data) {
this.Order = order;
this.Id = data.Id;
this.Created = data.Created;

View File

@ -1,4 +1,4 @@
function NetworkViewModel(data) {
export function NetworkViewModel(data) {
this.Id = data.Id;
this.Name = data.Name;
this.Scope = data.Scope;

View File

@ -1,4 +1,4 @@
function NodeViewModel(data) {
export function NodeViewModel(data) {
this.Model = data;
this.Id = data.ID;
this.Version = data.Version.Index;

View File

@ -1,7 +1,7 @@
// This model is based on https://github.com/moby/moby/blob/0ac25dfc751fa4304ab45afd5cd8705c2235d101/api/types/plugin.go#L8-L31
// instead of the official documentation.
// See: https://github.com/moby/moby/issues/34241
function PluginViewModel(data) {
export function PluginViewModel(data) {
this.Id = data.Id;
this.Name = data.Name;
this.Enabled = data.Enabled;

View File

@ -1,4 +1,4 @@
function SecretViewModel(data) {
export function SecretViewModel(data) {
this.Id = data.ID;
this.CreatedAt = data.CreatedAt;
this.UpdatedAt = data.UpdatedAt;

View File

@ -1,4 +1,4 @@
function ServiceViewModel(data, runningTasks, allTasks) {
export function ServiceViewModel(data, runningTasks, allTasks) {
this.Model = data;
this.Id = data.ID;
this.Tasks = [];

View File

@ -1,3 +1,3 @@
function SwarmViewModel(data) {
export function SwarmViewModel(data) {
this.Id = data.ID;
}

View File

@ -1,4 +1,4 @@
function TaskViewModel(data) {
export function TaskViewModel(data) {
this.Id = data.ID;
this.Created = data.CreatedAt;
this.Updated = data.UpdatedAt;

View File

@ -1,4 +1,4 @@
function VolumeViewModel(data) {
export function VolumeViewModel(data) {
this.Id = data.Name;
this.Driver = data.Driver;
this.Options = data.Options;

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { jsonObjectsToArrayHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('Build', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function BuildFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict';

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { logsHandler, genericHandler } from "./response/handlers";
angular.module('portainer.docker')
.factory('Container', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
function ContainerFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { genericHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('Exec', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
function ExecFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {

View File

@ -1,3 +1,7 @@
import angular from 'angular';
import { jsonObjectsToArrayHandler, deleteImageHandler } from './response/handlers';
import { imageGetResponse } from './response/image';
angular.module('portainer.docker')
.factory('Image', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', 'HttpRequestHelper',
function ImageFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, HttpRequestHelper) {

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { genericHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('Network', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
function NetworkFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {

View File

@ -16,7 +16,7 @@ function isJSON(jsonString) {
// The Docker API often returns a list of JSON object.
// This handler wrap the JSON objects in an array.
// Used by the API in: Image push, Image create, Events query.
function jsonObjectsToArrayHandler(data) {
export function jsonObjectsToArrayHandler(data) {
var str = '[' + data.replace(/\n/g, ' ').replace(/\}\s*\{/g, '}, {') + ']';
return angular.fromJson(str);
}
@ -27,7 +27,7 @@ function jsonObjectsToArrayHandler(data) {
// This handler ensure a valid JSON object is returned in any case.
// Used by the API in: container deletion, network deletion, network creation, volume creation,
// container exec, exec resize.
function genericHandler(data) {
export function genericHandler(data) {
var response = {};
// No data is returned when deletion is successful (Docker 1.9 -> 1.12)
if (!data) {
@ -46,7 +46,7 @@ function genericHandler(data) {
// The Docker API returns the logs as a single string.
// This handler wraps the data in a JSON object under the "logs" property.
function logsHandler(data) {
export function logsHandler(data) {
return {
logs: data
};
@ -57,7 +57,7 @@ function logsHandler(data) {
// container the error (Docker = 1.12).
// This handler returns the original array on success or a newly created array containing
// only one JSON object with the field message filled with the error message on failure.
function deleteImageHandler(data) {
export function deleteImageHandler(data) {
// A string is returned on failure (Docker < 1.12)
var response = [];
if (!isJSON(data)) {

View File

@ -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 imageGetResponse(data) {
export function imageGetResponse(data) {
var response = {};
response.file = data;
return response;

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { logsHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('Service', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', 'HttpRequestHelper',
function ServiceFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, HttpRequestHelper) {

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { jsonObjectsToArrayHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('System', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function SystemFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict';

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { logsHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('Task', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function TaskFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict';

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { genericHandler } from './response/handlers';
angular.module('portainer.docker')
.factory('Volume', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function VolumeFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict';

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { ContainerDetailsViewModel, ContainerViewModel } from '../models/container';
angular.module('portainer.docker')
.factory('ContainerService', ['$q', 'Container', 'ResourceControlService', 'LogHelper',
function ContainerServiceFactory($q, Container, ResourceControlService, LogHelper) {

View File

@ -1,3 +1,9 @@
import angular from 'angular';
import _ from 'lodash';
import { ImageViewModel } from '../models/image';
import { ImageDetailsViewModel } from "../models/imageDetails";
import { ImageLayerViewModel } from "../models/imageLayer";
angular.module('portainer.docker')
.factory('ImageService', ['$q', 'Image', 'ImageHelper', 'RegistryService', 'HttpRequestHelper', 'ContainerService', 'FileUploadService',
function ImageServiceFactory($q, Image, ImageHelper, RegistryService, HttpRequestHelper, ContainerService, FileUploadService) {

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { NetworkViewModel } from '../models/network';
angular.module('portainer.docker')
.factory('NetworkService', ['$q', 'Network', function NetworkServiceFactory($q, Network) {
'use strict';

View File

@ -1,3 +1,6 @@
import angular from 'angular';
import { VolumeViewModel } from '../models/volume';
angular.module('portainer.docker')
.factory('VolumeService', ['$q', 'Volume', 'VolumeHelper', 'ResourceControlService', function VolumeServiceFactory($q, Volume, VolumeHelper, ResourceControlService) {
'use strict';

View File

@ -1,4 +1,4 @@
angular.module('portainer.docker').component('hostView', {
templateUrl: 'app/docker/views/host/host-view.html',
templateUrl: './host-view.html',
controller: 'HostViewController'
});

View File

@ -1,4 +1,4 @@
angular.module('portainer.docker').component('nodeBrowserView', {
templateUrl: 'app/docker/views/nodes/node-browser/node-browser.html',
templateUrl: './node-browser.html',
controller: 'NodeBrowserController'
});

View File

@ -1,4 +1,4 @@
angular.module('portainer.docker').component('nodeDetailsView', {
templateUrl: 'app/docker/views/nodes/node-details/node-details-view.html',
templateUrl: './node-details-view.html',
controller: 'NodeDetailsViewController'
});

View File

@ -14,7 +14,7 @@ angular.module('extension.storidge', [])
url: '/profiles',
views: {
'content@': {
templateUrl: 'app/extensions/storidge/views/profiles/profiles.html',
templateUrl: './views/profiles/profiles.html',
controller: 'StoridgeProfilesController'
}
}
@ -25,7 +25,7 @@ angular.module('extension.storidge', [])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/extensions/storidge/views/profiles/edit/profile.html',
templateUrl: './views/profiles/edit/profile.html',
controller: 'StoridgeProfileController'
}
}
@ -39,7 +39,7 @@ angular.module('extension.storidge', [])
},
views: {
'content@': {
templateUrl: 'app/extensions/storidge/views/profiles/create/createprofile.html',
templateUrl: './views/profiles/create/createprofile.html',
controller: 'StoridgeCreateProfileController'
}
}
@ -50,7 +50,7 @@ angular.module('extension.storidge', [])
url: '/cluster',
views: {
'content@': {
templateUrl: 'app/extensions/storidge/views/cluster/cluster.html',
templateUrl: './views/cluster/cluster.html',
controller: 'StoridgeClusterController'
}
}
@ -61,7 +61,7 @@ angular.module('extension.storidge', [])
url: '/events',
views: {
'content@': {
templateUrl: 'app/extensions/storidge/views/monitor/monitor.html',
templateUrl: './views/monitor/monitor.html',
controller: 'StoridgeMonitorController'
}
}

View File

@ -1,5 +1,5 @@
angular.module('extension.storidge').component('storidgeClusterEventsDatatable', {
templateUrl: 'app/extensions/storidge/components/cluster-events-datatable/storidgeClusterEventsDatatable.html',
templateUrl: './storidgeClusterEventsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
title: '@',

View File

@ -1,5 +1,5 @@
angular.module('extension.storidge').component('storidgeNodesDatatable', {
templateUrl: 'app/extensions/storidge/components/nodes-datatable/storidgeNodesDatatable.html',
templateUrl: './storidgeNodesDatatable.html',
controller: 'GenericDatatableController',
bindings: {
title: '@',

View File

@ -1,5 +1,5 @@
angular.module('extension.storidge').component('storidgeProfileSelector', {
templateUrl: 'app/extensions/storidge/components/profileSelector/storidgeProfileSelector.html',
templateUrl: './storidgeProfileSelector.html',
controller: 'StoridgeProfileSelectorController',
bindings: {
'storidgeProfile': '='

View File

@ -1,5 +1,5 @@
angular.module('extension.storidge').component('storidgeProfilesDatatable', {
templateUrl: 'app/extensions/storidge/components/profiles-datatable/storidgeProfilesDatatable.html',
templateUrl: './storidgeProfilesDatatable.html',
controller: 'GenericDatatableController',
bindings: {
title: '@',

View File

@ -1,27 +1,18 @@
<!DOCTYPE html>
<html lang="en" ng-app="<%= pkg.name %>">
<html lang="en" ng-app="portainer">
<head>
<meta charset="utf-8">
<title>Portainer</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="<%= pkg.author %>">
<meta name="author" content="Portainer.io">
<!-- build:css css/app.css -->
<link href="css/vendor.css" rel="stylesheet">
<link href="css/portainer.css" rel="stylesheet">
<!-- endbuild -->
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- build:js js/app.js -->
<script src="js/angular.js"></script>
<script src="js/vendor.js"></script>
<script src="js/portainer.js"></script>
<!-- endbuild -->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon" sizes="180x180" href="ico/apple-touch-icon.png">

View File

@ -1,3 +1,39 @@
import angular from 'angular';
import authenticationTemplate from "./views/auth/auth.html";
import sidebarTemplate from './views/sidebar/sidebar.html';
import aboutTemplate from './views/about/about.html';
import accountTemplate from './views/account/account.html';
import endpointsTemplate from './views/endpoints/endpoints.html';
import endpointTemplate from './views/endpoints/edit/endpoint.html';
import createendpointTemplate from './views/endpoints/create/createendpoint.html';
import endpointAccessTemplate from './views/endpoints/access/endpointAccess.html';
import groupsTemplate from './views/groups/groups.html';
import groupTemplate from './views/groups/edit/group.html';
import creategroupTemplate from './views/groups/create/creategroup.html';
import groupAccessTemplate from './views/groups/access/groupAccess.html';
import homeTemplate from './views/home/home.html';
import initEndpointTemplate from './views/init/endpoint/initEndpoint.html';
import initAdminTemplate from './views/init/admin/initAdmin.html';
import registriesTemplate from './views/registries/registries.html';
import registryTemplate from './views/registries/edit/registry.html';
import createregistryTemplate from './views/registries/create/createregistry.html';
import registryAccessTemplate from './views/registries/access/registryAccess.html';
import settingsTemplate from './views/settings/settings.html';
import settingsAuthenticationTemplate from './views/settings/authentication/settingsAuthentication.html';
import stacksTemplate from './views/stacks/stacks.html';
import stackTemplate from './views/stacks/edit/stack.html';
import createstackTemplate from './views/stacks/create/createstack.html';
import supportTemplate from './views/support/support.html';
import tagsTemplate from './views/tags/tags.html';
import updatePasswordTemplate from './views/update-password/updatePassword.html';
import usersTemplate from './views/users/users.html';
import userTemplate from './views/users/edit/user.html';
import teamsTemplate from './views/teams/teams.html';
import teamTemplate from './views/teams/edit/team.html';
import templatesTemplate from './views/templates/templates.html';
import templateTemplate from './views/templates/edit/template.html';
import createtemplateTemplate from './views/templates/create/createtemplate.html';
angular.module('portainer.app', [])
.config(['$stateRegistryProvider', function ($stateRegistryProvider) {
'use strict';
@ -13,7 +49,7 @@ angular.module('portainer.app', [])
},
views: {
'sidebar@': {
templateUrl: 'app/portainer/views/sidebar/sidebar.html',
templateUrl: sidebarTemplate,
controller: 'SidebarController'
}
}
@ -30,7 +66,7 @@ angular.module('portainer.app', [])
url: '/about',
views: {
'content@': {
templateUrl: 'app/portainer/views/about/about.html'
templateUrl: aboutTemplate,
}
}
};
@ -40,7 +76,7 @@ angular.module('portainer.app', [])
url: '/account',
views: {
'content@': {
templateUrl: 'app/portainer/views/account/account.html',
templateUrl: accountTemplate,
controller: 'AccountController'
}
}
@ -55,7 +91,7 @@ angular.module('portainer.app', [])
},
views: {
'content@': {
templateUrl: 'app/portainer/views/auth/auth.html',
templateUrl: authenticationTemplate,
controller: 'AuthenticationController'
},
'sidebar@': {}
@ -70,7 +106,7 @@ angular.module('portainer.app', [])
url: '/endpoints',
views: {
'content@': {
templateUrl: 'app/portainer/views/endpoints/endpoints.html',
templateUrl: endpointsTemplate,
controller: 'EndpointsController'
}
}
@ -81,7 +117,7 @@ angular.module('portainer.app', [])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/portainer/views/endpoints/edit/endpoint.html',
templateUrl: endpointTemplate,
controller: 'EndpointController'
}
}
@ -92,7 +128,7 @@ angular.module('portainer.app', [])
url: '/new',
views: {
'content@': {
templateUrl: 'app/portainer/views/endpoints/create/createendpoint.html',
templateUrl: createendpointTemplate,
controller: 'CreateEndpointController'
}
}
@ -103,7 +139,7 @@ angular.module('portainer.app', [])
url: '/access',
views: {
'content@': {
templateUrl: 'app/portainer/views/endpoints/access/endpointAccess.html',
templateUrl: endpointAccessTemplate,
controller: 'EndpointAccessController'
}
}
@ -114,7 +150,7 @@ angular.module('portainer.app', [])
url: '/groups',
views: {
'content@': {
templateUrl: 'app/portainer/views/groups/groups.html',
templateUrl: groupsTemplate,
controller: 'GroupsController'
}
}
@ -125,7 +161,7 @@ angular.module('portainer.app', [])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/portainer/views/groups/edit/group.html',
templateUrl: groupTemplate,
controller: 'GroupController'
}
}
@ -136,7 +172,7 @@ angular.module('portainer.app', [])
url: '/new',
views: {
'content@': {
templateUrl: 'app/portainer/views/groups/create/creategroup.html',
templateUrl: creategroupTemplate,
controller: 'CreateGroupController'
}
}
@ -147,7 +183,7 @@ angular.module('portainer.app', [])
url: '/access',
views: {
'content@': {
templateUrl: 'app/portainer/views/groups/access/groupAccess.html',
templateUrl: groupAccessTemplate,
controller: 'GroupAccessController'
}
}
@ -158,7 +194,7 @@ angular.module('portainer.app', [])
url: '/home',
views: {
'content@': {
templateUrl: 'app/portainer/views/home/home.html',
templateUrl: homeTemplate,
controller: 'HomeController'
}
}
@ -181,7 +217,7 @@ angular.module('portainer.app', [])
url: '/endpoint',
views: {
'content@': {
templateUrl: 'app/portainer/views/init/endpoint/initEndpoint.html',
templateUrl: initEndpointTemplate,
controller: 'InitEndpointController'
}
}
@ -192,7 +228,7 @@ angular.module('portainer.app', [])
url: '/admin',
views: {
'content@': {
templateUrl: 'app/portainer/views/init/admin/initAdmin.html',
templateUrl: initAdminTemplate,
controller: 'InitAdminController'
}
}
@ -203,7 +239,7 @@ angular.module('portainer.app', [])
url: '/registries',
views: {
'content@': {
templateUrl: 'app/portainer/views/registries/registries.html',
templateUrl: registriesTemplate,
controller: 'RegistriesController'
}
}
@ -214,7 +250,7 @@ angular.module('portainer.app', [])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/portainer/views/registries/edit/registry.html',
templateUrl: registryTemplate,
controller: 'RegistryController'
}
}
@ -225,7 +261,7 @@ angular.module('portainer.app', [])
url: '/new',
views: {
'content@': {
templateUrl: 'app/portainer/views/registries/create/createregistry.html',
templateUrl: createregistryTemplate,
controller: 'CreateRegistryController'
}
}
@ -236,7 +272,7 @@ angular.module('portainer.app', [])
url: '/access',
views: {
'content@': {
templateUrl: 'app/portainer/views/registries/access/registryAccess.html',
templateUrl: registryAccessTemplate,
controller: 'RegistryAccessController'
}
}
@ -247,7 +283,7 @@ angular.module('portainer.app', [])
url: '/settings',
views: {
'content@': {
templateUrl: 'app/portainer/views/settings/settings.html',
templateUrl: settingsTemplate,
controller: 'SettingsController'
}
}
@ -258,7 +294,7 @@ angular.module('portainer.app', [])
url: '/auth',
views: {
'content@': {
templateUrl: 'app/portainer/views/settings/authentication/settingsAuthentication.html',
templateUrl: settingsAuthenticationTemplate,
controller: 'SettingsAuthenticationController'
}
}
@ -269,7 +305,7 @@ angular.module('portainer.app', [])
url: '/stacks',
views: {
'content@': {
templateUrl: 'app/portainer/views/stacks/stacks.html',
templateUrl: stacksTemplate,
controller: 'StacksController'
}
}
@ -280,7 +316,7 @@ angular.module('portainer.app', [])
url: '/:name?id&type&external',
views: {
'content@': {
templateUrl: 'app/portainer/views/stacks/edit/stack.html',
templateUrl: stackTemplate,
controller: 'StackController'
}
}
@ -291,7 +327,7 @@ angular.module('portainer.app', [])
url: '/newstack',
views: {
'content@': {
templateUrl: 'app/portainer/views/stacks/create/createstack.html',
templateUrl: createstackTemplate,
controller: 'CreateStackController'
}
}
@ -302,7 +338,7 @@ angular.module('portainer.app', [])
url: '/support',
views: {
'content@': {
templateUrl: 'app/portainer/views/support/support.html'
templateUrl: supportTemplate,
}
}
};
@ -312,7 +348,7 @@ angular.module('portainer.app', [])
url: '/tags',
views: {
'content@': {
templateUrl: 'app/portainer/views/tags/tags.html',
templateUrl: tagsTemplate,
controller: 'TagsController'
}
}
@ -323,7 +359,7 @@ angular.module('portainer.app', [])
url: '/update-password',
views: {
'content@': {
templateUrl: 'app/portainer/views/update-password/updatePassword.html',
templateUrl: updatePasswordTemplate,
controller: 'UpdatePasswordController'
},
'sidebar@': {}
@ -335,7 +371,7 @@ angular.module('portainer.app', [])
url: '/users',
views: {
'content@': {
templateUrl: 'app/portainer/views/users/users.html',
templateUrl: usersTemplate,
controller: 'UsersController'
}
}
@ -346,7 +382,7 @@ angular.module('portainer.app', [])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/portainer/views/users/edit/user.html',
templateUrl: userTemplate,
controller: 'UserController'
}
}
@ -357,7 +393,7 @@ angular.module('portainer.app', [])
url: '/teams',
views: {
'content@': {
templateUrl: 'app/portainer/views/teams/teams.html',
templateUrl: teamsTemplate,
controller: 'TeamsController'
}
}
@ -368,7 +404,7 @@ angular.module('portainer.app', [])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/portainer/views/teams/edit/team.html',
templateUrl: teamTemplate,
controller: 'TeamController'
}
}
@ -379,7 +415,7 @@ angular.module('portainer.app', [])
url: '/templates',
views: {
'content@': {
templateUrl: 'app/portainer/views/templates/templates.html',
templateUrl: templatesTemplate,
controller: 'TemplatesController'
}
}
@ -390,7 +426,7 @@ angular.module('portainer.app', [])
url: '/:id',
views: {
'content@': {
templateUrl: 'app/portainer/views/templates/edit/template.html',
templateUrl: templateTemplate,
controller: 'TemplateController'
}
}
@ -401,7 +437,7 @@ angular.module('portainer.app', [])
url: '/new',
views: {
'content@': {
templateUrl: 'app/portainer/views/templates/create/createtemplate.html',
templateUrl: createtemplateTemplate,
controller: 'CreateTemplateController'
}
}

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('accessTable', {
templateUrl: 'app/portainer/components/access-table/accessTable.html',
templateUrl: './accessTable.html',
controller: function() {
this.state = {
orderBy: 'Name',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('porAccessControlForm', {
templateUrl: 'app/portainer/components/accessControlForm/porAccessControlForm.html',
templateUrl: './porAccessControlForm.html',
controller: 'porAccessControlFormController',
bindings: {
// This object will be populated with the form data.

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('porAccessControlPanel', {
templateUrl: 'app/portainer/components/accessControlPanel/porAccessControlPanel.html',
templateUrl: './porAccessControlPanel.html',
controller: 'porAccessControlPanelController',
bindings: {
// The component will use this identifier when updating the resource control object.

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('porAccessManagement', {
templateUrl: 'app/portainer/components/accessManagement/porAccessManagement.html',
templateUrl: './porAccessManagement.html',
controller: 'porAccessManagementController',
bindings: {
accessControlledEntity: '<',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('codeEditor', {
templateUrl: 'app/portainer/components/code-editor/codeEditor.html',
templateUrl: './codeEditor.html',
controller: 'CodeEditorController',
bindings: {
identifier: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('endpointsDatatable', {
templateUrl: 'app/portainer/components/datatables/endpoints-datatable/endpointsDatatable.html',
templateUrl: './endpointsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('groupsDatatable', {
templateUrl: 'app/portainer/components/datatables/groups-datatable/groupsDatatable.html',
templateUrl: './groupsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('registriesDatatable', {
templateUrl: 'app/portainer/components/datatables/registries-datatable/registriesDatatable.html',
templateUrl: './registriesDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('stacksDatatable', {
templateUrl: 'app/portainer/components/datatables/stacks-datatable/stacksDatatable.html',
templateUrl: './stacksDatatable.html',
controller: 'StacksDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('tagsDatatable', {
templateUrl: 'app/portainer/components/datatables/tags-datatable/tagsDatatable.html',
templateUrl: './tagsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

View File

@ -1,5 +1,5 @@
angular.module('portainer.app').component('teamsDatatable', {
templateUrl: 'app/portainer/components/datatables/teams-datatable/teamsDatatable.html',
templateUrl: './teamsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',

Some files were not shown because too many files have changed in this diff Show More