You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2016/02/03 11:26:42 UTC

ignite git commit: IGNITE-843 Fixed export all.

Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 77430e5ef -> 0d14a01c4


IGNITE-843 Fixed export all.


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

Branch: refs/heads/ignite-843-rc2
Commit: 0d14a01c46dcd459960e26175dd44b4ddcef441b
Parents: 77430e5
Author: Andrey <an...@gridgain.com>
Authored: Wed Feb 3 17:26:40 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Wed Feb 3 17:26:40 2016 +0700

----------------------------------------------------------------------
 .../src/main/js/app/modules/terms/main.js           |  2 +-
 .../src/main/js/controllers/sql-controller.js       | 16 ++++++++++------
 .../control-center-web/src/main/js/routes/agent.js  | 10 +++++++---
 3 files changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0d14a01c/modules/control-center-web/src/main/js/app/modules/terms/main.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/terms/main.js b/modules/control-center-web/src/main/js/app/modules/terms/main.js
index 40f7ba2..0fad45d 100644
--- a/modules/control-center-web/src/main/js/app/modules/terms/main.js
+++ b/modules/control-center-web/src/main/js/app/modules/terms/main.js
@@ -24,7 +24,7 @@ angular
 .provider('igniteTerms', function() {
     let _rows = [
         'Apache Ignite Web Console',
-        '© 2015 The Apache Software Foundation.',
+        '© 2016 The Apache Software Foundation.',
         'Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
     ];
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0d14a01c/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 7aa71d9..fa2605e 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
@@ -833,14 +833,14 @@ consoleModule.controller('sqlController', function ($http, $timeout, $interval,
         var csvContent = '';
 
         if (meta) {
-            csvContent += meta.map(_fullColName).join(',') + '\n';
+            csvContent += meta.map(_fullColName).join(';') + '\n';
         }
 
         rows.forEach(function (row) {
             if (Array.isArray(row)) {
                 csvContent += row.map(function (elem) {
                     return elem ? JSON.stringify(elem) : '';
-                }).join(',');
+                }).join(';');
             }
             else {
                 var first = true;
@@ -849,7 +849,7 @@ consoleModule.controller('sqlController', function ($http, $timeout, $interval,
                     if (first)
                         first = false;
                     else
-                        csvContent += ',';
+                        csvContent += ';';
 
                     var elem = row[prop.fieldName];
 
@@ -874,9 +874,13 @@ consoleModule.controller('sqlController', function ($http, $timeout, $interval,
     };
 
     $scope.exportCsvAll = function(paragraph) {
-        $http.post('/api/v1/agent/query/getAll', {demo: $scope.demo, query: paragraph.query, cacheName: paragraph.cacheName})
-            .success(function (item) {
-                _export(paragraph.name + '-all.csv', item.meta, item.rows);
+        $http.post('/api/v1/agent/query/getAll', {
+                demo: $scope.demo,
+                query: paragraph.queryArgs.query,
+                cacheName: paragraph.queryArgs.cacheName
+            })
+            .success(function (response) {
+                _export(paragraph.name + '-all.csv', response.meta, response.rows);
             })
             .error(function (errMsg) {
                 $common.showError(errMsg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/0d14a01c/modules/control-center-web/src/main/js/routes/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/agent.js b/modules/control-center-web/src/main/js/routes/agent.js
index 872d4f4..8c2326c 100644
--- a/modules/control-center-web/src/main/js/routes/agent.js
+++ b/modules/control-center-web/src/main/js/routes/agent.js
@@ -122,15 +122,19 @@ router.post('/query/getAll', function (req, res) {
     _client(req.currentUserId())
         .then((client) => {
             // Create sql query.
-            var qry = new SqlFieldsQuery(req.body.query);
+            const qry = req.body.query ? new SqlFieldsQuery(req.body.query) : new ScanQuery();
 
             // Set page size for query.
             qry.setPageSize(1024);
 
             // Get query cursor.
-            return client.ignite(req.body.demo).cache(req.body.cacheName).query(qry).getAll();
+            const cursor = client.ignite(req.body.demo).cache(req.body.cacheName).query(qry);
+
+            return new Promise(function (resolve) {
+                cursor.getAll().then(rows => resolve({meta: cursor.fieldsMetadata(), rows}))
+            });
         })
-        .then((rows) => res.json({meta: cursor.fieldsMetadata(), rows: rows}))
+        .then(response => res.json(response))
         .catch(_handleException(res));
 });