mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
Refactor Sunstone Upgrade notification
This commit is contained in:
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> <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);
|
||||
|
||||
@@ -204,6 +204,12 @@ SUPPORT = {
|
||||
:project => "OpenNebula"
|
||||
}
|
||||
|
||||
UPGRADE = {
|
||||
:upgrade => "<span style='color: #0098c3'>Upgrade Available</span> <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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in new issue
Block a user