ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: IGNITE-843 Added groups tips. Removed counter from tables. Fixed indexed types add logic: do not allow empty input.
Date Mon, 06 Jul 2015 08:59:01 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 0e71a87ef -> 6f3ffa90f


IGNITE-843 Added groups tips. Removed counter from tables. Fixed indexed types add logic:
do not allow empty input.


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

Branch: refs/heads/ignite-843
Commit: 6f3ffa90fbc49bcecf632c2a7caffb8c2609b45d
Parents: 0e71a87
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Mon Jul 6 15:59:00 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Mon Jul 6 15:59:00 2015 +0700

----------------------------------------------------------------------
 .../nodejs/public/form-models/caches.json       | 17 +++++-
 .../public/javascripts/controllers/caches.js    | 57 +++++++++-----------
 .../nodejs/views/includes/controls.jade         |  8 +--
 3 files changed, 45 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6f3ffa90/modules/web-control-center/nodejs/public/form-models/caches.json
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/public/form-models/caches.json b/modules/web-control-center/nodejs/public/form-models/caches.json
index f401006..61b2c08 100644
--- a/modules/web-control-center/nodejs/public/form-models/caches.json
+++ b/modules/web-control-center/nodejs/public/form-models/caches.json
@@ -58,6 +58,7 @@
   "advanced": [
     {
       "label": "Async back pressure control",
+      "tip": ["Cache async back pressure settings."],
       "fields": [
         {
           "label": "Max async concurrency",
@@ -259,10 +260,20 @@
     {
       "label": "Near cache",
       "tip": [
-        "Near cache settings."
+        "Near cache settings.",
+        "Near cache is a small local cache that stores most recently or most frequently accessed
data.",
+        "Should be used in case when it is impossible to send computations to remote nodes."
       ],
       "fields": [
         {
+          "label": "Enabled",
+          "type": "check",
+          "model": "nearCacheEnabled",
+          "tip": [
+            "Flag indicating whether to configure near cache."
+          ]
+        },
+        {
           "label": "Start size",
           "type": "number",
           "path": "nearConfiguration",
@@ -532,6 +543,7 @@
     },
     {
       "label": "Statistics",
+      "tip": ["Cache statistics and management settings."],
       "fields": [
         {
           "label": "Statistics enabled",
@@ -768,7 +780,8 @@
     {
       "label": "Write behind",
       "tip": [
-        "Cache write behind settings."
+        "Cache write behind settings.",
+        "Write-behind is a special mode when updates to cache accumulated and then asynchronously
flushed to persistent store as a bulk operation."
       ],
       "fields": [
         {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6f3ffa90/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js b/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
index e69d54a..bc89494 100644
--- a/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
+++ b/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
@@ -197,7 +197,26 @@ configuratorModule.controller('cachesController', ['$scope', '$alert',
'$http',
                 });
         };
 
+        $scope.checkIndexedTypes = function (keyCls, valCls) {
+            if (!keyCls) {
+                $alert({title: 'Key class name should be non empty!'});
+
+                return false;
+            }
+
+            if (!valCls) {
+                $alert({title: 'Value class name should be non empty!'});
+
+                return false;
+            }
+
+            return true;
+        };
+
         $scope.addIndexedTypes = function (keyCls, valCls) {
+            if (!$scope.checkIndexedTypes(keyCls, valCls))
+                return;
+
             var idxTypes = $scope.backupItem.indexedTypes;
 
             var newItem = {keyClass: keyCls, valueClass: valCls};
@@ -208,40 +227,16 @@ configuratorModule.controller('cachesController', ['$scope', '$alert',
'$http',
                 $scope.backupItem.indexedTypes = [newItem];
         };
 
-        $scope.editIndexedTypes = function (idx) {
-            $scope.indexedTypeIdx = idx;
+        $scope.saveIndexedType = function (idx, keyCls, valCls) {
+            if (!$scope.checkIndexedTypes(keyCls, valCls))
+                return idx;
 
-            if (idx < 0) {
-                $scope.currKeyCls = '';
-                $scope.currValCls = '';
-            }
-            else {
-                var idxType = $scope.backupItem.indexedTypes[idx];
-
-                $scope.currKeyCls = idxType.keyClass;
-                $scope.currValCls = idxType.valueClass;
-            }
-        };
-
-        $scope.saveIndexedType = function (k, v) {
-            var idxTypes = $scope.backupItem.indexedTypes;
-
-            var idx = $scope.indexedTypeIdx;
+            var idxType = $scope.backupItem.indexedTypes[idx];
 
-            if (idx < 0) {
-                var newItem = {keyClass: k, valueClass: v};
+            idxType.keyClass = keyCls;
+            idxType.valueClass = valCls;
 
-                if (idxTypes)
-                    idxTypes.push(newItem);
-                else
-                    $scope.backupItem.indexedTypes = [newItem];
-            }
-            else {
-                var idxType = idxTypes[idx];
-
-                idxType.keyClass = k;
-                idxType.valueClass = v;
-            }
+            return -1;
         };
     }]
 );
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6f3ffa90/modules/web-control-center/nodejs/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/views/includes/controls.jade b/modules/web-control-center/nodejs/views/includes/controls.jade
index 028b187..b37bdc0 100644
--- a/modules/web-control-center/nodejs/views/includes/controls.jade
+++ b/modules/web-control-center/nodejs/views/includes/controls.jade
@@ -144,7 +144,7 @@ mixin form-row
                     +details-row
         div(ng-switch-when='table-simple')&attributes(fieldCommon)
             div
-                label {{field.tableLabel}}: {{#{fieldMdl}.length}}
+                label {{field.tableLabel}}
                 +tipLabel('field.tip')
             table.links-edit.col-sm-12(st-table='#{fieldMdl}' ng-show='#{fieldMdl}.length
> 0')
                 tbody
@@ -169,7 +169,7 @@ mixin form-row
         div(ng-switch-when='indexedTypes')
             - var tblMdl = 'backupItem.indexedTypes'
             div
-                label Indexed types: {{#{tblMdl}.length}}
+                label Indexed types
                 +tipLabel('field.tip')
             table.links-edit.col-sm-12(st-table=tblMdl ng-show='#{tblMdl}.length > 0')
                 tbody
@@ -180,7 +180,7 @@ mixin form-row
                                 i.tipField.fa.fa-remove(ng-click='field.editIdx = -1; #{tblMdl}.splice($index,
1)')
                             div(ng-show='field.editIdx == {{$index}}')
                                 label.labelField {{$index + 1}})
-                                i.tipField.fa.fa-floppy-o(ng-click='field.editIdx = -1; #{tblMdl}[$index]={keyClass:
curKeyClass, valueClass: curValueClass}')
+                                i.tipField.fa.fa-floppy-o(ng-click='field.editIdx = saveIndexedType($index,
curKeyClass, curValueClass)')
                                 .input-tip
                                     .col-sm-12
                                         input.form-control.table-form-control(type='text'
ng-model='curKeyClass' placeholder='Key class full name')
@@ -190,4 +190,4 @@ mixin form-row
                 input.form-control(type='text' ng-model='newKeyClass' ng-focus='field.editIdx
= -1' placeholder='Key class full name')
                 .settings-row
                     input.form-control(type='text' ng-model='newValueClass' ng-focus='field.editIdx
= -1' placeholder='Value class full name')
-                button.btn.btn-primary.fieldButton(ng-click='field.editIdx = -1; addIndexedTypes(newKeyClass,
newValueClass)') Add
+                button.btn.btn-primary.fieldButton(ng-disabled='!newKeyClass || !newValueClass'
ng-click='field.editIdx = -1; addIndexedTypes(newKeyClass, newValueClass)') Add


Mime
View raw message