You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/07/15 21:16:52 UTC
[04/45] incubator-ignite git commit: IGNITE-843 WIP on offheap checks.
IGNITE-843 WIP on offheap checks.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bd49a5e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bd49a5e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bd49a5e1
Branch: refs/heads/ignite-1121
Commit: bd49a5e144dd11f667bbe98f0de76ab88080e1d0
Parents: f0701d3
Author: AKuznetsov <ak...@gridgain.com>
Authored: Mon Jul 13 16:47:47 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Mon Jul 13 16:47:47 2015 +0700
----------------------------------------------------------------------
.../nodejs/controllers/caches-controller.js | 22 ++++++++++++++++----
.../nodejs/views/includes/controls.jade | 13 ++++++------
2 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd49a5e1/modules/web-control-center/nodejs/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/controllers/caches-controller.js b/modules/web-control-center/nodejs/controllers/caches-controller.js
index d76e80f..29564c7 100644
--- a/modules/web-control-center/nodejs/controllers/caches-controller.js
+++ b/modules/web-control-center/nodejs/controllers/caches-controller.js
@@ -87,11 +87,25 @@ controlCenterModule.controller('cachesController', ['$scope', '$http', 'commonFu
$scope.caches = [];
$scope.required = function (field) {
- if (field.label == 'Eviction policy') {
- var backupItem = $scope.backupItem;
+ var model = commonFunctions.isDefined(field.path) ? field.path + '.' + field.model : field.model;
- return backupItem.swapEnabled ||
- (commonFunctions.isDefined(backupItem.offHeapMaxMemory) && backupItem.offHeapMaxMemory >= 0);
+ var backupItem = $scope.backupItem;
+
+ var memoryMode = backupItem.memoryMode;
+ var offHeapMaxMemory = backupItem.offHeapMaxMemory;
+
+ if (model == 'offHeapMaxMemory') {
+ var oft = memoryMode == 'OFFHEAP_TIERED';
+
+ if (oft && !commonFunctions.isDefined(offHeapMaxMemory))
+ backupItem.offHeapMaxMemory = 0;
+
+ return oft;
+ }
+
+ if (model == 'evictionPolicy.kind') {
+ return memoryMode == 'ONHEAP_TIERED' && backupItem.swapEnabled ||
+ (commonFunctions.isDefined(offHeapMaxMemory) && offHeapMaxMemory >= 0);
}
return false;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bd49a5e1/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 6f55394..7fbe11e 100644
--- a/modules/web-control-center/nodejs/views/includes/controls.jade
+++ b/modules/web-control-center/nodejs/views/includes/controls.jade
@@ -96,6 +96,7 @@ mixin form-row
- var fieldMdl = 'getModel(backupItem, field.path)[field.model]';
- var fieldCommon = {'ng-model': fieldMdl, 'ng-required': 'field.required || required(field)'};
+ - var fieldRequiredClass = '{true: "required"}[field.required || required(field)]'
div(ng-switch='field.type')
div.checkbox.col-sm-6(ng-switch-when='check')
@@ -104,19 +105,19 @@ mixin form-row
| {{field.label}}
+tipLabel('field.tip')
div(ng-switch-when='text')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
+ label(class=lblClasses ng-class=fieldRequiredClass) {{field.label}}:
.col-sm-4
+tipField('field.tip')
.input-tip
input.form-control(type='text' placeholder='{{field.placeholder}}')&attributes(fieldCommon)
div(ng-switch-when='password')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
+ label(class=lblClasses ng-class=fieldRequiredClass) {{field.label}}:
.col-sm-4
+tipField('field.tip')
.input-tip
input.form-control(type='password' placeholder='{{field.placeholder}}')&attributes(fieldCommon)
div(ng-switch-when='number' ng-hide='{{field.hide}}')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
+ label(class=lblClasses ng-class=fieldRequiredClass) {{field.label}}:
.col-sm-4
+tipField('field.tip')
.input-tip
@@ -125,13 +126,13 @@ mixin form-row
+exclamation('{{field.model}}', 'max', 'Value is more than allowable maximum.')
+exclamation('{{field.model}}', 'number', 'Invalid value. Only numbers allowed.')
div(ng-switch-when='dropdown' ng-hide='{{field.hide}}')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
+ label(class=lblClasses ng-class=fieldRequiredClass) {{field.label}}:
.col-sm-4
+tipField('field.tip')
.input-tip
button.form-control(bs-select data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}')&attributes(fieldCommon)
div(ng-switch-when='dropdown-multiple' ng-hide='{{field.hide}}')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
+ label(class=lblClasses ng-class=fieldRequiredClass) {{field.label}}:
.col-sm-4
+tipField('field.tip')
.input-tip
@@ -140,7 +141,7 @@ mixin form-row
div(ng-switch-when='dropdown-details' ng-hide='{{field.hide}}')
- var expanded = 'field.details[' + fieldMdl + '].expanded'
- label(class=lblClasses ng-class='{true: "required"}[field.required || required(field)]') {{field.label}}:
+ label(class=lblClasses ng-class=fieldRequiredClass) {{field.label}}:
.col-sm-4
+tipField('field.tip')
.input-tip