ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: # GG-843 Fixed hide system columns.
Date Wed, 09 Sep 2015 07:54:07 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 e083c18c2 -> a161af457


# GG-843 Fixed hide system columns.


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

Branch: refs/heads/ignite-843
Commit: a161af457eb7b1182b2b1780d57f540885e98033
Parents: e083c18
Author: Andrey <anovikov@gridgain.com>
Authored: Wed Sep 9 14:55:00 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Wed Sep 9 14:55:00 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 31 ++++++++++++++++----
 modules/control-center-web/src/main/js/db.js    |  2 +-
 .../src/main/js/public/stylesheets/style.scss   |  9 ++----
 .../src/main/js/views/sql/sql.jade              | 10 +++----
 4 files changed, 34 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a161af45/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 d763a97..17fc90a 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
@@ -44,6 +44,7 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
     $scope.exportDropdown = [{ 'text': 'Export all', 'click': 'exportAll(paragraph)'}];
 
     $scope.floatTheadOptions = {
+        autoReflow:true,
         useAbsolutePositioning: true,
         scrollContainer: function($table) {
             return $table.closest(".sql-table-wrapper");
@@ -65,6 +66,16 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
         }
     };
 
+    var _hideColumn = function (col) {
+        return !(col.fieldName === "_KEY") && !(col.fieldName == "_VAL");
+    };
+
+    var _allColumn = function (col) {
+        return true;
+    };
+
+    var paragraphId = 0;
+
     $scope.aceInit = function (editor) {
         editor.setAutoScrollEditorIntoView(true);
         editor.$blockScrolling = Infinity;
@@ -80,8 +91,6 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
         editor.setTheme('ace/theme/chrome');
     };
 
-    var paragraphId = 0;
-
     var loadNotebook = function () {
         $http.post('/notebooks/get', {noteId: $scope.noteId})
             .success(function (notebook) {
@@ -188,7 +197,8 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
             query: '',
             pageSize: $scope.pageSizes[0],
             result: 'none',
-            hideColumns: true,
+            hideSystemColumns: true,
+            disabledSystemColumns: false,
             rate: {
                 value: 1,
                 unit: 'm',
@@ -280,22 +290,31 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                 $common.showError('Receive agent error: ' + err);
         });
 
+
+    $scope.applySystemColumns = function (paragraph) {
+        paragraph.columnFilter = !paragraph.disabledSystemColumns && paragraph.hideSystemColumns
? _hideColumn : _allColumn;
+    };
+
     var _processQueryResult = function (paragraph) {
         return function (res) {
             paragraph.meta = [];
             paragraph.chartColumns = [];
 
             if (res.meta) {
+                paragraph.disabledSystemColumns = res.meta.length == 2 &&
+                    res.meta[0].fieldName === "_KEY" && res.meta[1].fieldName ===
"_VAL";
+
+                $scope.applySystemColumns(paragraph);
+
                 paragraph.meta = res.meta;
 
                 var idx = 0;
 
-                _.forEach(paragraph.meta, function (meta) {
+                _.forEach(res.meta, function (meta) {
                     var col = {value: idx++, label: meta.fieldName};
 
-                    if (!(paragraph.hideColumns && (col.label === '_KEY' || col.label
=== '_VAL'))) {
+                    if (paragraph.disabledSystemColumns || _hideColumn(meta))
                         paragraph.chartColumns.push(col);
-                    }
                 });
 
                 paragraph.chartColX = paragraph.chartColumns.length > 0 ? paragraph.chartColumns[0].value
: null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/a161af45/modules/control-center-web/src/main/js/db.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/db.js b/modules/control-center-web/src/main/js/db.js
index 02a9250..9ec588e 100644
--- a/modules/control-center-web/src/main/js/db.js
+++ b/modules/control-center-web/src/main/js/db.js
@@ -351,7 +351,7 @@ var NotebookSchema = new Schema({
         editor: Boolean,
         result: {type: String, enum: ['none', 'table', 'bar', 'pie', 'line', 'area']},
         pageSize: Number,
-        hideColumns: Boolean,
+        hideSystemColumns: Boolean,
         cache: {
             name: String,
             mode: {type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL']}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a161af45/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 730f2b3..339a6ef 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
@@ -137,17 +137,18 @@ ul.navbar-nav, .sidebar-nav {
     }
 
     .active {
+        font-size: 1em;
         background-color: $ignite-background-dark-color;
     }
 }
 
-.dropdown-menu {
+.theme-line .dropdown-menu {
+    min-width: 75px;
     max-height: 20em;
     overflow: auto;
     overflow-x: hidden;
 }
 
-
 .theme-line .border-left .sidebar-nav {
     padding-left: 15px;
 }
@@ -1402,10 +1403,6 @@ a {
     }
 }
 
-.theme-line .dropdown-menu {
-    min-width: 75px;
-}
-
 .panel-tip-container {
     display: inline-block;
     margin: -3px -3px -3px -3px;

http://git-wip-us.apache.org/repos/asf/ignite/blob/a161af45/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 d0d20fc..39ef592 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
@@ -99,14 +99,14 @@ block container
                                         a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph,
true)' ng-click='actionAvailable(paragraph, true) ? explain(paragraph) : ""' data-placement='bottom'
bs-tooltip data-title='{{actionTooltip(paragraph, "explain", true)}}') Explain
                                         a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph,
true)' ng-click='actionAvailable(paragraph, true) ? execute(paragraph) : ""' data-placement='bottom'
bs-tooltip data-title='{{actionTooltip(paragraph, "execute", true)}}') Execute
                                         a.btn.btn-primary(ng-disabled='!actionAvailable(paragraph,
false)' ng-click='actionAvailable(paragraph, false) ? scan(paragraph): ""' data-placement='bottom'
bs-tooltip data-title='{{actionTooltip(paragraph, "execute scan", false)}}') Scan
-                                        label
-                                            input(type='checkbox' ng-model='paragraph.hideColumns'
ng-disabled='paragraph.possibleHideColumns')
-                                            | Hide '_KEY', '_VAL'
                                         .pull-right
                                             label Refresh rate:
                                             button.btn.btn-default.fa.fa-clock-o.tipLabel(ng-class='{"btn-info":
paragraph.rate && paragraph.rate.executed}' bs-popover data-template-url='rate' data-placement='left'
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 style='margin-right: 0')
+                                            label(style='margin-left: 10px')
+                                                input(type='checkbox' ng-model='paragraph.hideSystemColumns'
ng-click='applySystemColumns(paragraph)' ng-disabled='paragraph.disabledSystemColumns')
+                                                | Hide system columns
                                 .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}}
@@ -128,10 +128,10 @@ block container
                                             table.table.table-condensed(st-table='displayedResult'
st-safe-src='paragraph.rows' float-thead='floatTheadOptions')
                                                 thead
                                                     tr
-                                                        th(ng-repeat='col in paragraph.meta
track by $index' data-ng-bind='col.fieldName' bs-tooltip='columnToolTip(col)' data-placement='bottom')
+                                                        th(ng-repeat='col in paragraph.meta
track by $index' ng-if='paragraph.columnFilter(col)' bs-tooltip='columnToolTip(col)' data-placement='bottom')
{{col.fieldName}}
                                                 tbody
                                                     tr(ng-repeat='row in displayedResult
track by $index')
-                                                        td(ng-repeat='val in row track by
$index') {{ val }}
+                                                        td(ng-repeat='val in row track by
$index' ng-if='paragraph.columnFilter(paragraph.meta[$index])') {{ val }}
                                     div(ng-show='paragraph.rows && paragraph.result
!= "table" && paragraph.result != "none"')
                                         button.btn.btn-default.chart-btn.fa.fa-cog(bs-popover
data-template-url='chart-settings' data-placement='left' data-auto-close='1' data-trigger='click')
                                         div(id='chart-{{paragraph.id}}')


Mime
View raw message