Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8300718761 for ; Fri, 4 Mar 2016 09:30:57 +0000 (UTC) Received: (qmail 22753 invoked by uid 500); 4 Mar 2016 09:30:57 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 22593 invoked by uid 500); 4 Mar 2016 09:30:57 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 21692 invoked by uid 99); 4 Mar 2016 09:30:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2016 09:30:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C738EE0A3C; Fri, 4 Mar 2016 09:30:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anovikov@apache.org To: commits@ignite.apache.org Date: Fri, 04 Mar 2016 09:31:24 -0000 Message-Id: <05db15e3b3994750899d73b7442ff3bf@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [29/50] ignite git commit: IGNITE-843 Fixed speed of very large data (more than 300 domains and caches) + lazy init. IGNITE-843 Fixed speed of very large data (more than 300 domains and caches) + lazy init. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/711086a4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/711086a4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/711086a4 Branch: refs/heads/ignite-843 Commit: 711086a4e517526f0cb7d82d3e73d69dcda2a7c0 Parents: 2d178a5 Author: Dmitriyff Authored: Thu Feb 25 18:59:40 2016 +0700 Committer: Alexey Kuznetsov Committed: Thu Feb 25 18:59:40 2016 +0700 ---------------------------------------------------------------------- .../main/js/app/filters/byName/byName.filter.js | 23 +++++++++++ .../control-center-web/src/main/js/app/index.js | 2 + .../configuration/summary/summary.controller.js | 9 +++-- .../main/js/views/configuration/summary.jade | 41 ++++++++++++++------ 4 files changed, 60 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/711086a4/modules/control-center-web/src/main/js/app/filters/byName/byName.filter.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/app/filters/byName/byName.filter.js b/modules/control-center-web/src/main/js/app/filters/byName/byName.filter.js new file mode 100644 index 0000000..3b0746f --- /dev/null +++ b/modules/control-center-web/src/main/js/app/filters/byName/byName.filter.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +export default ['byName', [() => (arr, search) => { + if (!(arr && arr.length) || !search) + return arr; + + return _.filter(arr, ({ name }) => name.indexOf(search) >= 0); +}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/711086a4/modules/control-center-web/src/main/js/app/index.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/app/index.js b/modules/control-center-web/src/main/js/app/index.js index eb76256..25ea53f 100644 --- a/modules/control-center-web/src/main/js/app/index.js +++ b/modules/control-center-web/src/main/js/app/index.js @@ -102,6 +102,7 @@ import IgniteCountries from './services/Countries/Countries.service'; // Filters. import hasPojo from './filters/hasPojo/hasPojo.filter'; +import byName from './filters/byName/byName.filter'; angular .module('ignite-console', [ @@ -149,6 +150,7 @@ angular // Providers. // Filters. .filter(...hasPojo) +.filter(...byName) .config(['$stateProvider', '$locationProvider', '$urlRouterProvider', function($stateProvider, $locationProvider, $urlRouterProvider) { // Set up the states. $stateProvider http://git-wip-us.apache.org/repos/asf/ignite/blob/711086a4/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js index adcc467..48d7b83 100644 --- a/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js +++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/summary/summary.controller.js @@ -222,15 +222,18 @@ export default [ srvCfg.name = cluster.name + '-server.xml'; }; - const updateTab = (cluster) => { + $scope.$watch('cluster', (cluster) => { if (!cluster) return; if (!$filter('hasPojo')(cluster) && $scope.tabsClient.activeTab === 3) $scope.tabsClient.activeTab = 0; - }; + }); - $scope.$watch('cluster', updateTab); + $scope.$watch('cluster._id', () => { + $scope.tabsClient.init = []; + $scope.tabsServer.init = []; + }); // TODO IGNITE-2114: implemented as independent logic for download. $scope.downloadConfiguration = function() { http://git-wip-us.apache.org/repos/asf/ignite/blob/711086a4/modules/control-center-web/src/main/js/views/configuration/summary.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/configuration/summary.jade b/modules/control-center-web/src/main/js/views/configuration/summary.jade index efff15c..176c483 100644 --- a/modules/control-center-web/src/main/js/views/configuration/summary.jade +++ b/modules/control-center-web/src/main/js/views/configuration/summary.jade @@ -32,10 +32,27 @@ mixin ignite-form-field-tooltip(message) .padding-dflt(ng-if='!clusters || clusters.length == 0') | You have no clusters configured. Please configure them #[a(ui-sref='base.configuration.clusters') here]. - div(ng-show='clusters || clusters.length > 0') - +main-table('clusters', 'clusters', 'clusterName', 'selectItem(row)', '{{$index + 1}}) {{row.name}}', 'name') + div(ng-show='clusters && clusters.length > 0') + .padding-bottom-dflt + table.links + thead + tr + th + lable.labelHeader.labelFormField clusters: + .col-sm-3.pull-right(style='padding: 0') + input.form-control(type='text' ng-model='clusterName' placeholder='Filter clusters...' value='') + tbody + tr + td + .scrollable-y(ng-show='(clusters | byName:clusterName).length > 0' style='max-height: 200px') + table + tbody + tr(ng-repeat='row in (clusters | byName:clusterName) track by row._id' ignite-bs-affix-update) + td + a(ng-class='{active: row._id == selectedItem._id}' on-click-focus='clusterName' ng-click='selectItem(row)') {{$index + 1}}) {{row.name}} + label.placeholder(ng-show='(clusters | byName:clusterName).length == 0') No clusters found - div(ng-show='selectedItem && tableVisibleRow(displayedRows, selectedItem)') + div(ng-show='selectedItem && (clusters | byName:clusterName).length') .padding-top-dflt(bs-affix) button.btn.btn-primary(id='download' ng-click='downloadConfiguration()' bs-tooltip='' data-title='Download project' data-placement='bottom') Download project .btn.btn-primary(bs-tooltip='' data-title='Preview generated project structure' data-placement='bottom') @@ -55,13 +72,13 @@ mixin ignite-form-field-tooltip(message) ignite-ui-ace-tabs.summary-tabs div(bs-tabs data-bs-active-pane="tabsServer.activeTab" template='configuration/summary-tabs.html') div(bs-pane title='XML') - ignite-ui-ace-xml(data-cluster='cluster') + ignite-ui-ace-xml(ng-if='tabsServer.activeTab == 0 || tabsServer.init[0]' ng-init='tabsServer.init[0] = true' data-cluster='cluster') div(bs-pane title='Java') - ignite-ui-ace-java(data-cluster='cluster') + ignite-ui-ace-java(ng-if='tabsServer.activeTab == 1 || tabsServer.init[1]' ng-init='tabsServer.init[1] = true' data-cluster='cluster') div(bs-pane title='POM') - ignite-ui-ace-pom(data-cluster='cluster') + ignite-ui-ace-pom(ng-if='tabsServer.activeTab == 2 || tabsServer.init[2]' ng-init='tabsServer.init[2] = true' data-cluster='cluster') div(bs-pane title='Dockerfile') - ignite-ui-ace-docker(data-cluster='cluster' ng-model='ctrl.data.docker') + ignite-ui-ace-docker(ng-if='tabsServer.activeTab == 3 || tabsServer.init[3]' ng-init='tabsServer.init[3] = true' data-cluster='cluster' ng-model='ctrl.data.docker') .panel.panel-default .panel-heading(role='tab' bs-collapse-toggle) @@ -135,10 +152,10 @@ mixin ignite-form-field-tooltip(message) .summary-tabs(ignite-ui-ace-tabs) div(bs-tabs data-bs-active-pane="tabsClient.activeTab" template='configuration/summary-tabs.html') div(bs-pane title='XML') - ignite-ui-ace-xml(data-cluster='cluster' data-cluster-cfg='#{nearCfg}') + ignite-ui-ace-xml(ng-if='tabsClient.activeTab == 0 || tabsClient.init[0]' ng-init='tabsClient.init[0] = true' data-cluster='cluster' data-cluster-cfg='#{nearCfg}') div(bs-pane title='Java') - ignite-ui-ace-java(data-cluster='cluster' data-cluster-cfg='#{nearCfg}') + ignite-ui-ace-java(ng-if='tabsClient.activeTab == 1 || tabsClient.init[1]' ng-init='tabsClient.init[1] = true' data-cluster='cluster' data-cluster-cfg='#{nearCfg}') div(bs-pane title='POM') - ignite-ui-ace-pom(data-cluster='cluster') - div(bs-pane title='POJO' ng-show='cluster | hasPojo') - ignite-ui-ace-pojos(data-cluster='cluster' ng-model='ctrl.data.pojos') + ignite-ui-ace-pom(ng-if='tabsClient.activeTab == 2 || tabsClient.init[2]' ng-init='tabsClient.init[2] = true' data-cluster='cluster') + div(bs-pane title='POJO' ng-if='cluster | hasPojo') + ignite-ui-ace-pojos(ng-if='tabsClient.activeTab == 3 || tabsClient.init[3]' ng-init='tabsClient.init[3] = true' data-cluster='cluster' ng-model='ctrl.data.pojos')