Repository: incubator-ignite Updated Branches: refs/heads/ignite-843 5690a1fed -> 2af72547b
# ignite-850 WIP Discovery details. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/507ad484 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/507ad484 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/507ad484 Branch: refs/heads/ignite-843 Commit: 507ad4844431b5474b3b04645458b6c382e68da3 Parents: 7a9e3bf Author: Andrey <anovi...@gridgain.com> Authored: Tue Jun 9 18:08:17 2015 +0700 Committer: Andrey <anovi...@gridgain.com> Committed: Tue Jun 9 18:08:17 2015 +0700 ---------------------------------------------------------------------- .../nodejs/public/form-models/clusters.json | 22 +++++++++-------- .../public/javascripts/controllers/caches.js | 25 +++++++++++--------- .../public/javascripts/controllers/clusters.js | 9 +++---- modules/webconfig/nodejs/views/caches.jade | 4 ++-- .../nodejs/views/includes/controls.jade | 9 ++++--- 5 files changed, 37 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/507ad484/modules/webconfig/nodejs/public/form-models/clusters.json ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/public/form-models/clusters.json b/modules/webconfig/nodejs/public/form-models/clusters.json index e87b7fa..270e332 100644 --- a/modules/webconfig/nodejs/public/form-models/clusters.json +++ b/modules/webconfig/nodejs/public/form-models/clusters.json @@ -156,7 +156,7 @@ { "label": "Account id", "type": "text", - "model": "addrReqAttempts", + "model": "accountId", "placeholder": "", "tip": [ "Service account ID (typically an e-mail address)." @@ -187,11 +187,12 @@ "advanced": [ { "label": "Atomic data structures", + "model": "atomicConfiguration", "fields": [ { "label": "Backups", "type": "text", - "model": "atomicConfiguration.backups", + "model": "backups", "placeholder": "0", "tip": [ "Number of backup nodes" @@ -200,14 +201,14 @@ { "label": "Cache mode", "type": "dropdown", - "model": "atomicConfiguration.cacheMode", + "model": "cacheMode", "placeholder": "PARTITIONED", "items": "cacheModes" }, { "label": "Sequence reserve", "type": "text", - "model": "atomicConfiguration.atomicSequenceReserveSize", + "model": "atomicSequenceReserveSize", "placeholder": "1,000", "tip": [ "Default number of sequence values reserved for IgniteAtomicSequence instances.", @@ -559,11 +560,12 @@ }, { "label": "Transactions", + "model": "transactionConfiguration", "fields": [ { "label": "Cache concurrency", "type": "text", - "model": "transactionConfiguration.defaultTxConcurrency", + "model": "defaultTxConcurrency", "placeholder": "PESSIMISTIC", "items": "transactionConcurrency", "tip": [ @@ -573,7 +575,7 @@ { "label": "Isolation", "type": "text", - "model": "transactionConfiguration.transactionIsolation", + "model": "transactionIsolation", "placeholder": "REPEATABLE_READ", "items": "transactionIsolation", "tip": [ @@ -583,7 +585,7 @@ { "label": "Default timeout", "type": "text", - "model": "transactionConfiguration.defaultTxTimeout", + "model": "defaultTxTimeout", "placeholder": "0", "tip": [ "Default transaction timeout." @@ -592,7 +594,7 @@ { "label": "Pessimistic log cleanup delay", "type": "text", - "model": "transactionConfiguration.pessimisticTxLogLinger", + "model": "pessimisticTxLogLinger", "placeholder": "10,000", "tip": [ "Cache transaction concurrency to use when one is not explicitly specified." @@ -601,7 +603,7 @@ { "label": "Pessimistic log size", "type": "text", - "model": "transactionConfiguration.pessimisticTxLogSize", + "model": "pessimisticTxLogSize", "placeholder": "0", "tip": [ "Cache transaction concurrency to use when one is not explicitly specified." @@ -610,7 +612,7 @@ { "label": "Enable serializable cache transactions", "type": "check", - "model": "transactionConfiguration.txSerializableEnabled", + "model": "txSerializableEnabled", "tip": [ "Flag to enable/disable isolation level for cache transactions.", "Serializable level does carry certain overhead and if not used, should be disabled." http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/507ad484/modules/webconfig/nodejs/public/javascripts/controllers/caches.js ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/public/javascripts/controllers/caches.js b/modules/webconfig/nodejs/public/javascripts/controllers/caches.js index 2a10c6d..a7d09b6 100644 --- a/modules/webconfig/nodejs/public/javascripts/controllers/caches.js +++ b/modules/webconfig/nodejs/public/javascripts/controllers/caches.js @@ -102,19 +102,20 @@ configuratorModule.controller('cachesController', ['$scope', '$modal', '$http', }); }; - $scope.removeItem = function(item) { - $http.post('/rest/caches/remove', {_id: item._id}) - .success(function() { - var index = $scope.caches.indexOf(item); + $scope.removeItem = function() { + var _id = $scope.selectedItem._id; - if (index !== -1) { - $scope.caches.splice(index, 1); + $http.post('/rest/caches/remove', {_id: _id}) + .success(function() { + var i = _.findIndex($scope.caches, function(cache) { + return cache._id == _id; + }); - if ($scope.selectedItem == item) { - $scope.selectedItem = undefined; + if (i >= 0) { + $scope.caches.splice(i, 1); - $scope.backupItem = undefined; - } + $scope.selectedItem = undefined; + $scope.backupItem = undefined; } }) .error(function(errorMessage) { @@ -123,7 +124,9 @@ configuratorModule.controller('cachesController', ['$scope', '$modal', '$http', }; // Save cache in db. - $scope.saveItem = function(item) { + $scope.saveItem = function() { + var item = $scope.backupItem; + $http.post('/rest/caches/save', item) .success(function() { var i = _.findIndex($scope.caches, function(cache) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/507ad484/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js b/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js index 390c38a..ec9105b 100644 --- a/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js +++ b/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js @@ -128,7 +128,7 @@ configuratorModule.controller('clustersController', ['$scope', '$modal', '$http' }; $scope.removeItem = function() { - var _id = $scope.selectedItem; + var _id = $scope.selectedItem._id; $http.post('/rest/clusters/remove', {_id: _id}) .success(function() { @@ -139,11 +139,8 @@ configuratorModule.controller('clustersController', ['$scope', '$modal', '$http' if (i >= 0) { $scope.clusters.splice(i, 1); - if ($scope.selectedItem == item) { - $scope.selectedItem = undefined; - - $scope.backupItem = undefined; - } + $scope.selectedItem = undefined; + $scope.backupItem = undefined; } }) .error(function(errorMessage) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/507ad484/modules/webconfig/nodejs/views/caches.jade ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/views/caches.jade b/modules/webconfig/nodejs/views/caches.jade index 23b0fd4..e42c026 100644 --- a/modules/webconfig/nodejs/views/caches.jade +++ b/modules/webconfig/nodejs/views/caches.jade @@ -54,5 +54,5 @@ block content span(bs-collapse-toggle) a(ng-click='expanded = true' ng-hide='expanded') Show advanced settings... a(ng-click='expanded = false' ng-show='expanded') Hide advanced settings... - button.btn.btn-primary(ng-click='saveItem(backupItem)' ng-disabled='editForm.$invalid') Save - button.btn.btn-primary(ng-click='removeItem(selectedItem)' ng-disabled='editForm.$invalid') Remove + button.btn.btn-primary(ng-click='saveItem()' ng-disabled='editForm.$invalid') Save + button.btn.btn-primary(ng-click='removeItem()' ng-disabled='editForm.$invalid') Remove http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/507ad484/modules/webconfig/nodejs/views/includes/controls.jade ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/views/includes/controls.jade b/modules/webconfig/nodejs/views/includes/controls.jade index b1b74cd..883aaf1 100644 --- a/modules/webconfig/nodejs/views/includes/controls.jade +++ b/modules/webconfig/nodejs/views/includes/controls.jade @@ -70,18 +70,21 @@ mixin form-row div(ng-switch='field.type') div(ng-switch-when='check') - input(type='checkbox' ng-model='backupItem[field.model]') + input(type='checkbox' ng-if='!group.model' ng-model='backupItem[field.model]') + input(type='checkbox' ng-if='group.model' ng-model='backupItem[group.model][field.model]') label(ng-click='backupItem[field.model] = !backupItem[field.model]') {{field.label}} +tip div(ng-switch-when='text') +lbl .col-sm-4 - input.form-control(type='text' ng-model='backupItem[field.model]' placeholder='{{field.placeholder}}') + input.form-control(type='text' ng-if='!group.model' ng-model='backupItem[field.model]' placeholder='{{field.placeholder}}') + input.form-control(type='text' ng-if='group.model' ng-model='backupItem[group.model][field.model]' placeholder='{{field.placeholder}}') +tip div(ng-switch-when='dropdown') +lbl .col-sm-4 - button.form-control(bs-select ng-model='backupItem[field.model]' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}') + button.form-control(bs-select ng-if='!group.model' ng-model='backupItem[field.model]' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}') + button.form-control(bs-select ng-if='group.model' ng-model='backupItem[group.model][field.model]' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}') +tip div(ng-switch-when='dropdown-multiple') +lbl