feautre #4217: Moved TYPE to the marketplace app

This commit is contained in:
Ruben S. Montero committed 2015-12-12 21:10:14 +01:00
1 parent 753c885714
commit 91f7ec5bb2
13 files changed
+150 -162

No files matched your search

-6
View File
@@ -21,11 +21,6 @@
:desc: Number of Marketplace Apps
:size: 6
:TYPE:
:desc: Marketplace type
:size: 4
:left: true
:MAD:
:desc: Marketplace driver
:size: 7
@@ -37,5 +32,4 @@
- :SIZE
- :AVAIL
- :APPS
- :TYPE
- :MAD
+6
View File
@@ -31,6 +31,11 @@
:desc: Publishing date for the marketplace app
:size: 15
:TYPE:
:desc: Marketplace app type
:size: 4
:left: true
:MARKET:
:desc: Name of the marketplace
:size: 10
@@ -44,4 +49,5 @@
- :SIZE
- :STAT
- :DATE
- :TYPE
- :MARKET
+15 -16
View File
@@ -98,46 +98,45 @@ class OneMarketPlaceHelper < OpenNebulaHelper::OneHelper
OpenNebula::MarketPlacePool.new(@client)
end
def format_resource(datastore, options = {})
def format_resource(market, options = {})
str="%-15s: %-20s"
str_h1="%-80s"
CLIHelper.print_header(str_h1 % "MARKETPLACE #{datastore['ID']} INFORMATION")
puts str % ["ID", datastore.id.to_s]
puts str % ["NAME", datastore.name]
puts str % ["USER", datastore['UNAME']]
puts str % ["GROUP", datastore['GNAME']]
puts str % ["TYPE", datastore.type_str]
CLIHelper.print_header(str_h1 % "MARKETPLACE #{market['ID']} INFORMATION")
puts str % ["ID", market.id.to_s]
puts str % ["NAME", market.name]
puts str % ["USER", market['UNAME']]
puts str % ["GROUP", market['GNAME']]
puts str % ["MARKET_MAD", datastore['MARKET_MAD']]
puts str % ["MARKET_MAD", market['MARKET_MAD']]
puts
CLIHelper.print_header(str_h1 % "MARKETPLACE CAPACITY", false)
puts str % ["TOTAL:", OpenNebulaHelper.unit_to_str(datastore['TOTAL_MB'].to_i,{},'M')]
puts str % ["FREE:", OpenNebulaHelper.unit_to_str(datastore['FREE_MB'].to_i, {},'M')]
puts str % ["USED: ", OpenNebulaHelper.unit_to_str(datastore['USED_MB'].to_i, {},'M')]
puts str % ["TOTAL:", OpenNebulaHelper.unit_to_str(market['TOTAL_MB'].to_i,{},'M')]
puts str % ["FREE:", OpenNebulaHelper.unit_to_str(market['FREE_MB'].to_i, {},'M')]
puts str % ["USED: ", OpenNebulaHelper.unit_to_str(market['USED_MB'].to_i, {},'M')]
puts
CLIHelper.print_header(str_h1 % "PERMISSIONS",false)
["OWNER", "GROUP", "OTHER"].each { |e|
mask = "---"
mask[0] = "u" if datastore["PERMISSIONS/#{e}_U"] == "1"
mask[1] = "m" if datastore["PERMISSIONS/#{e}_M"] == "1"
mask[2] = "a" if datastore["PERMISSIONS/#{e}_A"] == "1"
mask[0] = "u" if market["PERMISSIONS/#{e}_U"] == "1"
mask[1] = "m" if market["PERMISSIONS/#{e}_M"] == "1"
mask[2] = "a" if market["PERMISSIONS/#{e}_A"] == "1"
puts str % [e, mask]
}
puts
CLIHelper.print_header(str_h1 % "MARKETPLACE TEMPLATE", false)
puts datastore.template_str
puts market.template_str
puts
CLIHelper.print_header("%-15s" % "MARKETAPPS")
datastore.marketapp_ids.each do |id|
market.marketapp_ids.each do |id|
puts "%-15s" % [id]
end
end
+7 -1
View File
@@ -64,11 +64,16 @@ class OneMarketPlaceAppHelper < OpenNebulaHelper::OneHelper
OpenNebulaHelper.time_to_str(d["DATE"])
end
column :TYPE, "Marketplace app type", :left, :size=>4 do |d|
type = MarketPlaceApp::MARKETPLACEAPP_TYPES[d["TYPE"].to_i]
MarketPlaceApp::SHORT_MARKETPLACEAPP_TYPES[type]
end
column :MARKET, "Name of the marketplace", :left, :size=>10 do |d|
d["MARKETPLACE"]
end
default :ID,:NAME,:PUBLISHER,:VERSION,:SIZE,:STAT,:DATE,:MARKET
default :ID,:NAME,:PUBLISHER,:VERSION,:SIZE,:STAT,:DATE,:TYPE,:MARKET
end
table
@@ -96,6 +101,7 @@ class OneMarketPlaceAppHelper < OpenNebulaHelper::OneHelper
CLIHelper.print_header(str_h1 % "MARKETPLACE APP #{app['ID']} INFORMATION")
puts str % ["ID", app.id.to_s]
puts str % ["NAME", app.name]
puts str % ["TYPE", app.type_str]
puts str % ["USER", app['UNAME']]
puts str % ["GROUP", app['GNAME']]
puts str % ["MARKETPLACE", app['MARKETPLACE']]