refactor(app): introduce webpack and babel (#2407)

* feat(agent): add new host page

* feat(agent): convert volume-browser to files-datatable

* fix(agent): browse folders in file-datatable

* feat(engine-details): replace engine view with host view

* feat(engine-details): remove old panels

* feat(engine-details): add basic engine-details-panel component

* feat(engine-details): pass details to the different components

* feat(engine-details): replace host-view with host-overview

* feat(engine-details): add commaseperated filter

* feat(engine-details): add host-view container component

* feat(engine-details): add host-details component

* feat(engine-details): build host details object

* feat(engine-details): format engine version

* feat(engine-details): get details for one node

* feat(engine-details): pass is-agent from view

* feat(engine-details): replace old node view with a new component

* feat(engine-details): add swarm-node-details component

* feat(engine-details): remove isSwarm binding

* feat(engine-details): remove node-details and include in parent

* feat(engine-details): add labels-table component

* feat(engine-details): add update node service

* feat(engine-details): add update label functionality

* style(engine-details): remove whitespaces

* feat(engine-details): remove old node page

* feat(engine-details): pass is agent to host details

* feat(host-details): hide missing info

* feat(host-details): update node availability

* style(host-details): remove obsolete event object

* feat(host-details): fix labels not sending

* feat(host-details): remove flags for hiding data

* feat(host-details): create mock call to server for agent host info

* style(host-details): fix spelling mistake in filter's name

* feat(host-details): get info from agent

* feat(host-details): hide engine labels when empty

* feat(node-details): move labels table and save button

* feat(host-info): add different urls for refresh

* feat(host-details): show disk/devices info for agent

* feat(host-view): add loading indicator to devices-panel

* feat(host-details): add loading indicator to disks panel

* feat(agent): fix browse volume

* feat(agent): browse files

* feat(agent): enable rename

* feat(agent): download file

* fix(agent): download file from root

* feat(agent): delete file

* style(agent): remove whitespaces

* fix(agent): fix link on node browser

* feat(agent): basic file uploader

* feat(agent): add basic file upload

* fix(volume-browser): move volume id to query params

* feat(node-browser): moved uploader into browser

* feat(node-browser): add upload spinner

* feat(agent): browse files relative to root

* feat(build): add webpack build config

* feat(build): add missing imports

* feat(webpack): add missing imports

* feat(build): enable eslint on build

* feat(build): add webpack notifier

* feat(build): clean terminal on build

* feat(build): import all globals

* feat(build): add angular import

* feat(build): fix styles

* feat(build): load favicons

* feat(build): load css before script

* feat(webpack): split vendors css and js to a different bundle

* feat(webpack): import angular in all files

* feat(webpack): remove eslint global config

* feat(webpack): add webpack clean dist

* feat(webpack): fix styling issues

* refactor(webpack): remove empty controllers

* refactor(webpack): optimize moment

* refactor(webpack): add bundle analyzer

* feat(webpack): add babel

* refactor(webpack): optimize lodash

* refactor(toastr): update toastr

* feat(webpack): create basic production and dev config

* fix(webpack): fix production config

* fix(webpack): fix html templates url

* refactor(webpack): remove angular imports

* refactor(webpack): remove more angular imports

* refactor(webpack): return angular to entry file

* style(webpack): remove comments from config

* fix(hosts): remove browse button

* fix(webpack): import lodash

* fix(webpack): import missing htmls

* feat(webpack): reduce lodash size

* feat(webpack): config grunt to use webpack

* feat(webpack): add postcss

* chore(codeclimate): use eslint-5 channel

* feat(deps): upgrade from lodash to lodash-es

* fix(webpack): fix bug with lodash

* chore(build): add build client script

* fix(webpack): fix missing jsyaml reference

* refactor(webpack): seperate builds of img files

* chore(build): add a way to check times of webpack build

* feat(webpack): add dev server

* fix(webpack): fix css output name

* chore(webpack): optimize images

* chore(webpack): add node env

* fix(build): copy templates on release

* chore(webpack): set env NODE_ENV

* feat(webpack): set NODE_ENV on production builds

* fix(extensions): set image path

* refactor(css): move vendor css to js import

* style(app): remove whitespaces

* fix(build-system): allow DevOps pipeline to leverage webpack (#2670)

* Update devopsbuild task to use webpack & remove AppVeyor environment var

* Added -Force to replace the existing dist folder

* Removed Test-Path

* dep(build-system): add angularjs-annotate to webpack + fix on imports

* Merge branch 'develop' into webpack

* refactor(app): webpack aliases for imports + async / await dep + start refactor

* style(extensions): use develop version of the view

* fix(app): fix several issues introduced by webpack migration

* fix(webpack): fix ng-include not loading templates with webpack

* Fix Windows CI with Webpack (#2782)

* fix(configs): refactor broke configs creation and list views

* fix(build-system): update build_binary_devops for Windows
pull/2811/head
Chaim Lev-Ari 2019-03-21 07:46:49 +02:00 committed by Anthony Lapenna
parent 14845a4a53
commit 45113a7ff4
308 changed files with 8798 additions and 1050 deletions

12
.babelrc Normal file
View File

@ -0,0 +1,12 @@
{
"plugins": ["lodash", "angularjs-annotate"],
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"useBuiltIns": "usage"
}
]
]
}

View File

@ -53,6 +53,7 @@ plugins:
mass_threshold: 80
eslint:
enabled: true
channel: "eslint-5"
config:
config: .eslintrc.yml
fixme:

3
.eslintignore Normal file
View File

@ -0,0 +1,3 @@
node_modules/
dist/
test/

View File

@ -1,287 +1,290 @@
env:
browser: true
jquery: true
node: true
globals:
angular: true
# globals:
# angular: true
# $: true
# _: true
# moment: true
# filesize: true
# splitargs: true
extends:
- 'eslint:recommended'
# http://eslint.org/docs/rules/
parserOptions:
ecmaVersion: 2018
sourceType: module
ecmaFeatures:
modules: true
# # 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
# # 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: warn
# 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
# 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
# # 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: warn
# 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
# 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
# Strict
strict: off
# # Strict
# strict: 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
# # 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
# 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
# # 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
# 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
# # 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
# # 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,12 @@
import '../assets/css/app.css';
import angular from 'angular';
import './agent/_module';
import './azure/_module';
import './docker/__module';
import './extensions/storidge/__module';
import './portainer/__module';
angular.module('portainer', [
'ui.bootstrap',
'ui.router',
@ -17,7 +26,6 @@ angular.module('portainer', [
'angular-clipboard',
'ngFileSaver',
'luegg.directives',
'portainer.templates',
'portainer.app',
'portainer.agent',
'portainer.azure',
@ -26,4 +34,11 @@ angular.module('portainer', [
'extension.storidge',
'rzModule',
'moment-picker'
]);
]);
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,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.agent').controller('HostBrowserController', [
'HostBrowserService', 'Notifications', 'FileSaver', 'ModalService',
function HostBrowserController(HostBrowserService, Notifications, FileSaver, ModalService) {

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,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.agent')
.controller('VolumeBrowserController', ['HttpRequestHelper', 'VolumeBrowserService', 'FileSaver', 'Blob', 'ModalService', 'Notifications',
function (HttpRequestHelper, VolumeBrowserService, FileSaver, Blob, ModalService, Notifications) {

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,5 @@
import { browseGetResponse } from './response/browse';
angular.module('portainer.agent')
.factory('Browse', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', 'StateManager',
function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, StateManager) {

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

View File

@ -1,3 +1,5 @@
import { browseGetResponse } from '../response/browse';
angular.module('portainer.agent')
.factory('BrowseVersion1', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict';

View File

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

View File

@ -1,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer')
.run(['$rootScope', '$state', 'Authentication', 'authManager', 'StateManager', 'EndpointProvider', 'Notifications', 'Analytics', 'cfpLoadingBar', '$transitions', 'HttpRequestHelper',
function ($rootScope, $state, Authentication, authManager, StateManager, EndpointProvider, Notifications, Analytics, cfpLoadingBar, $transitions, HttpRequestHelper) {

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,6 @@
function ContainerInstanceProviderViewModel(data) {
import _ from 'lodash-es';
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,5 @@
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,5 @@
import { LocationViewModel } from '../models/location';
angular.module('portainer.azure')
.factory('LocationService', ['$q', 'Location', function LocationServiceFactory($q, Location) {
'use strict';

View File

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

View File

@ -1,3 +1,5 @@
import { ResourceGroupViewModel } from '../models/resource_group';
angular.module('portainer.azure')
.factory('ResourceGroupService', ['$q', 'ResourceGroup', function ResourceGroupServiceFactory($q, ResourceGroup) {
'use strict';

View File

@ -1,3 +1,5 @@
import { SubscriptionViewModel } from '../models/subscription';
angular.module('portainer.azure')
.factory('SubscriptionService', ['$q', 'Subscription', function SubscriptionServiceFactory($q, Subscription) {
'use strict';

View File

@ -1,3 +1,5 @@
import { ContainerGroupDefaultModel } from '../../../models/container_group';
angular.module('portainer.azure')
.controller('AzureCreateContainerInstanceController', ['$q', '$scope', '$state', 'AzureService', 'Notifications',
function ($q, $scope, $state, AzureService, Notifications) {

View File

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

View File

@ -23,8 +23,9 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/configs',
views: {
'content@': {
templateUrl: 'app/docker/views/configs/configs.html',
controller: 'ConfigsController'
templateUrl: './views/configs/configs.html',
controller: 'ConfigsController',
controllerAs: 'ctrl'
}
}
};
@ -34,7 +35,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'
}
}
@ -45,8 +46,9 @@ angular.module('portainer.docker', ['portainer.app'])
url: '/new?id',
views: {
'content@': {
templateUrl: 'app/docker/views/configs/create/createconfig.html',
controller: 'CreateConfigController'
templateUrl: './views/configs/create/createconfig.html',
controller: 'CreateConfigController',
controllerAs: 'ctrl'
}
}
};
@ -56,7 +58,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'
}
}
@ -67,7 +69,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'
}
}
@ -78,7 +80,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'
}
}
@ -89,7 +91,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'
}
}
@ -100,7 +102,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'
}
}
@ -111,7 +113,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'
}
}
@ -122,7 +124,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'
}
}
@ -133,7 +135,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'
}
}
@ -174,7 +176,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'
}
}
@ -185,7 +187,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'
}
}
@ -196,7 +198,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'
}
}
@ -207,7 +209,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'
}
}
@ -218,7 +220,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'
}
}
@ -229,7 +231,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'
}
}
@ -240,7 +242,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'
}
}
@ -251,7 +253,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'
}
}
@ -298,7 +300,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'
}
}
@ -309,7 +311,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'
}
}
@ -320,7 +322,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'
}
}
@ -331,7 +333,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'
}
}
@ -342,7 +344,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'
}
}
@ -353,7 +355,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'
}
}
@ -364,7 +366,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'
}
}
@ -375,7 +377,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'
}
}
@ -386,7 +388,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'
}
}
@ -403,7 +405,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'
}
}
@ -414,7 +416,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'
}
}
@ -425,7 +427,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'
}
}
@ -436,7 +438,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'
}
}
@ -447,7 +449,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'
}
}
@ -458,7 +460,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,5 +1,5 @@
angular.module('portainer.docker').component('containerQuickActions', {
templateUrl: 'app/docker/components/container-quick-actions/containerQuickActions.html',
templateUrl: './containerQuickActions.html',
bindings: {
containerId: '<',
nodeName: '<',

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,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.docker')
.controller('ContainersDatatableController', ['PaginationService', 'DatatableService', 'EndpointProvider',
function (PaginationService, DatatableService, EndpointProvider) {
@ -197,7 +199,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;

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('jobsDatatable', {
templateUrl: 'app/docker/components/datatables/host-jobs-datatable/jobsDatatable.html',
templateUrl: './jobsDatatable.html',
controller: 'JobsDatatableController',
bindings: {
titleText: '@',

View File

@ -1,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.docker')
.controller('JobsDatatableController', ['$q', '$state', 'PaginationService', 'DatatableService', 'ContainerService', 'ModalService', 'Notifications',
function ($q, $state, PaginationService, DatatableService, ContainerService, ModalService, Notifications) {
@ -73,7 +75,7 @@ angular.module('portainer.docker')
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;

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: 'NetworksDatatableController',
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,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.docker')
.controller('ServiceTasksDatatableController', ['DatatableService',
function (DatatableService) {

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,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.docker')
.controller('ServicesDatatableController', ['PaginationService', 'DatatableService', 'EndpointProvider',
function (PaginationService, DatatableService, EndpointProvider) {

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: 'TasksDatatableController',
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,6 +1,5 @@
angular.module('portainer.docker').component('devicesPanel', {
templateUrl:
'app/docker/components/host-view-panels/devices-panel/devices-panel.html',
templateUrl: './devices-panel.html',
bindings: {
devices: '<'
}

View File

@ -1,6 +1,5 @@
angular.module('portainer.docker').component('disksPanel', {
templateUrl:
'app/docker/components/host-view-panels/disks-panel/disks-panel.html',
templateUrl: './disks-panel.html',
bindings: {
disks: '<'
}

View File

@ -1,6 +1,5 @@
angular.module('portainer.docker').component('engineDetailsPanel', {
templateUrl:
'app/docker/components/host-view-panels/engine-details-panel/engine-details-panel.html',
templateUrl: './engine-details-panel.html',
bindings: {
engine: '<'
}

View File

@ -1,5 +1,5 @@
angular.module('portainer.docker').component('hostDetailsPanel', {
templateUrl: 'app/docker/components/host-view-panels/host-details-panel/host-details-panel.html',
templateUrl: './host-details-panel.html',
bindings: {
host: '<',
isJobEnabled: '<',

View File

@ -1,6 +1,5 @@
angular.module('portainer.docker').component('nodeAvailabilitySelect', {
templateUrl:
'app/docker/components/host-view-panels/node-availability-select/node-availability-select.html',
templateUrl: './node-availability-select.html',
controller: 'NodeAvailabilitySelectController',
bindings: {
availability: '<',

View File

@ -1,6 +1,5 @@
angular.module('portainer.docker').component('nodeLabelsTable', {
templateUrl:
'app/docker/components/host-view-panels/node-labels-table/node-labels-table.html',
templateUrl: './node-labels-table.html',
controller: 'NodeLabelsTableController',
bindings: {
labels: '<',

View File

@ -1,6 +1,5 @@
angular.module('portainer.docker').component('swarmNodeDetailsPanel', {
templateUrl:
'app/docker/components/host-view-panels/swarm-node-details-panel/swarm-node-details-panel.html',
templateUrl: './swarm-node-details-panel.html',
controller: 'SwarmNodeDetailsPanelController',
bindings: {
details: '<',

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,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.docker')
.controller('porImageRegistryController', ['$q', 'RegistryService', 'DockerHubService', 'ImageService', 'Notifications',
function ($q, RegistryService, DockerHubService, ImageService, Notifications) {

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,3 +1,5 @@
import moment from 'moment';
angular.module('portainer.docker')
.controller('LogViewerController', ['clipboard',
function (clipboard) {

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,4 +1,4 @@
function MacvlanFormData() {
export function MacvlanFormData() {
this.Scope = 'local';
this.SelectedNetworkConfig = '';
this.DatatableState = {

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,4 +1,4 @@
function VolumesNFSFormData() {
export function VolumesNFSFormData() {
this.useNFS = false;
this.serverAddress = '';
this.mountPoint = '';

View File

@ -1,3 +1,5 @@
import _ from 'lodash-es';
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 () {

View File

@ -1,3 +1,5 @@
import _ from 'lodash-es';
function ConstraintModel(op, key, value) {
this.op = op;
this.value = value;

View File

@ -1,4 +1,7 @@
angular.module('portainer.docker').factory('ContainerHelper', [function ContainerHelperFactory() {
import splitargs from 'splitargs/src/splitargs'
angular.module('portainer.docker')
.factory('ContainerHelper', [function ContainerHelperFactory() {
'use strict';
var helper = {};

View File

@ -1,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.docker')
.factory('ImageHelper', [function ImageHelperFactory() {
'use strict';

View File

@ -1,3 +1,5 @@
import _ from 'lodash-es';
angular.module('portainer.docker')
.factory('InfoHelper', [function InfoHelperFactory() {
'use strict';

View File

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

View File

@ -1,4 +1,6 @@
function ConfigViewModel(data) {
import { ResourceControlViewModel } from '../../portainer/models/resourceControl';
export function ConfigViewModel(data) {
this.Id = data.ID;
this.CreatedAt = data.CreatedAt;
this.UpdatedAt = data.UpdatedAt;

View File

@ -1,4 +1,7 @@
function createStatus(statusText) {
import _ from 'lodash-es';
import { ResourceControlViewModel } from '../../portainer/models/resourceControl';
export function createStatus(statusText) {
var status = _.toLower(statusText);
if (status.indexOf('paused') > -1) {
@ -19,7 +22,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 +65,7 @@ function ContainerViewModel(data) {
}
}
function ContainerStatsViewModel(data) {
export function ContainerStatsViewModel(data) {
this.read = data.read;
this.preread = data.preread;
if(data.memory_stats.privateworkingset !== undefined) { // Windows
@ -88,7 +91,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

@ -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),
@ -83,7 +83,7 @@ function ContainerCapabilities() {
});
}
function ContainerCapability(cap, allowed) {
export function ContainerCapability(cap, allowed) {
this.capability = cap;
this.allowed = allowed;
this.description = capDesc[cap];

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;
@ -23,7 +23,7 @@ function ImageViewModel(data) {
}
}
function ImageBuildModel(data) {
export function ImageBuildModel(data) {
this.hasError = false;
var buildLogs = [];

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,6 @@
function NetworkViewModel(data) {
import { ResourceControlViewModel } from "../../portainer/models/resourceControl";
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,6 @@
function SecretViewModel(data) {
import { ResourceControlViewModel } from '../../portainer/models/resourceControl'
export function SecretViewModel(data) {
this.Id = data.ID;
this.CreatedAt = data.CreatedAt;
this.UpdatedAt = data.UpdatedAt;

View File

@ -1,4 +1,6 @@
function ServiceViewModel(data, runningTasks, allTasks) {
import { ResourceControlViewModel } from '../../portainer/models/resourceControl';
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,6 @@
function VolumeViewModel(data) {
import { ResourceControlViewModel } from "../../portainer/models/resourceControl";
export function VolumeViewModel(data) {
this.Id = data.Name;
this.CreatedAt = data.CreatedAt;
this.Driver = data.Driver;

View File

@ -1,3 +1,5 @@
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';

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