ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-843 Refactoring and fixing cluster form validation.
Date Tue, 02 Feb 2016 11:01:03 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 47522d24f -> b755b6337


IGNITE-843 Refactoring and fixing cluster form validation.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b755b633
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b755b633
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b755b633

Branch: refs/heads/ignite-843-rc2
Commit: b755b63373a14cb7dfbe8c4811515e852048339e
Parents: 47522d2
Author: Dmitriyff <dmitriyff@gmail.com>
Authored: Tue Feb 2 18:00:57 2016 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Feb 2 18:00:57 2016 +0700

----------------------------------------------------------------------
 .../control-center-web/src/main/js/app/index.js |  2 +
 .../configuration/clusters/deployment.jade      | 34 +++++-----
 .../clusters/general/discovery/cloud.jade       | 68 ++++++++++----------
 .../clusters/general/discovery/multicast.jade   | 38 +++++------
 .../clusters/general/discovery/vm.jade          | 38 +++++------
 .../states/configuration/clusters/ssl.jade      | 34 +++++-----
 .../js/app/services/cleanup/cleanup.service.js  | 61 ++++++++++++++++++
 .../main/js/controllers/clusters-controller.js  |  6 +-
 .../src/main/js/views/settings/admin.jade       |  2 +-
 9 files changed, 173 insertions(+), 110 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/app/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/index.js b/modules/control-center-web/src/main/js/app/index.js
index 7ce2fb0..2e25044 100644
--- a/modules/control-center-web/src/main/js/app/index.js
+++ b/modules/control-center-web/src/main/js/app/index.js
@@ -92,6 +92,7 @@ import igniteUiAcePojos from './directives/ui-ace-pojos/ui-ace-pojos.directive';
 import igniteFormFieldJavaClass from './directives/form-field-java-class/form-field-java-class.directive';
 
 // Services.
+import cleanup from './services/cleanup/cleanup.service';
 import IgniteUiAceOnLoad from './services/UiAceOnLoad/service';
 
 // Providers
@@ -139,6 +140,7 @@ angular
 .directive(...igniteUiAcePojos)
 .directive(...igniteFormFieldJavaClass)
 // Services.
+.service(...cleanup)
 .service(...IgniteUiAceOnLoad)
 // Providers.
 .provider(...igniteCountries)

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/deployment.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/deployment.jade
b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/deployment.jade
index 74fdc32..2949f16 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/deployment.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/deployment.jade
@@ -98,13 +98,13 @@ form.panel.panel-default(name='#{form}' novalidate)
                             data-ng-disabled='!#{enabled}'
                         )
                 .settings-row
-                    ignite-form-group(ng-init='__ = {};' ng-model='#{exclude}' ng-form='#{form}'
)
+                    ignite-form-group(ng-model='#{exclude}' ng-form='#{form}' )
                         ignite-form-field-label
                             | Local class path exclude
                         ignite-form-group-tooltip
                             | List of packages from the system classpath that need to be
peer-to-peer loaded from task originating node#[br]
                             | '*' is supported at the end of the package name which means
that all sub-packages and their classes are included like in Java package import clause
-                        ignite-form-group-add(ng-show='#{enabled}' ng-click='(__.add = [{}])')
+                        ignite-form-group-add(ng-show='#{enabled}' ng-click='(group.add =
[{}])')
                             | Add package name.
 
                         - var field = 'edit'
@@ -112,17 +112,17 @@ form.panel.panel-default(name='#{form}' novalidate)
                         - var save = exclude + '[$index] = ' + field
 
                         .group-content(ng-if='#{exclude}.length')
-                            ignite-form-field(ng-repeat='model in #{exclude} track by $index'
type='internal' ng-init='___ = {}')
+                            ignite-form-field(ng-repeat='model in #{exclude} track by $index'
type='internal')
                                 .indexField
                                     | {{ $index+1 }}) 
                                 i.tipField.fa.fa-remove(
-                                    ng-hide='___.edit'
+                                    ng-hide='field.edit'
                                     bs-tooltip='"Remove package name"'
                                     ng-click='#{exclude}.splice(#{exclude}.indexOf(model),
1)'
                                 )
-                                span(ng-hide='___.edit')
-                                    a.labelFormField(ng-click='#{enabled} && (___.edit
= true)') {{ model }}
-                                span(ng-if='___.edit' ng-init='#{field} = model')
+                                span(ng-hide='field.edit')
+                                    a.labelFormField(ng-click='#{enabled} && (field.edit
= true)') {{ model }}
+                                span(ng-if='field.edit' ng-init='#{field} = model')
                                     ignite-form-field-input-text(
                                         data-name='#{field}'
                                         data-ng-model='#{field}'
@@ -132,13 +132,13 @@ form.panel.panel-default(name='#{form}' novalidate)
                                         data-java-package-name='true'
                                         data-ignite-unique='#{exclude}'
                                         data-ignite-form-field-input-autofocus='true'
-                                        on-enter='#{valid} && (#{save}); #{valid}
&& (___.edit = false);'
-                                        on-escape='___.edit = false'
-                                        ng-blur='#{valid} && (#{save}); (___.edit
= false)'
+                                        on-enter='#{valid} && (#{save}); #{valid}
&& (field.edit = false);'
+                                        on-escape='field.edit = false'
+                                        ng-blur='#{valid} && (#{save}); (field.edit
= false)'
                                     )
                                         i.fa.fa-floppy-o(
                                             ng-show='#{valid}'
-                                            ng-click='#{valid} && (#{save}); #{valid}
&& (___.edit = false);'
+                                            ng-click='#{valid} && (#{save}); #{valid}
&& (field.edit = false);'
                                             bs-tooltip 
                                             data-title='Click icon or press [Enter] to save
item' 
                                         )
@@ -152,7 +152,7 @@ form.panel.panel-default(name='#{form}' novalidate)
                         - var valid = form + '.' + field + '.$valid'
                         - var push = exclude + '.push(' + field + ')'
 
-                        .group-content(ng-repeat='field in __.add')
+                        .group-content(ng-repeat='field in group.add')
                             ignite-form-field(type='internal')
                                 ignite-form-field-input-text(
                                     data-name='#{field}'
@@ -163,13 +163,13 @@ form.panel.panel-default(name='#{form}' novalidate)
                                     data-java-package-name='true'
                                     data-ignite-unique='#{exclude}'
                                     data-ignite-form-field-input-autofocus='true'
-                                    on-enter='#{valid} && #{push}; #{valid} &&
(stopblur = true) && (__.add = [{}])'
-                                    on-escape='__.add = []'
-                                    ng-blur='#{valid} && #{push}; !stopblur &&
(__.add = [])'
+                                    on-enter='#{valid} && #{push}; #{valid} &&
(stopblur = true) && (group.add = [{}])'
+                                    on-escape='group.add = []'
+                                    ng-blur='#{valid} && #{push}; !stopblur &&
(group.add = [])'
                                 )
                                     i.fa.fa-floppy-o(
                                         ng-show='#{valid}'
-                                        ng-click='#{valid} && #{push}; #{valid} &&
(__.add = [])'
+                                        ng-click='#{valid} && #{push}; #{valid} &&
(group.add = [])'
                                         bs-tooltip 
                                         data-title='Click icon or press [Enter] to save item'

                                     )
@@ -179,7 +179,7 @@ form.panel.panel-default(name='#{form}' novalidate)
                                     +feedback(field, 'javaKeywords', 'Package name could
not contains reserved java keyword: ""!')
                                     +feedback(field, 'igniteUnique', 'Such package already
exists!')
             
-                        .group-content-empty(ng-if='!(#{exclude}.length) && !__.add.length')
+                        .group-content-empty(ng-if='!(#{exclude}.length) && !group.add.length')
                             | Not defined
             .col-sm-6
                 .preview-panel(ng-init='mode = false')

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
index 283f72a..addd5d3 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/cloud.jade
@@ -70,14 +70,14 @@ div
                 data-ng-required='true'
             )
     .details-row(ng-if='true')
-        ignite-form-group(ng-init='__ = {};' ng-model='#{regions}' ng-form='generalDiscoveryCloudRegions')
+        ignite-form-group(ng-model='#{regions}' ng-form='generalDiscoveryCloudRegions')
             ignite-form-field-label
                 | Regions
             ignite-form-group-tooltip
                 | List of regions where VMs are located#[br]
                 | If the regions are not set then every region, that a cloud provider has,
will be investigated. This could lead to significant performance degradation#[br]
                 | Note, that some cloud providers, like Google Compute Engine, doesn't have
a notion of a region. For such providers regions are redundant
-            ignite-form-group-add(ng-click='__.add = [{}]')
+            ignite-form-group-add(ng-click='group.add = [{}]')
                 | Add new address
 
             - var field = 'edit'
@@ -85,17 +85,17 @@ div
             - var save = addresses + '[$index] = ' + field
 
             .group-content(ng-if='#{regions}.length')
-                ignite-form-field(ng-repeat='model in #{regions} track by $index' type='internal'
ng-init='___ = {}')
+                ignite-form-field(ng-repeat='model in #{regions} track by $index' type='internal')
                     .indexField
                         | {{ $index+1 }}) 
                     i.tipField.fa.fa-remove(
-                        ng-hide='___.edit'
+                        ng-hide='field.edit'
                         bs-tooltip='"Remove region"'
                         ng-click='#{regions}.splice(#{regions}.indexOf(model), 1)'
                     )
-                    span(ng-hide='___.edit')
-                        a.labelFormField(ng-click='___.edit = true') {{ model }}
-                    span(ng-if='___.edit' ng-init='#{field} = model')
+                    span(ng-hide='field.edit')
+                        a.labelFormField(ng-click='field.edit = true') {{ model }}
+                    span(ng-if='field.edit' ng-init='#{field} = model')
                         ignite-form-field-input-text(
                             data-name='#{field}'
                             data-ng-model='#{field}'
@@ -103,13 +103,13 @@ div
                             data-placeholder='Region name'
                             data-ignite-unique='#{regions}'
                             data-ignite-form-field-input-autofocus='true'
-                            on-enter='#{valid} && (#{save}); #{valid} &&
(___.edit = false);'
-                            on-escape='___.edit = false'
-                            ng-blur='#{valid} && (#{save}); (___.edit = false)'
+                            on-enter='#{valid} && (#{save}); #{valid} &&
(field.edit = false);'
+                            on-escape='field.edit = false'
+                            ng-blur='#{valid} && (#{save}); (field.edit = false)'
                         )
                             i.fa.fa-floppy-o(
                                 ng-show='#{valid}'
-                                ng-click='#{valid} && (#{save}); #{valid} &&
(___.edit = false);'
+                                ng-click='#{valid} && (#{save}); #{valid} &&
(field.edit = false);'
                                 bs-tooltip 
                                 data-title='Click icon or press [Enter] to save item' 
                             )
@@ -124,7 +124,7 @@ div
             - var valid = form + '.' + field + '.$valid'
             - var push = regions + '.push(' + field + ')'
 
-            .group-content(ng-repeat='field in __.add')
+            .group-content(ng-repeat='field in group.add')
                 ignite-form-field(type='internal')
                     ignite-form-field-input-text(
                         data-name='#{field}'
@@ -133,13 +133,13 @@ div
                         data-placeholder='Region name'
                         data-ignite-unique='#{regions}'
                         data-ignite-form-field-input-autofocus='true'
-                        on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (__.add = [{}])'
-                        on-escape='__.add = []'
-                        ng-blur='#{valid} && #{push}; !stopblur && (__.add
= [])'
+                        on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (group.add = [{}])'
+                        on-escape='group.add = []'
+                        ng-blur='#{valid} && #{push}; !stopblur && (group.add
= [])'
                     )
                         i.fa.fa-floppy-o(
                             ng-show='#{valid}'
-                            ng-click='#{valid} && #{push}; #{valid} && (__.add
= [])'
+                            ng-click='#{valid} && #{push}; #{valid} && (group.add
= [])'
                             bs-tooltip 
                             data-title='Click icon or press [Enter] to save item' 
                         )
@@ -150,17 +150,17 @@ div
                             data-title='Such region already exists!'
                         )
             
-            .group-content-empty(ng-if='!(#{regions}.length) && !__.add.length')
+            .group-content-empty(ng-if='!(#{regions}.length) && !group.add.length')
                 | Not defined
     .details-row(ng-if='true')
-         ignite-form-group(ng-init='__ = {};' ng-model='#{zones}' ng-form='generalDiscoveryCloudZones')
+         ignite-form-group(ng-model='#{zones}' ng-form='generalDiscoveryCloudZones')
             ignite-form-field-label
                 | Zones
             ignite-form-group-tooltip
                 | List of zones where VMs are located#[br]
                 | If the zones are not set then every zone from specified regions, will be
taken into account#[br]
                 | Note, that some cloud providers, like Rackspace, doesn't have a notion
of a zone. For such providers zones are redundant
-            ignite-form-group-add(ng-click='__.add = [{}]')
+            ignite-form-group-add(ng-click='group.add = [{}]')
                 | Add new address
 
             - var field = 'edit'
@@ -168,17 +168,17 @@ div
             - var save = addresses + '[$index] = ' + field
 
             .group-content(ng-if='#{zones}.length')
-                ignite-form-field(ng-repeat='model in #{zones} track by $index' type='internal'
ng-init='___ = {}')
+                ignite-form-field(ng-repeat='model in #{zones} track by $index' type='internal')
                     .indexField
                         | {{ $index+1 }}) 
                     i.tipField.fa.fa-remove(
-                        ng-hide='___.edit'
+                        ng-hide='field.edit'
                         bs-tooltip='"Remove zone"'
                         ng-click='#{zones}.splice(#{zones}.indexOf(model), 1)'
                     )
-                    span(ng-hide='___.edit')
-                        a.labelFormField(ng-click='___.edit = true') {{ model }}
-                    span(ng-if='___.edit' ng-init='#{field} = model')
+                    span(ng-hide='field.edit')
+                        a.labelFormField(ng-click='field.edit = true') {{ model }}
+                    span(ng-if='field.edit' ng-init='#{field} = model')
                         ignite-form-field-input-text(
                             data-name='#{field}'
                             data-ng-model='#{field}'
@@ -186,13 +186,13 @@ div
                             data-placeholder='Zone name'
                             data-ignite-unique='#{zones}'
                             data-ignite-form-field-input-autofocus='true'
-                            on-enter='#{valid} && (#{save}); #{valid} &&
(___.edit = false);'
-                            on-escape='___.edit = false'
-                            ng-blur='#{valid} && (#{save}); (___.edit = false)'
+                            on-enter='#{valid} && (#{save}); #{valid} &&
(field.edit = false);'
+                            on-escape='field.edit = false'
+                            ng-blur='#{valid} && (#{save}); (field.edit = false)'
                         )
                             i.fa.fa-floppy-o(
                                 ng-show='#{valid}'
-                                ng-click='#{valid} && (#{save}); #{valid} &&
(___.edit = false);'
+                                ng-click='#{valid} && (#{save}); #{valid} &&
(field.edit = false);'
                                 bs-tooltip 
                                 data-title='Click icon or press [Enter] to save item' 
                             )
@@ -207,7 +207,7 @@ div
             - var valid = form + '.' + field + '.$valid'
             - var push = zones + '.push(' + field + ')'
 
-            .group-content(ng-repeat='field in __.add')
+            .group-content(ng-repeat='field in group.add')
                 ignite-form-field(type='internal')
                     ignite-form-field-input-text(
                         data-name='#{field}'
@@ -216,13 +216,13 @@ div
                         data-placeholder='Zone name'
                         data-ignite-unique='#{zones}'
                         data-ignite-form-field-input-autofocus='true'
-                        on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (__.add = [{}])'
-                        on-escape='__.add = []'
-                        ng-blur='#{valid} && #{push}; !stopblur && (__.add
= [])'
+                        on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (group.add = [{}])'
+                        on-escape='group.add = []'
+                        ng-blur='#{valid} && #{push}; !stopblur && (group.add
= [])'
                     )
                         i.fa.fa-floppy-o(
                             ng-show='#{valid}'
-                            ng-click='#{valid} && #{push}; #{valid} && (__.add
= [])'
+                            ng-click='#{valid} && #{push}; #{valid} && (group.add
= [])'
                             bs-tooltip 
                             data-title='Click icon or press [Enter] to save item' 
                         )
@@ -233,5 +233,5 @@ div
                             data-title='Such zone already exists!'
                         )
             
-            .group-content-empty(ng-if='!(#{zones}.length) && !__.add.length')
+            .group-content-empty(ng-if='!(#{zones}.length) && !group.add.length')
                 | Not defined

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/multicast.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/multicast.jade
b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/multicast.jade
index 44b0944..6d774d4 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/multicast.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/multicast.jade
@@ -83,7 +83,7 @@ div
                 data-ng-model='#{model}.localAddress'
             )
     .details-row
-        ignite-form-group(ng-init='__ = {};' ng-model='#{addresses}' ng-form='discoveryMulticastAddresses')
+        ignite-form-group(ng-model='#{addresses}' ng-form='discoveryMulticastAddresses')
             ignite-form-field-label
                 | Addresses
             ignite-form-group-tooltip
@@ -98,7 +98,7 @@ div
                 | If port range is provided (e.g. host:port1..port2) the following should
be considered:#[br]
                 ul: li port1 < port2 should be true
                     li Both port1 and port2 should be greater than 0
-            ignite-form-group-add(ng-click='__.add = [{}]')
+            ignite-form-group-add(ng-click='group.add = [{}]')
                 | Add new address
 
             - var field = 'edit'
@@ -106,21 +106,21 @@ div
             - var save = addresses + '[$index] = ' + field
 
             .group-content(ng-if='#{addresses}.length')
-                ignite-form-field(ng-repeat='model in #{addresses} track by $index' type='internal'
ng-init=' ___ = {}')
+                ignite-form-field(ng-repeat='model in #{addresses} track by $index' type='internal')
                     .indexField
                         | {{ $index+1 }}) 
                     i.tipField.fa.fa-remove(
-                        ng-hide='___.edit'
+                        ng-hide='field.edit'
                         bs-tooltip='"Remove address"'
                         ng-click='#{addresses}.splice(#{addresses}.indexOf(model), 1)'
                     )
 
-                    ignite-form-field-down(ng-if='!$last' ng-hide='___.edit' data-ng-model='model'
data-models='#{addresses}')
-                    ignite-form-field-up(ng-if='!$first' ng-hide='___.edit' data-ng-model='model'
data-models='#{addresses}')
+                    ignite-form-field-down(ng-if='!$last' ng-hide='field.edit' data-ng-model='model'
data-models='#{addresses}')
+                    ignite-form-field-up(ng-if='!$first' ng-hide='field.edit' data-ng-model='model'
data-models='#{addresses}')
 
-                    span(ng-hide='___.edit')
-                        a.labelFormField(ng-click='___.edit = true') {{ model }}
-                    span(ng-if='___.edit' ng-init='#{field} = model')
+                    span(ng-hide='field.edit')
+                        a.labelFormField(ng-click='field.edit = true') {{ model }}
+                    span(ng-if='field.edit' ng-init='#{field} = model')
                         ignite-form-field-input-text(
                             data-name='#{field}'
                             data-ng-model='#{field}'
@@ -128,13 +128,13 @@ div
                             data-placeholder='IP address:port'
                             data-ignite-unique='#{addresses}'
                             data-ignite-form-field-input-autofocus='true'
-                            on-enter='#{valid} && (#{save}); #{valid} &&
(___.edit = false);'
-                            on-escape='___.edit = false'
-                            ng-blur='#{valid} && (#{save}); (___.edit = false)'
+                            on-enter='#{valid} && (#{save}); #{valid} &&
(field.edit = false);'
+                            on-escape='field.edit = false'
+                            ng-blur='#{valid} && (#{save}); (field.edit = false)'
                         )
                             i.fa.fa-floppy-o(
                                 ng-show='#{valid}'
-                                ng-click='#{valid} && (#{save}); #{valid} &&
(___.edit = false);'
+                                ng-click='#{valid} && (#{save}); #{valid} &&
(field.edit = false);'
                                 bs-tooltip 
                                 data-title='Click icon or press [Enter] to save item' 
                             )
@@ -149,7 +149,7 @@ div
             - var valid = form + '.' + field + '.$valid'
             - var push = addresses + '.push(' + field + ')'
 
-            .group-content(ng-repeat='field in __.add')
+            .group-content(ng-repeat='field in group.add')
                 ignite-form-field(type='internal')
                     ignite-form-field-input-text(
                         data-name='#{field}'
@@ -158,13 +158,13 @@ div
                         data-placeholder='IP address:port'
                         data-ignite-unique='#{addresses}'
                         data-ignite-form-field-input-autofocus='true'
-                        on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (__.add = [{}])'
-                        on-escape='__.add = []'
-                        ng-blur='#{valid} && #{push}; !stopblur && (__.add
= [])'
+                        on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (group.add = [{}])'
+                        on-escape='group.add = []'
+                        ng-blur='#{valid} && #{push}; !stopblur && (group.add
= [])'
                     )
                         i.fa.fa-floppy-o(
                             ng-show='#{valid}'
-                            ng-click='#{valid} && #{push}; #{valid} && (__.add
= [])'
+                            ng-click='#{valid} && #{push}; #{valid} && (group.add
= [])'
                             bs-tooltip 
                             data-title='Click icon or press [Enter] to save item' 
                         )
@@ -175,5 +175,5 @@ div
                             data-title='Such IP address already exists!'
                         )
             
-            .group-content-empty(ng-if='!(#{addresses}.length) && !__.add.length')
+            .group-content-empty(ng-if='!(#{addresses}.length) && !group.add.length')
                 | Not defined

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/vm.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/vm.jade
b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/vm.jade
index ca3fee1..fa693d2 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/vm.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/general/discovery/vm.jade
@@ -19,7 +19,7 @@
 - var form = 'discoveryVmAddresses';
 
 div
-    ignite-form-group(ng-init='__ = {};' ng-model='#{addresses}' ng-form='discoveryVmAddresses')
+    ignite-form-group(ng-model='#{addresses}' ng-form='discoveryVmAddresses')
         ignite-form-field-label
             | Addresses
         ignite-form-group-tooltip
@@ -34,7 +34,7 @@ div
             | If port range is provided (e.g. host:port1..port2) the following should be
considered:#[br]
             ul: li port1 < port2 should be true
                 li Both port1 and port2 should be greater than 0
-        ignite-form-group-add(ng-click='__.add = [{}]')
+        ignite-form-group-add(ng-click='group.add = [{}]')
             | Add new address
 
         - var field = 'edit'
@@ -42,21 +42,21 @@ div
         - var save = addresses + '[$index] = ' + field
 
         .group-content(ng-if='#{addresses}.length')
-            ignite-form-field(ng-repeat='model in #{addresses} track by $index' type='internal'
ng-init='___ = {}')
+            ignite-form-field(ng-repeat='model in #{addresses} track by $index' type='internal')
                 .indexField
                     | {{ $index+1 }}) 
                 i.tipField.fa.fa-remove(
-                    ng-hide='___.edit'
+                    ng-hide='field.edit'
                     bs-tooltip='"Remove address"'
                     ng-click='#{addresses}.splice(#{addresses}.indexOf(model), 1)'
                 )
 
-                ignite-form-field-down(ng-if='!$last' ng-hide='___.edit' data-ng-model='model'
data-models='#{addresses}')
-                ignite-form-field-up(ng-if='!$first' ng-hide='___.edit' data-ng-model='model'
data-models='#{addresses}')
+                ignite-form-field-down(ng-if='!$last' ng-hide='field.edit' data-ng-model='model'
data-models='#{addresses}')
+                ignite-form-field-up(ng-if='!$first' ng-hide='field.edit' data-ng-model='model'
data-models='#{addresses}')
                 
-                span(ng-hide='___.edit')
-                    a.labelFormField(ng-click='___.edit = true') {{ model }}
-                span(ng-if='___.edit' ng-init='#{field} = model')
+                span(ng-hide='field.edit')
+                    a.labelFormField(ng-click='field.edit = true') {{ model }}
+                span(ng-if='field.edit' ng-init='#{field} = model')
                     ignite-form-field-input-text(
                         data-name='#{field}'
                         data-ng-model='#{field}'
@@ -64,13 +64,13 @@ div
                         data-placeholder='IP address:port'
                         data-ignite-unique='#{addresses}'
                         data-ignite-form-field-input-autofocus='true'
-                        on-enter='#{valid} && (#{save}); #{valid} && (___.edit
= false);'
-                        on-escape='___.edit = false'
-                        ng-blur='#{valid} && (#{save}); (___.edit = false)'
+                        on-enter='#{valid} && (#{save}); #{valid} && (field.edit
= false);'
+                        on-escape='field.edit = false'
+                        ng-blur='#{valid} && (#{save}); (field.edit = false)'
                     )
                         i.fa.fa-floppy-o(
                             ng-show='#{valid}'
-                            ng-click='#{valid} && (#{save}); #{valid} &&
(___.edit = false);'
+                            ng-click='#{valid} && (#{save}); #{valid} &&
(field.edit = false);'
                             bs-tooltip 
                             data-title='Click icon or press [Enter] to save item' 
                         )
@@ -85,7 +85,7 @@ div
         - var valid = form + '.' + field + '.$valid'
         - var push = addresses + '.push(' + field + ')'
 
-        .group-content(ng-repeat='field in __.add')
+        .group-content(ng-repeat='field in group.add')
             ignite-form-field(type='internal')
                 ignite-form-field-input-text(
                     data-name='#{field}'
@@ -94,13 +94,13 @@ div
                     data-placeholder='IP address:port'
                     data-ignite-unique='#{addresses}'
                     data-ignite-form-field-input-autofocus='true'
-                    on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (__.add = [{}])'
-                    on-escape='__.add = []'
-                    ng-blur='#{valid} && #{push}; !stopblur && (__.add =
[])'
+                    on-enter='#{valid} && #{push}; #{valid} && (stopblur
= true) && (group.add = [{}])'
+                    on-escape='group.add = []'
+                    ng-blur='#{valid} && #{push}; !stopblur && (group.add
= [])'
                 )
                     i.fa.fa-floppy-o(
                         ng-show='#{valid}'
-                        ng-click='#{valid} && #{push}; #{valid} && (__.add
= [])'
+                        ng-click='#{valid} && #{push}; #{valid} && (group.add
= [])'
                         bs-tooltip 
                         data-title='Click icon or press [Enter] to save item' 
                     )
@@ -111,5 +111,5 @@ div
                         data-title='Such IP address already exists!'
                     )
         
-        .group-content-empty(id='addresses' ng-if='!(#{addresses}.length) && !__.add.length')
+        .group-content-empty(id='addresses' ng-if='!(#{addresses}.length) && !group.add.length')
                 | Not defined

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/ssl.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/ssl.jade
b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/ssl.jade
index 4ae5aeb..4c428ee 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/ssl.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/ssl.jade
@@ -111,12 +111,12 @@ form.panel.panel-default(name='#{form}' novalidate)
                         )
 
                 .settings-row
-                    ignite-form-group(ng-init='__ = {};' ng-form='trustManagers' ng-model='#{trust}')
+                    ignite-form-group(ng-form='trustManagers' ng-model='#{trust}')
                         ignite-form-field-label
                             | Trust managers
                         ignite-form-group-tooltip
                             | Pre-configured trust managers
-                        ignite-form-group-add(ng-show='#{enabled}' ng-click='(__.add = [{}])')
+                        ignite-form-group-add(ng-show='#{enabled}' ng-click='(group.add =
[{}])')
                             | Add new trust manager.
 
                         - var field = 'edit'
@@ -124,31 +124,31 @@ form.panel.panel-default(name='#{form}' novalidate)
                         - var save = trust + '[$index] = ' + field
 
                         .group-content(ng-if='#{trust}.length')
-                            ignite-form-field(ng-repeat='model in #{trust} track by $index'
type='internal' ng-init='___ = {}')
+                            ignite-form-field(ng-repeat='model in #{trust} track by $index'
type='internal')
                                 .indexField
                                     | {{ $index+1 }}) 
                                 i.tipField.fa.fa-remove(
                                     ng-show='#{enabled}'
-                                    ng-hide='___.edit'
+                                    ng-hide='field.edit'
                                     bs-tooltip='"Remove trust manager"'
                                     ng-click='#{enabled} && (#{trust}.splice(#{trust}.indexOf(model),
1))'
                                 )
-                                span(ng-hide='___.edit')
-                                    a.labelFormField(ng-click='#{enabled} && (___.edit
= true)') {{ model }}
-                                span(ng-if='___.edit' ng-init='#{field} = model')
+                                span(ng-hide='field.edit')
+                                    a.labelFormField(ng-click='#{enabled} && (field.edit
= true)') {{ model }}
+                                span(ng-if='field.edit' ng-init='#{field} = model')
                                     ignite-form-field-java-class(
                                         data-name='#{field}'
                                         data-ng-model='#{field}'
                                         data-ng-required='true'
                                         data-ignite-unique='#{trust}'
                                         data-ignite-form-field-input-autofocus='true'
-                                        on-enter='#{valid} && (#{save}); #{valid}
&& (___.edit = false);'
-                                        on-escape='___.edit = false'
-                                        ng-blur='#{valid} && (#{save}); (___.edit
= false)'
+                                        on-enter='#{valid} && (#{save}); #{valid}
&& (field.edit = false);'
+                                        on-escape='field.edit = false'
+                                        ng-blur='#{valid} && (#{save}); (field.edit
= false)'
                                     )
                                         i.fa.fa-floppy-o(
                                             ng-show='#{valid}'
-                                            ng-click='#{valid} && (#{save}); #{valid}
&& (___.edit = false);'
+                                            ng-click='#{valid} && (#{save}); #{valid}
&& (field.edit = false);'
                                             bs-tooltip 
                                             data-title='Click icon or press [Enter] to save
item' 
                                         )
@@ -163,7 +163,7 @@ form.panel.panel-default(name='#{form}' novalidate)
                         - var valid = form + '.' + field + '.$valid'
                         - var push = trust + '.push(' + field + ')'
 
-                        .group-content(ng-repeat='field in __.add')
+                        .group-content(ng-repeat='field in group.add')
                             ignite-form-field(type='internal')
                                 ignite-form-field-java-class(
                                     data-name='#{field}'
@@ -171,13 +171,13 @@ form.panel.panel-default(name='#{form}' novalidate)
                                     data-ng-required='true'
                                     data-ignite-unique='#{trust}'
                                     data-ignite-form-field-input-autofocus='true'
-                                    on-enter='#{valid} && #{push}; #{valid} &&
(stopblur = true) && (__.add = [{}])'
-                                    on-escape='__.add = []'
-                                    ng-blur='#{valid} && #{push}; !stopblur &&
(__.add = [])'
+                                    on-enter='#{valid} && #{push}; #{valid} &&
(stopblur = true) && (group.add = [{}])'
+                                    on-escape='group.add = []'
+                                    ng-blur='#{valid} && #{push}; !stopblur &&
(group.add = [])'
                                 )
                                     i.fa.fa-floppy-o(
                                         ng-show='#{valid}'
-                                        ng-click='#{valid} && #{push}; #{valid} &&
(__.add = [])'
+                                        ng-click='#{valid} && #{push}; #{valid} &&
(group.add = [])'
                                         bs-tooltip 
                                         data-title='Click icon or press [Enter] to save item'

                                     )
@@ -188,7 +188,7 @@ form.panel.panel-default(name='#{form}' novalidate)
                                         data-title='Such trust manager already exists!'
                                     )
 
-                        .group-content-empty(ng-if='!(#{trust}.length) && !__.add.length')
+                        .group-content-empty(ng-if='!(#{trust}.length) && !group.add.length')
                             | Not defined
 
                 .settings-row(ng-if='!#{trust}.length')

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/app/services/cleanup/cleanup.service.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/services/cleanup/cleanup.service.js
b/modules/control-center-web/src/main/js/app/services/cleanup/cleanup.service.js
new file mode 100644
index 0000000..e3a1716
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/services/cleanup/cleanup.service.js
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+const isArray = angular.isArray;
+const isDefined = angular.isDefined;
+const isNumber = angular.isNumber;
+const isObject = angular.isObject;
+const isString = angular.isString;
+const isUndefined = angular.isUndefined;
+
+export default ['$cleanup', () => {
+    const cleanup = (original, dist) => {
+        if (isUndefined(original))
+            return dist;
+
+        if (isObject(original)) {
+            let key;
+
+            for (key in original) {
+                if (original.hasOwnProperty(key)) {
+                    const attr = cleanup(original[key]);
+
+                    if (isDefined(attr)) {
+                        dist = dist || {};
+                        dist[key] = attr;
+                    }
+                }
+            }
+        } else if ((isString(original) && original.length) || isNumber(original))
+            dist = original;
+        else if (isArray(original) && original.length) {
+            dist = [];
+
+            let i = 0;
+            const l = original.length;
+
+            for (; i < l; i++)
+                dist[i] = cleanup(original[i], {});
+        }
+
+        return dist;
+    };
+
+    return cleanup;
+}];

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/clusters-controller.js b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
index 56a86d8..ef61cfd 100644
--- a/modules/control-center-web/src/main/js/controllers/clusters-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
@@ -17,7 +17,7 @@
 
 // Controller for Clusters screen.
 consoleModule.controller('clustersController', function ($http, $timeout, $scope, $state,
$controller,
-    $common, $focus, $confirm, $clone, $preview, $loading, $unsavedChangesGuard, igniteIncludeEventGroups)
{
+    $common, $focus, $confirm, $clone, $preview, $loading, $unsavedChangesGuard, $cleanup,
igniteIncludeEventGroups) {
         $unsavedChangesGuard.install($scope);
 
         var __original_value;
@@ -175,7 +175,7 @@ consoleModule.controller('clustersController', function ($http, $timeout,
$scope
                 $scope.$watch('backupItem', function (val) {
                     var form = $scope.ui.inputForm;
 
-                    if (form.$pristine || (form.$valid && __original_value === JSON.stringify(val)))
+                    if (form.$pristine || (form.$valid && __original_value === JSON.stringify($cleanup(val))))
                         form.$setPristine();
                     else
                         form.$setDirty();
@@ -299,7 +299,7 @@ consoleModule.controller('clustersController', function ($http, $timeout,
$scope
 
                 $scope.backupItem = angular.extend({}, blank, $scope.backupItem);
 
-                __original_value = JSON.stringify($scope.backupItem);
+                __original_value = JSON.stringify($cleanup($scope.backupItem));
 
                 if ($common.getQueryVariable('new'))
                     $state.go('base.configuration.clusters');

http://git-wip-us.apache.org/repos/asf/ignite/blob/b755b633/modules/control-center-web/src/main/js/views/settings/admin.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/settings/admin.jade b/modules/control-center-web/src/main/js/views/settings/admin.jade
index d06a0b1..0a021d3 100644
--- a/modules/control-center-web/src/main/js/views/settings/admin.jade
+++ b/modules/control-center-web/src/main/js/views/settings/admin.jade
@@ -52,5 +52,5 @@
                                 i.fa.fa-eye(ng-click='becomeUser(row)' style='margin-left:
5px'  bs-tooltip='' data-title='Become this user')
                 tfoot
                     tr
-                        td.text-right(colspan='5')
+                        td.text-right(colspan='7')
                             div(st-pagination st-items-by-page='15' st-displayed-pages='5')


Mime
View raw message