ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: IGNITE-843: WIP on persistence UI.
Date Mon, 29 Jun 2015 15:41:46 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 0937f7093 -> b9fb6fcdf


IGNITE-843: WIP on persistence UI.


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

Branch: refs/heads/ignite-843
Commit: b9fb6fcdf6d23207dd98329200bffcc62a850de5
Parents: 0937f70
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Mon Jun 29 22:41:43 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Mon Jun 29 22:41:43 2015 +0700

----------------------------------------------------------------------
 .../javascripts/controllers/persistences.js     | 38 ++++++++++++-----
 modules/webconfig/nodejs/views/persistence.jade | 43 ++++++++++++--------
 2 files changed, 53 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9fb6fcd/modules/webconfig/nodejs/public/javascripts/controllers/persistences.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/public/javascripts/controllers/persistences.js b/modules/webconfig/nodejs/public/javascripts/controllers/persistences.js
index 857113a..278d9a1 100644
--- a/modules/webconfig/nodejs/public/javascripts/controllers/persistences.js
+++ b/modules/webconfig/nodejs/public/javascripts/controllers/persistences.js
@@ -118,15 +118,33 @@ configuratorModule.controller('persistenceController', ['$scope', '$alert',
'$ht
                 });
         };
 
-        $scope.tables = [
-            {schema: 'Schema1', keyClass: 'KeyClass1', valueClass: 'ValueClass1'},
-            {schema: 'Schema2', keyClass: 'KeyClass2', valueClass: 'ValueClass2'},
-            {schema: 'Schema3', keyClass: 'KeyClass3', valueClass: 'ValueClass3'}];
-
-        $scope.columns = [
-            {use: true, key: true, ak: true, dbName: 'name1', dbType: 'dbType1', javaName:
'javaName1', javaType: 'javaType1'},
-            {use: true, key: false, ak: false, dbName: 'name2', dbType: 'dbType2', javaName:
'javaName2', javaType: 'javaType2'},
-            {use: false, key: false, ak: false, dbName: 'name3', dbType: 'dbType3', javaName:
'javaName3', javaType: 'javaType3'}
-        ];
+        $scope.data = {
+            curTableIdx: -1,
+            curFieldIdx: -1,
+            tables: [
+                {schemaName: 'Schema1', use: true},
+                {schemaName: 'Schema1', use: true, tableName: 'Table1', keyClass: 'KeyClass1',
valueClass: 'ValueClass1',
+                    fields: [
+                        {use: true, key: true, ak: true, dbName: 'name1', dbType: 'dbType1',
javaName: 'javaName1', javaType: 'javaType1'},
+                        {use: true, key: false, ak: false, dbName: 'name2', dbType: 'dbType2',
javaName: 'javaName2', javaType: 'javaType2'},
+                        {use: false, key: false, ak: false, dbName: 'name3', dbType: 'dbType3',
javaName: 'javaName3', javaType: 'javaType3'}
+                    ]
+                },
+                {schemaName: 'Schema2', use: false},
+                {schemaName: 'Schema2', use: false, tableName: 'Table2', keyClass: 'KeyClass2',
valueClass: 'ValueClass2',
+                    fields: [
+                        {use: true, key: true, ak: true, dbName: 'name4', dbType: 'dbType4',
javaName: 'javaName4', javaType: 'javaType4'},
+                        {use: true, key: false, ak: false, dbName: 'name5', dbType: 'dbType5',
javaName: 'javaName5', javaType: 'javaType5'},
+                        {use: false, key: false, ak: false, dbName: 'name6', dbType: 'dbType6',
javaName: 'javaName6', javaType: 'javaType6'}
+                    ]},
+                {schemaName: 'Schema2', use: false, tableName: 'Table3', keyClass: 'KeyClass3',
valueClass: 'ValueClass3',
+                    fields: [
+                        {use: true, key: true, ak: true, dbName: 'name7', dbType: 'dbType7',
javaName: 'javaName7', javaType: 'javaType7'},
+                        {use: true, key: false, ak: false, dbName: 'name8', dbType: 'dbType8',
javaName: 'javaName8', javaType: 'javaType8'},
+                        {use: false, key: false, ak: false, dbName: 'name9', dbType: 'dbType9',
javaName: 'javaName9', javaType: 'javaType9'}
+                    ]}]
+        };
+
+        $scope.curTableIdx = -1;
     }]
 );

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9fb6fcd/modules/webconfig/nodejs/views/persistence.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/persistence.jade b/modules/webconfig/nodejs/views/persistence.jade
index 194f507..a9996f8 100644
--- a/modules/webconfig/nodejs/views/persistence.jade
+++ b/modules/webconfig/nodejs/views/persistence.jade
@@ -45,26 +45,28 @@ block content
                         .panel-body
                             .settings-row(ng-repeat='field in connection')
                                 +form-row
-            button.btn.btn-primary(ng-disabled='inputForm.$invalid' ng-click='saveItem()')
Save
-            button.btn.btn-primary.btn-second(ng-show='backupItem._id' ng-click='removeItem()')
Remove
-            button.btn.btn-primary.btn-second(ng-click='reloadMetadata()') Reload
-        .links(ng-hide='tables.length == 0')
-            table.table-bordered.table-condensed.col-sm-12(st-table='tables')
+        .links(ng-hide='data.tables.length == 0')
+            table.table-bordered.table-condensed.col-sm-12(st-table='data.tables')
                 thead
                     tr
                         th Schema/Table
                         th Key class
                         th Value class
                 tbody
-                    tr(ng-repeat='row in tables')
-                        td.col-sm-4
-                            a {{row.schema}}
-                        td.col-sm-4
-                            a {{row.keyClass}}
-                        td.col-sm-4
-                            a {{row.valueClass}}
-        .links(ng-hide='columns.length == 0')
-            table.table-bordered.table-condensed.col-sm-12(st-table='columns')
+                    tr(ng-repeat='row in data.tables')
+                        td
+                            input(type='checkbox' ng-if='!row.tableName' ng-checked='row.use'
ng-click='data.curTableIdx = -1')
+                            a(ng-if='!row.tableName' style='margin-left: 5px' ng-click='data.curTableIdx
= -1') {{row.schemaName}}
+                            input(type='checkbox' ng-if='row.tableName' style='margin-left:
10px' ng-checked = 'row.use' ng-click='data.curTableIdx = $index')
+                            a(ng-if='row.tableName' style='margin-left: 5px' ng-click='data.curTableIdx
= $index') {{row.tableName}}
+                        td
+                            a(ng-show='data.curTableIdx != $index' ng-click='data.curTableIdx
= $index; curKeyClass = data.tables[$index].keyClass') {{row.keyClass}}
+                            input(type='text' ng-show='data.curTableIdx == $index' ng-model='curKeyClass'
placeholder='Key class full name')
+                        td
+                            a(ng-show='data.curTableIdx != $index' ng-click='data.curTableIdx
= $index; curValueClass = data.tables[$index].valueClass') {{row.valueClass}}
+                            input(type='text' ng-show='data.curTableIdx == $index' ng-model='curValueClass'
placeholder='Value class full name')
+        .links(ng-hide='data.curTableIdx < 0')
+            table.table-bordered.table-condensed.col-sm-12(st-table='data.tables[data.curTableIdx].fields')
                 thead
                     tr
                         th.col-sm-1 Use
@@ -75,7 +77,7 @@ block content
                         th.col-sm-2 Java Name
                         th.col-sm-2 Java Type
                 tbody
-                    tr(ng-repeat='row in columns')
+                    tr(ng-repeat='row in data.tables[data.curTableIdx].fields')
                         td.col-sm-1
                             input(type='checkbox' ng-checked='row.use')
                         td.col-sm-1
@@ -83,12 +85,17 @@ block content
                         td.col-sm-1
                             input(type='checkbox' ng-checked='row.ak')
                         td.col-sm-2
-                            a {{row.dbName}}
+                            a(ng-click='data.curFieldIdx = $index') {{row.dbName}}
                         td.col-sm-2
                             a {{row.dbType}}
                         td.col-sm-2
-                            a {{row.javaName}}
+                            a(ng-show='data.curFieldIdx != $index' ng-click='data.curFieldIdx
= $index; curJavaName = data.tables[data.curTableIdx].fields[$index].javaName') {{row.javaName}}
+                            input(type='text' ng-show='data.curFieldIdx == $index' ng-model='curJavaName'
placeholder='Field Java name')
                         td.col-sm-2
-                            a {{row.javaType}}
+                            a(ng-show='data.curFieldIdx != $index' ng-click='data.curFieldIdx
= $index; curJavaType = data.tables[data.curTableIdx].fields[$index].javaType') {{row.javaType}}
+                            input(type='text' ng-show='data.curFieldIdx == $index' ng-model='curJavaType'
placeholder='Field Java type')
+            button.btn.btn-primary(ng-disabled='inputForm.$invalid' ng-click='saveItem()')
Save
+            button.btn.btn-primary.btn-second(ng-show='backupItem._id' ng-click='removeItem()')
Remove
+            button.btn.btn-primary.btn-second(ng-click='reloadMetadata()') Reload
 
 


Mime
View raw message