Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #3683 display free and available space in vSphere datastore selection #1039

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/helpers/compute_resources_vms_helper.rb
Expand Up @@ -56,6 +56,12 @@ def libvirt_networks(compute)
select
end

def vsphere_datastores(compute)
compute.datastores.map { |ds|
[ds.freespace && ds.capacity ? "#{ds.name} (#{_('free')}: #{number_to_human_size(ds.freespace)}, #{_('total')}: #{number_to_human_size(ds.capacity)})" : ds.name, ds.name]
}
end

def available_actions(vm)
case vm
when Fog::Compute::OpenStack::Server
Expand Down
@@ -1,5 +1,5 @@
<div class="fields">
<%= selectable_f f, :datastore, compute_resource.datastores, { }, :class => "span2 disable-unsupported", :label => _("Data Store") %>
<%= selectable_f f, :datastore, vsphere_datastores(compute_resource), { }, :class => "span4 disable-unsupported", :label => _("Data Store") %>
<%= text_f f, :name, :class => "input-mini disable-unsupported", :label => "Name" %>
<%= text_f f, :size_gb,
:class => "input-mini disable-unsupported",
Expand Down