From 172fa4859012de93187d460f282e833ff32df69b Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 22 Feb 2011 16:09:11 +0100 Subject: [PATCH 01/46] Feature #495: Fixed bug in Host.create --- src/sunstone/public/js/opennebula.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 74fdbe8027..59c3e2a622 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -267,7 +267,7 @@ var OpenNebula = { url: "/host", type: "POST", dataType: "json", - data: data, + data: JSON.stringify(data), success: function(response) { if (callback) From 86c7768ca6308ce20aa0d94b177b8b5ba1b45fe6 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 22 Feb 2011 17:01:43 +0100 Subject: [PATCH 02/46] Feature #495: Use a darker overlay for jQuery UI dialogs --- src/sunstone/public/css/application.css | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css index 886e469918..4d2a4ad743 100644 --- a/src/sunstone/public/css/application.css +++ b/src/sunstone/public/css/application.css @@ -21,20 +21,20 @@ body { p{ margin:0 10px 10px; } -a { - color: #000C96; text-decoration: none; +a { + color: #000C96; text-decoration: none; } -a:hover { - color: #127FE4; text-decoration: none; +a:hover { + color: #127FE4; text-decoration: none; } -select, button { - padding: 2px; +select, button { + padding: 2px; } -h2 { - float:left; - font-size:20px; - margin-bottom: 5px; +h2 { + float:left; + font-size:20px; + margin-bottom: 5px; padding-bottom: 0} h3 { @@ -296,7 +296,7 @@ textarea:focus{ } .remove_button { - + } tr.odd, tr.even { @@ -480,6 +480,8 @@ tr.even:hover{ cursor: pointer; } +.ui-widget-overlay { background: #353735; opacity: .60; filter:Alpha(Opacity=60); } + .ui-tabs .ui-tabs-nav li a { /*padding: .5em 1em;*/ padding: .3em 1em; From 2f65bbb51dd0df7e32a5d53d7786e4f3eb76a23f Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 22 Feb 2011 18:06:59 +0100 Subject: [PATCH 03/46] Feature #495: New Host - cpu & memory bars show undefined values during INIT --- src/sunstone/public/js/one-ui_views.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index b3b5cbc7a7..a88391eaf0 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -2253,18 +2253,24 @@ function hostElementArray(host_json){ if (!acpu) {acpu=100}; acpu = acpu - parseInt(host.HOST_SHARE.CPU_USAGE); - total_mem = parseInt(host.HOST_SHARE.MAX_MEM); free_mem = parseInt(host.HOST_SHARE.FREE_MEM); - ratio_mem = Math.round(((total_mem - free_mem) / total_mem) * 100); + + if (total_mem == 0) { + ratio_mem = 0; + } else { + ratio_mem = Math.round(((total_mem - free_mem) / total_mem) * 100); + } total_cpu = parseInt(host.HOST_SHARE.MAX_CPU); used_cpu = Math.max(total_cpu - parseInt(host.HOST_SHARE.USED_CPU),acpu); - ratio_cpu = Math.round(((total_cpu - used_cpu) / total_cpu) * 100); - - + if (total_cpu == 0) { + ratio_cpu = 0; + } else { + ratio_cpu = Math.round(((total_cpu - used_cpu) / total_cpu) * 100); + } pb_mem = '
\ From c14188650539490c545f52e25fe671ac60cee677 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 22 Feb 2011 18:07:39 +0100 Subject: [PATCH 04/46] Feature #495: Created a new error regexp --- src/sunstone/public/js/one-ui_views.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index a88391eaf0..f5c7a07080 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -2588,8 +2588,9 @@ function onError(request,error_json) { }; //Parse known errors: - var action_error = new RegExp("^\\[(\\w+)\\] Error trying to (\\w+) (\\w+) \\[(\\w+)\\].*Reason: (.*)\.$"); - var get_error = new RegExp("^\\[(\\w+)\\] Error getting (\\w+) \\[(\\w+)\\]\.$"); + var action_error = /^\[(\w+)\] Error trying to (\w+) (\w+) \[(\w+)\].*Reason: (.*)\.$/; + var action_error_noid = /^\[(\w+)\] Error trying to (\w+) (\w+) (.*)\.$/; + var get_error = /^\[(\w+)\] Error getting (\w+) \[(\w+)\]\.$/; var auth_error = /^\[(\w+)\] User \[.\] not authorized to perform (\w+) on (\w+) \[?(\w+)\]?\.?$/; if (m = message.match(action_error)) { @@ -2598,6 +2599,11 @@ function onError(request,error_json) { object = m[3]; id = m[4]; reason = m[5]; + } else if (m = message.match(action_error_noid)) { + method = m[1]; + action = m[2]; + object = m[3]; + reason = m[4]; } else if (m = message.match(get_error)) { method = m[1]; action = "SHOW"; From a471511073feb85db1dca881a492ffce74d5ca46 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 22 Feb 2011 18:59:40 +0100 Subject: [PATCH 05/46] feature #495: Change Sunstone file names --- src/sunstone/bin/sunstone-server | 102 ++++++++++++++++++ src/sunstone/config.ru | 2 +- src/sunstone/models/OpenNebulaJSON.rb | 23 ++-- .../models/OpenNebulaJSON/ClusterJSON.rb | 2 +- .../models/OpenNebulaJSON/HostJSON.rb | 2 +- .../models/OpenNebulaJSON/ImageJSON.rb | 2 +- .../models/OpenNebulaJSON/PoolJSON.rb | 2 +- .../models/OpenNebulaJSON/UserJSON.rb | 2 +- .../OpenNebulaJSON/VirtualMachineJSON.rb | 2 +- .../OpenNebulaJSON/VirtualNetworkJSON.rb | 2 +- .../models/{OneUI.rb => SunstoneServer.rb} | 0 .../{one-ui.rb => sunstone-server.rb} | 0 12 files changed, 119 insertions(+), 22 deletions(-) create mode 100644 src/sunstone/bin/sunstone-server rename src/sunstone/models/{OneUI.rb => SunstoneServer.rb} (100%) rename src/sunstone/{one-ui.rb => sunstone-server.rb} (100%) diff --git a/src/sunstone/bin/sunstone-server b/src/sunstone/bin/sunstone-server new file mode 100644 index 0000000000..5ac68703d0 --- /dev/null +++ b/src/sunstone/bin/sunstone-server @@ -0,0 +1,102 @@ +if [ -z "$ONE_LOCATION" ]; then + SUNSTONE_PID=/var/run/one/sunstone.pid + SUNSTONE_SERVER=/usr/lib/one/sunstone/config.ru + SUNSTONE_LOCK_FILE=/var/lock/one/.sunstone.lock + SUNSTONE_LOG=/var/log/one/sunstone.log +else + SUNSTONE_PID=$ONE_LOCATION/var/sunstone.pid + SUNSTONE_SERVER=$ONE_LOCATION/lib/sunstone/config.ru + SUNSTONE_LOCK_FILE=$ONE_LOCATION/var/.sunstone.lock + SUNSTONE_LOG=$ONE_LOCATION/var/sunstone.log +fi + +PORT="4567" +HOST="127.0.0.1" + +setup() +{ + + if [ -f $SUNSTONE_LOCK_FILE ]; then + if [ -f $SUNSTONE_PID ]; then + SUNSTONEPID=`cat $SUNSTONE_PID` + ps $SUNSTONEPID &> /dev/null + if [ $? -eq 0 ]; then + echo "Sunstone Server is still running (PID:$SUNSTONEPID). Please try 'sunstone-server stop' first." + exit 1 + fi + fi + echo "Stale .lock detected. Erasing it." + rm $SUNSTONE_LOCK_FILE + fi +} + + +start() +{ + if [ ! -f "$SUNSTONE_SERVER" ]; then + echo "Can not find $SUNSTONE_SERVER." + exit 1 + fi + + # Start the sunstone daemon + touch $SUNSTONE_LOCK_FILE + rackup $SUNSTONE_SERVER -s thin -p $PORT -o $HOST -P $SUNSTONE_PID &> $SUNSTONE_LOG & + + LASTRC=$? + + if [ $LASTRC -ne 0 ]; then + echo "Error executing $SUNSTONE_SERVER" + exit 1 + fi + + sleep 1 + ps $LASTPID &> /dev/null + + if [ $? -ne 0 ]; then + echo "Error executing $SUNSTONE_SERVER." + exit 1 + fi + + echo "sunstone-server started" +} + +# +# Function that stops the daemon/service +# +stop() +{ + if [ ! -f $SUNSTONE_PID ]; then + echo "Couldn't find sunstone-server process pid." + exit 1 + fi + + # Kill the sunstone daemon + kill -INT `cat $SUNSTONE_PID` &> /dev/null + + echo "sunstone-server stopped" +} + +while getopts "p:h:" OPTION +do + case $OPTION in + p) PORT=$OPTARG;; + h) HOST=$OPTARG;; + \?) echo "Invalid option: -$OPTARG" >&2; exit 3 ;; + esac +done + +shift $((OPTIND-1)) + +case "$1" in + start) + setup + start + ;; + stop) + stop + ;; + *) + echo "Usage: sunstone {start|stop}" >&2 + exit 3 + ;; +esac \ No newline at end of file diff --git a/src/sunstone/config.ru b/src/sunstone/config.ru index a7034811d0..8b695e23af 100644 --- a/src/sunstone/config.ru +++ b/src/sunstone/config.ru @@ -19,6 +19,6 @@ # TBD Change path for intallation tree $: << File.dirname(__FILE__) -require 'one-ui.rb' +require 'sunstone-server.rb' run Sinatra::Application diff --git a/src/sunstone/models/OpenNebulaJSON.rb b/src/sunstone/models/OpenNebulaJSON.rb index 28821ef8e1..51e2478221 100644 --- a/src/sunstone/models/OpenNebulaJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON.rb @@ -18,29 +18,24 @@ ONE_LOCATION = ENV["ONE_LOCATION"] if !ONE_LOCATION RUBY_LIB_LOCATION = "/usr/lib/one/ruby" - VAR_LOCATION = "/var/lib/one" else RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" - VAR_LOCATION = ONE_LOCATION+"/var" end $: << RUBY_LIB_LOCATION +$: << File.dirname(__FILE__) require 'OpenNebula' include OpenNebula -# TBD Change path for intallation tree -#require 'OpenNebulaJSON/PoolJSON' -#require 'OpenNebulaJSON/HostJSON' -#require 'OpenNebulaJSON/JSONUtils' -require 'models/OpenNebulaJSON/ClusterJSON' -require 'models/OpenNebulaJSON/HostJSON' -require 'models/OpenNebulaJSON/ImageJSON' -require 'models/OpenNebulaJSON/JSONUtils' -require 'models/OpenNebulaJSON/PoolJSON' -require 'models/OpenNebulaJSON/UserJSON' -require 'models/OpenNebulaJSON/VirtualMachineJSON' -require 'models/OpenNebulaJSON/VirtualNetworkJSON' +require 'OpenNebulaJSON/ClusterJSON' +require 'OpenNebulaJSON/HostJSON' +require 'OpenNebulaJSON/ImageJSON' +require 'OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/PoolJSON' +require 'OpenNebulaJSON/UserJSON' +require 'OpenNebulaJSON/VirtualMachineJSON' +require 'OpenNebulaJSON/VirtualNetworkJSON' module OpenNebula class Error diff --git a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb index 9c015d0187..a8dbc44635 100644 --- a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'models/OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class ClusterJSON < OpenNebula::Cluster diff --git a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb index 42490d405a..33f8962f6a 100644 --- a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'models/OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class HostJSON < OpenNebula::Host diff --git a/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb b/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb index 05cb041d21..36ddb98790 100644 --- a/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'models/OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class ImageJSON < OpenNebula::Image diff --git a/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb b/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb index 4c4414200d..d32241c5d7 100644 --- a/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/PoolJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'models/OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class HostPoolJSON < OpenNebula::HostPool; include JSONUtils; end diff --git a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb index 803903641f..1a17e93a6d 100644 --- a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'models/OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class UserJSON < OpenNebula::User diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index 932b54a97b..3bdc57eeaa 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'models/OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class VirtualMachineJSON < OpenNebula::VirtualMachine diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb index 3170dd1607..b4e7503dbb 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'models/OpenNebulaJSON/JSONUtils' +require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class VirtualNetworkJSON < OpenNebula::VirtualNetwork diff --git a/src/sunstone/models/OneUI.rb b/src/sunstone/models/SunstoneServer.rb similarity index 100% rename from src/sunstone/models/OneUI.rb rename to src/sunstone/models/SunstoneServer.rb diff --git a/src/sunstone/one-ui.rb b/src/sunstone/sunstone-server.rb similarity index 100% rename from src/sunstone/one-ui.rb rename to src/sunstone/sunstone-server.rb From 4421b4cd5ea6994aa358e0213faf84e2ade3c80d Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 22 Feb 2011 19:02:54 +0100 Subject: [PATCH 06/46] feature #495: Fix require in sunstone-server --- src/sunstone/sunstone-server.rb | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index e8f5a4b24c..c71b857aa1 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -16,30 +16,21 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -############################################################################## -# Environment Configuration for the Server -############################################################################## -HOST = "127.0.0.1" -PORT = "4567" - - ############################################################################## # Required libraries ############################################################################## require 'rubygems' require 'sinatra' -require 'models/OneUI' +require 'models/SunstoneServer' ############################################################################## # Sinatra Configuration ############################################################################## -set :host, HOST -set :port, PORT - use Rack::Session::Pool + ############################################################################## # Helpers ############################################################################## @@ -54,7 +45,7 @@ helpers do user = auth.credentials[0] sha1_pass = Digest::SHA1.hexdigest(auth.credentials[1]) - rc = OneUI.authorize(user, sha1_pass) + rc = SunstoneServer.authorize(user, sha1_pass) if rc[1] session["user"] = user session["user_id"] = rc[1] @@ -86,7 +77,7 @@ before do unless request.path=='/login' || request.path=='/' halt 401 unless authorized? - @OneUI = OneUI.new(session["user"], session["password"]) + @SunstoneServer = SunstoneServer.new(session["user"], session["password"]) end end @@ -132,44 +123,44 @@ end # GET Pool information ############################################################################## get '/:pool' do - @OneUI.get_pool(params[:pool], session["user_id"]) + @SunstoneServer.get_pool(params[:pool], session["user_id"]) end ############################################################################## # GET Resource information ############################################################################## get '/:resource/:id' do - @OneUI.get_resource(params[:resource], params[:id]) + @SunstoneServer.get_resource(params[:resource], params[:id]) end ############################################################################## # Delete Resource ############################################################################## delete '/:resource/:id' do - @OneUI.delete_resource(params[:resource], params[:id]) + @SunstoneServer.delete_resource(params[:resource], params[:id]) end ############################################################################## # Create a new Resource ############################################################################## post '/:pool' do - @OneUI.create_resource(params[:pool], request.body.read) + @SunstoneServer.create_resource(params[:pool], request.body.read) end ############################################################################## # Perform an action on a Resource ############################################################################## post '/:resource/:id/action' do - @OneUI.perform_action(params[:resource], params[:id], request.body.read) + @SunstoneServer.perform_action(params[:resource], params[:id], request.body.read) end ############################################################################## # Config and Logs ############################################################################## get '/config' do - @OneUI.get_configuration + @SunstoneServer.get_configuration(session["user_id"]) end get '/vm/:id/log' do - @OneUI.get_vm_log(params[:id].to_i) + @SunstoneServer.get_vm_log(params[:id]) end From 7ac29ac7c63824b0e51d0edb0fed6860bcc4d802 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 22 Feb 2011 19:06:27 +0100 Subject: [PATCH 07/46] feature #495: Change name class SunstoneServer --- src/sunstone/models/SunstoneServer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index f41200adbf..fe2b9efa25 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -20,7 +20,7 @@ require 'models/OpenNebulaJSON' include OpenNebulaJSON -class OneUI +class SunstoneServer def initialize(username, password) # TBD one_client_user(name) from CloudServer @client = Client.new("dummy:dummy") From bb760948911694e10fce69f8664ed043df28dbc9 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 22 Feb 2011 19:07:22 +0100 Subject: [PATCH 08/46] feature #495: Check user for GET log action --- src/sunstone/models/SunstoneServer.rb | 28 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index fe2b9efa25..d42a10fceb 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -150,7 +150,11 @@ class SunstoneServer ############################################################################ # ############################################################################ - def get_configuration + def get_configuration(user_id) + if user_id != "0" + return [401, ""] + end + one_config = VAR_LOCATION + "/config" config = Hash.new @@ -178,17 +182,21 @@ class SunstoneServer # ############################################################################ def get_vm_log(id) - id = id.to_s - vm_log_file = VAR_LOCATION + "/#{id}/vm.log" + resource = retrieve_resource("vm", id) + if OpenNebula.is_error?(resource) + return [404, nil] + else + vm_log_file = VAR_LOCATION + "/#{id}/vm.log" - begin - log = File.read(vm_log_file) - rescue Exception => e - error = Error.new("Error: log for VM #{id} not available") - return [500, error.to_s] + begin + log = File.read(vm_log_file) + rescue Exception => e + error = Error.new("Error: log for VM #{id} not available") + return [500, error.to_s] + end + + return [200, log] end - - return [200, log] end private From b362eae32a4b0678885cd9b5a71512727347a608 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Wed, 23 Feb 2011 12:22:31 +0100 Subject: [PATCH 09/46] Feature #495: moved vendor libraries to vendor directories --- src/sunstone/public/css/jquery.jgrowl.css | 0 src/sunstone/public/css/layout.css | 0 .../jquery-ui-1.8.7.custom.css | 34 +++++++++--------- .../ui-bg_flat_0_575c5b_40x100.png | Bin .../ui-bg_flat_0_8f9392_40x100.png | Bin .../ui-bg_flat_0_aaaaaa_40x100.png | Bin .../ui-bg_flat_75_ffffff_40x100.png | Bin .../ui-bg_glass_55_fbf9ee_1x400.png | Bin .../ui-bg_glass_65_ffffff_1x400.png | Bin .../ui-bg_glass_75_dadada_1x400.png | Bin .../ui-bg_glass_75_e6e6e6_1x400.png | Bin .../ui-bg_glass_95_fef1ec_1x400.png | Bin .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin .../ui-icons_222222_256x240.png | Bin .../ui-icons_222222_256x240.png.old | Bin .../ui-icons_2e83ff_256x240.png | Bin .../ui-icons_454545_256x240.png | Bin .../ui-icons_888888_256x240.png | Bin .../ui-icons_cd0a0a_256x240.png | Bin src/sunstone/public/js/layout.js | 0 src/sunstone/public/js/{ => vendor}/base64.js | 0 .../js/{ => vendor}/jquery-1.4.4.min.js | 0 .../jquery-ui-1.8.7.custom.min.js | 0 .../js/{ => vendor}/jquery.dataTables.min.js | 0 .../{ => vendor}/jquery.jgrowl_minimized.js | 0 .../{ => vendor}/jquery.layout.min-1.2.0.js | 0 src/sunstone/templates/index.html | 16 ++++----- src/sunstone/templates/login.html | 7 ++-- 28 files changed, 29 insertions(+), 28 deletions(-) mode change 100755 => 100644 src/sunstone/public/css/jquery.jgrowl.css mode change 100755 => 100644 src/sunstone/public/css/layout.css rename src/sunstone/public/css/{smoothness => vendor}/jquery-ui-1.8.7.custom.css (94%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_flat_0_575c5b_40x100.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_flat_0_8f9392_40x100.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_flat_0_aaaaaa_40x100.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_flat_75_ffffff_40x100.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_glass_55_fbf9ee_1x400.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_glass_65_ffffff_1x400.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_glass_75_dadada_1x400.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_glass_75_e6e6e6_1x400.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_glass_95_fef1ec_1x400.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-bg_highlight-soft_75_cccccc_1x100.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-icons_222222_256x240.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-icons_222222_256x240.png.old (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-icons_2e83ff_256x240.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-icons_454545_256x240.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-icons_888888_256x240.png (100%) rename src/sunstone/public/css/{smoothness/images => vendor}/ui-icons_cd0a0a_256x240.png (100%) mode change 100755 => 100644 src/sunstone/public/js/layout.js rename src/sunstone/public/js/{ => vendor}/base64.js (100%) rename src/sunstone/public/js/{ => vendor}/jquery-1.4.4.min.js (100%) rename src/sunstone/public/js/{ => vendor}/jquery-ui-1.8.7.custom.min.js (100%) rename src/sunstone/public/js/{ => vendor}/jquery.dataTables.min.js (100%) rename src/sunstone/public/js/{ => vendor}/jquery.jgrowl_minimized.js (100%) rename src/sunstone/public/js/{ => vendor}/jquery.layout.min-1.2.0.js (100%) diff --git a/src/sunstone/public/css/jquery.jgrowl.css b/src/sunstone/public/css/jquery.jgrowl.css old mode 100755 new mode 100644 diff --git a/src/sunstone/public/css/layout.css b/src/sunstone/public/css/layout.css old mode 100755 new mode 100644 diff --git a/src/sunstone/public/css/smoothness/jquery-ui-1.8.7.custom.css b/src/sunstone/public/css/vendor/jquery-ui-1.8.7.custom.css similarity index 94% rename from src/sunstone/public/css/smoothness/jquery-ui-1.8.7.custom.css rename to src/sunstone/public/css/vendor/jquery-ui-1.8.7.custom.css index e74edd7957..15e2706919 100644 --- a/src/sunstone/public/css/smoothness/jquery-ui-1.8.7.custom.css +++ b/src/sunstone/public/css/vendor/jquery-ui-1.8.7.custom.css @@ -59,26 +59,26 @@ /*.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; }*/ /*.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }*/ -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } @@ -89,14 +89,14 @@ ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } +.ui-icon { width: 16px; height: 16px; background-image: url(ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-icons_cd0a0a_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } @@ -291,8 +291,8 @@ .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } /* Overlays */ -.ui-widget-overlay { background: #575c5b url(images/ui-bg_flat_0_575c5b_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* +.ui-widget-overlay { background: #575c5b url(ui-bg_flat_0_575c5b_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* * jQuery UI Resizable 1.8.7 * * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_flat_0_575c5b_40x100.png b/src/sunstone/public/css/vendor/ui-bg_flat_0_575c5b_40x100.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_flat_0_575c5b_40x100.png rename to src/sunstone/public/css/vendor/ui-bg_flat_0_575c5b_40x100.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_flat_0_8f9392_40x100.png b/src/sunstone/public/css/vendor/ui-bg_flat_0_8f9392_40x100.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_flat_0_8f9392_40x100.png rename to src/sunstone/public/css/vendor/ui-bg_flat_0_8f9392_40x100.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/src/sunstone/public/css/vendor/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png rename to src/sunstone/public/css/vendor/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/src/sunstone/public/css/vendor/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png rename to src/sunstone/public/css/vendor/ui-bg_flat_75_ffffff_40x100.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/src/sunstone/public/css/vendor/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png rename to src/sunstone/public/css/vendor/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/src/sunstone/public/css/vendor/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png rename to src/sunstone/public/css/vendor/ui-bg_glass_65_ffffff_1x400.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/src/sunstone/public/css/vendor/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png rename to src/sunstone/public/css/vendor/ui-bg_glass_75_dadada_1x400.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/src/sunstone/public/css/vendor/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png rename to src/sunstone/public/css/vendor/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/src/sunstone/public/css/vendor/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png rename to src/sunstone/public/css/vendor/ui-bg_glass_95_fef1ec_1x400.png diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/src/sunstone/public/css/vendor/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to src/sunstone/public/css/vendor/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png b/src/sunstone/public/css/vendor/ui-icons_222222_256x240.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png rename to src/sunstone/public/css/vendor/ui-icons_222222_256x240.png diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png.old b/src/sunstone/public/css/vendor/ui-icons_222222_256x240.png.old similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png.old rename to src/sunstone/public/css/vendor/ui-icons_222222_256x240.png.old diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_2e83ff_256x240.png b/src/sunstone/public/css/vendor/ui-icons_2e83ff_256x240.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-icons_2e83ff_256x240.png rename to src/sunstone/public/css/vendor/ui-icons_2e83ff_256x240.png diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_454545_256x240.png b/src/sunstone/public/css/vendor/ui-icons_454545_256x240.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-icons_454545_256x240.png rename to src/sunstone/public/css/vendor/ui-icons_454545_256x240.png diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_888888_256x240.png b/src/sunstone/public/css/vendor/ui-icons_888888_256x240.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-icons_888888_256x240.png rename to src/sunstone/public/css/vendor/ui-icons_888888_256x240.png diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/src/sunstone/public/css/vendor/ui-icons_cd0a0a_256x240.png similarity index 100% rename from src/sunstone/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png rename to src/sunstone/public/css/vendor/ui-icons_cd0a0a_256x240.png diff --git a/src/sunstone/public/js/layout.js b/src/sunstone/public/js/layout.js old mode 100755 new mode 100644 diff --git a/src/sunstone/public/js/base64.js b/src/sunstone/public/js/vendor/base64.js similarity index 100% rename from src/sunstone/public/js/base64.js rename to src/sunstone/public/js/vendor/base64.js diff --git a/src/sunstone/public/js/jquery-1.4.4.min.js b/src/sunstone/public/js/vendor/jquery-1.4.4.min.js similarity index 100% rename from src/sunstone/public/js/jquery-1.4.4.min.js rename to src/sunstone/public/js/vendor/jquery-1.4.4.min.js diff --git a/src/sunstone/public/js/jquery-ui-1.8.7.custom.min.js b/src/sunstone/public/js/vendor/jquery-ui-1.8.7.custom.min.js similarity index 100% rename from src/sunstone/public/js/jquery-ui-1.8.7.custom.min.js rename to src/sunstone/public/js/vendor/jquery-ui-1.8.7.custom.min.js diff --git a/src/sunstone/public/js/jquery.dataTables.min.js b/src/sunstone/public/js/vendor/jquery.dataTables.min.js similarity index 100% rename from src/sunstone/public/js/jquery.dataTables.min.js rename to src/sunstone/public/js/vendor/jquery.dataTables.min.js diff --git a/src/sunstone/public/js/jquery.jgrowl_minimized.js b/src/sunstone/public/js/vendor/jquery.jgrowl_minimized.js similarity index 100% rename from src/sunstone/public/js/jquery.jgrowl_minimized.js rename to src/sunstone/public/js/vendor/jquery.jgrowl_minimized.js diff --git a/src/sunstone/public/js/jquery.layout.min-1.2.0.js b/src/sunstone/public/js/vendor/jquery.layout.min-1.2.0.js similarity index 100% rename from src/sunstone/public/js/jquery.layout.min-1.2.0.js rename to src/sunstone/public/js/vendor/jquery.layout.min-1.2.0.js diff --git a/src/sunstone/templates/index.html b/src/sunstone/templates/index.html index a6c483b362..9100ba8156 100644 --- a/src/sunstone/templates/index.html +++ b/src/sunstone/templates/index.html @@ -4,18 +4,18 @@ OpenNebula Admin Console - + - - - - - - + + + + + + @@ -27,7 +27,6 @@
-
@@ -40,7 +39,6 @@
\
\ \ '+ From 6a6c865a6219c59637dc49c2baca1f4869b9c999 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:03:58 +0100 Subject: [PATCH 24/46] Fixed image creation --- src/sunstone/public/js/one-ui_views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index bdee84ff12..c9a94f55fd 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -2089,7 +2089,7 @@ function createImageDialog(){ break; } obj = { "image" : img_json }; - OpenNebula.Image.create({data: obj,success: addImageElement,error: onError}); + OpenNebula.Image.register({data: obj,success: addImageElement,error: onError}); $create_image_dialog.dialog('close'); return false; From b8f3cbd42a8f8434299d7b2331ae32256f30af1a Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:07:14 +0100 Subject: [PATCH 25/46] Feature #495: Image state in the extended info fixed --- src/sunstone/public/js/one-ui_views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index c9a94f55fd..2139dd22f1 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -3172,7 +3172,7 @@ function updateImageInfo(request,img){ \ \ \ - \ + \ \
Virtual Network template
State'+img_info.STATE+''+OpenNebula.Helper.resource_state.("image",img_info.STATE)+'
\
\ From df519779131d1f39ed4c2c480b8ac066fdb2ff13 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:12:15 +0100 Subject: [PATCH 26/46] Fixed public persistency flag in extended image info --- src/sunstone/public/js/one-ui_views.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index 2139dd22f1..90f4db5986 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -3160,11 +3160,11 @@ function updateImageInfo(request,img){ \ \ Public\ - '+(img_info.PUBLIC ? "yes" : "no")+'\ + '+(parseInt(img_info.PUBLIC) ? "yes" : "no")+'\ \ \ Persistent\ - '+(img_info.PERSISTENT ? "yes" : "no")+'\ + '+(parseInt(img_info.PERSISTENT) ? "yes" : "no")+'\ \ \ Source\ @@ -3172,7 +3172,7 @@ function updateImageInfo(request,img){ \ \ State\ - '+OpenNebula.Helper.resource_state.("image",img_info.STATE)+'\ + '+OpenNebula.Helper.resource_state("image",img_info.STATE)+'\ \ \
\ From 7b6f3307bc618112b58a49e139186174575ef8b8 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:15:12 +0100 Subject: [PATCH 27/46] Feature #495: Removed preset value in the image attribute dialog --- src/sunstone/public/js/one-ui_views.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index 90f4db5986..51baf489ce 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -809,11 +809,11 @@ function setupImageAttributesDialogs(){
\ \ \ - \ + \
\
\ \ - \ + \
\
\ \ From 1696587c75e85d2607de8b96ebaeb32452c29036 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:18:18 +0100 Subject: [PATCH 28/46] Feature #495: Fixed image attribute dialog size --- src/sunstone/public/js/one-ui_views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index 51baf489ce..eba872a6e1 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -826,7 +826,7 @@ function setupImageAttributesDialogs(){ autoOpen:false, width:400, modal:true, - height:270, + height:200, resizable:false, }); From 7288f5c189b2705fe7514ea71b895d742058ddfe Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:25:04 +0100 Subject: [PATCH 29/46] Feature #495: Select all checkbox autoselects when all is checked and viceversa. --- src/sunstone/public/js/one-ui_views.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index eba872a6e1..6c910c7b1a 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -2235,9 +2235,17 @@ function tableCheckboxesListener(dataTable){ dataTable = $(this).parents('table').dataTable(); context = dataTable.parents('form'); last_action_b = $('.last_action_button',context); - nodes_length = $('input:checked',dataTable.fnGetNodes()).length; + nodes = dataTable.fnGetNodes(); + total_length = nodes.length; + checked_length = $('input:checked',nodes).length; - if (nodes_length){ + if (total_length == checked_length){ + $('.check_all',dataTable).attr("checked","checked"); + } else { + $('.check_all',dataTable).removeAttr("checked"); + } + + if (checked_length){ $('.top_button, .list_button',context).button("enable"); if (last_action_b.length && last_action_b.val().length){ last_action_b.button("enable"); From 95b4b90d8f0152f884f79d71f6a054b0c220b0dd Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:32:47 +0100 Subject: [PATCH 30/46] Feature #495: Fixed some column sizes --- src/sunstone/public/js/one-ui_views.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index 6c910c7b1a..7e2410edcd 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -179,7 +179,8 @@ function initDataTables(){ "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, - { "sWidth": "35px", "aTargets": [1] } + { "sWidth": "35px", "aTargets": [1] }, + { "sWidth": "100px", "aTargets": [2] } ] }); @@ -190,8 +191,9 @@ function initDataTables(){ "sPaginationType": "full_numbers", "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "60px", "aTargets": [0,5,6,7] }, - { "sWidth": "35px", "aTargets": [1] } + { "sWidth": "60px", "aTargets": [0,4,5,6,7] }, + { "sWidth": "35px", "aTargets": [1] }, + { "sWidth": "100px", "aTargets": [2] } ] }); @@ -217,7 +219,8 @@ function initDataTables(){ "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0,3] }, - { "sWidth": "35px", "aTargets": [1] } + { "sWidth": "35px", "aTargets": [1] }, + { "sWidth": "100px", "aTargets": [2,3] } ] }); From 28b5ad6f2c69cb605a8638944fb050cd1f692c5a Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:48:16 +0100 Subject: [PATCH 31/46] Feature #495: Fixed user refresh button and consider empty pool possibility --- src/sunstone/public/js/one-ui_views.templates.js | 2 +- src/sunstone/public/js/opennebula.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.templates.js b/src/sunstone/public/js/one-ui_views.templates.js index 67dbaa50b6..244050c1bd 100644 --- a/src/sunstone/public/js/one-ui_views.templates.js +++ b/src/sunstone/public/js/one-ui_views.templates.js @@ -895,7 +895,7 @@ var userlist_tmpl = '
\
\
\ - OpenNebula.VM.list\ + OpenNebula.User.list\
\
\ \ diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 59c3e2a622..c7e7502f16 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -126,7 +126,9 @@ var OpenNebula = { var p_pool = []; - pool = response[pool_name][type]; + if (response[pool_name]) { + pool = response[pool_name][type]; + } else { pull = null }; if (pool == null) { From 46f7a1852800eea51fc52b5ed828ad0b4be536f5 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 23 Feb 2011 19:56:12 +0100 Subject: [PATCH 32/46] Feature #495: Update select lists of images and networks when a new element is added --- src/sunstone/public/js/one-ui_views.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index 7e2410edcd..513de90782 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -2771,11 +2771,14 @@ function updateVNetworkElement(request, vn_json){ function deleteVNetworkElement(req){ deleteElement(dataTable_vNetworks,'#vnetwork_'+req.request.data); + //How to delete vNetwork select option here? } function addVNetworkElement(request,vn_json){ element = vNetworkElementArray(vn_json); addElement(element,dataTable_vNetworks); + vnetworks_select += ""; + $('div.vm_section#networks select#NETWORK').html(vnetworks_select); } @@ -2828,11 +2831,14 @@ function updateImageElement(request, image_json){ function deleteImageElement(req){ deleteElement(dataTable_images,'#image_'+req.request.data); + //how to update the image select here? } function addImageElement(request, image_json){ element = imageElementArray(image_json); addElement(element,dataTable_images); + images_select += ""; + $('div.vm_section#disks select#IMAGE').html(images_select); } function updateImagesView(request, images_list){ From eede785e7034bd74f6a1d968a6e8562e9e7424cc Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 24 Feb 2011 11:28:24 +0100 Subject: [PATCH 33/46] Feature #495: Delete cluster as button and not as list item --- src/sunstone/public/js/one-ui_views.templates.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.templates.js b/src/sunstone/public/js/one-ui_views.templates.js index 244050c1bd..a31490e7de 100644 --- a/src/sunstone/public/js/one-ui_views.templates.js +++ b/src/sunstone/public/js/one-ui_views.templates.js @@ -168,14 +168,14 @@ var hostlist_tmpl =
\
\ \ + \ \
\
\ - \ + \
\
\ \ From adda759f2055331756eefa6fedd8b03a5aec04f7 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 24 Feb 2011 11:41:44 +0100 Subject: [PATCH 34/46] Feature #495: Improved path vs source radio labels in the new image dialog --- src/sunstone/public/js/one-ui_views.templates.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.templates.js b/src/sunstone/public/js/one-ui_views.templates.js index a31490e7de..a9dbe832eb 100644 --- a/src/sunstone/public/js/one-ui_views.templates.js +++ b/src/sunstone/public/js/one-ui_views.templates.js @@ -1042,10 +1042,13 @@ var create_image_tmpl =
\
\ \ - Provide a path
\ - Provide a source
\ - Create an empty datablock\ -
Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.
\ + \ +
\ + \ +
\ + \ + \ +
Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.

\
\
\ \ From 21c5155b5e1d597cad62f83a4083ce9600484fb1 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 24 Feb 2011 12:28:57 +0100 Subject: [PATCH 35/46] Feature #495: fixed bug in install.sh when installing with the -l option --- install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index ccddf49715..ec2d5b1341 100755 --- a/install.sh +++ b/install.sh @@ -297,6 +297,11 @@ INSTALL_CLIENT_FILES=( RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula ) +INSTALL_SUNSTONE_RUBY_FILES=( + SUNSTONE_RUBY_LIB_FILES:$LIB_LOCATION/ruby + RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula +) + INSTALL_SUNSTONE_FILES=( SUNSTONE_FILES:$SUNSTONE_LOCATION SUNSTONE_BIN_FILES:$BIN_LOCATION @@ -308,8 +313,6 @@ INSTALL_SUNSTONE_FILES=( SUNSTONE_PUBLIC_CSS_FILES:$SUNSTONE_LOCATION/public/css SUNSTONE_PUBLIC_CSS_VENDOR_FILES:$SUNSTONE_LOCATION/public/css/vendor SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images - SUNSTONE_RUBY_LIB_FILES:$LIB_LOCATION/ruby - RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula ) INSTALL_ETC_FILES=( @@ -818,7 +821,7 @@ do_file() { if [ "$CLIENT" = "yes" ]; then INSTALL_SET=${INSTALL_CLIENT_FILES[@]} elif [ "$SUNSTONE" = "yes" ]; then - INSTALL_SET=${INSTALL_SUNSTONE_FILES[@]} + INSTALL_SET="${INSTALL_SUNSTONE_RUBY_FILES[@]} ${INSTALL_SUNSTONE_FILES[@]}" else INSTALL_SET="${INSTALL_FILES[@]} ${INSTALL_SUNSTONE_FILES[@]}" fi From d3c19cc91a57a360ebfebbfe581f08b35c5a1f32 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 24 Feb 2011 12:31:24 +0100 Subject: [PATCH 36/46] feature #495: Add usage to sunstone-server --- src/sunstone/bin/sunstone-server | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/sunstone/bin/sunstone-server b/src/sunstone/bin/sunstone-server index 977750dd03..06efb73b8a 100755 --- a/src/sunstone/bin/sunstone-server +++ b/src/sunstone/bin/sunstone-server @@ -32,6 +32,14 @@ fi PORT="4567" HOST="127.0.0.1" +usage() { + echo + echo "Usage: sunstone-server [-H host] [-p port]" + echo + echo "-H: Host for the Sunstone server, default value: localhost" + echo "-p: Port for incoming connections, default value: 4567" +} + setup() { @@ -92,30 +100,25 @@ stop() # Kill the sunstone daemon kill -INT `cat $SUNSTONE_PID` &> /dev/null + # Remove pid files + rm -f $SUNSTONE_LOCK_FILE &> /dev/null + echo "sunstone-server stopped" } -while getopts "p:h:" OPTION +while getopts "p:H:" OPTION do case $OPTION in - p) PORT=$OPTARG;; - h) HOST=$OPTARG;; - \?) echo "Invalid option: -$OPTARG" >&2; exit 3 ;; + p) PORT=$OPTARG;; + H) HOST=$OPTARG;; + *) usage; exit 3;; esac done shift $((OPTIND-1)) case "$1" in - start) - setup - start - ;; - stop) - stop - ;; - *) - echo "Usage: sunstone {start|stop}" >&2 - exit 3 - ;; + start) setup; start;; + stop) stop;; + *) usage; exit 3;; esac From c92baa6cd223c9bfd5aad877aa09e4b9271cd287 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 24 Feb 2011 12:31:57 +0100 Subject: [PATCH 37/46] feature #495: Change user_flag for pools --- src/sunstone/models/SunstoneServer.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index fbb9422c82..be52bde555 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -14,8 +14,6 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -# TBD Change path for intallation tree - ONE_LOCATION = ENV["ONE_LOCATION"] if !ONE_LOCATION @@ -24,7 +22,6 @@ else VAR_LOCATION = ONE_LOCATION+"/var" end -#require 'OpenNebulaJSON' require 'models/OpenNebulaJSON' include OpenNebulaJSON @@ -61,9 +58,8 @@ class SunstoneServer ############################################################################ # ############################################################################ - def get_pool(kind, user_id) - user_flag = user_id=="0" ? -2 : -1 - + def get_pool(kind) + user_flag = -1 pool = case kind when "cluster" then ClusterPoolJSON.new(@client) when "host" then HostPoolJSON.new(@client) From 0b1f69a8ad14bcd7f850440702eca2de8a2fefb4 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 24 Feb 2011 12:33:43 +0100 Subject: [PATCH 38/46] feature #495: Change error when VM log is not found --- src/sunstone/models/SunstoneServer.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index be52bde555..0efa1dc63e 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -195,8 +195,7 @@ class SunstoneServer begin log = File.read(vm_log_file) rescue Exception => e - error = Error.new("Error: log for VM #{id} not available") - return [500, error.to_s] + return [200, "Log for VM #{id} not available"] end return [200, log] From beed4932dea8c8219abd335a81c468a54bda404a Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 24 Feb 2011 12:34:22 +0100 Subject: [PATCH 39/46] feature #495: Change user_flag for GET pool --- src/sunstone/sunstone-server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index c71b857aa1..f855f3e0bc 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -123,7 +123,7 @@ end # GET Pool information ############################################################################## get '/:pool' do - @SunstoneServer.get_pool(params[:pool], session["user_id"]) + @SunstoneServer.get_pool(params[:pool]) end ############################################################################## From 7201037ac8c7ba771c31e5ab6bb5f1bf181a55b8 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 24 Feb 2011 12:36:55 +0100 Subject: [PATCH 40/46] Feature #495: Fixed bug defining twice the ONE_LOCATION global variable in the sinatra server --- src/sunstone/models/OpenNebulaJSON.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/models/OpenNebulaJSON.rb b/src/sunstone/models/OpenNebulaJSON.rb index 51e2478221..709f553a48 100644 --- a/src/sunstone/models/OpenNebulaJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -ONE_LOCATION = ENV["ONE_LOCATION"] +ONE_LOCATION = ENV["ONE_LOCATION"] if !ONE_LOCATION if !ONE_LOCATION RUBY_LIB_LOCATION = "/usr/lib/one/ruby" From c8e87b3ee9477508756d6aa1480e254b832c4969 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 24 Feb 2011 12:51:33 +0100 Subject: [PATCH 41/46] Feature #495: Fixed mismatch in the name of the "saveas" and "livemigrate" action. --- src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb | 4 ++-- src/sunstone/test/examples/vm/{save_as.json => saveas.json} | 4 ++-- src/sunstone/test/spec/vm_spec.rb | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename src/sunstone/test/examples/vm/{save_as.json => saveas.json} (78%) diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index 3bdc57eeaa..92d152a9e9 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -45,14 +45,14 @@ module OpenNebulaJSON when "deploy" then self.deploy(action_hash['params']) when "finalize" then self.finalize when "hold" then self.hold - when "live_migrate" then self.live_migrate(action_hash['params']) + when "livemigrate" then self.live_migrate(action_hash['params']) when "migrate" then self.migrate(action_hash['params']) when "resume" then self.resume when "release" then self.release when "stop" then self.stop when "suspend" then self.suspend when "restart" then self.restart - when "save_as" then self.save_as(action_hash['params']) + when "saveas" then self.save_as(action_hash['params']) when "shutdown" then self.shutdown else error_msg = "#{action_hash['perform']} action not " << diff --git a/src/sunstone/test/examples/vm/save_as.json b/src/sunstone/test/examples/vm/saveas.json similarity index 78% rename from src/sunstone/test/examples/vm/save_as.json rename to src/sunstone/test/examples/vm/saveas.json index 8f4ae8e40e..1ccf3d3698 100644 --- a/src/sunstone/test/examples/vm/save_as.json +++ b/src/sunstone/test/examples/vm/saveas.json @@ -4,6 +4,6 @@ "disk_id": "0", "image_name": "new_image" }, - "perform": "save_as" + "perform": "saveas" } -} \ No newline at end of file +} diff --git a/src/sunstone/test/spec/vm_spec.rb b/src/sunstone/test/spec/vm_spec.rb index cecd164724..1ade30e4d8 100644 --- a/src/sunstone/test/spec/vm_spec.rb +++ b/src/sunstone/test/spec/vm_spec.rb @@ -35,7 +35,7 @@ describe 'VirtualMachine tests' do @action_deploy = File.read(EXAMPLES_PATH + '/vm/deploy.json') @action_hold = File.read(EXAMPLES_PATH + '/vm/hold.json') - @action_saveas = File.read(EXAMPLES_PATH + '/vm/save_as.json') + @action_saveas = File.read(EXAMPLES_PATH + '/vm/saveas.json') @wrong_action = File.read(EXAMPLES_PATH + '/error/wrong_action.json') end @@ -125,7 +125,7 @@ describe 'VirtualMachine tests' do end ############################################################################ - # Save_as + # Saveas ############################################################################ it "should prepare the VirtualMachine 0 disk to be saved" do url = '/vm/0/action' @@ -134,7 +134,7 @@ describe 'VirtualMachine tests' do last_response.status.should eql(204) end - it "should get VirtualMachine 0 information after save_as action" do + it "should get VirtualMachine 0 information after saveas action" do url = '/vm/0' get url From c8464e2b4e899982f04c8555e5f96c9200b78c61 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 24 Feb 2011 12:54:56 +0100 Subject: [PATCH 42/46] Feature #495: Images select updated correctly when disabling/deleting images --- src/sunstone/public/js/one-ui_views.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index 513de90782..7df4e976b7 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -2497,7 +2497,9 @@ function updateImageSelect(image_list){ images_select=""; images_select += ""; $.each(image_list, function(){ - images_select += ""; + if ((this.IMAGE.STATE < 3) && (this.IMAGE.STATE > 0)){ + images_select += ''; + } }); //update static selectors @@ -2827,18 +2829,32 @@ function updateImageElement(request, image_json){ id = image_json.IMAGE.ID; element = imageElementArray(image_json); updateSingleElement(element,dataTable_images,'#image_'+id); + if ((image_json.IMAGE.STATE < 3) && + (image_json.IMAGE.STATE > 0) && + ($('#img_sel_'+id,images_select).length == 0)){ + images_select += ''; + } + else { + tag = 'option#img_sel_'+id; + select = $(''); + $(tag,select).remove(); + images_select = $(select).html(); + } + $('div.vm_section#disks select#IMAGE').html(images_select); } function deleteImageElement(req){ deleteElement(dataTable_images,'#image_'+req.request.data); - //how to update the image select here? + tag = 'option#img_sel_'+req.request.data; + select = $(''); + $(tag,select).remove(); + images_select = $(select).html(); + $('div.vm_section#disks select#IMAGE').html(images_select); } function addImageElement(request, image_json){ element = imageElementArray(image_json); addElement(element,dataTable_images); - images_select += ""; - $('div.vm_section#disks select#IMAGE').html(images_select); } function updateImagesView(request, images_list){ From 21f5fb1cf3e252722f2619fbe1fe997fa83ff29e Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 24 Feb 2011 13:09:24 +0100 Subject: [PATCH 43/46] Feature #495: Fixed empty username + nokogiri --- src/sunstone/public/js/one-ui_views.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index c0b84e342b..612b34148b 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -2423,10 +2423,16 @@ function vNetworkInfoListener(){ function userElementArray(user_json){ user = user_json.USER; + if (!user.NAME || user.NAME == {}){ + name = ""; + } else { + name = user.NAME; + } + return [ '', user.ID, - user.NAME + name ] } From 1fdcdd9cd0408ff03416b4c9a3b024d2833600e5 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 24 Feb 2011 14:02:00 +0100 Subject: [PATCH 44/46] Feature #495: Fixed bug in manual created VM templates. There were two DOM objects with the same ID. --- src/sunstone/public/js/one-ui_views.js | 4 ++-- src/sunstone/public/js/one-ui_views.templates.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js index 2613efdd35..dbd0100687 100644 --- a/src/sunstone/public/js/one-ui_views.js +++ b/src/sunstone/public/js/one-ui_views.js @@ -1901,10 +1901,10 @@ function createVMachineDialog(){ }); $('button#create_vm_form_manual').click(function(){ - template = $('#vm_template').val(); + template = $('#textarea_vm_template').val(); //wrap it in the "vm" object - template = {vm: {vm_raw: template}}; + template = {"vm": {"vm_raw": template}}; OpenNebula.VM.create({data: template, success: addVMachineElement, diff --git a/src/sunstone/public/js/one-ui_views.templates.js b/src/sunstone/public/js/one-ui_views.templates.js index a9dbe832eb..6a3a83873d 100644 --- a/src/sunstone/public/js/one-ui_views.templates.js +++ b/src/sunstone/public/js/one-ui_views.templates.js @@ -757,7 +757,7 @@ var create_vm_tmpl = \

Write the Virtual Machine template here

\
\ - \ + \
\
\
\ From 0c9bc165842182312d6827f817ca73a19ab940f2 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 24 Feb 2011 14:26:44 +0100 Subject: [PATCH 45/46] Feature #495: Fixed bug in log location in system wide mode --- src/sunstone/models/SunstoneServer.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 0efa1dc63e..cc3c256532 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -17,9 +17,11 @@ ONE_LOCATION = ENV["ONE_LOCATION"] if !ONE_LOCATION + LOG_LOCATION = "/var/log/one" VAR_LOCATION = "/var/lib/one" else VAR_LOCATION = ONE_LOCATION+"/var" + LOG_LOCATION = ONE_LOCATION+"/var" end require 'models/OpenNebulaJSON' @@ -190,7 +192,11 @@ class SunstoneServer if OpenNebula.is_error?(resource) return [404, nil] else - vm_log_file = VAR_LOCATION + "/#{id}/vm.log" + if !ONE_LOCATION + vm_log_file = LOG_LOCATION + "/#{id}.log" + else + vm_log_file = LOG_LOCATION + "/#{id}/vm.log" + end begin log = File.read(vm_log_file) From ba318e95bb00d4ec0f438d5c9321840d3cbf3480 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 24 Feb 2011 14:36:56 +0100 Subject: [PATCH 46/46] Feature #495: updated NOTICE --- NOTICE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE b/NOTICE index e35b54607c..443c4c1a02 100644 --- a/NOTICE +++ b/NOTICE @@ -7,8 +7,8 @@ documentation at www.OpenNebula.org AUTHORS -- Ruben Santiago Montero (rubensm@dacya.ucm.es) -- Ignacio Martin Llorente (llorente@dacya.ucm.es) +- Ruben Santiago Montero (rsmontero@opennebula.org) +- Ignacio Martin Llorente (imllorente@opennebula.org) ACKNOWLEDGEMENTS