Refactor Sunstone Upgrade notification

This commit is contained in:
Jaime Melis committed 2016-06-10 17:54:26 +02:00
1 parent 1956b15db6
commit 4ecff42131
3 files changed
+13 -9

No files matched your search

@@ -18,10 +18,6 @@ define(function(require) {
var Locale = require('utils/locale');
var TAB_ID = 'upgrade-top-tab';
var UPGRADE = "<span style='color: #0098c3'>Upgrade Available</span>&nbsp;<span style='color:#DC7D24'><i class='fa fa-exclamation-circle'></i></span>";
var NO_UPGRADE = "";
var UPGRADE_URL = "http://opennebula.org/software/";
var Tab = {
tabId: TAB_ID,
title: "",
@@ -33,7 +29,7 @@ define(function(require) {
function _setup() {
$('#li_upgrade-top-tab > a').on("click", function(e){
window.location = UPGRADE_URL;
window.location = config['upgrade']['url'];
return false;
});
@@ -50,9 +46,9 @@ define(function(require) {
var tab_title;
if (remote_version && (version < remote_version)) {
tab_title = UPGRADE;
tab_title = config['upgrade']['upgrade'];
} else {
tab_title = NO_UPGRADE;
tab_title = config['upgrade']['no_upgrade'];
}
$("li[id$='upgrade-top-tab'] > a").html(tab_title);
+8 -1
View File
@@ -204,6 +204,12 @@ SUPPORT = {
:project => "OpenNebula"
}
UPGRADE = {
:upgrade => "<span style='color: #0098c3'>Upgrade Available</span>&nbsp;<span style='color:#DC7D24'><i class='fa fa-exclamation-circle'></i></span>",
:no_upgrade => "",
:url => "http://opennebula.org/software/"
}
##############################################################################
# Helpers
##############################################################################
@@ -465,7 +471,8 @@ get '/' do
erb :index, :locals => {
:logos_conf => logos_conf,
:oned_conf => oned_conf,
:support => SUPPORT
:support => SUPPORT,
:upgrade => UPGRADE
}
end
+2 -1
View File
@@ -48,7 +48,8 @@
'zone_id' : '<%= session[:zone_id] %>',
'vm_logos' : <%= logos_conf.to_json %>,
'oned_conf' : <%= oned_conf.to_json %>,
'support' : <%= support.to_json %>
'support' : <%= support.to_json %>,
'upgrade' : <%= upgrade.to_json %>
};
</script>