From 621e35658bb202ee886850b36728f776e890f7f9 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 18 Jul 2012 14:22:01 +0200 Subject: [PATCH] Feature #1302: Sunstone support for IE * Fix javascript for IE 7 * Add explorer canvas library so graphs are painted in IE 7,8 * Add warnings to IE users (cherry picked from commit 692fdbe3ce9d2c693ef71e1cad06d6882fe7ff31) --- install.sh | 7 + src/sunstone/public/js/locale.js | 4 +- src/sunstone/public/js/login.js | 28 +++ src/sunstone/public/js/monitoring.js | 4 +- src/sunstone/public/js/opennebula.js | 27 ++- src/sunstone/public/js/plugins/acls-tab.js | 5 +- .../public/js/plugins/clusters-tab.js | 24 +-- src/sunstone/public/js/plugins/config-tab.js | 8 +- .../public/js/plugins/dashboard-tab.js | 2 +- .../public/js/plugins/datastores-tab.js | 19 +- src/sunstone/public/js/plugins/groups-tab.js | 10 +- src/sunstone/public/js/plugins/hosts-tab.js | 8 +- src/sunstone/public/js/plugins/images-tab.js | 16 +- .../public/js/plugins/marketplace-tab.js | 4 +- src/sunstone/public/js/plugins/system-tab.js | 4 +- .../public/js/plugins/templates-tab.js | 10 +- src/sunstone/public/js/plugins/users-tab.js | 19 +- src/sunstone/public/js/plugins/vms-tab.js | 20 +- src/sunstone/public/js/plugins/vnets-tab.js | 25 ++- .../public/js/plugins/vresources-tab.js | 4 +- .../public/vendor/explorercanvas/LICENSE.txt | 202 ++++++++++++++++++ .../public/vendor/explorercanvas/NOTICE | 8 + .../explorercanvas/excanvas.compiled.js | 35 +++ src/sunstone/templates/login.html | 6 +- src/sunstone/views/index.erb | 3 + 25 files changed, 395 insertions(+), 107 deletions(-) create mode 100644 src/sunstone/public/vendor/explorercanvas/LICENSE.txt create mode 100644 src/sunstone/public/vendor/explorercanvas/NOTICE create mode 100644 src/sunstone/public/vendor/explorercanvas/excanvas.compiled.js diff --git a/install.sh b/install.sh index fd161239ad..64ea77a958 100755 --- a/install.sh +++ b/install.sh @@ -266,6 +266,7 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \ $SUNSTONE_LOCATION/public/locale/zh_TW \ $SUNSTONE_LOCATION/public/vendor \ $SUNSTONE_LOCATION/public/vendor/crypto-js \ + $SUNSTONE_LOCATION/public/vendor/explorercanvas \ $SUNSTONE_LOCATION/public/vendor/jQueryLayout \ $SUNSTONE_LOCATION/public/vendor/dataTables \ $SUNSTONE_LOCATION/public/vendor/jQueryUI \ @@ -489,6 +490,7 @@ INSTALL_SUNSTONE_FILES=( SUNSTONE_PUBLIC_JS_PLUGINS_FILES:$SUNSTONE_LOCATION/public/js/plugins SUNSTONE_PUBLIC_CSS_FILES:$SUNSTONE_LOCATION/public/css SUNSTONE_PUBLIC_VENDOR_CRYPTOJS:$SUNSTONE_LOCATION/public/vendor/crypto-js + SUNSTONE_PUBLIC_VENDOR_EXPLORERCANVAS:$SUNSTONE_LOCATION/public/vendor/explorercanvas SUNSTONE_PUBLIC_VENDOR_DATATABLES:$SUNSTONE_LOCATION/public/vendor/dataTables SUNSTONE_PUBLIC_VENDOR_JGROWL:$SUNSTONE_LOCATION/public/vendor/jGrowl SUNSTONE_PUBLIC_VENDOR_JQUERY:$SUNSTONE_LOCATION/public/vendor/jQuery @@ -1345,6 +1347,11 @@ src/sunstone/public/vendor/crypto-js/core-min.js \ src/sunstone/public/vendor/crypto-js/enc-base64-min.js \ src/sunstone/public/vendor/crypto-js/NEW-BSD-LICENSE.txt" +SUNSTONE_PUBLIC_VENDOR_EXPLORERCANVAS="\ +src/sunstone/public/vendor/explorercanvas/excanvas.compiled.js \ +src/sunstone/public/vendor/explorercanvas/NOTICE \ +src/sunstone/public/vendor/explorercanvas/LICENSE.txt" + SUNSTONE_PUBLIC_VENDOR_FILEUPLOADER="\ src/sunstone/public/vendor/fileuploader/NOTICE \ src/sunstone/public/vendor/fileuploader/fileuploader.js" diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js index fedfc42cc6..b53137fc6a 100644 --- a/src/sunstone/public/js/locale.js +++ b/src/sunstone/public/js/locale.js @@ -63,7 +63,7 @@ function setLang(lang_str){ $.post('config',JSON.stringify({lang:lang_tmp}),function(){ window.location.href = "."; }); - }, + } }; OpenNebula.User.update(obj); @@ -74,7 +74,7 @@ function setLang(lang_str){ if (whichUI() == "sunstone"){ var obj = { data : { - id: uid, + id: uid }, success: updateUserTemplate }; diff --git a/src/sunstone/public/js/login.js b/src/sunstone/public/js/login.js index 6b460d35c0..a1012c14e6 100644 --- a/src/sunstone/public/js/login.js +++ b/src/sunstone/public/js/login.js @@ -55,6 +55,32 @@ function authenticate(){ }); } +function getInternetExplorerVersion(){ +// Returns the version of Internet Explorer or a -1 +// (indicating the use of another browser). + var rv = -1; // Return value assumes failure. + if (navigator.appName == 'Microsoft Internet Explorer') + { + var ua = navigator.userAgent; + var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); + if (re.exec(ua) != null) + rv = parseFloat( RegExp.$1 ); + } + return rv; +} + +function checkVersion(){ + var ver = getInternetExplorerVersion(); + + if ( ver > -1 ){ + msg = ver <= 7.0 ? "You are using an old version of IE. \ +Please upgrade or use Firefox or Chrome for full compatibility." : + "OpenNebula Sunstone is best seen with Chrome or Firefox"; + $("#error_box").text(msg); + $("#error_box").fadeIn('slow'); + } +} + $(document).ready(function(){ $("#login_form").submit(function (){ authenticate(); @@ -70,4 +96,6 @@ $(document).ready(function(){ $("input#username.box").focus(); $("#login_spinner").hide(); + + checkVersion(); }); diff --git a/src/sunstone/public/js/monitoring.js b/src/sunstone/public/js/monitoring.js index e2efa88563..98244595e7 100644 --- a/src/sunstone/public/js/monitoring.js +++ b/src/sunstone/public/js/monitoring.js @@ -222,7 +222,7 @@ var SunstoneMonitoring = { var data = partitions[partition] var color = config.colorize ? config.colorize(partition) : null series.push({ label: partition, - data: data, + data: data }) } return series @@ -261,7 +261,7 @@ var SunstoneMonitoring = { data: [[totals[i],0]], //we paint on 0 value of y axis // y axis labels will be hidden label: paths[i], - color: config.colorize? config.colorize(paths[i]) : null, + color: config.colorize? config.colorize(paths[i]) : null }) } return series diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 1e4ac8a512..2e85940675 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -389,9 +389,16 @@ var OpenNebula = { type: "POST", data: {remember: remember}, beforeSend : function(req) { - req.setRequestHeader( "Authorization", - "Basic " + btoa(username + ":" + password) - ) + var token = username + ':' + password; + var authString = 'Basic '; + if (typeof(btoa) === 'function') + authString += btoa(token) + else { + token = CryptoJS.enc.Utf8.parse(token); + authString += CryptoJS.enc.Base64.stringify(token) + } + + req.setRequestHeader( "Authorization", authString); }, success: function(response){ return callback ? callback(request, response) : null; @@ -484,7 +491,7 @@ var OpenNebula = { }, "monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.Host.resource,false); - }, + } }, "Network": { @@ -558,7 +565,7 @@ var OpenNebula = { }, "fetch_template" : function(params){ OpenNebula.Action.show(params,OpenNebula.Network.resource,"template"); - }, + } }, "VM": { @@ -753,7 +760,7 @@ var OpenNebula = { "set_quota" : function(params){ var action_obj = { quotas : params.data.extra_param }; OpenNebula.Action.simple_action(params,OpenNebula.User.resource,"set_quota",action_obj); - }, + } // "addgroup" : function(params){ // var action_obj = {"group_id": params.data.extra_param }; @@ -995,7 +1002,7 @@ var OpenNebula = { }, "fetch_template" : function(params){ OpenNebula.Action.show(params,OpenNebula.Datastore.resource,"template"); - }, + } }, "Marketplace" : { @@ -1023,8 +1030,8 @@ var OpenNebula = { }, error: function(res){ return callback_error ? callback_error(request, OpenNebula.Error(res)) : null; - }, + } }); - }, - }, + } + } } diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index 2189989d69..fc08166d59 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -150,7 +150,7 @@ var acl_actions = { hideDialog(); $('div#acls_tab div.legend_div').slideToggle(); } - }, + } } var acl_buttons = { @@ -172,7 +172,6 @@ var acl_buttons = { text: '?', alwaysActive: true } - } var acls_tab = { @@ -192,7 +191,7 @@ SunstoneMonitoringConfig['ACL'] = { "totalAcls" : { operation: SunstoneMonitoring.ops.totalize } - }, + } } diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index ddae85b026..57baa73a5d 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -120,7 +120,7 @@ var cluster_actions = { callback : function (req) { Sunstone.runAction("Host.show",req.request.data[0][1].host_id); }, - error : onError, + error : onError }, "Cluster.delhost" : { @@ -138,7 +138,7 @@ var cluster_actions = { callback : function (req) { Sunstone.runAction("Datastore.show",req.request.data[0][1].ds_id); }, - error : onError, + error : onError }, "Cluster.deldatastore" : { @@ -147,7 +147,7 @@ var cluster_actions = { callback : function (req) { Sunstone.runAction("Datastore.show",req.request.data[0][1].ds_id); }, - error : onError, + error : onError }, "Cluster.addvnet" : { @@ -156,7 +156,7 @@ var cluster_actions = { callback : function (req) { Sunstone.runAction("Network.show",req.request.data[0][1].vnet_id); }, - error : onError, + error : onError }, "Cluster.delvnet" : { @@ -165,7 +165,7 @@ var cluster_actions = { callback : function (req) { Sunstone.runAction("Network.show",req.request.data[0][1].vnet_id); }, - error : onError, + error : onError }, "Cluster.delete" : { @@ -205,8 +205,8 @@ var cluster_actions = { [], []), clusterElements()); - }, - }, + } + } }; var cluster_buttons = { @@ -255,7 +255,7 @@ var clusters_tab = { buttons: cluster_buttons, showOnTopMenu: false, tabClass: "topTab subTab", - parentTab: "infra_tab", + parentTab: "infra_tab" }; @@ -311,7 +311,7 @@ SunstoneMonitoringConfig['CLUSTER_HOST'] = { dataType: "pie", operation: SunstoneMonitoring.ops.hostCpuUsagePartition, plotOptions: { - series: { pie: { show: true } }, + series: { pie: { show: true } } } }, "cpuUsageBar" : { @@ -364,7 +364,7 @@ SunstoneMonitoringConfig['CLUSTER_HOST'] = { } } } - }, + } } } @@ -907,7 +907,7 @@ function setupCreateClusterDialog(){ var cluster_json = { "cluster": { - "name": $('#name',this).val(), + "name": $('#name',this).val() } }; @@ -990,7 +990,7 @@ $(document).ready(function(){ "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, - { "sWidth": "35px", "aTargets": [1,3,4,5] }, + { "sWidth": "35px", "aTargets": [1,3,4,5] } ], "oLanguage": (datatable_lang != "") ? { diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index c8c1008806..ed49cb8b5e 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -70,14 +70,14 @@ var config_actions = { call: OpenNebula.Config.list, callback: updateConfig, error: onError - }, + } }; var config_tab = { title: tr("Configuration"), content: config_tab_content, tabClass: "subTab", - parentTab: "dashboard_tab", + parentTab: "dashboard_tab" }; Sunstone.addActions(config_actions); @@ -103,7 +103,7 @@ function updateConfig(request,response){ function updateWss(){ var user_info_req = { data : { - id: uid, + id: uid }, success: function(req,user_json) { var template = user_json.USER.TEMPLATE; @@ -123,7 +123,7 @@ function updateWss(){ error: onError }; OpenNebula.User.update(request); - }, + } }; OpenNebula.User.show(user_info_req); $.post('config',JSON.stringify({wss : ($('#config_table #wss_checkbox').is(':checked') ? "yes" : "no")})); diff --git a/src/sunstone/public/js/plugins/dashboard-tab.js b/src/sunstone/public/js/plugins/dashboard-tab.js index 5993d5b06a..42cc399ab2 100644 --- a/src/sunstone/public/js/plugins/dashboard-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-tab.js @@ -181,7 +181,7 @@ var dashboard_tab_content = var dashboard_tab = { title: ''+tr("Dashboard"), content: dashboard_tab_content, - showOnTopMenu: false, + showOnTopMenu: false } Sunstone.addMainTab('dashboard_tab',dashboard_tab); diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 3b5f79a5df..6e9f886618 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -207,7 +207,7 @@ var datastore_actions = { "Datastore.update_dialog" : { type: "custom", - call: popUpDatastoreTemplateUpdateDialog, + call: popUpDatastoreTemplateUpdateDialog }, "Datastore.update" : { @@ -284,7 +284,7 @@ var datastore_actions = { Sunstone.runAction("Cluster.adddatastore",cluster,ds); }, elements: datastoreElements, - notify:true, + notify:true }, "Datastore.help" : { @@ -293,8 +293,7 @@ var datastore_actions = { hideDialog(); $('div#datastores_tab div.legend_div').slideToggle(); } - }, - + } }; var datastore_buttons = { @@ -306,20 +305,20 @@ var datastore_buttons = { "Datastore.create_dialog" : { type: "create_dialog", text: tr("+ New"), - condition: mustBeAdmin, + condition: mustBeAdmin }, "Datastore.update_dialog" : { type: "action", text: tr("Update properties"), alwaysActive: true, - condition: mustBeAdmin, + condition: mustBeAdmin }, "Datastore.addtocluster" : { type: "confirm_with_select", text: tr("Select cluster"), select: clusters_sel, tip: tr("Select the destination cluster:"), - condition: mustBeAdmin, + condition: mustBeAdmin }, "Datastore.chown" : { type: "confirm_with_select", @@ -356,7 +355,7 @@ var datastore_info_panel = { "datastore_template_tab" : { title: tr("Datastore template"), content: "" - }, + } } var datastores_tab = { @@ -365,7 +364,7 @@ var datastores_tab = { buttons: datastore_buttons, tabClass: "subTab", parentTab: "infra_tab", - showOnTopMenu: false, + showOnTopMenu: false } Sunstone.addActions(datastore_actions); @@ -608,7 +607,7 @@ function setupDatastoreTemplateUpdateDialog(){ width:500, modal:true, height:height, - resizable:true, + resizable:true }); $('button',dialog).button(); diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index 5b23eb9a5b..37aeaf0390 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -139,7 +139,7 @@ var group_actions = { type: "list", call: OpenNebula.Group.list, callback: updateGroupsView, - error: onError, + error: onError }, "Group.show" : { @@ -223,7 +223,7 @@ var group_actions = { hideDialog(); $('div#groups_tab div.legend_div').slideToggle(); } - }, + } } var group_buttons = { @@ -247,7 +247,7 @@ var group_buttons = { "Group.quotas_dialog" : { type : "action", text : tr("Update quotas"), - condition: mustBeAdmin, + condition: mustBeAdmin }, "Group.delete" : { type: "confirm", @@ -265,7 +265,7 @@ var group_info_panel = { "group_info_tab" : { title: tr("Group information"), content:"" - }, + } }; var groups_tab = { @@ -296,7 +296,7 @@ SunstoneMonitoringConfig['GROUP'] = { "totalGroups" : { operation: SunstoneMonitoring.ops.totalize } - }, + } } Sunstone.addActions(group_actions); diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 4c18260eb3..4849013234 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -290,7 +290,7 @@ var host_actions = { }, callback: null, elements: hostElements, - notify:true, + notify:true }, "Host.help" : { @@ -372,7 +372,7 @@ var hosts_tab = { buttons: host_buttons, tabClass: "subTab", parentTab: "infra_tab", - showOnTopMenu: false, + showOnTopMenu: false }; @@ -473,7 +473,7 @@ SunstoneMonitoringConfig['HOST'] = { dataType: "pie", operation: SunstoneMonitoring.ops.hostCpuUsagePartition, plotOptions: { - series: { pie: { show: true } }, + series: { pie: { show: true } } } }, "totalHosts" : { //count number of hosts @@ -530,7 +530,7 @@ SunstoneMonitoringConfig['HOST'] = { } } } - }, + } } } diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index ef49c60c70..3d99b58206 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -282,7 +282,7 @@ var image_actions = { call: function () { waitingNodes(dataTable_images); Sunstone.runAction("Image.list"); - }, + } }, "Image.autorefresh" : { @@ -314,7 +314,7 @@ var image_actions = { "Image.update_dialog" : { type: "custom", - call: popUpImageTemplateUpdateDialog, + call: popUpImageTemplateUpdateDialog }, "Image.update" : { @@ -491,7 +491,7 @@ var image_buttons = { }, "Image.clone_dialog" : { type: "action", - text: tr("Clone"), + text: tr("Clone") }, "Image.delete" : { type: "confirm", @@ -787,7 +787,7 @@ function setupCreateImageDialog(){ width: "258px", // left: "133px", height: "15px", - display: "inline-block", + display: "inline-block" }); $('#upload-progress div',dialog).css("border","1px solid #AAAAAA"); @@ -841,7 +841,7 @@ function setupCreateImageDialog(){ return false; }, onCancel: function(id, fileName){ - }, + } }); var file_input = false; @@ -947,7 +947,7 @@ function setupCreateImageDialog(){ "image" : { "image_raw" : template }, - "ds_id" : ds_id, + "ds_id" : ds_id }; Sunstone.runAction("Image.create",img_obj); $create_image_dialog.dialog('close'); @@ -983,7 +983,7 @@ function setupImageTemplateUpdateDialog(){ width:700, modal:true, height:height, - resizable:false, + resizable:false }); $('button',dialog).button(); @@ -1152,7 +1152,7 @@ function setupImageCloneDialog(){ autoOpen:false, width:375, modal:true, - resizable:false, + resizable:false }); $('button',dialog).button(); diff --git a/src/sunstone/public/js/plugins/marketplace-tab.js b/src/sunstone/public/js/plugins/marketplace-tab.js index 3ffb249040..1a5fd382c8 100644 --- a/src/sunstone/public/js/plugins/marketplace-tab.js +++ b/src/sunstone/public/js/plugins/marketplace-tab.js @@ -115,7 +115,7 @@ var marketplace_tab_content = '\ var marketplace_tab = { title: '' + tr("Marketplace"), content: marketplace_tab_content, - buttons: market_buttons, + buttons: market_buttons }; Sunstone.addMainTab('marketplace_tab', marketplace_tab); @@ -130,7 +130,7 @@ var marketplace_info_panel = { "marketplace_info_tab" : { title: tr("Appliance information"), content:"" - }, + } }; Sunstone.addInfoPanel("marketplace_info_panel", marketplace_info_panel); diff --git a/src/sunstone/public/js/plugins/system-tab.js b/src/sunstone/public/js/plugins/system-tab.js index fd0bbe78f9..8dc7e4519a 100644 --- a/src/sunstone/public/js/plugins/system-tab.js +++ b/src/sunstone/public/js/plugins/system-tab.js @@ -14,8 +14,8 @@ /* limitations under the License. */ /* -------------------------------------------------------------------------- */ -var system_tab_content = -'\ +var system_tab_content = '\ +
\ \
\ \ diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 295ffe0762..19306d34e3 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -683,7 +683,7 @@ var template_actions = { call: function () { waitingNodes(dataTable_templates); Sunstone.runAction("Template.list"); - }, + } }, "Template.autorefresh" : { @@ -791,7 +791,7 @@ var template_actions = { hideDialog(); $('div#templates_tab div.legend_div').slideToggle(); } - }, + } } var template_buttons = { @@ -829,7 +829,7 @@ var template_buttons = { }, "Template.clone_dialog" : { type: "action", - text: tr("Clone"), + text: tr("Clone") }, "Template.delete" : { type: "confirm", @@ -2034,7 +2034,7 @@ function setupTemplateTemplateUpdateDialog(){ width:700, modal:true, height:height, - resizable:false, + resizable:false }); $('button',dialog).button(); @@ -2148,7 +2148,7 @@ function setupTemplateCloneDialog(){ autoOpen:false, width:375, modal:true, - resizable:false, + resizable:false }); $('button',dialog).button(); diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index 9ab1256e64..00eccecc6c 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -189,7 +189,7 @@ var user_actions = { call: function () { waitingNodes(dataTable_users); Sunstone.runAction("User.list"); - }, + } }, "User.autorefresh" : { @@ -215,7 +215,7 @@ var user_actions = { notifyMessage(tr("Change password successful")); }, elements: userElements, - error: onError, + error: onError }, "User.chgrp" : { type: "multiple", @@ -353,8 +353,7 @@ var user_actions = { hideDialog(); $('div#users_tab div.legend_div').slideToggle(); } - }, - + } } var user_buttons = { @@ -375,7 +374,7 @@ var user_buttons = { }, "User.update_password" : { type : "action", - text : tr("Change password"), + text : tr("Change password") }, "User.quotas_dialog" : { type : "action", @@ -437,7 +436,7 @@ var user_info_panel = { "user_quotas_tab" : { title: tr("User quotas"), content:"" - }, + } }; var users_tab = { @@ -446,7 +445,7 @@ var users_tab = { buttons: user_buttons, tabClass: 'subTab', parentTab: 'system_tab', - condition: mustBeAdmin, + condition: mustBeAdmin }; var users_tab_non_admin = { @@ -455,7 +454,7 @@ var users_tab_non_admin = { buttons: user_buttons, tabClass: 'subTab', parentTab: 'dashboard_tab', - condition: mustNotBeAdmin, + condition: mustNotBeAdmin } @@ -489,13 +488,13 @@ SunstoneMonitoringConfig['USER'] = { min: 0 }, legend : { show: false, - noColumns: 2, + noColumns: 2 } } }, "totalUsers" : { operation: SunstoneMonitoring.ops.totalize - }, + } } } diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 86ff58de67..b14a6f3f72 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -191,7 +191,7 @@ var vm_actions = { "VM.create_dialog" : { type: "custom", - call: popUpCreateVMDialog, + call: popUpCreateVMDialog }, "VM.update_dialog" : { @@ -225,14 +225,14 @@ var vm_actions = { call : function (){ waitingNodes(dataTable_vMachines); Sunstone.runAction("VM.list"); - }, + } }, "VM.autorefresh" : { type: "custom", call : function() { OpenNebula.VM.list({timeout: true, success: updateVMachinesView,error: onError}); - }, + } }, "VM.deploy" : { @@ -483,7 +483,7 @@ var vm_actions = { hideDialog(); $('div#vms_tab div.legend_div').slideToggle(); } - }, + } }; @@ -577,7 +577,7 @@ var vm_buttons = { "VM.stop" : { type: "confirm", text: tr("Stop"), - tip: "This will stop selected VMs" + tip: tr("This will stop selected VMs") }, "VM.restart" : { type: "confirm", @@ -639,7 +639,7 @@ var vm_info_panel = { }, "vm_history_tab" : { title: tr("History information"), - content: "", + content: "" } }; @@ -745,7 +745,7 @@ SunstoneMonitoringConfig['VM'] = { min: 0, tickFormatter : function(val,axis) { return humanize_size(val,true); - }, + } }, legend: { noColumns: 3, @@ -755,7 +755,7 @@ SunstoneMonitoringConfig['VM'] = { } } } - }, + } } } @@ -1063,7 +1063,7 @@ function updateVMInfo(request,vm){ var history_tab = { title: tr("History information"), - content: generateHistoryTable(vm_info), + content: generateHistoryTable(vm_info) }; Sunstone.updateInfoPanelTab("vm_info_panel","vm_info_tab",info_tab); @@ -1378,7 +1378,7 @@ function setupVMTemplateUpdateDialog(){ width:500, modal:true, height:height, - resizable:true, + resizable:true }); $('button',dialog).button(); diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 929f1d3836..523c7e4568 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -302,7 +302,7 @@ var vnet_actions = { call: OpenNebula.Network.addleases, callback: vnShow, error: onError, - notify: false, + notify: false }, "Network.rmleases" : { @@ -310,7 +310,7 @@ var vnet_actions = { call: OpenNebula.Network.rmleases, callback: vnShow, error: onError, - notify: false, + notify: false }, "Network.hold" : { @@ -318,7 +318,7 @@ var vnet_actions = { call: OpenNebula.Network.hold, callback: vnShow, error: onError, - notify: false, + notify: false }, "Network.release" : { @@ -326,7 +326,7 @@ var vnet_actions = { call: OpenNebula.Network.release, callback: vnShow, error: onError, - notify: false, + notify: false }, "Network.chown" : { @@ -409,7 +409,7 @@ var vnet_actions = { }, callback: null, elements: vnElements, - notify:true, + notify: true }, "Network.help" : { @@ -418,8 +418,7 @@ var vnet_actions = { hideDialog(); $('div#vnets_tab div.legend_div').slideToggle(); } - }, - + } }; @@ -445,7 +444,7 @@ var vnet_buttons = { text: tr("Select cluster"), select: clusters_sel, tip: tr("Select the destination cluster:"), - condition: mustBeAdmin, + condition: mustBeAdmin }, "Network.chown" : { type: "confirm_with_select", @@ -460,7 +459,7 @@ var vnet_buttons = { text: tr("Change group"), select: groups_sel, tip: tr("Select the new group")+":", - condition: mustBeAdmin, + condition: mustBeAdmin }, "Network.delete" : { @@ -483,7 +482,7 @@ var vnet_info_panel = { "vnet_leases_tab" : { title: tr("Lease management"), content: "" - }, + } } var vnets_tab = { @@ -492,7 +491,7 @@ var vnets_tab = { buttons: vnet_buttons, tabClass: "subTab", parentTab: "infra_tab", - showOnTopMenu: false, + showOnTopMenu: false } Sunstone.addActions(vnet_actions); @@ -997,7 +996,7 @@ function setupCreateVNetDialog() { //Create the VNetwork. network_json = { - "vnet" : network_json, + "vnet" : network_json }; Sunstone.runAction("Network.create",network_json); @@ -1035,7 +1034,7 @@ function setupVNetTemplateUpdateDialog(){ width:700, modal:true, height:height, - resizable:true, + resizable:true }); $('button',dialog).button(); diff --git a/src/sunstone/public/js/plugins/vresources-tab.js b/src/sunstone/public/js/plugins/vresources-tab.js index 494f8eb1a2..0e6d91f84a 100644 --- a/src/sunstone/public/js/plugins/vresources-tab.js +++ b/src/sunstone/public/js/plugins/vresources-tab.js @@ -14,8 +14,8 @@ /* limitations under the License. */ /* -------------------------------------------------------------------------- */ -var vres_tab_content = -'
\ +var vres_tab_content = '\ +
\ \
\ \ diff --git a/src/sunstone/public/vendor/explorercanvas/LICENSE.txt b/src/sunstone/public/vendor/explorercanvas/LICENSE.txt new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/src/sunstone/public/vendor/explorercanvas/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/sunstone/public/vendor/explorercanvas/NOTICE b/src/sunstone/public/vendor/explorercanvas/NOTICE new file mode 100644 index 0000000000..734f4d1efc --- /dev/null +++ b/src/sunstone/public/vendor/explorercanvas/NOTICE @@ -0,0 +1,8 @@ +THIRD-PARTY SOFTWARE + + * Authors: Emil A Eklund + Erik Arvidsson + Glen Murphy + * Info: http://code.google.com/p/explorercanvas/ + * Copyright: Copyright 2006 Google Inc. + * License: Apache 2 License. See LICENSE file. diff --git a/src/sunstone/public/vendor/explorercanvas/excanvas.compiled.js b/src/sunstone/public/vendor/explorercanvas/excanvas.compiled.js new file mode 100644 index 0000000000..a34ca1da34 --- /dev/null +++ b/src/sunstone/public/vendor/explorercanvas/excanvas.compiled.js @@ -0,0 +1,35 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +document.createElement("canvas").getContext||(function(){var s=Math,j=s.round,F=s.sin,G=s.cos,V=s.abs,W=s.sqrt,k=10,v=k/2;function X(){return this.context_||(this.context_=new H(this))}var L=Array.prototype.slice;function Y(b,a){var c=L.call(arguments,2);return function(){return b.apply(a,c.concat(L.call(arguments)))}}var M={init:function(b){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var a=b||document;a.createElement("canvas");a.attachEvent("onreadystatechange",Y(this.init_,this,a))}},init_:function(b){b.namespaces.g_vml_|| +b.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");b.namespaces.g_o_||b.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!b.styleSheets.ex_canvas_){var a=b.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=b.getElementsByTagName("canvas"),d=0;for(;d','","");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};i.stroke=function(b){var a=[],c=P(b?this.fillStyle:this.strokeStyle),d=c.color,f=c.alpha*this.globalAlpha;a.push("g.x)g.x=e.x;if(h.y==null||e.yg.y)g.y=e.y}}a.push(' ">');if(b)if(typeof this.fillStyle=="object"){var m=this.fillStyle,r=0,n={x:0,y:0},o=0,q=1;if(m.type_=="gradient"){var t=m.x1_/this.arcScaleX_,E=m.y1_/this.arcScaleY_,p=this.getCoords_(m.x0_/this.arcScaleX_,m.y0_/this.arcScaleY_), +z=this.getCoords_(t,E);r=Math.atan2(z.x-p.x,z.y-p.y)*180/Math.PI;if(r<0)r+=360;if(r<1.0E-6)r=0}else{var p=this.getCoords_(m.x0_,m.y0_),w=g.x-h.x,x=g.y-h.y;n={x:(p.x-h.x)/w,y:(p.y-h.y)/x};w/=this.arcScaleX_*k;x/=this.arcScaleY_*k;var R=s.max(w,x);o=2*m.r0_/R;q=2*m.r1_/R-o}var u=m.colors_;u.sort(function(ba,ca){return ba.offset-ca.offset});var J=u.length,da=u[0].color,ea=u[J-1].color,fa=u[0].alpha*this.globalAlpha,ga=u[J-1].alpha*this.globalAlpha,S=[],l=0;for(;l')}else a.push('');else{var K=this.lineScale_*this.lineWidth;if(K<1)f*=K;a.push("')}a.push("");this.element_.insertAdjacentHTML("beforeEnd",a.join(""))};i.fill=function(){this.stroke(true)};i.closePath=function(){this.currentPath_.push({type:"close"})};i.getCoords_=function(b,a){var c=this.m_;return{x:k*(b*c[0][0]+a*c[1][0]+c[2][0])-v,y:k*(b*c[0][1]+a*c[1][1]+c[2][1])-v}};i.save=function(){var b={};O(this,b);this.aStack_.push(b);this.mStack_.push(this.m_);this.m_=y(I(),this.m_)};i.restore=function(){O(this.aStack_.pop(), +this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b[a][c])||isNaN(b[a][c]))return false}return true}function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][1]-a[0][1]*a[1][0]))}}i.translate=function(b,a){A(this,y([[1,0,0],[0,1,0],[b,a,1]],this.m_),false)};i.rotate=function(b){var a=G(b),c=F(b);A(this,y([[a,c,0],[-c,a,0],[0,0,1]],this.m_),false)};i.scale=function(b,a){this.arcScaleX_*=b;this.arcScaleY_*=a;A(this,y([[b,0,0],[0,a, +0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager= +M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})(); diff --git a/src/sunstone/templates/login.html b/src/sunstone/templates/login.html index c708ec0ea5..690afc7c93 100644 --- a/src/sunstone/templates/login.html +++ b/src/sunstone/templates/login.html @@ -7,14 +7,16 @@ + - -