diff --git a/install.sh b/install.sh index 60e7bfc776..ed3207a5b5 100755 --- a/install.sh +++ b/install.sh @@ -1523,6 +1523,7 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \ src/sunstone/public/images/opennebula-sunstone-big.png \ src/sunstone/public/images/opennebula-sunstone-small.png \ src/sunstone/public/images/opennebula-sunstone-v4.0.png \ + src/sunstone/public/images/opennebula-sunstone-v4.0-small.png \ src/sunstone/public/images/panel.png \ src/sunstone/public/images/panel_short.png \ src/sunstone/public/images/pbar.gif \ diff --git a/share/rubygems/deprecated/README b/share/rubygems/deprecated/README new file mode 100644 index 0000000000..3d0fbd9915 --- /dev/null +++ b/share/rubygems/deprecated/README @@ -0,0 +1 @@ +This gem is deprecated, use "opennebula" gem instead. diff --git a/share/rubygems/generate b/share/rubygems/generate index a7313b843d..4914aa454e 100755 --- a/share/rubygems/generate +++ b/share/rubygems/generate @@ -21,7 +21,7 @@ require 'tmpdir' DEFAULTS={ - :version => "3.9.0.beta", + :version => "3.9.80.beta", :date => Time.now.strftime("%Y-%m-%d"), :dependencies => [] } @@ -30,7 +30,7 @@ TEMPLATE=< { - :name => 'oca', + :name => 'opennebula', :files => [ ['src/oca/ruby/opennebula.rb', '/lib'], ['src/oca/ruby/opennebula/*.rb', '/lib/opennebula'], @@ -66,7 +66,7 @@ GEM_DESCRIPTION={ }, :cli => { - :name => 'cli', + :name => 'opennebula-cli', :files => [ ['src/cli/one[a-z]*', '/bin'], ['src/cli/*.rb', '/lib'], @@ -74,10 +74,22 @@ GEM_DESCRIPTION={ ['NOTICE', ''], ['LICENSE', ''] ], - :summary => 'OpenNebula Client API', + :summary => 'OpenNebula Command Line Interface', :description => 'Commands used to talk to OpenNebula', :dependencies => [ - ['opennebula-oca', "= #{DEFAULTS[:version]}"] + ['opennebula', "= #{DEFAULTS[:version]}"] + ] + }, + + :oca_deprecated => { + :name => 'opennebula-oca', + :files => [ + ['share/rubygems/deprecated/README', ''] + ], + :summary => 'OpenNebula Client API (deprecated)', + :description => 'Use opennebula gem instead', + :dependencies => [ + ['opennebula', "= #{DEFAULTS[:version]}"] ] } } diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index a75362b9d3..23c9f6b770 100644 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -56,6 +56,7 @@ module CommandParser def initialize(args=[], &block) @available_options = Array.new @commands = Hash.new + @command_list = Array.new @formats = Hash.new @main = nil @@ -288,6 +289,21 @@ module CommandParser end } cmd[:proc] = block + @command_list << name.to_sym + @commands[name.to_sym] = cmd + end + + def deprecated_command(name, new_command) + cmd = Hash.new + cmd[:desc] = "Deprecated, use #{new_command} instead" + cmd[:arity] = 0 + cmd[:options] = [] + cmd[:args_format] = [[:string, nil]] * 20 + cmd[:deprecated] = new_command + cmd[:proc] = lambda do + print_deprecated(new_command) + end + @commands[name.to_sym] = cmd end @@ -418,6 +434,10 @@ module CommandParser exit -1 end + if comm[:deprecated] + print_deprecated(comm[:deprecated]) + end + extra_options = comm[:options] if comm parse(extra_options) @@ -617,7 +637,9 @@ module CommandParser puts "## OPTIONS" shown_opts = Array.new - @commands.each do |key,value| + @command_list.each do |key| + value = @commands[key] + value[:options].flatten.each do |o| if shown_opts.include?(o[:name]) next @@ -659,11 +681,12 @@ module CommandParser else puts "## COMMANDS" - @commands.each{ |key,value| + @command_list.each do |key| + value = @commands[key] printf cmd_format5, "* #{key} " print_command(value) - } + end end end @@ -713,6 +736,12 @@ module CommandParser } end + def print_deprecated(new_command) + puts "This command is deprecated, use instead:" + puts " $ #{File.basename $0} #{new_command}" + exit(-1) + end + def word_wrap(size, text, first_size=nil) output=[] line="" diff --git a/src/cli/onevm b/src/cli/onevm index 777e007bea..30ee3232ef 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -769,4 +769,16 @@ cmd=CommandParser::CmdParser.new(ARGV) do vm.resize(template, enforce) end end + + # Deprecated commands + + deprecated_command(:attachdisk, 'disk-attach') + deprecated_command(:detachdisk, 'disk-detach') + deprecated_command(:saveas, 'disk-snapshot') + deprecated_command(:livemigrate, 'migrate --live') + deprecated_command(:cancel, 'shutdown --hard') + deprecated_command(:reset, 'reboot --hard') + deprecated_command(:restart, 'boot') + deprecated_command(:delete, 'destroy') + deprecated_command(:resubmit, 'destroy --recreate') end diff --git a/src/sunstone/OpenNebulaVNC.rb b/src/sunstone/OpenNebulaVNC.rb index 0e063196e0..59653d183d 100644 --- a/src/sunstone/OpenNebulaVNC.rb +++ b/src/sunstone/OpenNebulaVNC.rb @@ -103,6 +103,8 @@ class OpenNebulaVNC return false end + STDOUT.puts "VNC proxy started" + true end diff --git a/src/sunstone/bin/novnc-server b/src/sunstone/bin/novnc-server index 20d2772a50..f72aba74fe 100755 --- a/src/sunstone/bin/novnc-server +++ b/src/sunstone/bin/novnc-server @@ -70,9 +70,9 @@ if ARGV[0] when :start vnc.start when :stop - vnc.stop(ARGV[1]=='--force') + vnc.stop(true) when :restart - vnc.stop + vnc.stop(true) sleep 1 vnc.start when :status diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index 12dc37e3d0..f8a6e28aad 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -47,8 +47,8 @@ module OpenNebulaJSON when "deploy" then self.deploy(action_hash['params']) when "finalize" then self.finalize when "hold" then self.hold - when "livemigrate" then self.live_migrate(action_hash['params']) - when "migrate" then self.migrate(action_hash['params']) + when "livemigrate" then self.migrate(action_hash['params'], true) + when "migrate" then self.migrate(action_hash['params'], false) when "resume" then self.resume when "release" then self.release when "stop" then self.stop @@ -87,12 +87,9 @@ module OpenNebulaJSON super(params['host_id']) end - def live_migrate(params=Hash.new) - super(params['host_id']) - end - - def migrate(params=Hash.new) - super(params['host_id']) + def migrate(params=Hash.new, live=false, enforce=false) + # TODO add enforce parameter + super(params['host_id'], live) end def save_as(params=Hash.new) diff --git a/src/sunstone/public/css/app.css b/src/sunstone/public/css/app.css index 318cc99e2b..6fe6775220 100644 --- a/src/sunstone/public/css/app.css +++ b/src/sunstone/public/css/app.css @@ -6854,3 +6854,9 @@ div.time-picker li.selected { .columns { line-height: 2; } + +/* line 786, ../sass/app.scss */ +.transparent_table, .transparent_table tr { + background: none !important; + border: 0px !important; +} diff --git a/src/sunstone/public/images/opennebula-sunstone-v4.0-small.png b/src/sunstone/public/images/opennebula-sunstone-v4.0-small.png new file mode 100644 index 0000000000..5e56708a4e Binary files /dev/null and b/src/sunstone/public/images/opennebula-sunstone-v4.0-small.png differ diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index 8960a91cb5..d28a4af0c5 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -72,8 +72,8 @@ var create_acl_tmpl = '+tr("Create ACL")+'\ \ \ -
\
\ +
\
\
\ \ diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index bb902ddc98..ce14bb5292 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -75,8 +75,8 @@ var create_datastore_tmpl = '+tr("Create Datastore")+'\ \
\ -
\ \ +
\
\
\ \ @@ -143,7 +143,7 @@ var create_datastore_tmpl = \
\
\ @@ -195,30 +195,30 @@ var create_datastore_tmpl =
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\ @@ -226,43 +226,42 @@ var create_datastore_tmpl =
\
\
\ - \ + \
\
\ - \ + \
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\
\
\
\ -
\ +
\ \
\ -
\ +
\ \
\
\
\
\ - \
\
\
\ @@ -271,6 +270,7 @@ var create_datastore_tmpl = \
\ ×\ + \
'; var datastore_image_table_tmpl='\ @@ -936,7 +936,7 @@ function select_ceph(){ $('select#ds_mad').attr('disabled', 'disabled'); $('select#tm_mad').val('ceph'); $('select#tm_mad').attr('disabled', 'disabled'); - $('select#ds_type').val('rbd'); + $('select#disk_type').val('RBD'); } function select_lvm(){ diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 4856357237..0234a397af 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -82,8 +82,8 @@ var create_host_tmpl = '+tr("Create Host")+'\ \
\ -
\
\ +
\
\
\ \ diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index da43df0e36..7855699c93 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -517,13 +517,13 @@ function generate_capacity_tab_content() { '
'+ '
'+ '
'+ - '
'+ + '
'+ '
'+ ''+ '
'+ '
'+ '
'+ - '
'+ + '
'+ ''+ '
'+ '
'+ @@ -556,13 +556,13 @@ function generate_capacity_tab_content() { '

'+tr("Advanced options")+'

'+ '
'+ '
'+ - '
'+ + '
'+ '
'+ ''+ '
'+ '
'+ '
'+ - '
'+ + '
'+ ''+ '
'+ '
'+ @@ -751,7 +751,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ '
'+ '
'+ '
'+ - '
'+ + '
'+ '
'+ '
'+ ''+ @@ -852,13 +852,13 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ '
'+ '
'+ '
'+ - '
'+ + '
'+ '
'+ ''+ '
'+ '
'+ '
'+ - '
'+ + '
'+ ''+ '
'+ '
'+ @@ -1225,15 +1225,19 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ '
'+ '
'+ '
'+ + '
'+ + ''+tr("ICMP")+''+ '
'+ - '
'+ + '
'+ + ''+ '
'+ - '
'+ - ''+ + '
'+ + ''+ '
'+ '
'+ '
'+ '
'+ + '
'+ '
'+ '
'+ '
'; @@ -1376,10 +1380,13 @@ function updateTemplateInfo(request,template){ }; var template_tab = { title: tr("Template"), - content: '\ - '+ - prettyPrintJSON(template_info.TEMPLATE)+ - '
'+tr("Template")+'
' + content: '
\ +
\ + '+ + prettyPrintJSON(template_info.TEMPLATE)+'\ +
\ +
\ +
' }; $("#div_edit_rename_link").die(); @@ -1551,6 +1558,7 @@ function setupCreateTemplateDialog(){ if (value.length == 0) remove = true; } + if (remove) delete obj[elem]; } @@ -2324,37 +2332,45 @@ function setupCreateTemplateDialog(){ '
'+ ''+tr("SSH")+''+ '
'+ - '
'+ - ''+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+tr("Add an ssh public key to the context. If the Public Key textarea is empty then the user variable SSH_PUBLIC_KEY will be used.")+'
'+ '
'+ '
'+ - '
'+ '
'+ - '
'+ - ''+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ + '
'+ + ''+ '
'+ '
'+ + '
'+ + '