ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [25/50] [abbrv] ignite git commit: IGNITE-2840 Refactoring to mixins.
Date Mon, 28 Mar 2016 08:48:05 GMT
 IGNITE-2840 Refactoring to mixins.


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

Branch: refs/heads/ignite-2875
Commit: f8a690ece50012520ca5ff05da4741c19228d2c5
Parents: 94632f2
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Mon Mar 21 18:26:05 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Mon Mar 21 18:26:05 2016 +0700

----------------------------------------------------------------------
 .../ui-ace-java/ui-ace-java.directive.js        |   5 -
 .../ui-ace-xml/ui-ace-xml.directive.js          |   5 -
 .../src/main/js/app/helpers/jade/mixins.jade    | 120 ++++++-
 .../form/field/input/number.directive.js        |   1 +
 .../js/app/modules/form/field/input/number.jade |   1 +
 .../app/modules/states/configuration.state.js   |   5 +-
 .../states/configuration/clusters/atomic.jade   |  74 ++---
 .../states/configuration/clusters/binary.jade   | 120 ++-----
 .../configuration/clusters/communication.jade   | 332 +++----------------
 .../configuration/clusters/connector.jade       | 314 +++---------------
 .../configuration/clusters/deployment.jade      | 181 +++-------
 .../configuration/clusters/discovery.jade       | 296 ++---------------
 .../states/configuration/clusters/events.jade   |  33 +-
 .../states/configuration/clusters/general.jade  |  89 ++---
 .../clusters/general/discovery/cloud.jade       | 229 ++++---------
 .../clusters/general/discovery/google.jade      |  59 +---
 .../clusters/general/discovery/jdbc.jade        |  13 +-
 .../clusters/general/discovery/multicast.jade   | 159 ++-------
 .../clusters/general/discovery/s3.jade          |  14 +-
 .../clusters/general/discovery/shared.jade      |  12 +-
 .../clusters/general/discovery/vm.jade          | 100 ++----
 .../clusters/general/discovery/zookeeper.jade   | 126 +++----
 .../bounded-exponential-backoff.jade            |  39 +--
 .../discovery/zookeeper/retrypolicy/custom.jade |  14 +-
 .../retrypolicy/exponential-backoff.jade        |  39 +--
 .../zookeeper/retrypolicy/forever.jade          |  14 +-
 .../zookeeper/retrypolicy/n-times.jade          |  26 +-
 .../zookeeper/retrypolicy/one-time.jade         |  14 +-
 .../zookeeper/retrypolicy/until-elapsed.jade    |  26 +-
 .../states/configuration/clusters/igfs.jade     |  34 +-
 .../configuration/clusters/marshaller.jade      | 129 ++-----
 .../states/configuration/clusters/metrics.jade  |  74 +----
 .../clusters/preview-panel.directive.js         | 239 -------------
 .../states/configuration/clusters/ssl.jade      | 179 ++--------
 .../states/configuration/clusters/swap.jade     | 128 ++-----
 .../states/configuration/clusters/thread.jade   |  76 +----
 .../states/configuration/clusters/time.jade     |  75 +----
 .../configuration/clusters/transactions.jade    | 111 ++-----
 .../configuration/preview-panel.directive.js    | 239 +++++++++++++
 .../main/js/controllers/clusters-controller.js  |   7 +-
 .../main/js/helpers/generator/generator-java.js | 110 +++---
 .../main/js/helpers/generator/generator-xml.js  |  92 +++--
 .../main/js/views/configuration/clusters.jade   |   2 +-
 43 files changed, 1063 insertions(+), 2892 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/directives/ui-ace-java/ui-ace-java.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/directives/ui-ace-java/ui-ace-java.directive.js b/modules/control-center-web/src/main/js/app/directives/ui-ace-java/ui-ace-java.directive.js
index 617cfbe..77cb774 100644
--- a/modules/control-center-web/src/main/js/app/directives/ui-ace-java/ui-ace-java.directive.js
+++ b/modules/control-center-web/src/main/js/app/directives/ui-ace-java/ui-ace-java.directive.js
@@ -64,11 +64,6 @@ export default ['igniteUiAceJava', ['GeneratorJava', (generator) => {
 
                     break;
 
-                case 'clusterDiscovery':
-                    ctrl.generator = (cluster) => generator.clusterDiscovery(cluster.discovery).asString();
-
-                    break;
-
                 case 'igfss':
                     ctrl.generator = (cluster) => {
                         const igfss = _.reduce(scope.detail, (acc, igfs) => {

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/directives/ui-ace-xml/ui-ace-xml.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/directives/ui-ace-xml/ui-ace-xml.directive.js b/modules/control-center-web/src/main/js/app/directives/ui-ace-xml/ui-ace-xml.directive.js
index b379404..215c1b9 100644
--- a/modules/control-center-web/src/main/js/app/directives/ui-ace-xml/ui-ace-xml.directive.js
+++ b/modules/control-center-web/src/main/js/app/directives/ui-ace-xml/ui-ace-xml.directive.js
@@ -64,11 +64,6 @@ export default ['igniteUiAceXml', ['GeneratorXml', (generator) => {
 
                     break;
 
-                case 'clusterDiscovery':
-                    ctrl.generator = (cluster) => generator.clusterDiscovery(cluster.discovery).asString();
-
-                    break;
-
                 case 'igfss':
                     ctrl.generator = (cluster) => {
                         const igfss = _.reduce(scope.detail, (acc, igfs) => {

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/helpers/jade/mixins.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/helpers/jade/mixins.jade b/modules/control-center-web/src/main/js/app/helpers/jade/mixins.jade
index 0c4e140..2fd0270 100644
--- a/modules/control-center-web/src/main/js/app/helpers/jade/mixins.jade
+++ b/modules/control-center-web/src/main/js/app/helpers/jade/mixins.jade
@@ -55,6 +55,22 @@ mixin java-class(lbl, model, name, enabled, required, tip)
         )
 
 //- Mixin for text field.
+mixin text-ip-address(lbl, model, name, enabled, placeholder, tip)
+    ignite-form-field
+        ignite-form-field-label
+            | #{lbl}
+        ignite-form-field-tooltip
+            | !{tip}
+        ignite-form-field-input-text(
+            data-id=name
+            data-name=name
+            data-ng-model=model
+            data-ipaddress='true'
+            data-ng-disabled='!(#{enabled})'
+            data-placeholder=placeholder
+        )
+
+//- Mixin for text field.
 mixin text-enabled(lbl, model, name, enabled, required, placeholder, tip)
     ignite-form-field
         ignite-form-field-label
@@ -81,7 +97,7 @@ mixin text-options(lbl, model, name, options, enabled, placeholder, tip)
             | #{lbl}
         ignite-form-field-tooltip
             | !{tip}
-        ignite-form-field-input-text(
+        ignite-form-field-input-datalist(
             data-id=name
             data-name=name
             data-ng-model=model
@@ -109,6 +125,10 @@ mixin number-requited(lbl, model, name, required, enabled, placeholder, min, tip
 
 //- Mixin for required numeric field with maximum and minimum limit.
 mixin number-min-max(lbl, model, name, enabled, placeholder, min, max, tip)
+    +number-min-max-step(lbl, model, name, enabled, placeholder, min, max, '1', tip)
+
+//- Mixin for required numeric field with maximum and minimum limit.
+mixin number-min-max-step(lbl, model, name, enabled, placeholder, min, max, step, tip)
     ignite-form-field
         ignite-form-field-label
             | #{lbl}
@@ -122,6 +142,7 @@ mixin number-min-max(lbl, model, name, enabled, placeholder, min, max, tip)
             data-placeholder=placeholder
             data-min=min
             data-max=max
+            data-step=step
         )
 
 //- Mixin for numeric field.
@@ -169,11 +190,11 @@ mixin dropdown-multiple(lbl, model, name, placeholder, placeholderEmpty, options
 
 //- Mixin for table java class field.
 mixin table-java-class-field(field, items, save, newItem)
-    - var reset = (newItem ? 'group.add = []' : 'field.edit = false')
-
     - var resetOnEnter = newItem ? '(stopblur = true) && (group.add = [{}])' : '(field.edit = false)'
     - var onEnter = valid + ' && (' + save + '); ' + valid + ' && ' + resetOnEnter + ';'
 
+    - var onEscape = (newItem ? 'group.add = []' : 'field.edit = false')
+
     - var resetOnBlur = (newItem ? '!stopblur && (group.add = [])' : 'field.edit = false')
     - var onBlur = valid + ' && ( ' + save + '); ' + resetOnBlur + ';'
 
@@ -184,15 +205,87 @@ mixin table-java-class-field(field, items, save, newItem)
         data-ignite-unique=items
         data-ignite-form-field-input-autofocus='true'
         on-enter=onEnter
+        on-escape=onEscape
+        ng-blur=onBlur
+    )
+        block
+
+//- Mixin for table java package field.
+mixin table-java-package-field(field, items, save, newItem)
+    - var resetOnEnter = newItem ? '(stopblur = true) && (group.add = [{}])' : '(field.edit = false)'
+    - var onEnter = valid + ' && (' + save + '); ' + valid + ' && ' + resetOnEnter + ';'
+
+    - var onEscape = (newItem ? 'group.add = []' : 'field.edit = false')
+
+    - var resetOnBlur = (newItem ? '!stopblur && (group.add = [])' : 'field.edit = false')
+    - var onBlur = valid + ' && ( ' + save + '); ' + resetOnBlur + ';'
+
+    ignite-form-field-input-text(
+        data-name=field
+        data-ng-model=field
+        data-ng-required='true'
+        data-placeholder='Enter package name'
+        data-java-keywords='true'
+        data-java-package-name='true'
+        data-ignite-unique=items
+        data-ignite-form-field-input-autofocus='true'
+        on-enter=onEnter
+        on-escape=onEscape
+        ng-blur=onBlur
+    )
+        block
+
+//- Mixin for table text field.
+mixin table-text-field(field, items, save, placeholder, newItem)
+    - var resetOnEnter = newItem ? '(stopblur = true) && (group.add = [{}])' : '(field.edit = false)'
+    - var onEnter = valid + ' && (' + save + '); ' + valid + ' && ' + resetOnEnter + ';'
+
+    - var onEscape = (newItem ? 'group.add = []' : 'field.edit = false')
+
+    - var resetOnBlur = (newItem ? '!stopblur && (group.add = [])' : 'field.edit = false')
+    - var onBlur = valid + ' && ( ' + save + '); ' + resetOnBlur + ';'
+
+    ignite-form-field-input-text(
+        data-name=field
+        data-ng-model=field
+        data-ng-required='true'
+        data-placeholder=placeholder
+        data-ignite-unique=items
+        data-ignite-form-field-input-autofocus='true'
+        on-enter=onEnter
+        on-escape=onEscape
+        ng-blur=onBlur
+    )
+        block
+
+//- Mixin for table address field.
+mixin table-address-field(field, items, save, newItem)
+    - var resetOnEnter = newItem ? '(stopblur = true) && (group.add = [{}])' : '(field.edit = false)'
+    - var onEnter = valid + ' && (' + save + '); ' + valid + ' && ' + resetOnEnter + ';'
+
+    - var onEscape = (newItem ? 'group.add = []' : 'field.edit = false')
+
+    - var resetOnBlur = (newItem ? '!stopblur && (group.add = [])' : 'field.edit = false')
+    - var onBlur = valid + ' && ( ' + save + '); ' + resetOnBlur + ';'
+
+    ignite-form-field-input-text(
+        data-name=field
+        data-ng-model=field
+        data-ng-required='true'
+        data-placeholder='IP address:port'
+        data-ipaddress='true'
+        data-ignite-unique=items
+        data-ignite-form-field-input-autofocus='true'
+        on-enter=onEnter
+        on-escape=onEscape
         ng-blur=onBlur
-        on-escape=reset
     )
         block
 
 //- Mixin for table save button.
 mixin table-save-button(valid, save, newItem)
     - var reset = (newItem ? 'group.add = []' : 'field.edit = false')
-    - var onClick = valid + ' && ' + save + '; ' + valid  + '&& (' + reset + ');'
+    - var onClick = valid + ' && ' + save + '; ' + valid  + ' && (' + reset + ');'
 
     i.fa.fa-floppy-o(
         ng-show=valid
@@ -202,19 +295,30 @@ mixin table-save-button(valid, save, newItem)
     )
 
 //- Mixin for table remove button.
-mixin table-remove-button(items, tip)
+mixin table-remove-conditional-button(items, show, tip)
     i.tipField.fa.fa-remove(
+        ng-show='#{show}'
         ng-hide='field.edit'
         bs-tooltip='"#{tip}"'
         ng-click='#{items}.splice(#{items}.indexOf(model), 1)'
     )
 
+//- Mixin for table remove button.
+mixin table-remove-button(items, tip)
+    +table-remove-conditional-button(items, 'true', tip)
+
 //- Mixin for table feedback for unique validator.
 mixin table-feedback-unique(from, field, tip)
-    - var formField = form + '.' + field
+    i.fa.fa-exclamation-triangle.form-control-feedback(
+        ng-show=form + '.' + field + '.$error.igniteUnique'
+        bs-tooltip
+        data-title=tip
+    )
 
+//- Mixin for table feedback for valid host name / IP address.
+mixin table-feedback-ip-address(from, field, tip)
     i.fa.fa-exclamation-triangle.form-control-feedback(
-        ng-show='!' + formField + '.$pristine && ' + formField + '.$error.igniteUnique'
+        ng-show=form + '.' + field + '.$error.ipaddress'
         bs-tooltip
         data-title=tip
     )

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js
index cc135b5..cc2dd31 100644
--- a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.directive.js
@@ -54,6 +54,7 @@ export default ['igniteFormFieldInputNumber', ['IgniteFormGUID', (guid) => {
 
             min: '@',
             max: '@',
+            step: '@',
             value: '=ngModel'
         },
         link,

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
index 4429d30..3caf020 100644
--- a/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
+++ b/modules/control-center-web/src/main/js/app/modules/form/field/input/number.jade
@@ -30,6 +30,7 @@ mixin feedback(error, message)
         type='number'
         min='{{ min || 0 }}'
         max='{{ max || Number.MAX_VALUE }}'
+        step='{{ step || 1 }}'
 
         data-ng-model='value'
         data-ng-required='required || false'

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/states/configuration.state.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration.state.js b/modules/control-center-web/src/main/js/app/modules/states/configuration.state.js
index 0c32181..fa2f6fe 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration.state.js
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration.state.js
@@ -17,9 +17,10 @@
 
 import angular from 'angular';
 
-// Clusters screen.
-import previewPanel from './configuration/clusters/preview-panel.directive';
+// Common directives.
+import previewPanel from './configuration/preview-panel.directive.js';
 
+// Clusters screen.
 import clustersGeneral from './configuration/clusters/general.directive';
 
 import clustersGeneralDiscoveryCloud from './configuration/clusters/general/discovery/cloud.directive';

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/atomic.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/atomic.jade b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/atomic.jade
index 8d108b8..4f27a0b 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/atomic.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/atomic.jade
@@ -14,6 +14,8 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 
+include ../../../../../app/helpers/jade/mixins.jade
+
 - var model = 'backupItem.atomicConfiguration'
 
 form.panel.panel-default(name='atomics' novalidate)
@@ -28,59 +30,23 @@ form.panel.panel-default(name='atomics' novalidate)
         .panel-body(ng-if='__show__')
             .col-sm-6
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Cache mode:
-                        ignite-form-field-tooltip
-                            | Cache modes:
-                            ul: li Partitioned - in this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes
-                                li Replicated - in this mode all the keys are distributed to all participating nodes
-                                li Local - in this mode caches residing on different grid nodes will not know about each other
-                        ignite-form-field-dropdown(
-                            data-id='cacheMode'
-                            data-name='cacheMode'
-                            data-options='[\
-                                {value: "LOCAL", label: "LOCAL"},\
-                                {value: "REPLICATED", label: "REPLICATED"},\
-                                {value: "PARTITIONED", label: "PARTITIONED"}\
-                            ]'
-                            data-ng-model='#{model}.cacheMode'
-                            data-placeholder='PARTITIONED'
-                        )
+                    +dropdown('Cache mode:', model + '.cacheMode', 'cacheMode', 'true', 'PARTITIONED',
+                        '[\
+                            {value: "LOCAL", label: "LOCAL"},\
+                            {value: "REPLICATED", label: "REPLICATED"},\
+                            {value: "PARTITIONED", label: "PARTITIONED"}\
+                        ]',
+                        'Cache modes:\
+                        <ul>\
+                            <li>Partitioned - in this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes</li>\
+                            <li>Replicated - in this mode all the keys are distributed to all participating nodes</li>\
+                            <li>Local - in this mode caches residing on different grid nodes will not know about each other</li>\
+                        </ul>')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Sequence reserve:
-                        ignite-form-field-tooltip
-                            | Default number of sequence values reserved for IgniteAtomicSequence instances#[br]
-                            | After a certain number has been reserved, consequent increments of sequence will happen locally, without communication with other nodes, until the next reservation has to be made
-                        ignite-form-field-input-number(
-                            data-id='atomicSequenceReserveSize'
-                            data-name='atomicSequenceReserveSize'
-                            data-ng-model='#{model}.atomicSequenceReserveSize'
-                            data-placeholder='1000'
-                        )
+                    +number('Sequence reserve:', model + '.atomicSequenceReserveSize', 'atomicSequenceReserveSize', 'true', '1000', '0',
+                        'Default number of sequence values reserved for IgniteAtomicSequence instances<br/>\
+                        After a certain number has been reserved, consequent increments of sequence will happen locally, without communication with other nodes, until the next reservation has to be made')
                 .settings-row(ng-if='!(#{model}.cacheMode && #{model}.cacheMode != "PARTITIONED")')
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Backups:
-                        ignite-form-field-tooltip
-                            | Number of backup nodes
-                        ignite-form-field-input-number(
-                            data-id='backups'
-                            data-name='backups'
-                            data-ng-model='#{model}.backups'
-                            data-placeholder='0'
-                        )
-            ignite-ui-ace-tabs.col-sm-6
-                .preview-panel(ng-init='mode = false')
-                    .preview-legend
-                        a(ng-class='{active: !mode, inactive: mode}' ng-click='mode = false') XML
-                        | &nbsp;
-                        a(ng-class='{active: mode, inactive: !mode}' ng-click='mode = true') Java
-                    .preview-content(ng-if='mode')
-                        ignite-ui-ace-java(data-master='backupItem' data-generator='clusterAtomics' ng-model='$parent.data')
-                    .preview-content(ng-if='!mode')
-                        ignite-ui-ace-xml(data-master='backupItem' data-generator='clusterAtomics' ng-model='$parent.data')
-                    .preview-content-empty(ng-if='!data')
-                        label All Defaults
+                    +number('Backups:', model + '.backups', 'backups', 'true', '0', '0', 'Number of backup nodes')
+            .col-sm-6
+                +preview-xml-java(model, 'clusterAtomics')

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/binary.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/binary.jade b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/binary.jade
index bf9ba38..36f7960 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/binary.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/binary.jade
@@ -14,6 +14,8 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 
+include ../../../../../app/helpers/jade/mixins.jade
+
 - var model = 'backupItem.binaryConfiguration'
 - var types = model + '.typeConfigurations'
 
@@ -28,41 +30,15 @@ form.panel.panel-default(name='binary' novalidate)
         .panel-body(ng-if='__show__')
             .col-sm-6
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | ID mapper:
-                        ignite-form-field-tooltip
-                            | Maps given from BinaryNameMapper type and filed name to ID that will be used by Ignite in internals#[br]
-                            | Ignite never writes full strings for field or type names. Instead, for performance reasons, Ignite writes integer hash codes for type/class and field names. It has been tested that hash code conflicts for the type/class names or the field names within the same type are virtually non-existent and, to gain performance, it is safe to work with hash codes. For the cases when hash codes for different types or fields actually do collide #[b BinaryIdMapper] allows to override the automatically generated hash code IDs for the type and field names
-                        ignite-form-field-java-class(
-                            data-id='idMapper'
-                            data-name='idMapper'
-                            data-ng-model='#{model}.idMapper'
-                        )
+                    +java-class('ID mapper:', model + '.idMapper', 'idMapper', 'true', 'false',
+                        'Maps given from BinaryNameMapper type and filed name to ID that will be used by Ignite in internals<br/>\
+                        Ignite never writes full strings for field or type names. Instead, for performance reasons, Ignite writes integer hash codes for type/class and field names. It has been tested that hash code conflicts for the type/class names or the field names within the same type are virtually non - existent and, to gain performance, it is safe to work with hash codes. For the cases when hash codes for different types or fields actually do collide <b>BinaryIdMapper</b> allows to override the automatically generated hash code IDs for the type and field names')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Name mapper:
-                        ignite-form-field-tooltip
-                            | Maps type/class and field names to different names#[br]
-                        ignite-form-field-java-class(
-                            data-id='nameMapper'
-                            data-name='nameMapper'
-                            data-ng-model='#{model}.nameMapper'
-                        )
+                    +java-class('Name mapper:', model + '.nameMapper', 'nameMapper', 'true', 'false', 'Maps type/class and field names to different names')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Serializer:
-                        ignite-form-field-tooltip
-                            | Class with custom serialization logic for binary objects
-                        ignite-form-field-java-class(
-                            data-id='serializer'
-                            data-name='serializer'
-                            data-ng-model='#{model}.serializer'
-                        )
+                    +java-class('Serializer:', model + '.serializer', 'serializer', 'true', 'false', 'Class with custom serialization logic for binary objects')
                 .settings-row
-                    ignite-form-group(ng-form='typeConfigurations' ng-model='#{types}')
+                    ignite-form-group(ng-form='typeConfigurations' ng-model=types)
                         ignite-form-field-label
                             | Type configurations
                         ignite-form-group-tooltip
@@ -79,81 +55,25 @@ form.panel.panel-default(name='binary' novalidate)
                                         | Type name:
                                     ignite-form-field-tooltip
                                         | Type name
-                                    i.tipField.fa.fa-remove(
-                                        bs-tooltip='"Remove type configuration"'
-                                        ng-click='#{types}.splice(#{types}.indexOf(model), 1)'
-                                    )
+                                    +table-remove-button(types, 'Remove type configuration')
                                     ignite-form-field-java-class(
-                                        data-id='typeName'
-                                        data-name='typeName'
+                                        data-id='typeName{{$index}}'
+                                        data-name='typeName{{$index}}'
                                         data-ng-model='model.typeName'
                                         data-ng-required='true'
                                     )
                             .settings-row
-                                ignite-form-field
-                                    ignite-form-field-label
-                                        | ID mapper:
-                                    ignite-form-field-tooltip
-                                        | Maps given from BinaryNameMapper type and filed name to ID that will be used by Ignite in internals#[br]
-                                        | Ignite never writes full strings for field or type/class names. Instead, for performance reasons, Ignite writes integer hash codes for type/class and field names. It has been tested that hash code conflicts for the type/class names or the field names within the same type are virtually non-existent and, to gain performance, it is safe to work with hash codes. For the cases when hash codes for different types or fields actually do collide #[b BinaryIdMapper] allows to override the automatically generated hash code IDs for the type and field names
-                                    ignite-form-field-java-class(
-                                        data-id='idMapper'
-                                        data-name='idMapper'
-                                        data-ng-model='model.idMapper'
-                                    )
+                                +java-class('ID mapper:', 'model.idMapper', 'idMapper{{$index}}', 'true', 'false',
+                                    'Maps given from BinaryNameMapper type and filed name to ID that will be used by Ignite in internals<br/>\
+                                    Ignite never writes full strings for field or type/class names. Instead, for performance reasons, Ignite writes integer hash codes for type/class and field names. It has been tested that hash code conflicts for the type/class names or the field names within the same type are virtually non - existent and, to gain performance, it is safe to work with hash codes. For the cases when hash codes for different types or fields actually do collide #[b BinaryIdMapper] allows to override the automatically generated hash code IDs for the type and field names')
                             .settings-row
-                                ignite-form-field
-                                    ignite-form-field-label
-                                        | Name mapper:
-                                    ignite-form-field-tooltip
-                                        | Maps type/class and field names to different names#[br]
-                                    ignite-form-field-java-class(
-                                        data-id='nameMapper'
-                                        data-name='nameMapper'
-                                        data-ng-model='model.nameMapper'
-                                    )
+                                +java-class('Name mapper:', 'model.nameMapper', 'nameMapper{{$index}}', 'true', 'false', 'Maps type/class and field names to different names')
                             .settings-row
-                                ignite-form-field
-                                    ignite-form-field-label
-                                        | Serializer:
-                                    ignite-form-field-tooltip
-                                        | Class with custom serialization logic for binary object
-                                    ignite-form-field-java-class(
-                                        data-id='serializer'
-                                        data-name='serializer'
-                                        data-ng-model='model.serializer'
-                                    )
+                                +java-class('Serializer:', 'model.serializer', 'serializer{{$index}}', 'true', 'false', 'Class with custom serialization logic for binary object')
                             .settings-row
-                                ignite-form-field.checkbox
-                                    ignite-form-field-input-checkbox(
-                                        data-id='enum'
-                                        data-name='enum'
-                                        data-ng-model='model.enum'
-                                    )
-                                    | Enum
-                                    ignite-form-field-tooltip
-                                        | Flag indicating that this type is the enum
-
+                                +checkbox('Enum', 'model.enum', 'enum{{$index}}', 'Flag indicating that this type is the enum')
 
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='compactFooter'
-                            data-name='compactFooter'
-                            data-ng-model='#{model}.compactFooter'
-                        )
-                        | Compact footer
-                        ignite-form-field-tooltip
-                            | When enabled, Ignite will not write fields metadata when serializing objects(this will increase serialization performance), because internally #[b BinaryMarshaller] already distribute metadata inside cluster
-            ignite-ui-ace-tabs.col-sm-6
-                .preview-panel(ng-init='mode = false')
-                    .preview-legend
-                        a(ng-class='{active: !mode, inactive: mode}' ng-click='mode = false') XML
-                        | &nbsp;
-                        a(ng-class='{active: mode, inactive: !mode}' ng-click='mode = true') Java
-                    .preview-content(ng-if='mode')
-                        ignite-ui-ace-java(data-master='backupItem' data-generator='clusterBinary' ng-model='$parent.data')
-                    .preview-content(ng-if='!mode')
-                        ignite-ui-ace-xml(data-master='backupItem' data-generator='clusterBinary' ng-model='$parent.data')
-                    .preview-content-empty(ng-if='!data')
-                        label All Defaults
+                    +checkbox('Compact footer', model + '.compactFooter', 'compactFooter', 'When enabled, Ignite will not write fields metadata when serializing objects(this will increase serialization performance), because internally #[b BinaryMarshaller] already distribute metadata inside cluster')
+            .col-sm-6
+                +preview-xml-java(model, 'clusterBinary')

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/communication.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/communication.jade b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/communication.jade
index 43c9ef3..d4c3b8c 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/communication.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/communication.jade
@@ -14,7 +14,10 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 
-- var model = 'backupItem.communication'
+include ../../../../../app/helpers/jade/mixins.jade
+
+- var model = 'backupItem'
+- var communication = model + '.communication'
 
 form.panel.panel-default(name='communication' novalidate)
     .panel-heading(bs-collapse-toggle ng-click='__show__ = true')
@@ -27,321 +30,60 @@ form.panel.panel-default(name='communication' novalidate)
         .panel-body(ng-if='__show__')
             .col-sm-6
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Timeout:
-                        ignite-form-field-tooltip
-                            | Maximum timeout in milliseconds for network requests
-                        ignite-form-field-input-number(
-                            data-id='commNetworkTimeout'
-                            data-name='commNetworkTimeout'
-                            data-ng-model='backupItem.networkTimeout'
-                            data-placeholder='5000'
-                            data-min='1'
-                        )
+                    +number('Timeout:', model + '.networkTimeout', 'commNetworkTimeout', 'true', '5000', '1', 'Maximum timeout in milliseconds for network requests')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Send retry delay:
-                        ignite-form-field-tooltip
-                            | Interval in milliseconds between message send retries
-                        ignite-form-field-input-number(
-                            data-id='networkSendRetryDelay'
-                            data-name='networkSendRetryDelay'
-                            data-ng-model='backupItem.networkSendRetryDelay'
-                            data-placeholder='1000'
-                            data-min='1'
-                        )
+                    +number('Send retry delay:', model + '.networkSendRetryDelay', 'networkSendRetryDelay', 'true', '1000', '1', 'Interval in milliseconds between message send retries')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Send retry count:
-                        ignite-form-field-tooltip
-                            | Message send retries count
-                        ignite-form-field-input-number(
-                            data-id='networkSendRetryCount'
-                            data-name='networkSendRetryCount'
-                            data-ng-model='backupItem.networkSendRetryCount'
-                            data-placeholder='3'
-                            data-min='1'
-                        )
+                    +number('Send retry count:', model + '.networkSendRetryCount', 'networkSendRetryCount', 'true', '3', '1', 'Message send retries count')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Discovery startup delay:
-                        ignite-form-field-tooltip
-                            | This value is used to expire messages from waiting list whenever node discovery discrepancies happen
-                        ignite-form-field-input-number(
-                            data-id='discoveryStartupDelay'
-                            data-name='discoveryStartupDelay'
-                            data-ng-model='backupItem.discoveryStartupDelay'
-                            data-placeholder='60000'
-                            data-min='1'
-                        )
+                    +number('Discovery startup delay:', model + '.discoveryStartupDelay', 'discoveryStartupDelay', 'true', '60000', '1', 'This value is used to expire messages from waiting list whenever node discovery discrepancies happen')
                 .settings-row
-                   ignite-form-field
-                        ignite-form-field-label
-                            | Communication listener:
-                        ignite-form-field-tooltip
-                            | Communication listener
-                        ignite-form-field-java-class(
-                            data-id='comListener'
-                            data-name='comListener'
-                            data-ng-model='#{model}.listener'
-                        )
+                    +java-class('Communication listener:', communication + '.listener', 'comListener', 'true', 'false', 'Communication listener')
                 .settings-row
-                   ignite-form-field
-                        ignite-form-field-label
-                            | Local IP address:
-                        ignite-form-field-tooltip
-                            | Local host address for socket binding
-                        ignite-form-field-input-text(
-                            data-id='comLocalAddress'
-                            data-name='comLocalAddress'
-                            data-ng-model='#{model}.localAddress'
-                            data-placeholder='228.1.2.4'
-                        )
+                    +text-ip-address('Local IP address:', communication + '.localAddress', 'comLocalAddress', 'true', '228.1.2.4', 'Local host address for socket binding')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Local port:
-                        ignite-form-field-tooltip
-                            | Local port for socket binding
-                        ignite-form-field-input-number(
-                            data-id='comLocalPort'
-                            data-name='comLocalPort'
-                            data-ng-model='#{model}.localPort'
-                            data-placeholder='47100'
-                            data-min='1024'
-                            data-max='65535'
-                        )
+                    +number-min-max('Local port:', communication + '.localPort', 'comLocalPort', 'true', '47100', '1024', '65535', 'Local port for socket binding')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Local port range:
-                        ignite-form-field-tooltip
-                            | Local port range for local host ports
-                        ignite-form-field-input-number(
-                            data-id='comLocalPortRange'
-                            data-name='comLocalPortRange'
-                            data-ng-model='#{model}.localPortRange'
-                            data-placeholder='100'
-                            data-min='1'
-                        )
+                    +number('Local port range:', communication + '.localPortRange', 'comLocalPortRange', 'true', '100', '1', 'Local port range for local host ports')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Shared memory port:
-                        ignite-form-field-tooltip
-                            | Local port to accept shared memory connections#[br]
-                            | If set to #[b -1] shared memory communication will be disabled
-                        ignite-form-field-input-number(
-                            data-id='sharedMemoryPort'
-                            data-name='sharedMemoryPort'
-                            data-ng-model='#{model}.sharedMemoryPort'
-                            data-placeholder='48100'
-                            data-min='-1'
-                            data-max='65535'
-                        )
+                    +number-min-max('Shared memory port:', communication + '.sharedMemoryPort', 'sharedMemoryPort', 'true', '48100', '-1', '65535',
+                        'Local port to accept shared memory connections<br/>\
+                        If set to #[b -1] shared memory communication will be disabled')
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='directBuffer'
-                            data-name='directBuffer'
-                            data-ng-model='#{model}.directBuffer'
-                        )
-                        | Direct buffer
-                        ignite-form-field-tooltip
-                            | If value is true, then SPI will use ByteBuffer.allocateDirect(int) call#[br]
-                            | Otherwise, SPI will use ByteBuffer.allocate(int) call.
+                    +checkbox('Direct buffer', communication + '.directBuffer', 'directBuffer',
+                        'If value is true, then SPI will use ByteBuffer.allocateDirect(int) call<br/>\
+                        Otherwise, SPI will use ByteBuffer.allocate(int) call.')
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='directSendBuffer'
-                            data-name='directSendBuffer'
-                            data-ng-model='#{model}.directSendBuffer'
-                        )
-                        | Direct send buffer
-                        ignite-form-field-tooltip
-                            | Flag defining whether direct send buffer should be used
+                    +checkbox('Direct send buffer', communication + '.directSendBuffer', 'directSendBuffer', 'Flag defining whether direct send buffer should be used')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Idle connection timeout:
-                        ignite-form-field-tooltip
-                            | Maximum idle connection timeout upon which a connection to client will be closed
-                        ignite-form-field-input-number(
-                            data-id='idleConnectionTimeout'
-                            data-name='idleConnectionTimeout'
-                            data-ng-model='#{model}.idleConnectionTimeout'
-                            data-placeholder='30000'
-                            data-min='1'
-                        )
+                    +number('Idle connection timeout:', communication + '.idleConnectionTimeout', 'idleConnectionTimeout', 'true', '30000', '1',
+                        'Maximum idle connection timeout upon which a connection to client will be closed')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Connect timeout:
-                        ignite-form-field-tooltip
-                            | Connect timeout used when establishing connection with remote nodes
-                        ignite-form-field-input-number(
-                            data-id='connectTimeout'
-                            data-name='connectTimeout'
-                            data-ng-model='#{model}.connectTimeout'
-                            data-placeholder='5000'
-                        )
+                    +number('Connect timeout:', communication + '.connectTimeout', 'connectTimeout', 'true', '5000', '0', 'Connect timeout used when establishing connection with remote nodes')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Maximum connect timeout:
-                        ignite-form-field-tooltip
-                            | Maximum connect timeout
-                        ignite-form-field-input-number(
-                            data-id='maxConnectTimeout'
-                            data-name='maxConnectTimeout'
-                            data-ng-model='#{model}.maxConnectTimeout'
-                            data-placeholder='600000'
-                        )
+                    +number('Maximum connect timeout:', communication + '.maxConnectTimeout', 'maxConnectTimeout', 'true', '600000', '0', 'Maximum connect timeout')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Reconnect count:
-                        ignite-form-field-tooltip
-                            | Maximum number of reconnect attempts used when establishing connection with remote nodes
-                        ignite-form-field-input-number(
-                            data-id='comReconnectCount'
-                            data-name='comReconnectCount'
-                            data-ng-model='#{model}.reconnectCount'
-                            data-placeholder='10'
-                            data-min='1'
-                        )
+                    +number('Reconnect count:', communication + '.reconnectCount', 'comReconnectCount', 'true', '10', '1',
+                        'Maximum number of reconnect attempts used when establishing connection with remote nodes')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Socket send buffer:
-                        ignite-form-field-tooltip
-                            | Send buffer size for sockets created or accepted by this SPI
-                        ignite-form-field-input-number(
-                            data-id='socketSendBuffer'
-                            data-name='socketSendBuffer'
-                            data-ng-model='#{model}.socketSendBuffer'
-                            data-placeholder='32768'
-                        )
+                    +number('Socket send buffer:', communication + '.socketSendBuffer', 'socketSendBuffer', 'true', '32768', '0', 'Send buffer size for sockets created or accepted by this SPI')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Socket receive buffer:
-                        ignite-form-field-tooltip
-                            | Receive buffer size for sockets created or accepted by this SPI
-                        ignite-form-field-input-number(
-                            data-id='socketReceiveBuffer'
-                            data-name='socketReceiveBuffer'
-                            data-ng-model='#{model}.socketReceiveBuffer'
-                            data-placeholder='32768'
-                        )
+                    +number('Socket receive buffer:', communication + '.socketReceiveBuffer', 'socketReceiveBuffer', 'true', '32768', '0', 'Receive buffer size for sockets created or accepted by this SPI')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Message queue limit:
-                        ignite-form-field-tooltip
-                            | Message queue limit for incoming and outgoing messages
-                        ignite-form-field-input-number(
-                            data-id='messageQueueLimit'
-                            data-name='messageQueueLimit'
-                            data-ng-model='#{model}.messageQueueLimit'
-                            data-placeholder='1024'
-                        )
+                    +number('Message queue limit:', communication + '.messageQueueLimit', 'messageQueueLimit', 'true', '1024', '0', 'Message queue limit for incoming and outgoing messages')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Slow client queue limit:
-                        ignite-form-field-tooltip
-                            | Slow client queue limit
-                        ignite-form-field-input-number(
-                            data-id='slowClientQueueLimit'
-                            data-name='slowClientQueueLimit'
-                            data-ng-model='#{model}.slowClientQueueLimit'
-                            data-placeholder='0'
-                        )
+                    +number('Slow client queue limit:', communication + '.slowClientQueueLimit', 'slowClientQueueLimit', 'true', '0', '0', 'Slow client queue limit')
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='tcpNoDelay'
-                            data-name='tcpNoDelay'
-                            data-ng-model='#{model}.tcpNoDelay'
-                        )
-                        | TCP_NODELAY option
-                        ignite-form-field-tooltip
-                            | Value for TCP_NODELAY socket option
+                    +checkbox('TCP_NODELAY option', communication + '.tcpNoDelay', 'tcpNoDelay', 'Value for TCP_NODELAY socket option')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Ack send threshold:
-                        ignite-form-field-tooltip
-                            | Number of received messages per connection to node after which acknowledgment message is sent
-                        ignite-form-field-input-number(
-                            data-id='ackSendThreshold'
-                            data-name='ackSendThreshold'
-                            data-ng-model='#{model}.ackSendThreshold'
-                            data-placeholder='16'
-                            data-min='1'
-                        )
+                    +number('Ack send threshold:', communication + '.ackSendThreshold', 'ackSendThreshold', 'true', '16', '1', 'Number of received messages per connection to node after which acknowledgment message is sent')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Unacknowledged messages:
-                        ignite-form-field-tooltip
-                            | Maximum number of stored unacknowledged messages per connection to node
-                        ignite-form-field-input-number(
-                            data-id='unacknowledgedMessagesBufferSize'
-                            data-name='unacknowledgedMessagesBufferSize'
-                            data-ng-model='#{model}.unacknowledgedMessagesBufferSize'
-                            data-placeholder='0'
-                        )
+                    +number('Unacknowledged messages:', communication + '.unacknowledgedMessagesBufferSize', 'unacknowledgedMessagesBufferSize', 'true', '0', '0', 'Maximum number of stored unacknowledged messages per connection to node')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Socket write timeout:
-                        ignite-form-field-tooltip
-                            | Socket write timeout
-                        ignite-form-field-input-number(
-                            data-id='socketWriteTimeout'
-                            data-name='socketWriteTimeout'
-                            data-ng-model='#{model}.socketWriteTimeout'
-                            data-placeholder='2000'
-                        )
+                    +number('Socket write timeout:', communication + '.socketWriteTimeout', 'socketWriteTimeout', 'true', '2000', '0', 'Socket write timeout')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Selectors count:
-                        ignite-form-field-tooltip
-                            | Count of selectors te be used in TCP server
-                        ignite-form-field-input-number(
-                            data-id='selectorsCount'
-                            data-name='selectorsCount'
-                            data-ng-model='#{model}.selectorsCount'
-                            data-placeholder='min(4, availableProcessors)'
-                            data-min='1'
-                        )
+                    +number('Selectors count:', communication + '.selectorsCount', 'selectorsCount', 'true', 'min(4, availableProcessors)', '1', 'Count of selectors te be used in TCP server')
                 .settings-row
-                   ignite-form-field
-                        ignite-form-field-label
-                            | Address resolver:
-                        ignite-form-field-tooltip
-                            | Address resolver
-                        ignite-form-field-java-class(
-                            data-id='comAddressResolver'
-                            data-name='comAddressResolver'
-                            data-ng-model='#{model}.addressResolver'
-                        )
-            ignite-ui-ace-tabs.col-sm-6
-                .preview-panel(ng-init='mode = false')
-                    .preview-legend
-                        a(ng-class='{active: !mode, inactive: mode}' ng-click='mode = false') XML
-                        | &nbsp;
-                        a(ng-class='{active: mode, inactive: !mode}' ng-click='mode = true') Java
-                    .preview-content(ng-if='mode')
-                        ignite-ui-ace-java(data-master='backupItem' data-generator='clusterCommunication' ng-model='$parent.data')
-                    .preview-content(ng-if='!mode')
-                        ignite-ui-ace-xml(data-master='backupItem' data-generator='clusterCommunication' ng-model='$parent.data')
-                    .preview-content-empty(ng-if='!data')
-                        label All Defaults
+                    +java-class('Address resolver:', communication + '.addressResolver', 'comAddressResolver', 'true', 'false', 'Address resolver')
+            .col-sm-6
+                +preview-xml-java(model, 'clusterCommunication')

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/connector.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/connector.jade b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/connector.jade
index fe965a0..a1f6684 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/connector.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/connector.jade
@@ -14,7 +14,11 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 
+include ../../../../../app/helpers/jade/mixins.jade
+
 - var model = 'backupItem.connector'
+- var enabled = model + '.enabled'
+- var sslEnabled = enabled + ' && ' + model + '.sslEnabled'
 
 form.panel.panel-default(name='connector' novalidate)
     .panel-heading(bs-collapse-toggle ng-click='__show__ = true')
@@ -27,282 +31,72 @@ form.panel.panel-default(name='connector' novalidate)
         .panel-body(ng-if='__show__')
             .col-sm-6
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='restEnabled'
-                            data-name='restEnabled'
-                            data-ng-model='#{model}.enabled'
-                        )
-                        | Enabled
-                        ignite-form-field-tooltip
-                            | Flag indicating whether to configure connector configuration
+                    +checkbox('Enabled', enabled, 'restEnabled', 'Flag indicating whether to configure connector configuration')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Jetty configuration path:
-                        ignite-form-field-tooltip
-                            | Path, either absolute or relative to IGNITE_HOME, to Jetty XML configuration file#[br]
-                            | Jetty is used to support REST over HTTP protocol for accessing Ignite APIs remotely#[br]
-                            | If not provided, Jetty instance with default configuration will be started picking IgniteSystemProperties.IGNITE_JETTY_HOST and IgniteSystemProperties.IGNITE_JETTY_PORT as host and port respectively
-                        ignite-form-field-input-text(
-                            data-id='connectorJettyPath'
-                            data-name='connectorJettyPath'
-                            data-ng-model='#{model}.jettyPath'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
+                    +text-enabled('Jetty configuration path:', model + '.jettyPath', 'connectorJettyPath', enabled, 'false', 'Input path to Jetty configuration',
+                        'Path, either absolute or relative to IGNITE_HOME, to Jetty XML configuration file<br/>\
+                        Jetty is used to support REST over HTTP protocol for accessing Ignite APIs remotely<br/>\
+                        If not provided, Jetty instance with default configuration will be started picking IgniteSystemProperties.IGNITE_JETTY_HOST and IgniteSystemProperties.IGNITE_JETTY_PORT as host and port respectively')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | TCP host:
-                        ignite-form-field-tooltip
-                            | Host for TCP binary protocol server#[br]
-                            | This can be either an IP address or a domain name#[br]
-                            | If not defined, system-wide local address will be used IgniteConfiguration#getLocalHost()#[br]
-                            | You can also use '0.0.0.0' value to bind to all locally-available IP addresses
-                        ignite-form-field-input-text(
-                            data-id='connectorHost'
-                            data-name='connectorHost'
-                            data-ng-model='#{model}.host'
-                            data-ng-disabled='!#{model}.enabled'
-                            data-placeholder='IgniteConfiguration#getLocalHost()'
-                        )
+                    +text-ip-address('TCP host:', model + '.host', 'connectorHost', enabled, 'IgniteConfiguration#getLocalHost()',
+                        'Host for TCP binary protocol server<br/>\
+                        This can be either an IP address or a domain name<br/>\
+                        If not defined, system - wide local address will be used IgniteConfiguration#getLocalHost()<br/>\
+                        You can also use "0.0.0.0" value to bind to all locally - available IP addresses')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | TCP port:
-                        ignite-form-field-tooltip
-                            | Port for TCP binary protocol server
-                        ignite-form-field-input-number(
-                            data-id='connectorPort'
-                            data-name='connectorPort'
-                            data-ng-model='#{model}.port'
-                            data-ng-disabled='!#{model}.enabled'
-                            data-placeholder='11211'
-                            data-min='1024'
-                            data-max='65535'
-                        )
+                    +number-min-max('TCP port:', model + '.port', 'connectorPort', enabled, '11211', '1024', '65535', 'Port for TCP binary protocol server')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | TCP port range:
-                        ignite-form-field-tooltip
-                            | Number of ports for TCP binary protocol server to try if configured port is already in use
-                        ignite-form-field-input-number(
-                            data-id='connectorPortRange'
-                            data-name='connectorPortRange'
-                            data-ng-model='#{model}.portRange'
-                            data-placeholder='100'
-                            data-ng-disabled='!#{model}.enabled'
-                            data-min='1'
-                        )
+                    +number('TCP port range:', model + '.portRange', 'connectorPortRange', enabled, '100', '1', 'Number of ports for TCP binary protocol server to try if configured port is already in use')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Idle query cursor timeout:
-                        ignite-form-field-tooltip
-                            | Reject open query cursors that is not used timeout#[br]
-                            | If no fetch query request come within idle timeout, it will be removed on next check for old query cursors
-                        ignite-form-field-input-number(
-                        data-id='connectorIdleQueryCursorTimeout'
-                        data-name='connectorIdleQueryCursorTimeout'
-                        data-ng-model='#{model}.idleQueryCursorTimeout'
-                        data-placeholder='600000'
-                        data-ng-disabled='!#{model}.enabled'
-                        )
+                    +number('Idle query cursor timeout:', model + '.idleQueryCursorTimeout', 'connectorIdleQueryCursorTimeout', enabled, '600000', '0',
+                        'Reject open query cursors that is not used timeout<br/>\
+                        If no fetch query request come within idle timeout, it will be removed on next check for old query cursors')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Idle query cursor check frequency:
-                        ignite-form-field-tooltip
-                            | Idle query cursors check frequency#[br]
-                            | This setting is used to reject open query cursors that is not used
-                        ignite-form-field-input-number(
-                        data-id='connectorIdleQueryCursorCheckFrequency'
-                        data-name='connectorIdleQueryCursorCheckFrequency'
-                        data-ng-model='#{model}.idleQueryCursorCheckFrequency'
-                        data-placeholder='60000'
-                        data-ng-disabled='!#{model}.enabled'
-                        )
+                    +number('Idle query cursor check frequency:', model + '.idleQueryCursorCheckFrequency', 'connectorIdleQueryCursorCheckFrequency', enabled, '60000', '0',
+                        'Idle query cursors check frequency<br/>\
+                        This setting is used to reject open query cursors that is not used')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Idle timeout:
-                        ignite-form-field-tooltip
-                            | Idle timeout for REST server#[br]
-                            | This setting is used to reject half-opened sockets#[br]
-                            | If no packets come within idle timeout, the connection is closed
-                        ignite-form-field-input-number(
-                            data-id='connectorIdleTimeout'
-                            data-name='connectorIdleTimeout'
-                            data-ng-model='#{model}.idleTimeout'
-                            data-placeholder='7000'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
+                    +number('Idle timeout:', model + '.idleTimeout', 'connectorIdleTimeout', enabled, '7000', '0',
+                        'Idle timeout for REST server<br/>\
+                        This setting is used to reject half - opened sockets<br/>\
+                        If no packets come within idle timeout, the connection is closed')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Receive buffer size:
-                        ignite-form-field-tooltip
-                            | REST TCP server receive buffer size
-                        ignite-form-field-input-number(
-                            data-id='connectorReceiveBufferSize'
-                            data-name='connectorReceiveBufferSize'
-                            data-ng-model='#{model}.receiveBufferSize'
-                            data-placeholder='32768'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
+                    +number('Receive buffer size:', model + '.receiveBufferSize', 'connectorReceiveBufferSize', enabled, '32768', '0', 'REST TCP server receive buffer size')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Send buffer size:
-                        ignite-form-field-tooltip
-                            | REST TCP server send buffer size
-                        ignite-form-field-input-number(
-                            data-id='connectorSendBufferSize'
-                            data-name='connectorSendBufferSize'
-                            data-ng-model='#{model}.sendBufferSize'
-                            data-placeholder='32768'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
+                    +number('Send buffer size:', model + '.sendBufferSize', 'connectorSendBufferSize', enabled, '32768', '0', 'REST TCP server send buffer size')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Send queue limit:
-                        ignite-form-field-tooltip
-                            | REST TCP server send queue limit#[br]
-                            | If the limit exceeds, all successive writes will block until the queue has enough capacity
-                        ignite-form-field-input-number(
-                            data-id='connectorSendQueueLimit'
-                            data-name='connectorSendQueueLimit'
-                            data-ng-model='#{model}.sendQueueLimit'
-                            data-placeholder='unlimited'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
+                    +number('Send queue limit:', model + '.sendQueueLimit', 'connectorSendQueueLimit', enabled, 'unlimited', '0',
+                        'REST TCP server send queue limit<br/>\
+                        If the limit exceeds, all successive writes will block until the queue has enough capacity')
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='connectorDirectBuffer'
-                            data-name='connectorDirectBuffer'
-                            data-ng-model='#{model}.directBuffer'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
-                        | Direct buffer
-                        ignite-form-field-tooltip
-                            | Flag indicating whether REST TCP server should use direct buffers#[br]
-                            | A direct buffer is a buffer that is allocated and accessed using native system calls, without using JVM heap#[br]
-                            | Enabling direct buffer may improve performance and avoid memory issues (long GC pauses due to huge buffer size)
+                    +checkbox-enabled('Direct buffer', model + '.directBuffer', 'connectorDirectBuffer', enabled,
+                        'Flag indicating whether REST TCP server should use direct buffers<br/>\
+                        A direct buffer is a buffer that is allocated and accessed using native system calls, without using JVM heap<br/>\
+                        Enabling direct buffer may improve performance and avoid memory issues(long GC pauses due to huge buffer size)')
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='connectorNoDelay'
-                            data-name='connectorNoDelay'
-                            data-ng-model='#{model}.noDelay'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
-                        | TCP_NODELAY option
-                        ignite-form-field-tooltip
-                            | Flag indicating whether TCP_NODELAY option should be set for accepted client connections#[br]
-                            | Setting this option reduces network latency and should be enabled in majority of cases#[br]
-                            | For more information, see Socket#setTcpNoDelay(boolean)
+                    +checkbox-enabled('TCP_NODELAY option', model + '.noDelay', 'connectorNoDelay', enabled,
+                        'Flag indicating whether TCP_NODELAY option should be set for accepted client connections<br/>\
+                        Setting this option reduces network latency and should be enabled in majority of cases<br/>\
+                        For more information, see Socket#setTcpNoDelay(boolean)')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Selector count:
-                        ignite-form-field-tooltip
-                            | Number of selector threads in REST TCP server#[br]
-                            | Higher value for this parameter may increase throughput, but also increases context switching
-                        ignite-form-field-input-number(
-                            data-id='connectorSelectorCount'
-                            data-name='connectorSelectorCount'
-                            data-ng-model='#{model}.selectorCount'
-                            data-placeholder='min(4, availableProcessors)'
-                            data-ng-disabled='!#{model}.enabled'
-                            data-min='1'
-                        )
+                    +number('Selector count:', model + '.selectorCount', 'connectorSelectorCount', enabled, 'min(4, availableProcessors)', '1',
+                        'Number of selector threads in REST TCP server<br/>\
+                        Higher value for this parameter may increase throughput, but also increases context switching')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Thread pool size:
-                        ignite-form-field-tooltip
-                            | Thread pool size to use for processing of client messages (REST requests)
-                        ignite-form-field-input-number(
-                            data-id='connectorThreadPoolSize'
-                            data-name='connectorThreadPoolSize'
-                            data-ng-model='#{model}.threadPoolSize'
-                            data-placeholder='max(8, availableProcessors) * 2'
-                            data-ng-disabled='!#{model}.enabled'
-                            data-min='1'
-                        )
+                    +number('Thread pool size:', model + '.threadPoolSize', 'connectorThreadPoolSize', enabled, 'max(8, availableProcessors) * 2', '1',
+                        'Thread pool size to use for processing of client messages (REST requests)')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Message interceptor:
-                        ignite-form-field-tooltip
-                            | Interceptor allows to transform all objects exchanged via REST protocol#[br]
-                            | For example if you use custom serialisation on client you can write interceptor to transform binary representations received from client to Java objects and later access them from java code directly
-                        ignite-form-field-java-class(
-                            data-id='connectorMessageInterceptor'
-                            data-name='connectorMessageInterceptor'
-                            data-ng-model='#{model}.messageInterceptor'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
+                    +java-class('Message interceptor:', model + '.messageInterceptor', 'connectorMessageInterceptor', enabled, 'false',
+                        'Interceptor allows to transform all objects exchanged via REST protocol<br/>\
+                        For example if you use custom serialisation on client you can write interceptor to transform binary representations received from client to Java objects and later access them from java code directly')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Secret key:
-                        ignite-form-field-tooltip
-                            | Secret key to authenticate REST requests
-                        ignite-form-field-input-text(
-                            data-id='connectorSecretKey'
-                            data-name='connectorSecretKey'
-                            data-ng-model='#{model}.secretKey'
-                            data-ng-disabled='!#{model}.enabled'
-                            data-placeholder='Specify to enable authentication'
-                        )
+                    +text-enabled('Secret key:', model + '.secretKey', 'connectorSecretKey', enabled, 'false', 'Specify to enable authentication', 'Secret key to authenticate REST requests')
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='connectorSslEnabled'
-                            data-name='connectorSslEnabled'
-                            data-ng-model='#{model}.sslEnabled'
-                            data-ng-disabled='!#{model}.enabled'
-                        )
-                        | Enable SSL
-                        ignite-form-field-tooltip
-                            | Enables/disables SSL for REST TCP binary protocol
+                    +checkbox-enabled('Enable SSL', model + '.sslEnabled', 'connectorSslEnabled', enabled, 'Enables/disables SSL for REST TCP binary protocol')
                 .settings-row
-                    ignite-form-field.checkbox
-                        ignite-form-field-input-checkbox(
-                            data-id='connectorSslClientAuth'
-                            data-name='connectorSslClientAuth'
-                            data-ng-model='#{model}.sslClientAuth'
-                            data-ng-disabled='!#{model}.enabled || !#{model}.sslEnabled'
-                        )
-                        | Enable SSL client auth
-                        ignite-form-field-tooltip
-                            | Flag indicating whether or not SSL client authentication is required
+                    +checkbox-enabled('Enable SSL client auth', model + '.sslClientAuth', 'connectorSslClientAuth', sslEnabled, 'Flag indicating whether or not SSL client authentication is required')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | SSL factory:
-                        ignite-form-field-tooltip
-                            | Instance of Factory that will be used to create an instance of SSLContext for Secure Socket Layer on TCP binary protocol
-                        ignite-form-field-java-class(
-                            data-id='connectorSslFactory'
-                            data-name='connectorSslFactory'
-                            data-ng-model='#{model}.sslFactory'
-                            data-ng-required='#{model}.sslEnabled'
-                            data-ng-disabled='!#{model}.enabled || !#{model}.sslEnabled'
-                        )
-            ignite-ui-ace-tabs.col-sm-6
-                .preview-panel(ng-init='mode = false')
-                    .preview-legend
-                        a(ng-class='{active: !mode, inactive: mode}' ng-click='mode = false') XML
-                        | &nbsp;
-                        a(ng-class='{active: mode, inactive: !mode}' ng-click='mode = true') Java
-                    .preview-content(ng-if='mode')
-                        ignite-ui-ace-java(data-master='backupItem' data-generator='clusterConnector' ng-model='$parent.data')
-                    .preview-content(ng-if='!mode')
-                        ignite-ui-ace-xml(data-master='backupItem' data-generator='clusterConnector' ng-model='$parent.data')
-                    .preview-content-empty(ng-if='!data')
-                        label All Defaults
+                    +java-class('SSL factory:', model + '.sslFactory', 'connectorSslFactory', sslEnabled, sslEnabled,
+                        'Instance of Factory that will be used to create an instance of SSLContext for Secure Socket Layer on TCP binary protocol')
+            .col-sm-6
+                +preview-xml-java(model, 'clusterConnector')


Mime
View raw message