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 20F07186DF for ; Wed, 15 Jul 2015 19:17:08 +0000 (UTC) Received: (qmail 18229 invoked by uid 500); 15 Jul 2015 19:17:08 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 18197 invoked by uid 500); 15 Jul 2015 19:17:08 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 18188 invoked by uid 99); 15 Jul 2015 19:17:08 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2015 19:17:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 88CD31A700D for ; Wed, 15 Jul 2015 19:17:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id p9DHE40V3azf for ; Wed, 15 Jul 2015 19:16:59 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 477EC23117 for ; Wed, 15 Jul 2015 19:16:52 +0000 (UTC) Received: (qmail 16936 invoked by uid 99); 15 Jul 2015 19:16:49 -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; Wed, 15 Jul 2015 19:16:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4F109E051A; Wed, 15 Jul 2015 19:16:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sevdokimov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 15 Jul 2015 19:16:59 -0000 Message-Id: <5af4b0c7727a4f82a8b193243d38dbda@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [11/45] incubator-ignite git commit: IGNITE-843 WIP on metadata. IGNITE-843 WIP on metadata. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2265fe4f Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2265fe4f Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2265fe4f Branch: refs/heads/ignite-1121 Commit: 2265fe4fe0dd0fdc3d1cd7cd532926b807b9f02d Parents: 8424670 Author: AKuznetsov Authored: Tue Jul 14 11:57:41 2015 +0700 Committer: AKuznetsov Committed: Tue Jul 14 11:57:41 2015 +0700 ---------------------------------------------------------------------- .../nodejs/controllers/models/metadata.json | 67 +++++++++----------- modules/web-control-center/nodejs/db.js | 15 ++++- .../nodejs/views/includes/controls.jade | 48 ++++++++++++++ 3 files changed, 92 insertions(+), 38 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2265fe4f/modules/web-control-center/nodejs/controllers/models/metadata.json ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/controllers/models/metadata.json b/modules/web-control-center/nodejs/controllers/models/metadata.json index 02b9809..1f540ae 100644 --- a/modules/web-control-center/nodejs/controllers/models/metadata.json +++ b/modules/web-control-center/nodejs/controllers/models/metadata.json @@ -24,81 +24,74 @@ "placeholder": "Select kind" }, { - "label": "dbSchema", + "label": "Database schema", "type": "text", - "model": "dbSchema", + "model": "databaseSchema", "required": true, "placeholder": "Input DB schema name" }, { - "label": "dbTbl", + "label": "Database table", "type": "text", - "model": "dbTbl", + "model": "databaseTable", "required": true, "placeholder": "Input DB table name" }, { - "label": "keyType", + "label": "Key type", "type": "text", "model": "keyType", "required": true, "placeholder": "Full class name for Key" }, { - "label": "valType", + "label": "Value type", "type": "text", - "model": "valType", + "model": "value Type", "required": true, "placeholder": "Full class name for Value" }, { - "label": "keyFields", - "type": "text", + "label": "Key fields", + "type": "fieldsMetadata", "model": "keyFields", - "required": true, - "placeholder": "TODO" + "tip": ["Collection of key fields descriptions."] }, { "label": "valFields", - "type": "text", - "model": "valFields", - "required": true, - "placeholder": "TODO" + "type": "fieldsMetadata", + "model": "valueFields", + "tip": ["Collection of value fields descriptions."] }, { - "label": "qryFlds", + "label": "Query fields", "type": "text", - "model": "qryFlds", - "required": true, - "placeholder": "TODO" + "model": "queryFields", + "tip": ["TODO."] }, { - "label": "ascFlds", + "label": "Ascending fields", "type": "text", - "model": "ascFlds", - "required": true, - "placeholder": "TODO" + "model": "ascendingFields", + "tip": ["TODO."] }, { - "label": "descFlds", + "label": "Descending fields", "type": "text", - "model": "descFlds", - "required": true, - "placeholder": "TODO" + "model": "descendingFields", + "tip": ["TODO."] }, { - "label": "txtFlds", - "type": "text", - "model": "txtFlds", - "required": true, - "placeholder": "TODO" + "label": "Text fields", + "type": "table-simple", + "model": "textFields", + "tip": ["TODO."] }, { - "label": "grps", - "type": "text", - "model": "grps", - "required": true, - "placeholder": "TODO" + "label": "Groups", + "type": "groupsMetadata", + "model": "groups", + "tip": ["TODO."] } ] } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2265fe4f/modules/web-control-center/nodejs/db.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/db.js b/modules/web-control-center/nodejs/db.js index 101d4ae..b931f78 100644 --- a/modules/web-control-center/nodejs/db.js +++ b/modules/web-control-center/nodejs/db.js @@ -51,7 +51,20 @@ exports.Space = mongoose.model('Space', new Schema({ // Define cache type metadata model. var CacheTypeMetadataSchema = new Schema({ space: {type: ObjectId, ref: 'Space'}, - name: String + name: String, + kind: {type: String, enum: ['query', 'store', 'both']}, + databaseSchema: String, + databaseTable: String, + keyType: String, + valueType: String, + valType: String, + keyFields: [{dbName: String, dbType: Number, javaName: String, javaType: String}], + valueFields: [{dbName: String, dbType: Number, javaName: String, javaType: String}], + queryFields: [{name: String, className: String}], + ascendingFields: [{name: String, className: String}], + descendingFields: [{name: String, className: String}], + textFields: [String], + groups: [{name: String, fields: [{field: String, direction: String}]}] }); exports.CacheTypeMetadata = mongoose.model('CacheTypeMetadata', CacheTypeMetadataSchema); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2265fe4f/modules/web-control-center/nodejs/views/includes/controls.jade ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/views/includes/controls.jade b/modules/web-control-center/nodejs/views/includes/controls.jade index 7fbe11e..3256f57 100644 --- a/modules/web-control-center/nodejs/views/includes/controls.jade +++ b/modules/web-control-center/nodejs/views/includes/controls.jade @@ -174,6 +174,54 @@ mixin form-row +tipField('field.tip') .input-tip input.form-control(type='text' ng-model='newValue' ng-focus='field.editIdx = -1' placeholder='{{field.placeholder}}') + div(ng-switch-when='fieldsMetadata')&attributes(fieldCommon) + div + label.table-header {{field.label}}: + +tipLabel('field.tableTip') + table.links-edit.col-sm-12(st-table='#{fieldMdl}' ng-show='#{fieldMdl}.length > 0') + tbody + tr.col-sm-12(ng-repeat='item in #{fieldMdl} track by $index') + td.col-sm-6 + div(ng-show='field.editIdx != {{$index}}') + a(ng-click='field.editIdx = $index; curValue = #{fieldMdl}[$index]') {{$index + 1}}) {{item | compact}} + i.tipField.fa.fa-remove(ng-click='field.editIdx = -1; #{fieldMdl}.splice($index, 1)') + div(ng-show='field.editIdx == {{$index}}') + label.labelField {{$index + 1}}) + i.tipField.fa.fa-floppy-o(ng-click='#{fieldMdl}[$index] = curValue ? curValue : #{fieldMdl}[$index]; field.editIdx = curValue ? -1 : field.editIdx') + .input-tip + input.form-control(type='text' ng-model='curValue' placeholder='{{field.placeholder}}') + td.col-sm-1(ng-if='field.reordering') + i.fa.fa-arrow-up(ng-show='$index > 0' ng-click='swapSimpleItems(#{fieldMdl}, $index, $index - 1); field.editIdx = -1;') + i.fa.fa-arrow-down(ng-show='$index < #{fieldMdl}.length - 1' ng-click='swapSimpleItems(#{fieldMdl}, $index, $index + 1); field.editIdx = -1;') + .col-sm-6 + button.btn.btn-primary.fieldButton(ng-disabled='!newValue || #{fieldMdl}.indexOf(newValue) >= 0' ng-click='field.editIdx = -1; #{fieldMdl} ? #{fieldMdl}.push(newValue) : #{fieldMdl} = [newValue];') Add + +tipField('field.tip') + .input-tip + input.form-control(type='text' ng-model='newValue' ng-focus='field.editIdx = -1' placeholder='{{field.placeholder}}') + div(ng-switch-when='groupsMetadata')&attributes(fieldCommon) + div + label.table-header {{field.label}}: + +tipLabel('field.tableTip') + table.links-edit.col-sm-12(st-table='#{fieldMdl}' ng-show='#{fieldMdl}.length > 0') + tbody + tr.col-sm-12(ng-repeat='item in #{fieldMdl} track by $index') + td.col-sm-6 + div(ng-show='field.editIdx != {{$index}}') + a(ng-click='field.editIdx = $index; curValue = #{fieldMdl}[$index]') {{$index + 1}}) {{item | compact}} + i.tipField.fa.fa-remove(ng-click='field.editIdx = -1; #{fieldMdl}.splice($index, 1)') + div(ng-show='field.editIdx == {{$index}}') + label.labelField {{$index + 1}}) + i.tipField.fa.fa-floppy-o(ng-click='#{fieldMdl}[$index] = curValue ? curValue : #{fieldMdl}[$index]; field.editIdx = curValue ? -1 : field.editIdx') + .input-tip + input.form-control(type='text' ng-model='curValue' placeholder='{{field.placeholder}}') + td.col-sm-1(ng-if='field.reordering') + i.fa.fa-arrow-up(ng-show='$index > 0' ng-click='swapSimpleItems(#{fieldMdl}, $index, $index - 1); field.editIdx = -1;') + i.fa.fa-arrow-down(ng-show='$index < #{fieldMdl}.length - 1' ng-click='swapSimpleItems(#{fieldMdl}, $index, $index + 1); field.editIdx = -1;') + .col-sm-6 + button.btn.btn-primary.fieldButton(ng-disabled='!newValue || #{fieldMdl}.indexOf(newValue) >= 0' ng-click='field.editIdx = -1; #{fieldMdl} ? #{fieldMdl}.push(newValue) : #{fieldMdl} = [newValue];') Add + +tipField('field.tip') + .input-tip + input.form-control(type='text' ng-model='newValue' ng-focus='field.editIdx = -1' placeholder='{{field.placeholder}}') div(ng-switch-when='indexedTypes') - var tblMdl = 'backupItem.indexedTypes' div