register trial Fuel version
Change-Id: I01d5dab680dd85d798bbb677478ae1eac0b9a085
This commit is contained in:
parent
0b10ed5fae
commit
843174fb4f
@ -382,6 +382,16 @@ label {cursor: default;}
|
||||
.action-btn {margin-top: 7px;}
|
||||
}
|
||||
|
||||
#content .register-trial {
|
||||
margin-bottom: 0px;
|
||||
p {
|
||||
margin: 0px;
|
||||
}
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
// Footer
|
||||
// -------------------------
|
||||
.container,
|
||||
|
@ -96,7 +96,7 @@
|
||||
"irc_text": "If you have any questions, you can also reach out to developers on the IRC channel",
|
||||
"log_text": "If you have encountered some bugs or errors, you may also need to provide the support team with deployment and operational logs. You can download them all at once by clicking the button below.",
|
||||
"contact_support": "Contact Support",
|
||||
"register_fuel_title": "Register Fuel",
|
||||
"register_fuel_title": "Register product",
|
||||
"register_fuel_content": "Registering will ensure that you receive important notifications about issues and new versions of Mirantis products. In addition, you will receive complementary access to our basic support services for the next 30 days!",
|
||||
"download_diagnostic_snapshot_text": "Download Diagnostic Snapshot",
|
||||
"gen_logs_snapshot_text": "Generating logs snapshot...",
|
||||
@ -128,7 +128,10 @@
|
||||
"cluster_hardware_nodes": "Nodes",
|
||||
"cluster_hardware_cpu": "CPU (cores)",
|
||||
"cluster_hardware_hdd": "HDD",
|
||||
"cluster_hardware_ram": "RAM"
|
||||
"cluster_hardware_ram": "RAM",
|
||||
"register_trial_message_click": "Master node installation completed successfully. If you want to register your installation and sign up for trial support, please click ",
|
||||
"register_trial_link_label": "here",
|
||||
"register_trial_message_close": ". Otherwise you can close this panel."
|
||||
},
|
||||
"cluster_page": {
|
||||
"tabs": {
|
||||
|
@ -42,6 +42,8 @@ function(Coccyx, coccyxMixins, models, commonViews, ClusterPage, NodesTab, Clust
|
||||
'*default': 'listClusters'
|
||||
},
|
||||
initialize: function() {
|
||||
this.version = new models.FuelVersion();
|
||||
this.version.fetch();
|
||||
this.content = $('#content');
|
||||
this.navbar = new commonViews.Navbar({elements: [
|
||||
['environments', '#clusters'],
|
||||
@ -51,7 +53,7 @@ function(Coccyx, coccyxMixins, models, commonViews, ClusterPage, NodesTab, Clust
|
||||
this.content.before(this.navbar.render().el);
|
||||
this.breadcrumbs = new commonViews.Breadcrumbs();
|
||||
this.content.before(this.breadcrumbs.render().el);
|
||||
this.footer = new commonViews.Footer();
|
||||
this.footer = new commonViews.Footer({version: this.version});
|
||||
$('#footer').html(this.footer.render().el);
|
||||
this.content.find('.loading').addClass('layout-loaded');
|
||||
},
|
||||
|
@ -728,6 +728,11 @@ define(['utils', 'deepModel'], function(utils) {
|
||||
urlRoot: '/api/registration/key'
|
||||
});
|
||||
|
||||
models.FuelVersion = Backbone.Model.extend({
|
||||
constructorName: 'FuelVersion',
|
||||
urlRoot: '/api/version'
|
||||
});
|
||||
|
||||
models.LogsPackage = Backbone.Model.extend({
|
||||
constructorName: 'LogsPackage',
|
||||
urlRoot: '/api/logs/package'
|
||||
|
@ -21,11 +21,12 @@ define(
|
||||
'views/dialogs',
|
||||
'text!templates/clusters/page.html',
|
||||
'text!templates/clusters/cluster.html',
|
||||
'text!templates/clusters/new.html'
|
||||
'text!templates/clusters/new.html',
|
||||
'text!templates/clusters/register_trial.html'
|
||||
],
|
||||
function(models, utils, commonViews, dialogViews, clustersPageTemplate, clusterTemplate, newClusterTemplate) {
|
||||
function(models, utils, commonViews, dialogViews, clustersPageTemplate, clusterTemplate, newClusterTemplate, registerTrialTemplate) {
|
||||
'use strict';
|
||||
var ClustersPage, ClusterList, Cluster;
|
||||
var ClustersPage, ClusterList, Cluster, RegisterTrial;
|
||||
|
||||
ClustersPage = commonViews.Page.extend({
|
||||
navbarActiveElement: 'clusters',
|
||||
@ -39,6 +40,9 @@ function(models, utils, commonViews, dialogViews, clustersPageTemplate, clusterT
|
||||
var clustersView = new ClusterList({collection: this.collection});
|
||||
this.registerSubView(clustersView);
|
||||
this.$('.cluster-list').html(clustersView.render().el);
|
||||
var registerTrialView = new RegisterTrial();
|
||||
this.registerSubView(registerTrialView);
|
||||
this.$('.page-title').before(registerTrialView.render().el);
|
||||
return this;
|
||||
}
|
||||
});
|
||||
@ -137,5 +141,38 @@ function(models, utils, commonViews, dialogViews, clustersPageTemplate, clusterT
|
||||
}
|
||||
});
|
||||
|
||||
RegisterTrial = Backbone.View.extend({
|
||||
template: _.template(registerTrialTemplate),
|
||||
events: {
|
||||
'click .register-trial .close': 'closeTrialWarning'
|
||||
},
|
||||
bindings: {
|
||||
'.registration-link': {
|
||||
attributes: [{
|
||||
name: 'href',
|
||||
observe: 'key',
|
||||
onGet: function(value) {
|
||||
return !_.isUndefined(value) ? 'http://fuel.mirantis.com/create-subscriber/?key=' + value : '/';
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
initialize: function() {
|
||||
this.fuelKey = new models.FuelKey();
|
||||
this.fuelKey.fetch();
|
||||
app.version.on('sync', this.render, this);
|
||||
},
|
||||
closeTrialWarning: function() {
|
||||
localStorage.setItem('trialRemoved', 'true');
|
||||
this.remove();
|
||||
},
|
||||
render: function() {
|
||||
if (app.version.get('mirantis') == 'yes' && !localStorage.trialRemoved) {
|
||||
this.$el.html(this.template()).i18n();
|
||||
this.stickit(this.fuelKey);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
return ClustersPage;
|
||||
});
|
||||
|
@ -266,16 +266,14 @@ function(utils, models, dialogViews, navbarTemplate, nodesStatsTemplate, notific
|
||||
initialize: function(options) {
|
||||
this.locales = this.getAvailableLocales();
|
||||
this.setDefaultLocale();
|
||||
$.ajax({url: '/api/version'}).done(_.bind(function(data) {
|
||||
this.version = data.release;
|
||||
this.isMirantis = data.mirantis == "yes";
|
||||
this.render();
|
||||
}, this));
|
||||
this.version = options.version;
|
||||
this.version.on('sync', this.render, this);
|
||||
this.render();
|
||||
},
|
||||
render: function() {
|
||||
this.$el.html(this.template({
|
||||
version: this.version,
|
||||
isMirantis: this.isMirantis,
|
||||
version: this.version.get('release'),
|
||||
isMirantis: this.version.get('mirantis') == "yes",
|
||||
locales: this.locales,
|
||||
currentLocale: this.getCurrentLocale()
|
||||
})).i18n();
|
||||
|
6
nailgun/static/templates/clusters/register_trial.html
Normal file
6
nailgun/static/templates/clusters/register_trial.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="alert alert-info alert-dismissable register-trial">
|
||||
<button type="button" class="close" aria-hidden="true">×</button>
|
||||
<p>
|
||||
<%- $.t('clusters_page.register_trial_message_click') %><a target="_blank" class="registration-link" href=""><%- $.t('clusters_page.register_trial_link_label') %></a><%- $.t('clusters_page.register_trial_message_close') %>
|
||||
</p>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user