Project

General

Profile

« Previous | Next » 

Revision 361f3d61

Added by Ondřej Ezr about 3 years ago

Refs #30288 - improves CPUs counter input

In 22fa163731b38f597e4f96e0c0b345518a360b37 we've introduced React
component to implement the counter funcionality.
This uses the old `counter_f` form helper to render the React component
and effectivelly remove our dependency on the ui.spinner library.

View differences:

app/views/compute_resources_vms/form/ovirt/_base.html.erb
%>
<div id="cores-input">
<%= react_component('CPUCoresInput',
{label: 'Cores per socket',
disabled: disable_cores,
defaultValue: f.object.cores.present? ? f.object.cores : 1,
id: "#{f.object_name.gsub(/[\[\]]/, '[' => '_', ']' => '_')}cores",
name: "#{f.object_name}[cores]"}) %>
<%= counter_f(f, :cores, label: _('Cores per socket'), disabled: disable_cores) %>
</div>
<div id="sockets-input">
<%= react_component('CPUCoresInput',
{label: 'Sockets',
disabled: disable_sockets,
defaultValue: f.object.sockets.present? ? f.object.sockets : 1,
id: "#{f.object_name.gsub(/[\[\]]/, '[' => '_', ']' => '_')}sockets",
name: "#{f.object_name}[sockets]"}) %>
<%= counter_f(f, :sockets, label: _('Sockets'), disabled: disable_sockets) %>
</div>
<div id="memory-input">
<%= byte_size_f(f, :memory, label: _('Memory'), disabled: disable_mem) %>

Also available in: Unified diff