ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [1/2] ignite git commit: # GG-843 Fixed popover, sql tab, agent.
Date Tue, 08 Sep 2015 11:15:19 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 059a96115 -> a9080e5fe


# GG-843 Fixed popover, sql tab, agent.


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

Branch: refs/heads/ignite-843
Commit: 7c8cffa03ec1af1fb99bca0d74d781ae95fa3704
Parents: 85ca6a2
Author: Andrey <anovikov@gridgain.com>
Authored: Tue Sep 8 18:09:19 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Sep 8 18:09:19 2015 +0700

----------------------------------------------------------------------
 .../apache/ignite/agent/AgentConfiguration.java |  28 +----
 .../org/apache/ignite/agent/AgentLauncher.java  |   6 -
 .../org/apache/ignite/agent/AgentSocket.java    |   1 -
 .../src/main/js/agents/agent-manager.js         |  24 ++--
 .../src/main/js/controllers/common-module.js    |   9 +-
 .../main/js/controllers/models/metadata.json    |   1 +
 .../src/main/js/controllers/sql-controller.js   | 110 ++++++++++++-------
 modules/control-center-web/src/main/js/db.js    |   5 +
 .../src/main/js/public/stylesheets/style.scss   |  32 +++++-
 .../src/main/js/views/includes/controls.jade    |   2 +-
 .../src/main/js/views/sql/cache-metadata.jade   |  21 ++--
 .../src/main/js/views/sql/notebook-new.jade     |   4 +-
 .../src/main/js/views/sql/sql.jade              |  79 +++++++------
 .../src/main/js/views/templates/layout.jade     |   5 +-
 14 files changed, 172 insertions(+), 155 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java
b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java
index bde628d..3493dda 100644
--- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java
+++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java
@@ -35,10 +35,6 @@ public class AgentConfiguration {
     private static final String DFLT_NODE_URI = "http://localhost:8080";
 
     /** */
-    @Parameter(names = {"-l", "--login"}, description = "User's login (email) on Ignite Web
Control Center")
-    private String login;
-
-    /** */
     @Parameter(names = {"-t", "--token"}, description = "User's access token")
     private String token;
 
@@ -77,20 +73,6 @@ public class AgentConfiguration {
     private Boolean help;
 
     /**
-     * @return Login.
-     */
-    public String login() {
-        return login;
-    }
-
-    /**
-     * @param login Login.
-     */
-    public void login(String login) {
-        this.login = login;
-    }
-
-    /**
      * @return Token.
      */
     public String token() {
@@ -198,12 +180,7 @@ public class AgentConfiguration {
             props.load(reader);
         }
 
-        String val = (String)props.remove("login");
-
-        if (val != null)
-            login(val);
-
-        val = (String)props.remove("token");
+        String val = (String)props.remove("token");
 
         if (val != null)
             token(val);
@@ -238,9 +215,6 @@ public class AgentConfiguration {
      * @param cmd Command.
      */
     public void merge(AgentConfiguration cmd) {
-        if (cmd.login() != null)
-            login(cmd.login());
-
         if (cmd.token() != null)
             token(cmd.token());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java
b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java
index 7ec4c2a..230857e 100644
--- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java
+++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java
@@ -70,12 +70,6 @@ public class AgentLauncher {
 
         cfg.merge(cmdCfg);
 
-        if (cfg.login() == null) {
-            System.out.print("Login: ");
-
-            cfg.login(System.console().readLine().trim());
-        }
-
         if (cfg.token() == null) {
             System.out.print("Token: ");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java
b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java
index 7a87616..b7c837b 100644
--- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java
+++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java
@@ -105,7 +105,6 @@ public class AgentSocket implements WebSocketSender {
         JsonObject authMsg = new JsonObject();
 
         authMsg.addProperty("type", "AuthMessage");
-        authMsg.addProperty("login", cfg.login());
         authMsg.addProperty("token", cfg.token());
 
         send(authMsg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-web/src/main/js/agents/agent-manager.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/agents/agent-manager.js b/modules/control-center-web/src/main/js/agents/agent-manager.js
index 8d4db6f..5b5cfc0 100644
--- a/modules/control-center-web/src/main/js/agents/agent-manager.js
+++ b/modules/control-center-web/src/main/js/agents/agent-manager.js
@@ -228,31 +228,21 @@ Client.prototype._invokeRmtMethod = function(methodName, args) {
 Client.prototype._rmtAuthMessage = function(msg) {
     var self = this;
 
-    db.Account.findByUsername(msg.login, function(err, account) {
+    db.Account.findOne({ $or: [{ token: msg.token }, {token: undefined, _id: msg.token} ]
}, function(err, account) {
         if (err) {
             self.authResult('Failed to authorize user');
             // TODO IGNITE-1379 send error to web master.
         }
-        else if (!account) {
-            self.authResult('User not found');
-        }
+        else if (!account)
+            self.authResult('Invalid token, user not found');
         else {
-            var token = account.token;
-
-            if (!token)
-                token = account._id;
-
-            if (token == msg.token) {
-                self.authResult(null);
+            self.authResult(null);
 
-                self._user = account;
+            self._user = account;
 
-                self._manager._addClient(account._id, self);
+            self._manager._addClient(account._id, self);
 
-                self._ignite = new apacheIgnite.Ignite(new AgentServer(self));
-            }
-            else
-                self.authResult('Invalid token');
+            self._ignite = new apacheIgnite.Ignite(new AgentServer(self));
         }
     });
 };

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 2d23db8..3363fb2 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-var controlCenterModule = angular.module('ignite-web-control-center', ['ngAnimate', 'smart-table',
'mgcrea.ngStrap', 'ui.ace', 'ngSanitize']);
+var controlCenterModule = angular.module('ignite-web-control-center', ['ngAnimate', 'smart-table',
'mgcrea.ngStrap', 'ui.ace', 'ngSanitize', 'treeControl']);
 
 // Modal popup configuration.
 controlCenterModule.config(function ($modalProvider) {
@@ -1556,13 +1556,6 @@ controlCenterModule.controller('notebooks', ['$scope', '$modal', '$window',
'$ht
         _notebookNewModal.$promise.then(_notebookNewModal.show);
     };
 
-    $scope.$root.cancelCreateNotebook = function() {
-        _notebookNewModal.hide();
-
-        if ($scope.$root.notebooks.length == 0)
-            $window.location = '/configuration/clusters';
-    };
-
     $scope.$root.createNewNotebook = function(name) {
         $http.post('/notebooks/new', {name: name})
             .success(function (id) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-web/src/main/js/controllers/models/metadata.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/metadata.json b/modules/control-center-web/src/main/js/controllers/models/metadata.json
index 5df55e8..45da452 100644
--- a/modules/control-center-web/src/main/js/controllers/models/metadata.json
+++ b/modules/control-center-web/src/main/js/controllers/models/metadata.json
@@ -199,6 +199,7 @@
       "label": "Driver JAR",
       "id": "jdbcDriverJar",
       "type": "dropdown",
+      "container": "false",
       "model": "jdbcDriverJar",
       "items": "jdbcDriverJars",
       "tip": [

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/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 5bed7da..fb76a5e 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
@@ -50,6 +50,21 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
         }
     };
 
+    $scope.treeOptions = {
+        nodeChildren: "children",
+        dirSelectable: false,
+        injectClasses: {
+            ul: "a1",
+            li: "a2",
+            liSelected: "a7",
+            iExpanded: "a3",
+            iCollapsed: "a4",
+            iLeaf: "a5",
+            label: "a6",
+            labelSelected: "a8"
+        }
+    };
+
     $scope.aceInit = function (editor) {
         editor.setAutoScrollEditorIntoView(true);
         editor.$blockScrolling = Infinity;
@@ -137,7 +152,7 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                                 $window.location = "/sql/" +
                                     $scope.$root.notebooks[Math.min(idx,  $scope.$root.notebooks.length
- 1)]._id;
                             else
-                                $scope.inputNotebookName();
+                                $window.location = '/configuration/clusters';
                         }
                     })
                     .error(function (errMsg) {
@@ -166,13 +181,24 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
 
         var sz = $scope.notebook.paragraphs.length;
 
-        var paragraph = {id: paragraphId++, name: 'Query' + (sz ==0 ? '' : sz), editor: true,
query: '', pageSize: $scope.pageSizes[0], result: 'none'};
+        var paragraph = {
+            id: paragraphId++,
+            name: 'Query' + (sz ==0 ? '' : sz),
+            editor: true,
+            query: '',
+            pageSize: $scope.pageSizes[0],
+            result: 'none',
+            hideColumns: true,
+            rate: {
+                value: 1,
+                unit: 'm',
+                executed: false
+            }
+        };
 
         if ($scope.caches && $scope.caches.length > 0)
             paragraph.cache = $scope.caches[0];
 
-        paragraph.rate = {ruined: false, value: 0, unit: $scope.timeUnit[0].value};
-
         $scope.notebook.expandedParagraphs.push($scope.notebook.paragraphs.length);
 
         $scope.notebook.paragraphs.push(paragraph);
@@ -242,8 +268,17 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
         });
 
     $http.post('/agent/topology')
-        .success(function (clusters) {
-            $scope.caches = clusters[0].caches;
+        .success(function (nodes) {
+            $scope.caches = [];
+
+            nodes[0].caches.map(function (cache) {
+                $scope.caches.push({
+                    "name" : cache.name,
+                    meta: [
+                        {"name" : cache.name, "age" : "33", "children" : []}
+                    ]
+                });
+            })
         })
         .error(function (err, status) {
             $scope.caches = [];
@@ -254,15 +289,6 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                 $common.showError('Receive agent error: ' + err);
         });
 
-    var _appendOnLast = function (item) {
-        var idx = _.findIndex($scope.notebook.paragraphs, function (paragraph) {
-            return paragraph == item;
-        });
-
-        if ($scope.notebook.paragraphs.length == (idx + 1))
-            $scope.addParagraph();
-    };
-
     var _processQueryResult = function (paragraph) {
         return function (res) {
             paragraph.meta = [];
@@ -272,20 +298,17 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                 paragraph.meta = res.meta;
 
                 var idx = 0;
-                paragraph.chartColX = null;
-                paragraph.chartColY = null;
 
                 _.forEach(paragraph.meta, function (meta) {
                     var col = {value: idx++, label: meta.fieldName};
 
-                    paragraph.chartColumns.push(col);
-
-                    if (idx == 1)
-                        paragraph.chartColX = 0;
-
-                    if (idx == 2)
-                        paragraph.chartColY = 1;
+                    if (!(paragraph.hideColumns && (col.label === '_KEY' || col.label
=== '_VAL'))) {
+                        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.page = 1;
@@ -294,6 +317,8 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
 
             paragraph.queryId = res.queryId;
 
+            delete paragraph.errMsg;
+
             paragraph.rows = res.rows;
 
             paragraph.result = 'table';
@@ -303,36 +328,30 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
     $scope.execute = function (paragraph) {
         _saveNotebook();
 
-        _appendOnLast(paragraph);
-
         $http.post('/agent/query', {query: paragraph.query, pageSize: paragraph.pageSize,
cacheName: paragraph.cache.name})
             .success(_processQueryResult(paragraph))
             .error(function (errMsg) {
-                $common.showError(errMsg);
+                paragraph.errMsg = errMsg;
             });
     };
 
-    $scope.explain = function (item) {
+    $scope.explain = function (paragraph) {
         _saveNotebook();
 
-        _appendOnLast(item);
-
-        $http.post('/agent/query', {query: 'EXPLAIN ' + item.query, pageSize: item.pageSize,
cacheName: item.cache.name})
-            .success(_processQueryResult(item))
+        $http.post('/agent/query', {query: 'EXPLAIN ' + paragraph.query, pageSize: paragraph.pageSize,
cacheName: paragraph.cache.name})
+            .success(_processQueryResult(paragraph))
             .error(function (errMsg) {
-                $common.showError(errMsg);
+                paragraph.errMsg = errMsg;
             });
     };
 
-    $scope.scan = function (item) {
+    $scope.scan = function (paragraph) {
         _saveNotebook();
 
-        _appendOnLast(item);
-
-        $http.post('/agent/scan', {pageSize: item.pageSize, cacheName: item.cache.name})
-            .success(_processQueryResult(item))
+        $http.post('/agent/scan', {pageSize: paragraph.pageSize, cacheName: paragraph.cache.name})
+            .success(_processQueryResult(paragraph))
             .error(function (errMsg) {
-                $common.showError(errMsg);
+                paragraph.errMsg = errMsg;
             });
     };
 
@@ -390,13 +409,13 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
     };
 
     $scope.exportPage = function(paragraph) {
-        _export('export.csv', paragraph.meta, paragraph.rows);
+        _export(paragraph.name + '.csv', paragraph.meta, paragraph.rows);
     };
 
     $scope.exportAll = function(paragraph) {
         $http.post('/agent/query/getAll', {query: paragraph.query, cacheName: paragraph.cache.name})
             .success(function (item) {
-                _export('export-all.csv', item.meta, item.rows);
+                _export(paragraph.name + '-all.csv', item.meta, item.rows);
             })
             .error(function (errMsg) {
                 $common.showError(errMsg);
@@ -590,4 +609,13 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
             _insertChart(paragraph, _chartDatum('Area chart', paragraph), chart);
         });
     }
+
+    $scope.actionAvailable = function (paragraph, needQuery) {
+        return paragraph.cache && (!needQuery || paragraph.query);
+    };
+
+    $scope.actionTooltip = function (paragraph, action, needQuery) {
+        return $scope.actionAvailable(paragraph, needQuery) ? undefined
+            : 'To ' + action + ' query select cache' + (needQuery ? ' and input query' :
'');
+    };
 }]);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/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 88011d1..4391786 100644
--- a/modules/control-center-web/src/main/js/db.js
+++ b/modules/control-center-web/src/main/js/db.js
@@ -355,9 +355,14 @@ var NotebookSchema = new Schema({
         editor: Boolean,
         result: {type: String, enum: ['none', 'table', 'bar', 'pie', 'line', 'area']},
         pageSize: Number,
+        hideColumns: Boolean,
         cache: {
             name: String,
             mode: {type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL']}
+        },
+        rate: {
+            value: Number,
+            unit: {type: String, enum: ['s', 'm', 'h']}
         }
     }]
 });

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/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 2735da8..1350b83 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
@@ -339,7 +339,7 @@ h1, h2, h3, h4, h5, h6 {
     }
 }
 
-button {
+button, a.btn {
     margin-right: 5px;
 }
 
@@ -350,7 +350,7 @@ button {
 .btn-group {
     margin-right: 5px;
 
-    > button {
+    > button, a.btn {
         margin-right: 0;
     }
 }
@@ -426,6 +426,10 @@ h3 {
         margin-top: 30px;
     }
 
+    .btn-group {
+        margin-right: 0;
+    }
+
     .sql-editor {
         padding: 5px 0;
 
@@ -445,10 +449,6 @@ h3 {
             height: 27px;
         }
 
-        .btn-group {
-            margin-right: 0;
-        }
-
         margin-bottom: 10px;
     }
 
@@ -465,11 +465,31 @@ h3 {
         background-color: white;
     }
 
+    .wrong-caches-filter {
+        text-align: center;
+        color: $ignite-placeholder-color;
+        height: 65px;
+        line-height: 65px;
+    }
+
+    .empty-caches {
+        text-align: center;
+        color: $ignite-placeholder-color;
+        height: 100px;
+        line-height: 100px;
+    }
+
     .sql-empty-result {
         margin-bottom: 10px;
         text-align: center;
         color: $ignite-placeholder-color;
     }
+
+    .sql-error-result {
+        margin-bottom: 10px;
+        text-align: center;
+        color: $brand-danger;
+    }
 }
 
 .theme-line .panel-heading {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-web/src/main/js/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade
index bc2efc6..e65e1dc 100644
--- a/modules/control-center-web/src/main/js/views/includes/controls.jade
+++ b/modules/control-center-web/src/main/js/views/includes/controls.jade
@@ -294,7 +294,7 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
             div(class=fieldClasses)
                 +tipField('field.tip')
                 .input-tip
-                    button.form-control(id='{{::field.id}}' bs-select ng-disabled=fieldDisabled
data-placeholder='{{::field.placeholder}}' bs-options='item.value as item.label for item in
{{field.items}}' tabindex='0')&attributes(fieldCommon)
+                    button.form-control(id='{{::field.id}}' bs-select ng-disabled=fieldDisabled
data-placeholder='{{::field.placeholder}}' bs-options='item.value as item.label for item in
{{field.items}}' ng-attr-data-container='{{::field.container}}' tabindex='0')&attributes(fieldCommon)
         div(ng-switch-when='dropdown-multiple' ng-hide=fieldHide)
             dic(class=lblClasses)
                 label(ng-class=fieldRequiredClass) {{::field.label}}:

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade b/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade
index 1bce0c2..5bbf45e 100644
--- a/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade
+++ b/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade
@@ -11,17 +11,18 @@
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-.popover.settings(tabindex='-1' style='width: 200px')
+.popover.settings(tabindex='-1' style='width: 400px')
     .arrow
     h3.popover-title(style='color: black') Refresh rate
     button.close(id='paragraph-rate-close' type='button' ng-click='$hide()') &times;
     .popover-content
-        form(name='popoverForm')
-            .form-group(style='margin: 0; padding: 5px')
-                .col-sm-4(style='padding: 0')
-                    input.form-control(id='paragraph-rate' ng-init='value = paragraph.rate.value'
ng-model='value' type='number' required auto-focus)
-                .col-sm-8(style='padding-left: 5px; padding-right: 0')
-                    button.form-control(id='paragraph-unit' ng-init='unit = paragraph.rate.unit'
ng-model='unit' required placeholder='Time unit' bs-select bs-options='item.value as item.label
for item in timeUnit' tabindex='0')
-            .form-actions(style='margin-top: 30px; padding: 5px')
-                button.btn.btn-primary(id='paragraph-rate-start' ng-disabled='popoverForm.$invalid'
type='button' ng-click='startRefresh(paragraph, value, unit); $hide()') Start
-                button.btn.btn-primary.btn-default(id='paragraph-rate-stop' type='button'
ng-click='stopRefresh(paragraph); $hide()') Stop
+        treecontrol.tree-classic(tree-model='cache.meta' options='treeOptions' selected-node='node1')
employee: {{node.name}} age {{node.age}})
+        //form(name='popoverForm')
+        //    .form-group(style='margin: 0; padding: 5px')
+        //        .col-sm-4(style='padding: 0')
+        //            input.form-control(id='paragraph-rate' ng-init='value = paragraph.rate.value'
ng-model='value' type='number' required auto-focus)
+        //        .col-sm-8(style='padding-left: 5px; padding-right: 0')
+        //            button.form-control(id='paragraph-unit' ng-init='unit = paragraph.rate.unit'
ng-model='unit' required placeholder='Time unit' bs-select bs-options='item.value as item.label
for item in timeUnit' tabindex='0')
+        //    .form-actions(style='margin-top: 30px; padding: 5px')
+        //        button.btn.btn-primary(id='paragraph-rate-start' ng-disabled='popoverForm.$invalid'
type='button' ng-click='startRefresh(paragraph, value, unit); $hide()') Start
+        //        button.btn.btn-primary.btn-default(id='paragraph-rate-stop' type='button'
ng-click='stopRefresh(paragraph); $hide()') Stop

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-web/src/main/js/views/sql/notebook-new.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/notebook-new.jade b/modules/control-center-web/src/main/js/views/sql/notebook-new.jade
index 805e8d2..3be3d0b 100644
--- a/modules/control-center-web/src/main/js/views/sql/notebook-new.jade
+++ b/modules/control-center-web/src/main/js/views/sql/notebook-new.jade
@@ -19,7 +19,7 @@
         .modal-content
             .modal-header
                 button.close(type='button' ng-click='$hide()') &times;
-                h4.modal-title New notebook
+                h4.modal-title New SQL notebook
             form.form-horizontal(name='ui.inputForm' novalidate)
                 .modal-body.row
                     .col-sm-9.login.col-sm-offset-1
@@ -27,5 +27,5 @@
                         .col-sm-9
                             input.form-control(id='create-notebook' type='text' ng-model='name'
required auto-focus)
             .modal-footer
-                button.btn.btn-default(id='copy-btn-cancel' type='button' ng-click='cancelCreateNotebook()')
Cancel
+                button.btn.btn-default(id='copy-btn-cancel' type='button' ng-click='$hide()')
Cancel
                 button.btn.btn-primary(id='copy-btn-confirm' type='button' ng-disabled='ui.inputForm.$invalid'
ng-click='createNewNotebook(name)') Create

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/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 c112141..d0d20fc 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
@@ -39,11 +39,12 @@ block container
                         label {{notebook.name}}
                         .btn-group
                             +btn-toolbar('fa-pencil', 'notebook.edit = true;notebook.edit_name
= notebook.name', 'Rename notebook')
-                            +btn-toolbar('fa-paragraph', 'addParagraph()', 'Add new paragraph')
                             +btn-toolbar('fa-trash', 'removeNotebook()', 'Remove notebook')
                     h1.col-sm-6(ng-show='notebook.edit')
                         input.sql-name-input(ng-model='notebook.edit_name' required on-enter='renameNotebook(notebook.edit_name)'
on-escape='notebook.edit = false;')
                         i.tipLabel.fa.fa-floppy-o(ng-show='notebook.edit_name' ng-click='renameNotebook(notebook.edit_name)'
bs-tooltip data-title='Save notebook name' data-trigger='hover')
+                    .pull-right
+                        +btn-toolbar('fa-plus', 'addParagraph()', 'Add new query')
                 hr
                 .docs-body.paragraphs
                     .panel-group(bs-collapse ng-model='notebook.expandedParagraphs' data-allow-multiple='true'
data-start-collapsed='false')
@@ -79,52 +80,60 @@ block container
                                         div(ng-show='caches.length > 0' style='padding:
5px 10px' st-table='displayedCaches' st-safe-src='caches')
                                             lable.labelField.labelFormField Caches:
                                             .input-tip
-                                                input.form-control(type='text' placeholder='Filter
caches...')
+                                                input.form-control(type='text' st-search
placeholder='Filter caches...')
                                             table.links
                                                 tbody
                                                     tr(ng-repeat='cache in displayedCaches
track by cache.name')
                                                         td(style='width: 100%')
                                                             a(ng-class='{active: cache.name
== paragraph.cache.name}' ng-click='paragraph.cache = cache') {{$index + 1}}) {{::cache.name}}
-                                                        td(style='width: 15px')
-                                                            i.fa.fa-info-circle(bs-popover
data-template-url='cache-metadata' data-placement='left' data-auto-close='1' data-trigger='click')
-                                        div(ng-show='caches.length == 0')
-                                            label Placeholder empty caches
+                                                        //td(style='width: 15px')
+                                                        //    i.fa.fa-info-circle(bs-popover
data-template-url='cache-metadata' data-placement='left' data-auto-close='1' data-trigger='click')
+                                        .empty-caches(ng-show='displayedCaches.length ==
0 && caches.length != 0')
+                                            label Wrong caches filter
+                                        .empty-caches(ng-show='caches.length == 0')
+                                            label No caches
                                 .col-sm-12
                                     hr(style='margin: 0')
                                 .col-sm-12
                                     .details-row
-                                        button.btn.btn-primary(ng-click='explain(paragraph)'
ng-disabled='!paragraph.query || !paragraph.cache') Explain
-                                        button.btn.btn-primary(ng-click='execute(paragraph)'
ng-disabled='!paragraph.query || !paragraph.cache') Execute
-                                        button.btn.btn-primary(ng-click='scan(paragraph)'
ng-disabled='!paragraph.cache') Scan
+                                        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')
-                                .col-sm-12(ng-show='paragraph.result != "none"')
+                                .col-sm-12(ng-show='paragraph.errMsg')
                                     hr(style='margin-top: 0; margin-bottom: 10px')
-                                .col-sm-12(ng-show='paragraph.rows && paragraph.result
=== "table"')
-                                    .sql-table-total
-                                        label Page #:&nbsp;
-                                        b {{paragraph.page}}&nbsp;&nbsp;&nbsp;
-                                        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')
-                                                    span.caret
-                                    .sql-table-wrapper
-                                        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')
-                                            tbody
-                                                tr(ng-repeat='row in displayedResult track
by $index')
-                                                    td(ng-repeat='val in row track by $index')
{{ val }}
-                                .col-sm-12(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}}')
-                                        svg
-                                .col-sm-12.sql-empty-result(ng-show='!paragraph.rows &&
paragraph.result != "none"') Result set is empty.
+                                    .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')
+                                    div(ng-show='paragraph.rows && paragraph.result
=== "table"')
+                                        .sql-table-total(ng-show='paragraph.rows &&
paragraph.result === "table"')
+                                            label Page #:&nbsp;
+                                            b {{paragraph.page}}&nbsp;&nbsp;&nbsp;
+                                            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')
+                                                        span.caret
+                                        .sql-table-wrapper
+                                            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')
+                                                tbody
+                                                    tr(ng-repeat='row in displayedResult
track by $index')
+                                                        td(ng-repeat='val in row track by
$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}}')
+                                            svg
+                                    .sql-empty-result(ng-show='!paragraph.rows &&
paragraph.result != "none"') Result set is empty.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7c8cffa0/modules/control-center-web/src/main/js/views/templates/layout.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/layout.jade b/modules/control-center-web/src/main/js/views/templates/layout.jade
index 0959b65..55a4623 100644
--- a/modules/control-center-web/src/main/js/views/templates/layout.jade
+++ b/modules/control-center-web/src/main/js/views/templates/layout.jade
@@ -26,6 +26,8 @@ html(ng-app='ignite-web-control-center' ng-init='user = #{JSON.stringify(user)};
             // Font
             link(rel='stylesheet', href='//fonts.googleapis.com/css?family=Roboto+Slab:700:serif|Roboto+Slab:400:serif')
             link(rel='stylesheet', href='//cdnjs.cloudflare.com/ajax/libs/angular-motion/0.4.2/angular-motion.min.css')
+            link(rel='stylesheet', href='//cdn.rawgit.com/wix/angular-tree-control/master/css/tree-control.css')
+            link(rel='stylesheet', href='//cdn.rawgit.com/wix/angular-tree-control/master/css/tree-control-attribute.css')
 
             link(rel='stylesheet', href='/stylesheets/style.css')
 
@@ -48,7 +50,8 @@ html(ng-app='ignite-web-control-center' ng-init='user = #{JSON.stringify(user)};
             script(src='//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js')
             script(src='//angular-ui.github.io/ui-ace/dist/ui-ace.min.js')
 
-            script(src='////cdnjs.cloudflare.com/ajax/libs/floatthead/1.2.13/jquery.floatThead.min.js')
+            script(src='//cdnjs.cloudflare.com/ajax/libs/floatthead/1.2.13/jquery.floatThead.min.js')
+            script(src='//cdn.rawgit.com/wix/angular-tree-control/master/angular-tree-control.js')
 
             script(src='/common-module.js')
             script(src='/data-structures.js')


Mime
View raw message