diff --git a/app/assets/javascripts/about.js b/app/assets/javascripts/about.js deleted file mode 100644 index 5857fae75718..000000000000 --- a/app/assets/javascripts/about.js +++ /dev/null @@ -1,21 +0,0 @@ -$(function() { - "use strict"; - $(".compute-status").each(function(index, item) { - var item = $(item); - var url = item.data('url'); - $.ajax({ - type: 'post', - url: url, - success: function(response) { - item.text(__(response.status)); - item.attr('title',response.message); - if(response.status === "OK"){ - item.addClass('label label-success') - }else{ - item.addClass('label label-danger') - } - item.tooltip({html: true}); - } - }); - }); -}); diff --git a/app/helpers/about_helper.rb b/app/helpers/about_helper.rb new file mode 100644 index 000000000000..e4179a48e225 --- /dev/null +++ b/app/helpers/about_helper.rb @@ -0,0 +1,35 @@ +module AboutHelper + def plugins + @plugins.map do |plugin| + {:name => {name: plugin.name, url: plugin.url}, :description => plugin.description, + :author => plugin.author, :version => plugin.version } + end + end + + def proxies + @smart_proxies.map do |proxy| + {:id => {:name => proxy.name, :id => proxy.id}, + :features => proxy.features.map(&:name).to_sentence} + end + end + + def providers + nil unless SETTINGS[:unattended] + @providers.map do |provider| + {:provider => provider[:friendly_name], + :status => provider[:status] == :installed} + end + end + + def compute_resources + nil unless SETTINGS[:unattended] + @compute_resources.map do |compute| + {:id => {:name => compute.name, :id => compute.id}, + :type => compute.provider_friendly_name} + end + end + + def about_data + {:compute => compute_resources, :proxy => proxies, :plugin => plugins, :provider => providers } + end +end diff --git a/app/views/about/index.html.erb b/app/views/about/index.html.erb index 5c37fafe2009..3d94a6ba39fa 100644 --- a/app/views/about/index.html.erb +++ b/app/views/about/index.html.erb @@ -1,122 +1,12 @@ <% title _("About") %> -<%= javascript 'proxy_status', 'charts', 'about' %>
<%= _("No smart proxies to show") %>
- <% else %> -<%= _("Name") %> | -<%= _("Features") %> | -<%= _("Status") %> | -<%= _("Version") %> | -
---|---|---|---|
<%= link_to_if_authorized proxy.name, hash_for_smart_proxy_path(proxy) %> | -<%=h proxy.features.map(&:name).to_sentence %> | -<%= spinner %> |
- <%= spinner %> |
-
<%= _("Provider") %> | -<%= _("Status") %> | -|
---|---|---|
<%= provider[:friendly_name] %> | - <% if provider[:status] == :installed %> -<%= _('Installed') %> |
- <% else %>
- <%= _('Not Installed') %> |
- <% end %>
-
<%= _("No compute resource to show") %>
- <% else %> -<%= _("Name") %> | -<%= _("Type") %> | -<%= _("Status") %> | -
---|---|---|
<%= link_to(compute.name, compute) %> | -<%= compute.provider_friendly_name %> | -><%= spinner %> |
-
<%= _("No plugins found") %>
- <% else %> -<%= _("Name") %> | -<%= _("Description") %> | -<%= _("Author") %> | -<%= _("Version") %> | -
---|---|---|---|
<%= plugin.url.blank? ? plugin.name : link_to(plugin.name, plugin.url, :rel=>'external')%> | -<%= _(plugin.description) %> | -<%= plugin.author_url.blank? ? plugin.author : link_to(plugin.author, plugin.author_url)%> | -<%= plugin.version %> | -
<%= (_("Version %{version} %{copyright} 2009-%{year} Paul Kelly and %{author}") % {:version => SETTINGS[:version], :copyright => "©", :year=>DateTime.now.year, :author=>mail_to("ohadlevy@gmail.com", "Ohad Levy" )}).html_safe %>