ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: # ignite-843 Fixed sql notes.
Date Thu, 10 Sep 2015 16:46:44 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 683b8b708 -> aad8c924d


# ignite-843 Fixed sql notes.


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

Branch: refs/heads/ignite-843
Commit: aad8c924d762ea949d773db4984b65910dbbfbe5
Parents: 683b8b7
Author: anovikov <anovikov@gridgain.com>
Authored: Thu Sep 10 23:46:36 2015 +0700
Committer: anovikov <anovikov@gridgain.com>
Committed: Thu Sep 10 23:46:36 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 26 ++++++++++++--------
 .../src/main/js/public/stylesheets/style.scss   |  6 +++++
 .../src/main/js/views/sql/chart-settings.jade   |  4 +--
 .../src/main/js/views/sql/sql.jade              | 11 ++++++---
 4 files changed, 31 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/aad8c924/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 8bda268..5786a0f 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
@@ -317,8 +317,11 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                         paragraph.chartColumns.push(col);
                 });
 
-                paragraph.chartColX = paragraph.chartColumns.length > 0 ? paragraph.chartColumns[0].value
: null;
-                paragraph.chartColY = paragraph.chartColumns.length > 1 ? paragraph.chartColumns[1].value
: null;
+                paragraph.chartColX = paragraph.chartColumns.length > 0 &&
+                    paragraph.chartColumns.indexOf(paragraph.chartColX) == -1 ? paragraph.chartColumns[0]
: null;
+
+                paragraph.chartColY = paragraph.chartColumns.length > 1 &&
+                    paragraph.chartColumns.indexOf(paragraph.chartColY) == -1 ? paragraph.chartColumns[1]
: null;
             }
 
             paragraph.page = 1;
@@ -401,7 +404,7 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                     delete item.queryId;
             })
             .error(function (errMsg) {
-                $common.showError(errMsg);
+                paragraph.errMsg = errMsg;
             });
     };
 
@@ -559,7 +562,10 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
         var index = 0;
 
         var values = _.map(paragraph.rows, function (row) {
-            return {x: _chartNumber(row, paragraph.chartColX, index++), y: _chartNumber(row,
paragraph.chartColY, 0)}
+            return {
+                x: _chartNumber(row, paragraph.chartColX.value, index++),
+                y: _chartNumber(row, paragraph.chartColY.value, 0)
+            }
         });
 
         return [{key: key, values: values}];
@@ -572,10 +578,10 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
         var yAxisLabel = 'Y';
 
         _.forEach(paragraph.chartColumns, function (col) {
-            if (col.value == paragraph.chartColX)
+            if (col == paragraph.chartColX)
                 xAxisLabel = col.label;
 
-            if (col.value == paragraph.chartColY)
+            if (col == paragraph.chartColY)
                 yAxisLabel = col.label;
         });
 
@@ -634,8 +640,8 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
 
             var values = _.map(paragraph.rows, function (row) {
                 return {
-                    label: _chartLabel(row, paragraph.chartColX, index++),
-                    value: _chartNumber(row, paragraph.chartColY, 0)
+                    label: _chartLabel(row, paragraph.chartColX.value, index++),
+                    value: _chartNumber(row, paragraph.chartColY.value, 0)
                 }
             });
 
@@ -649,10 +655,10 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
         nv.addGraph(function() {
             var chart = nv.models.pieChart()
                     .x(function (row) {
-                        return _chartLabel(row, paragraph.chartColX, index++);
+                        return _chartLabel(row, paragraph.chartColX.value, index++);
                     })
                     .y(function (row) {
-                        return _chartNumber(row, paragraph.chartColY, 0);
+                        return _chartNumber(row, paragraph.chartColY.value, 0);
                     })
                 .showLabels(true)
                 .labelThreshold(.05)

http://git-wip-us.apache.org/repos/asf/ignite/blob/aad8c924/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 2249faf..7b93626 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -978,6 +978,12 @@ label {
     font-size: 16px;
 }
 
+.fa-chevron-circle-right {
+    color: $brand-primary;
+    margin-right: 5px;
+    font-size: 16px;
+}
+
 label.required:after {
     color: $brand-primary;
     content: ' *';

http://git-wip-us.apache.org/repos/asf/ignite/blob/aad8c924/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 1842dd0..02bae96 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
@@ -25,12 +25,12 @@
                     .col-sm-2
                         label X:
                     .col-sm-10
-                        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'
data-container='false' tabindex='0')
+                        button.form-control(id='chart-settings-X' ng-model='paragraph.chartColX'
data-placeholder='Col X' bs-select bs-options='item as item.label for item in paragraph.chartColumns'
data-container='false' tabindex='0')
                 .settings-row
                     .col-sm-2
                         label Y:
                     .col-sm-10
-                        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'
data-container='false' tabindex='1')
+                        button.form-control(id='chart-settings-Y' ng-model='paragraph.chartColY'
data-placeholder='Col Y' bs-select bs-options='item as item.label for item in paragraph.chartColumns'
data-container='false' tabindex='1')
             .form-actions
                 button.btn.btn-primary(id='chart-settings-apply' ng-disabled='chartSettingsForm.$invalid'
type='button' ng-click='applyChartSettings(paragraph); $hide()') Apply
                 button.btn.btn-primary(id='chart-settings-cancel' type='button' ng-click='$hide()')
Cancel

http://git-wip-us.apache.org/repos/asf/ignite/blob/aad8c924/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 7b660c3..e3e45bc 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
@@ -110,8 +110,9 @@ block container
                                 .col-sm-12(ng-show='paragraph.errMsg')
                                     hr(style='margin-top: 0; margin-bottom: 10px')
                                     .sql-error-result(ng-show='paragraph.errMsg') Error:
{{paragraph.errMsg}}
-                                .col-sm-12(ng-show='!paragraph.errMsg')
-                                    hr(ng-show='paragraph.result != "none"' style='margin-top:
0; margin-bottom: 10px')
+                                .col-sm-12(ng-show='!paragraph.errMsg && paragraph.result
!= "none"')
+                                    hr(style='margin-top: 0; margin-bottom: 10px')
+                                    .sql-empty-result(ng-show='!paragraph.rows') Result set
is empty.
                                     div(ng-show='paragraph.rows && paragraph.result
=== "table"')
                                         .sql-table-total(ng-show='paragraph.rows &&
paragraph.result === "table"')
                                             label Page #:&nbsp;
@@ -119,7 +120,6 @@ block container
                                             label Results:&nbsp;
                                             b {{paragraph.rows.length + paragraph.total}}
                                             .pull-right
-                                                button.btn.btn-primary(ng-click='nextPage(paragraph)'
ng-disabled='!paragraph.queryId') Next page
                                                 .btn-group
                                                     button.btn.btn-primary.fieldButton(ng-click='exportPage(paragraph)'
) Export
                                                     button.btn.btn-primary(id='export-item-dropdown'
data-toggle='dropdown' data-container='body' bs-dropdown='exportDropdown' data-placement='bottom-right')
@@ -136,4 +136,7 @@ block container
                                         a.chart-settings-link(ng-show='paragraph.chart' ng-click='$event.stopPropagation()'
bs-popover data-template-url='chart-settings' data-placement='bottom' data-auto-close='1'
data-trigger='click') Chart settings
                                         div(id='chart-{{paragraph.id}}')
                                             svg
-                                    .sql-empty-result(ng-show='!paragraph.rows &&
paragraph.result != "none"') Result set is empty.
+                                    div(ng-show='paragraph.queryId')
+                                        hr(style='margin-top: 0; margin-bottom: 5px')
+                                        a(style='float: right; margin-bottom: 5px;margin-right:
10px;' ng-click='nextPage(paragraph)') Next page
+                                        i.fa.fa-chevron-circle-right(style='float: right'
ng-click='nextPage(paragraph)')


Mime
View raw message