You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/07/15 21:17:21 UTC
[33/45] incubator-ignite git commit: # ignite-843 Fixed download for
summary page.
# ignite-843 Fixed download for summary page.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a1668d09
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a1668d09
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a1668d09
Branch: refs/heads/ignite-1121
Commit: a1668d09087afb271b58fcc7eba78a3bd9d7d361
Parents: 6ee8f34
Author: Andrey <an...@gridgain.com>
Authored: Wed Jul 15 15:24:26 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Wed Jul 15 15:24:26 2015 +0700
----------------------------------------------------------------------
.../nodejs/controllers/summary-controller.js | 22 +--
.../web-control-center/nodejs/routes/summary.js | 16 +-
.../nodejs/views/configuration/summary.jade | 178 ++++++++++---------
.../nodejs/views/templates/layout.jade | 8 +-
4 files changed, 114 insertions(+), 110 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a1668d09/modules/web-control-center/nodejs/controllers/summary-controller.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/controllers/summary-controller.js b/modules/web-control-center/nodejs/controllers/summary-controller.js
index c38a84f..9da6f59 100644
--- a/modules/web-control-center/nodejs/controllers/summary-controller.js
+++ b/modules/web-control-center/nodejs/controllers/summary-controller.js
@@ -157,25 +157,27 @@ controlCenterModule.controller('summaryController', ['$scope', '$http', 'commonF
$scope.clusters = data.clusters;
if ($scope.clusters.length > 0) {
- var restoredItem = angular.fromJson(sessionStorage.summaryBackupItem);
+ var restoredId = sessionStorage.summarySelectedId;
var selectIdx = 0;
- if (restoredItem && restoredItem._id) {
- var idx = _.findIndex($scope.clusters, function (clusters) {
- return clusters._id == restoredItem._id;
+ if (restoredId) {
+ var idx = _.findIndex($scope.clusters, function (cluster) {
+ return cluster._id == restoredId;
});
if (idx >= 0)
selectIdx = idx;
+ else
+ delete sessionStorage.summarySelectedId;
}
- $scope.generate($scope.clusters[selectIdx]);
- }
+ $scope.selectItem($scope.clusters[selectIdx]);
- $scope.$watch('selectedItem', function (val) {
- if (val)
- sessionStorage.summaryBackupItem = angular.toJson(val);
- }, true);
+ $scope.$watch('selectedItem', function (val) {
+ if (val)
+ sessionStorage.summarySelectedId = val._id;
+ }, true);
+ }
});
}]);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a1668d09/modules/web-control-center/nodejs/routes/summary.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/routes/summary.js b/modules/web-control-center/nodejs/routes/summary.js
index 8e56c81..1cb36c0 100644
--- a/modules/web-control-center/nodejs/routes/summary.js
+++ b/modules/web-control-center/nodejs/routes/summary.js
@@ -63,7 +63,7 @@ router.post('/download', function (req, res) {
if (!cluster)
return res.sendStatus(404);
- var client = req.body.type == 'client';
+ var clientCache = req.body.clientTemplate;
var archiver = require('archiver');
@@ -82,26 +82,26 @@ router.post('/download', function (req, res) {
});
//set the archive name
- res.attachment(cluster.name + '-configuration.zip');
+ res.attachment(cluster.name + (clientCache ? '-client' : '') + '-configuration.zip');
var generatorCommon = require('./generator/common');
- var javaClass = req.body.javaClass;
-
// Send the file to the page output.
zip.pipe(res);
- if (!client) {
+ var javaClass = req.body.javaClass;
+
+ if (!clientCache) {
zip.append(generatorDocker.generateClusterConfiguration(cluster, req.body.os), {name: "Dockerfile"});
- var props = generatorCommon.generateProperties(cluster, client);
+ var props = generatorCommon.generateProperties(cluster);
if (props)
zip.append(props, {name: "secret.properties"});
}
- zip.append(generatorXml.generateClusterConfiguration(cluster, client), {name: cluster.name + ".xml"})
- .append(generatorJava.generateClusterConfiguration(cluster, client, req.body.javaClass),
+ zip.append(generatorXml.generateClusterConfiguration(cluster, clientCache), {name: cluster.name + ".xml"})
+ .append(generatorJava.generateClusterConfiguration(cluster, javaClass, clientCache),
{name: javaClass ? 'ConfigurationFactory.java' : cluster.name + '.snipplet.java'})
.finalize();
});
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a1668d09/modules/web-control-center/nodejs/views/configuration/summary.jade
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/views/configuration/summary.jade b/modules/web-control-center/nodejs/views/configuration/summary.jade
index 8e43441..6875110 100644
--- a/modules/web-control-center/nodejs/views/configuration/summary.jade
+++ b/modules/web-control-center/nodejs/views/configuration/summary.jade
@@ -37,13 +37,14 @@ block content
h1 Configurations summary
hr
.docs-body(ng-controller='summaryController')
- .block-callout
- p(ng-bind-html='joinTip(screenTip)')
- div(ng-show='clusters.length == 0')
+ div
+ .block-callout
+ p(ng-bind-html='joinTip(screenTip)')
+ div(ng-if='clusters.length == 0')
| No cluster configured. You can
a(href='clusters') configure
| it.
- div(ng-show='clusters.length > 0')
+ div(ng-if='clusters.length > 0')
p Following cluster configurations were created, you can download them as XML, java code or as docker file.
.links
table.col-sm-12(st-table='clusters')
@@ -51,88 +52,89 @@ block content
tr(ng-repeat='row in clusters track by row._id')
td.col-sm-6(ng-class='{active: row._id == selectedItem._id}')
a(ng-click='selectItem(row)') {{$index + 1}}) {{row.name}}
- hr
- panel-group(bs-collapse ng-show='selectedItem && !generateError' data-allow-multiple="true")
- .panel.panel-default
- form.panel-heading(role="tab")(method='post' action='summary/download')
- input(type="hidden" name="_id" value="{{selectedItem._id}}")
- input(type="hidden" name="javaClassServer" value="{{javaClassServer}}")
- input(type="hidden" name="os" value="{{os}}")
-
- h3
- a(bs-collapse-toggle) Server
- button.btn.btn-primary.pull-right(type='submit' style='margin-top: -5px') Download
- .panel-collapse(role="tabpanel" bs-collapse-target)
- .panel-body
- .configBox(ng-show='selectedItem && !generateError')
- ul.nav.nav-tabs
- li(ng-class='{active: cfgLangServer == "xml"}')
- a(href, ng-click='cfgLangServer = "xml"')
- img(src='/images/xml.png', width='16px' height='16px')
- | XML
- li(ng-class='{active: cfgLangServer =="java"}')
- a(href, ng-click='cfgLangServer = "java"')
- img(src='/images/java.png', width='16px' height='16px')
- | Java
- li(ng-class="{active: cfgLangServer =='docker'}")
- a(href, ng-click='cfgLangServer = "docker"')
- img(src='/images/docker.png', width='16px' height='16px')
- | Dockerfile
- .settings-row
- div(ng-show="cfgLangServer == 'xml'")
- #xmlServer
- div(ng-show="cfgLangServer == 'java'")
- .col-sm-1
- label Generate:
- .col-sm-3
- button.form-control(type='button' ng-model='javaClassServer' bs-select data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in javaClassItems' data-sort='false')
- #javaServer
- div(ng-show="cfgLangServer == 'docker'")
- p
- a(style='color:#ec1c24' href='https://docs.docker.com/reference/builder' target="_blank") Docker
- | file is a text file with instructions to create Docker image.<br/>
- | To build image you have to store following Docker file with your Ignite XML configuration to the same directory.<br>
- | Also you could use predefined
- a(style='color:#ec1c24' href='https://ignite.incubator.apache.org/download.html#docker' target="_blank") Apache Ignite docker image
- | . For more information about using Ignite with Docker please read
- a(style='color:#ec1c24' href='http://apacheignite.readme.io/docs/docker-deployment' target="_blank") documentation
- |.
- .col-sm-2
- label(for='os') Operation System:
- .col-sm-4
- input#os.form-control(type='text', ng-model='os' placeholder='debian:8' data-min-length="0" data-html="1" data-auto-select="true" data-animation="am-flip-x" bs-typeahead bs-options='os for os in oss')
- .settings-row#docker(style='margin-top: 15px')
- div(ng-show='generateError') {{generateError}}
- .panel.panel-default
- form.panel-heading(role="tab")
- input(type="hidden" name="_id" value="{{selectedItem._id}}")
- input(type="hidden" name="javaClassClient" value="{{javaClassClient}}")
- input(type="hidden" name="clientSettings" value="{{backupItem}}")
+ br
+ br
+ br
+ div(ng-show='selectedItem && generated' role="tab" method='post' action='summary/download')
+ div(bs-collapse data-start-collapsed='false')
+ .panel.panel-default
+ form.panel-heading(role='tab' method='post' action='summary/download')
+ input(type="hidden" name="_id" value="{{selectedItem._id}}")
+ input(type="hidden" name="os" value="{{os}}")
+ input(type="hidden" name="javaClass" value="{{javaClassServer}}")
+ h3
+ a(bs-collapse-toggle) Server
+ button.btn.btn-primary.pull-right(type='submit' style='margin-top: -5px') Download
+ .panel-collapse(role="tabpanel" bs-collapse-target)
+ .panel-body
+ .configBox(ng-show='selectedItem && !generateError')
+ ul.nav.nav-tabs
+ li(ng-class='{active: cfgLangServer == "xml"}')
+ a(href, ng-click='cfgLangServer = "xml"')
+ img(src='/images/xml.png', width='16px' height='16px')
+ | XML
+ li(ng-class='{active: cfgLangServer =="java"}')
+ a(href, ng-click='cfgLangServer = "java"')
+ img(src='/images/java.png', width='16px' height='16px')
+ | Java
+ li(ng-class="{active: cfgLangServer =='docker'}")
+ a(href, ng-click='cfgLangServer = "docker"')
+ img(src='/images/docker.png', width='16px' height='16px')
+ | Dockerfile
+ .settings-row
+ div(ng-show="cfgLangServer == 'xml'")
+ #xmlServer
+ div(ng-show="cfgLangServer == 'java'")
+ .col-sm-1
+ label Generate:
+ .col-sm-3
+ button.form-control(type='button' ng-model='javaClassServer' bs-select data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in javaClassItems' data-sort='false')
+ #javaServer
+ div(ng-show="cfgLangServer == 'docker'")
+ p
+ a(style='color:#ec1c24' href='https://docs.docker.com/reference/builder' target="_blank") Docker
+ | file is a text file with instructions to create Docker image.<br/>
+ | To build image you have to store following Docker file with your Ignite XML configuration to the same directory.<br>
+ | Also you could use predefined
+ a(style='color:#ec1c24' href='https://ignite.incubator.apache.org/download.html#docker' target="_blank") Apache Ignite docker image
+ | . For more information about using Ignite with Docker please read
+ a(style='color:#ec1c24' href='http://apacheignite.readme.io/docs/docker-deployment' target="_blank") documentation
+ |.
+ .col-sm-2
+ label(for='os') Operation System:
+ .col-sm-4
+ input#os.form-control(type='text', ng-model='os' placeholder='debian:8' data-min-length="0" data-html="1" data-auto-select="true" data-animation="am-flip-x" bs-typeahead bs-options='os for os in oss')
+ .settings-row#docker(style='margin-top: 15px')
+ div(bs-collapse data-start-collapsed='false')
+ .panel.panel-default
+ form.panel-heading(role='tab' method='post' action='summary/download')
+ input(type="hidden" name="_id" value="{{selectedItem._id}}")
+ input(type="hidden" name="javaClass" value="{{javaClassClient}}")
+ input(type="hidden" name="clientTemplate" value="{{backupItem}}")
- h3
- a(bs-collapse-toggle) Client
- button.btn.btn-primary.pull-right(type='submit' style='margin-top: -5px') Download
- .panel-collapse(role="tabpanel" bs-collapse-target)
- .panel-body
- .configBox(ng-show='selectedItem && !generateError')
- .settings-row(ng-repeat='field in clientFields')
- +form-row
- ul.nav.nav-tabs
- li(ng-class='{active: cfgLangClient == "xml"}')
- a(href, ng-click='cfgLangClient = "xml"')
- img(src='/images/xml.png', width='16px' height='16px')
- | XML
- li(ng-class='{active: cfgLangClient =="java"}')
- a(href, ng-click='cfgLangClient = "java"')
- img(src='/images/java.png', width='16px' height='16px')
- | Java
- .settings-row
- div(ng-show="cfgLangClient == 'xml'")
- #xmlClient
- div(ng-show="cfgLangClient == 'java'")
- .col-sm-1
- label Generate:
- .col-sm-4
- button.form-control(type='button' ng-model='javaClassClient' bs-select data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in javaClassItems' data-sort='false')
- #javaClient
- div(ng-show='generateError') {{generateError}}
\ No newline at end of file
+ h3
+ a(bs-collapse-toggle) Client
+ button.btn.btn-primary.pull-right(type='submit' style='margin-top: -5px') Download
+ .panel-collapse(role="tabpanel" bs-collapse-target)
+ .panel-body
+ .configBox(ng-show='selectedItem && !generateError')
+ .settings-row(ng-repeat='field in clientFields')
+ +form-row
+ ul.nav.nav-tabs
+ li(ng-class='{active: cfgLangClient == "xml"}')
+ a(href, ng-click='cfgLangClient = "xml"')
+ img(src='/images/xml.png', width='16px' height='16px')
+ | XML
+ li(ng-class='{active: cfgLangClient =="java"}')
+ a(href, ng-click='cfgLangClient = "java"')
+ img(src='/images/java.png', width='16px' height='16px')
+ | Java
+ .settings-row
+ div(ng-show="cfgLangClient == 'xml'")
+ #xmlClient
+ div(ng-show="cfgLangClient == 'java'")
+ .col-sm-1
+ label Generate:
+ .col-sm-4
+ button.form-control(type='button' ng-model='javaClassClient' bs-select data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in javaClassItems' data-sort='false')
+ #javaClient
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a1668d09/modules/web-control-center/nodejs/views/templates/layout.jade
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/views/templates/layout.jade b/modules/web-control-center/nodejs/views/templates/layout.jade
index f9ec5d6..1bcaff7 100644
--- a/modules/web-control-center/nodejs/views/templates/layout.jade
+++ b/modules/web-control-center/nodejs/views/templates/layout.jade
@@ -36,10 +36,10 @@ html(ng-app='ignite-web-control-center', ng-init='user = #{JSON.stringify(user)}
script(src='//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.0/lodash.min.js')
- script(src='//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js')
- script(src='//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-sanitize.js')
- script(src='//cdnjs.cloudflare.com/ajax/libs/angular-strap/2.2.2/angular-strap.js')
- script(src='//cdnjs.cloudflare.com/ajax/libs/angular-strap/2.2.2/angular-strap.tpl.min.js')
+ script(src='//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js')
+ script(src='//cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.2/angular-sanitize.js')
+ script(src='//cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.0/angular-strap.js')
+ script(src='//cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.0/angular-strap.tpl.min.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/angular-smart-table/2.0.3/smart-table.js')