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 save/load db presets to/from mongo.
Date Wed, 19 Aug 2015 14:46:46 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 0993b4df0 -> e77e24567


IGNITE-843 WIP save/load db presets to/from mongo.


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

Branch: refs/heads/ignite-843
Commit: e77e245670a997a162968c6eae2406513edd9d90
Parents: 0993b4d
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Wed Aug 19 21:46:36 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Wed Aug 19 21:46:36 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/metadata-controller.js  | 25 ++++++++++++++++++++
 .../src/main/js/public/stylesheets/style.scss   | 18 ++++++++++++++
 .../src/main/js/routes/presets.js               |  6 ++---
 .../js/views/configuration/metadata-load.jade   |  7 +++---
 4 files changed, 49 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e77e2456/modules/control-center-web/src/main/js/controllers/metadata-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
index cb0c501..3bedebe 100644
--- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
@@ -229,6 +229,14 @@ controlCenterModule.controller('metadataController', [
             };
 
             $scope.loadMetadataFromDb = function () {
+                $scope.preset.space = $scope.spaces[0];
+
+                $http.post('presets/save', $scope.preset)
+                    .error(function (errMsg) {
+                        $common.showError(errMsg);
+                    });
+
+
                 $http.post('/agent/metadata', $scope.preset)
                     .success(function (tables) {
                         $scope.loadMeta.tables = _.map(tables, function (tbl) {
@@ -315,6 +323,23 @@ controlCenterModule.controller('metadataController', [
                     $common.showError(errMsg);
                 });
 
+            $http.post('presets/list')
+                .success(function (data) {
+                    _.forEach(data.presets, function (restoredPreset) {
+                        var preset = _.find(presets, function (dfltPreset) {
+                            return dfltPreset.jdbcDriverClass == restoredPreset.jdbcDriverClass;
+                        });
+
+                        if (preset) {
+                            preset.jdbcUrl = restoredPreset.jdbcUrl;
+                            preset.user = restoredPreset.user;
+                        }
+                    });
+                })
+                .error(function (errMsg) {
+                    $common.showError(errMsg);
+                });
+
             $scope.selectItem = function (item) {
                 setSelectedAndBackupItem(item, angular.copy(item));
             };

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e77e2456/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 2b4a878..8447a9a 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
@@ -781,6 +781,10 @@ button .caret, .btn .caret {
         div {
             padding: 0
         }
+
+        input[type="text"] {
+            font-weight: normal;
+        }
     }
 
     margin-bottom: 10px;
@@ -814,6 +818,20 @@ button .caret, .btn .caret {
     }
 }
 
+.theme-line table.metadata {
+    tr:hover {
+        cursor: default;
+    }
+
+    thead > tr th.header {
+        input[type="text"] {
+            font-weight: normal;
+        }
+    }
+
+    margin-bottom: 10px;
+}
+
 .theme-line table.sql-results {
     [class*="col-"] {
         padding-left: 0 !important;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e77e2456/modules/control-center-web/src/main/js/routes/presets.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/presets.js b/modules/control-center-web/src/main/js/routes/presets.js
index 119102a..6bfdc48 100644
--- a/modules/control-center-web/src/main/js/routes/presets.js
+++ b/modules/control-center-web/src/main/js/routes/presets.js
@@ -49,15 +49,15 @@ router.post('/list', function (req, res) {
 router.post('/save', function (req, res) {
     var params = req.body;
 
-    db.CacheTypeMetadata.findOne({space: params.space, jdbcDriverJar: params.jdbcDriverJar},
function (err, preset) {
+    db.DatabasePreset.findOne({space: params.space, jdbcDriverJar: params.jdbcDriverJar},
function (err, preset) {
         if (db.processed(err, res)) {
             if (preset)
-                db.CacheTypeMetadata.update({space: params.space, jdbcDriverJar: params.jdbcDriverJar},
params, {upsert: true}, function (err) {
+                db.DatabasePreset.update({space: params.space, jdbcDriverJar: params.jdbcDriverJar},
params, {upsert: true}, function (err) {
                     if (db.processed(err, res))
                         return res.sendStatus(200);
                 });
             else
-                (new db.CacheTypeMetadata(params)).save(function (err) {
+                (new db.DatabasePreset(params)).save(function (err) {
                     if (db.processed(err, res))
                         return res.sendStatus(200);
                 });

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e77e2456/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
b/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
index 4f7833a..71ad06a 100644
--- a/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/metadata-load.jade
@@ -30,14 +30,13 @@ include ../includes/controls
             div(ng-show='loadMeta.action == "tables"' style='margin: 15px')
                 .settings-row
                     label.col-sm-2.required Package:
-                    .col-sm-4
+                    .col-sm-10
                         input.form-control(type="text")
-                table.table.table-condensed.table-stripped.admin(st-table='displayedTables'
st-safe-src='loadMeta.tables')
+                table.table.table-condensed.table-stripped.metadata(st-table='displayedTables'
st-safe-src='loadMeta.tables')
                     thead
                         tr
                             th.header(colspan='5')
-                                .col-sm-5
-                                    input.form-control(type='text' st-search='' placeholder='Filter
tables...')
+                                input.form-control(type='text' st-search='' placeholder='Filter
tables...')
                         tr
                             th
                                 input(type='checkbox' ng-model='loadMeta.allSelected' ng-change='loadMeta.selectAll()')


Mime
View raw message