ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [1/4] ignite git commit: IGNITE-843 Fixed hide system columns.
Date Fri, 25 Sep 2015 06:59:32 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 1effc9065 -> d32caf0b4


IGNITE-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/54ad06da
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/54ad06da
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/54ad06da

Branch: refs/heads/ignite-843
Commit: 54ad06da0e07112b39650432e112e9a4b6ac4ca8
Parents: 3f29a19
Author: Andrey <anovikov@gridgain.com>
Authored: Fri Sep 25 13:00:03 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Fri Sep 25 13:00:03 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 61 ++++++++++----------
 .../src/main/js/views/sql/sql.jade              |  6 +-
 2 files changed, 34 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/54ad06da/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 47525bb..ba3f8f5 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
@@ -322,30 +322,39 @@ controlCenterModule.controller('sqlController',
         return paragraph.disabledSystemColumns || paragraph.systemColumns ? _allColumn :
_hideColumn;
     };
 
-    $scope.toggleSystemColumns = function (paragraph) {
-        if (paragraph.disabledSystemColumns)
-            return;
-
-        paragraph.systemColumns = !paragraph.systemColumns;
-
-        paragraph.columnFilter = _columnFilter(paragraph);
-
+    var _rebuildColumns = function (paragraph) {
         var columnDefs = [];
 
-        _.forEach(paragraph.meta, function (meta, idx) {
+        _.forEach(res.meta, function (meta, idx) {
             if (paragraph.columnFilter(meta)) {
+                paragraph.chartColumns.push({value: idx + 1, label: meta.fieldName});
+
                 columnDefs.push({
                     headerName: meta.fieldName,
-                    valueGetter: 'JSON.stringify(data[' + idx + '])'
+                    valueGetter: 'JSON.stringify(data[' + (idx) + '])'
                 });
             }
         });
 
         paragraph.gridOptions.api.setColumnDefs(columnDefs);
 
+        paragraph.chartKeyCols = _retainColumns(paragraph.chartColumns, paragraph.chartKeyCols,
0);
+        paragraph.chartValCols = _retainColumns(paragraph.chartColumns, paragraph.chartValCols,
1);
+    };
+
+    $scope.toggleSystemColumns = function (paragraph) {
+        if (paragraph.disabledSystemColumns)
+            return;
+
+        paragraph.systemColumns = !paragraph.systemColumns;
+
+        paragraph.columnFilter = _columnFilter(paragraph);
+
+        _rebuildColumns(paragraph);
+
         setTimeout(function () {
             paragraph.gridOptions.api.sizeColumnsToFit();
-        }, 1);
+        });
     };
 
     function _retainColumns(allCols, curCols, dfltIdx) {
@@ -389,23 +398,7 @@ controlCenterModule.controller('sqlController',
 
                 paragraph.meta = res.meta;
 
-                var columnDefs = [];
-
-                _.forEach(res.meta, function (meta, idx) {
-                    if (paragraph.columnFilter(meta)) {
-                        paragraph.chartColumns.push({value: idx + 1, label: meta.fieldName});
-
-                        columnDefs.push({
-                            headerName: meta.fieldName,
-                            valueGetter: 'JSON.stringify(data[' + (idx) + '])'
-                        });
-                    }
-                });
-
-                paragraph.gridOptions.api.setColumnDefs(columnDefs);
-
-                paragraph.chartKeyCols = _retainColumns(paragraph.chartColumns, paragraph.chartKeyCols,
0);
-                paragraph.chartValCols = _retainColumns(paragraph.chartColumns, paragraph.chartValCols,
1);
+                _rebuildColumns(paragraph)
             }
 
             paragraph.page = 1;
@@ -418,11 +411,13 @@ controlCenterModule.controller('sqlController',
 
             paragraph.rows = res.rows;
 
+            paragraph.gridOptions.api.showLoading(false);
+
             paragraph.gridOptions.api.setRowData(res.rows);
 
             setTimeout(function () {
                 paragraph.gridOptions.api.sizeColumnsToFit();
-            }, 1);
+            });
 
             if (paragraph.result == 'none')
                 paragraph.result = 'table';
@@ -448,6 +443,8 @@ controlCenterModule.controller('sqlController',
 
         paragraph.queryArgs = { query: paragraph.query, pageSize: paragraph.pageSize, cacheName:
paragraph.cacheName };
 
+        paragraph.gridOptions.api.showLoading(true);
+
         $http.post('/agent/query', paragraph.queryArgs)
             .success(function (res) {
                 _processQueryResult(paragraph)(res);
@@ -466,6 +463,8 @@ controlCenterModule.controller('sqlController',
 
         _cancelRefresh(paragraph);
 
+        paragraph.gridOptions.api.showLoading(true);
+
         $http.post('/agent/query', {query: 'EXPLAIN ' + paragraph.query, pageSize: paragraph.pageSize,
cacheName: paragraph.cacheName})
             .success(_processQueryResult(paragraph))
             .error(function (errMsg) {
@@ -478,6 +477,8 @@ controlCenterModule.controller('sqlController',
 
         _cancelRefresh(paragraph);
 
+        paragraph.gridOptions.api.showLoading(true);
+
         $http.post('/agent/scan', {pageSize: paragraph.pageSize, cacheName: paragraph.cacheName})
             .success(_processQueryResult(paragraph))
             .error(function (errMsg) {
@@ -867,7 +868,7 @@ controlCenterModule.controller('sqlController',
 
             $http.post('/agent/cache/metadata', {cacheName: cache.name})
                 .success(function (metadata) {
-                    cache.metadata = metadata;
+                    cache.metadata = _.sortBy(metadata, 'name');
                 })
                 .error(function (errMsg) {
                     $common.showError(errMsg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/54ad06da/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 b02989c..ac20a2b 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
@@ -133,9 +133,9 @@ block container
                                     .sql-error-result(ng-show='paragraph.errMsg') Error:
{{paragraph.errMsg}}
                                 .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"')
+                                    .sql-empty-result(ng-show='!paragraph.nonEmpty()') Result
set is empty.
+                                    div(ng-show='paragraph.result === "table" &&
paragraph.nonEmpty()')
+                                        .sql-table-total
                                             label Page #&nbsp;
                                             b {{paragraph.page}}&nbsp;&nbsp;&nbsp;
                                             label Results so far:&nbsp;


Mime
View raw message