ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-843 WIP on chart settings.
Date Sun, 06 Sep 2015 16:28:24 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 e2fc78ee0 -> 3025ddcb7


IGNITE-843 WIP on chart settings.


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

Branch: refs/heads/ignite-843
Commit: 3025ddcb7a73f52cb041fd41f42840ea44073b99
Parents: e2fc78e
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Sun Sep 6 23:28:24 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Sun Sep 6 23:28:24 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js     | 18 ++++++++++++------
 .../src/main/js/views/sql/chart-settings.jade     |  4 ++--
 .../src/main/js/views/sql/sql.jade                |  2 +-
 3 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3025ddcb/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index f94ec20..18021d3 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -258,23 +258,29 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
             $scope.addParagraph();
     };
 
-    $scope.chartColumns = [];
-
     var _processQueryResult = function (paragraph) {
         return function (res) {
             paragraph.meta = [];
+            paragraph.chartColumns = [];
 
             if (res.meta) {
                 paragraph.meta = res.meta;
 
                 var idx = 0;
+                paragraph.chartColX = null;
+                paragraph.chartColY = null;
 
                 _.forEach(paragraph.meta, function (meta) {
-                    $scope.chartColumns.push({value: meta.fieldName, label: meta.fieldName,
index: idx++});
-                });
+                    var col = {value: meta.fieldName, label: meta.fieldName, index: idx++};
+
+                    paragraph.chartColumns.push(col);
 
-                paragraph.chartX = paragraph.meta.length > 0 ? paragraph.meta[0] : null;
-                paragraph.chartY = paragraph.meta.length > 1 ? paragraph.meta[1] : null;
+                    if (idx == 1)
+                        paragraph.chartColX = col.value;
+
+                    if (idx == 2)
+                        paragraph.chartColY = col.value;
+                });
             }
 
             paragraph.page = 1;

http://git-wip-us.apache.org/repos/asf/ignite/blob/3025ddcb/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/chart-settings.jade b/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
index c7dc641..1640c58 100644
--- a/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
+++ b/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
@@ -24,11 +24,11 @@
                 .col-sm-2
                     label X:
                 .col-sm-10
-                    button.form-control(id='chart-settings-X' ng-model='colX' data-placeholder='Col
X' bs-select bs-options='item.value as item.label for item in chartColumns' tabindex='0')
+                    button.form-control(id='chart-settings-X' ng-model='paragraph.chartColX'
data-placeholder='Col X' bs-select bs-options='item.value as item.label for item in paragraph.chartColumns'
tabindex='0')
                 .col-sm-2
                     label Y:
                 .col-sm-10
-                    button.form-control(id='chart-settings-Y' ng-model='colY' data-placeholder='Col
Y' bs-select bs-options='item.value as item.label for item in chartColumns' tabindex='1')
+                    button.form-control(id='chart-settings-Y' ng-model='paragraph.chartColY'
data-placeholder='Col Y' bs-select bs-options='item.value as item.label for item in paragraph.chartColumns'
tabindex='1')
             .form-actions(style='margin-top: 30px; padding: 5px')
                 button.btn.btn-primary(id='chart-settings-apply' ng-disabled='chartSettingsForm.$invalid'
type='button' ng-click='$hide()') Apply
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3025ddcb/modules/control-center-web/src/main/js/views/sql/sql.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/sql.jade b/modules/control-center-web/src/main/js/views/sql/sql.jade
index bc81041..f65aed5 100644
--- a/modules/control-center-web/src/main/js/views/sql/sql.jade
+++ b/modules/control-center-web/src/main/js/views/sql/sql.jade
@@ -91,7 +91,7 @@ block container
                                         button.btn.btn-primary(ng-click='scan(paragraph)'
ng-disabled='!paragraph.cache') Scan
                                         .pull-right
                                             label Refresh rate:
-                                            button.btn.btn-default.fa.fa-clock-o.tipLabel(ng-class='{"btn-info":
paragraph.rate && paragraph.rate.ruined}' bs-popover data-template-url="rate" data-placement='top-right'
data-auto-close='1' data-trigger='click') {{rateAsString(paragraph)}}
+                                            button.btn.btn-default.fa.fa-clock-o.tipLabel(ng-class='{"btn-info":
paragraph.rate && paragraph.rate.ruined}' bs-popover data-template-url='rate' data-placement='top-right'
data-auto-close='1' data-trigger='click') {{rateAsString(paragraph)}}
                                             label.tipLabel Page size:
                                             button.btn.btn-default.base-control.tipLabel(ng-model='paragraph.pageSize'
bs-options='item for item in pageSizes' bs-select)
                                 .panel-body(ng-show='paragraph.rows && paragraph.result
=== "table" && paragraph.rows')


Mime
View raw message