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: # IGNITE-843 Fixed summary page.
Date Fri, 28 Aug 2015 06:27:18 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 0460d09eb -> 8d9983d8c


# IGNITE-843 Fixed summary page.


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

Branch: refs/heads/ignite-843
Commit: 4c528c97e71be364c0855e39fa83419028a162be
Parents: a07e80a
Author: Andrey <anovikov@gridgain.com>
Authored: Fri Aug 28 13:27:24 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Fri Aug 28 13:27:24 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/summary-controller.js   | 66 +++++++-------------
 .../src/main/js/routes/summary.js               | 26 --------
 .../main/js/views/configuration/summary.jade    |  1 +
 3 files changed, 23 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4c528c97/modules/control-center-web/src/main/js/controllers/summary-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/summary-controller.js b/modules/control-center-web/src/main/js/controllers/summary-controller.js
index c07df90..86868e1 100644
--- a/modules/control-center-web/src/main/js/controllers/summary-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/summary-controller.js
@@ -64,63 +64,41 @@ controlCenterModule.controller('summaryController', ['$scope', '$http',
'$common
         editor.setTheme('ace/theme/chrome');
     };
 
-    $scope.reloadServer = function () {
-        $scope.javaServer = $scope.configServer.javaClassServer === 2 ?
-            $scope.configServer.javaClass : $scope.configServer.javaSnippet;
+    $scope.generateJavaServer = function() {
+        $scope.javaServer = $generatorJava.cluster($scope.selectedItem, $scope.configServer.javaClassServer
=== 2)
+    };
 
-        if ($scope.configServer.docker) {
-            var os = $scope.configServer.os ? $scope.configServer.os : $scope.oss[0];
+    $scope.$watch('configServer.javaClassServer', $scope.generateJavaServer, true);
 
-            $scope.dockerServer = $scope.configServer.docker.replace(new RegExp('\%OS\%',
'g'), os);
-        }
+    $scope.generateDockerServer = function() {
+        var os = $scope.configServer.os ? $scope.configServer.os : $scope.oss[0];
+
+        $scope.dockerServer =  $generatorDocker.clusterDocker($scope.selectedItem, os);
+    };
+
+    $scope.$watch('configServer.os', $scope.generateDockerServer, true);
+
+    $scope.generateClient = function () {
+        $scope.xmlClient = $generatorXml.cluster($scope.selectedItem, $scope.backupItem.nearConfiguration);
+        $scope.javaClient = $generatorJava.cluster($scope.selectedItem, $scope.backupItem.javaClassClient
=== 2,
+            $scope.backupItem.nearConfiguration);
     };
 
+    $scope.$watch('backupItem', $scope.generateClient, true);
+
     $scope.selectItem = function (cluster) {
         if (!cluster)
             return;
 
         $scope.selectedItem = cluster;
 
-        $scope.$watch('javaClassServer', $scope.reloadServer);
-        $scope.$watch('os', $scope.reloadServer);
-
-        $scope.generateServer(cluster);
-
-        $scope.reloadServer();
+        $scope.xmlServer = $generatorXml.cluster(cluster);
 
-        $scope.$watch('configServer', function () {
-            $scope.reloadServer();
-        }, true);
+        $scope.generateJavaServer();
 
-        $scope.$watch('backupItem', function () {
-            $scope.generateClient();
-        }, true);
-    };
-
-    $scope.generateServer = function (cluster) {
-        $http.post('summary/generator', {_id: cluster._id})
-            .success(function (data) {
-                $scope.xmlServer = data.xmlServer;
-
-                $scope.configServer.javaClass = data.javaClassServer;
-                $scope.configServer.javaSnippet = data.javaSnippetServer;
-                $scope.configServer.docker = data.docker;
-            }).error(function (errMsg) {
-                $common.showError('Failed to generate config: ' + errMsg);
-            });
-    };
+        $scope.generateDockerServer();
 
-    $scope.generateClient = function () {
-        $http.post('summary/generator', {
-            _id: $scope.selectedItem._id, javaClass: $scope.backupItem.javaClassClient ===
2,
-            clientNearConfiguration: $scope.backupItem.nearConfiguration
-        })
-            .success(function (data) {
-                $scope.xmlClient = data.xmlClient;
-                $scope.javaClient = data.javaClient;
-            }).error(function (errMsg) {
-                $common.showError('Failed to generate config: ' + errMsg);
-            });
+        $scope.generateClient();
     };
 
     $scope.download = function () {

http://git-wip-us.apache.org/repos/asf/ignite/blob/4c528c97/modules/control-center-web/src/main/js/routes/summary.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/summary.js b/modules/control-center-web/src/main/js/routes/summary.js
index aee7ffe..9da9a5d 100644
--- a/modules/control-center-web/src/main/js/routes/summary.js
+++ b/modules/control-center-web/src/main/js/routes/summary.js
@@ -29,32 +29,6 @@ router.get('/', function (req, res) {
     res.render('configuration/summary');
 });
 
-router.post('/generator', function (req, res) {
-    // Get cluster.
-    db.Cluster.findById(req.body._id).deepPopulate('caches caches.queryMetadata caches.storeMetadata').exec(function
(err, cluster) {
-        if (err)
-            return res.status(500).send(err.message);
-
-        if (!cluster)
-            return res.sendStatus(404);
-
-        var clientCache = req.body.clientNearConfiguration;
-
-        if (clientCache)
-            return res.send({
-                xmlClient: $generatorXml.cluster(cluster, clientCache),
-                javaClient: $generatorJava.cluster(cluster, req.body.javaClass, clientCache)
-            });
-
-        return res.send({
-            xmlServer: $generatorXml.cluster(cluster),
-            javaSnippetServer: $generatorJava.cluster(cluster, false),
-            javaClassServer: $generatorJava.cluster(cluster, true),
-            docker: $generatorDocker.clusterDocker(cluster, '%OS%')
-        });
-    });
-});
-
 router.post('/download', function (req, res) {
     // Get cluster with all inner objects (caches, metadata).
     db.Cluster.findById(req.body._id).deepPopulate('caches caches.queryMetadata caches.storeMetadata').exec(function
(err, cluster) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/4c528c97/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 6f51247..5a02330 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
@@ -23,6 +23,7 @@ append scripts
     script(src='//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/mode-xml.js')
     script(src='//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/mode-java.js')
     script(src='//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/mode-dockerfile.js')
+    script(src='/generator-docker.js')
 
 append css
 


Mime
View raw message