ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-1257 Append property file to agent zip.
Date Tue, 13 Oct 2015 09:18:03 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 566cd757b -> 7469ef4e9


IGNITE-1257 Append property file to agent zip.


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

Branch: refs/heads/ignite-843-rc1
Commit: 7469ef4e96af81af0acc5b6610faee966bfddacc
Parents: 566cd75
Author: Andrey <anovikov@gridgain.com>
Authored: Tue Oct 13 16:18:00 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Oct 13 16:18:00 2015 +0700

----------------------------------------------------------------------
 .../src/main/resources/logging.properties       | 13 +++++--
 .../src/main/js/controllers/common-module.js    |  2 +-
 .../control-center-web/src/main/js/package.json |  1 +
 .../src/main/js/routes/agent.js                 | 39 ++++++++++++++++++++
 .../js/routes/generator/generator-properties.js |  2 +-
 5 files changed, 52 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7469ef4e/modules/control-center-agent/src/main/resources/logging.properties
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/src/main/resources/logging.properties b/modules/control-center-agent/src/main/resources/logging.properties
index 661f52c..629d0c5 100644
--- a/modules/control-center-agent/src/main/resources/logging.properties
+++ b/modules/control-center-agent/src/main/resources/logging.properties
@@ -13,8 +13,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-handlers =java.util.logging.ConsoleHandler
+handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
+
 .level=FINE
+
+java.util.logging.ConsoleHandler.formatter=org.apache.ignite.logger.java.JavaLoggerFormatter
 java.util.logging.ConsoleHandler.level=INFO
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-java.util.logging.SimpleFormatter.format=%1$tl:%1$tM:%1$tS %1$Tp %4$s: %5$s%n
+
+java.util.logging.FileHandler.formatter=org.apache.ignite.logger.java.JavaLoggerFormatter
+java.util.logging.FileHandler.pattern=ignite-web-agent.%g.log
+java.util.logging.FileHandler.level=FINE
+java.util.logging.FileHandler.limit=10485760
+java.util.logging.FileHandler.count=10

http://git-wip-us.apache.org/repos/asf/ignite/blob/7469ef4e/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 5e28ebd..957eb2f 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -1914,7 +1914,7 @@ consoleModule.controller('agent-download', [
         $scope.downloadAgent = function () {
             var lnk = document.createElement('a');
 
-            lnk.setAttribute('href', '/agent/ignite-web-agent-1.5.0-SNAPSHOT.zip');
+            lnk.setAttribute('href', '/agent/download-zip');
             lnk.style.display = 'none';
 
             document.body.appendChild(lnk);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7469ef4e/modules/control-center-web/src/main/js/package.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/package.json b/modules/control-center-web/src/main/js/package.json
index fdaca39..19e90d5 100644
--- a/modules/control-center-web/src/main/js/package.json
+++ b/modules/control-center-web/src/main/js/package.json
@@ -32,6 +32,7 @@
     "express-force-ssl": "^0.3.0",
     "express-session": "^1.11.1",
     "jade": "~1.11.0",
+    "jszip": "^2.5.0",
     "lodash": "3.10.1",
     "mongoose": "^4.1.10",
     "mongoose-deep-populate": "2.0.2",

http://git-wip-us.apache.org/repos/asf/ignite/blob/7469ef4e/modules/control-center-web/src/main/js/routes/agent.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/agent.js b/modules/control-center-web/src/main/js/routes/agent.js
index 1c44eb9..4176855 100644
--- a/modules/control-center-web/src/main/js/routes/agent.js
+++ b/modules/control-center-web/src/main/js/routes/agent.js
@@ -44,6 +44,45 @@ router.get('/download', function (req, res) {
 });
 
 /* Get grid topology. */
+router.get('/download-zip', function (req, res) {
+    var fs = require('fs');
+    var JSZip = require('jszip');
+    var config = require('../helpers/configuration-loader.js');
+
+    var agentFld =  'ignite-web-agent-1.5.0-SNAPSHOT';
+    var agentZip =  agentFld + '.zip';
+
+    // read a zip file
+    fs.readFile('public/agent/' + agentZip, function(err, data) {
+        if (err)
+            return res.download('public/agent/' + agentZip, agentZip);
+
+        var zip = new JSZip(data);
+
+        var prop = [];
+
+        var host = req.hostname.match(/:/g) ? req.hostname.slice(0, req.hostname.indexOf(':'))
: req.hostname;
+
+        prop.push('token=' + req.user.token);
+        prop.push('server-uri=wss://' + host + ':' + config.get('agent-server:port'));
+        prop.push('#node-uri=http://localhost:8080');
+        prop.push('#driver-folder=./jdbc-drivers');
+        prop.push('#test-drive-metadata=true');
+        prop.push('#test-drive-sql=true');
+
+        zip.file(agentFld + '/default.properties', prop.join('\n'));
+
+        var buffer = zip.generate({type:"nodebuffer"});
+
+        // Set the archive name.
+        res.attachment(agentZip);
+
+        res.send(buffer);
+
+    });
+});
+
+/* Get grid topology. */
 router.post('/topology', function (req, res) {
     var client = _client(req, res);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7469ef4e/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
b/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
index 1aaf735..fff1447 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
@@ -102,7 +102,7 @@ $generatorProperties.sslProperties = function (cluster, res) {
     }
 
     return res;
-}
+};
 
 // For server side we should export properties generation entry point.
 if (typeof window === 'undefined') {


Mime
View raw message