foreman_datacenter 0.1.45 → 0.1.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/foreman_datacenter/device_roles.css +31 -0
- data/app/controllers/foreman_datacenter/comments_controller.rb +2 -2
- data/app/helpers/foreman_datacenter/application_helper.rb +26 -0
- data/app/models/foreman_datacenter/rack.rb +4 -0
- data/app/views/foreman_datacenter/comments/_comments.html.erb +1 -1
- data/app/views/foreman_datacenter/comments/create.html.erb +2 -0
- data/app/views/foreman_datacenter/comments/index.html.erb +9 -0
- data/app/views/foreman_datacenter/console_ports/index.html.erb +1 -1
- data/app/views/foreman_datacenter/device_interface_connections/index.html.erb +1 -1
- data/app/views/foreman_datacenter/device_roles/index.html.erb +2 -3
- data/app/views/foreman_datacenter/device_roles/show.html.erb +2 -2
- data/app/views/foreman_datacenter/device_roles/welcome.html.erb +13 -0
- data/app/views/foreman_datacenter/device_types/index.html.erb +2 -3
- data/app/views/foreman_datacenter/device_types/show.html.erb +9 -9
- data/app/views/foreman_datacenter/device_types/welcome.html.erb +13 -0
- data/app/views/foreman_datacenter/devices/index.html.erb +1 -1
- data/app/views/foreman_datacenter/devices/inventory.html.erb +2 -2
- data/app/views/foreman_datacenter/devices/show.html.erb +7 -7
- data/app/views/foreman_datacenter/devices/welcome.html.erb +13 -0
- data/app/views/foreman_datacenter/manufacturers/index.html.erb +2 -3
- data/app/views/foreman_datacenter/manufacturers/show.html.erb +2 -2
- data/app/views/foreman_datacenter/manufacturers/welcome.html.erb +13 -0
- data/app/views/foreman_datacenter/platforms/index.html.erb +2 -3
- data/app/views/foreman_datacenter/platforms/show.html.erb +2 -2
- data/app/views/foreman_datacenter/platforms/welcome.html.erb +13 -0
- data/app/views/foreman_datacenter/power_ports/index.html.erb +1 -1
- data/app/views/foreman_datacenter/rack_groups/index.html.erb +2 -3
- data/app/views/foreman_datacenter/rack_groups/show.html.erb +2 -2
- data/app/views/foreman_datacenter/rack_groups/welcome.html.erb +13 -0
- data/app/views/foreman_datacenter/racks/_device_position.html.erb +24 -27
- data/app/views/foreman_datacenter/racks/_unpositioned_devices.html.erb +20 -0
- data/app/views/foreman_datacenter/racks/index.html.erb +2 -3
- data/app/views/foreman_datacenter/racks/show.html.erb +12 -3
- data/app/views/foreman_datacenter/racks/welcome.html.erb +13 -0
- data/app/views/foreman_datacenter/sites/index.html.erb +2 -3
- data/app/views/foreman_datacenter/sites/show.html.erb +3 -3
- data/app/views/foreman_datacenter/sites/welcome.html.erb +13 -0
- data/app/views/hosts/import_to_device.html.erb +1 -1
- data/db/migrate/20160727161914_create_sites.rb +1 -1
- data/db/migrate/20160728123353_create_rack_groups.rb +1 -1
- data/db/migrate/20160728143149_create_racks.rb +1 -1
- data/db/migrate/20160728161636_create_platforms.rb +1 -1
- data/db/migrate/20160728162635_create_device_roles.rb +1 -1
- data/db/migrate/20160728163815_create_manufacturers.rb +1 -1
- data/db/migrate/20160728164858_create_device_types.rb +1 -1
- data/db/migrate/20160728171422_create_devices.rb +1 -1
- data/db/migrate/20160728194401_create_device_interfaces.rb +1 -1
- data/db/migrate/20160728195242_create_device_interface_connections.rb +1 -1
- data/db/migrate/20160804104103_create_interface_templates.rb +1 -1
- data/db/migrate/20160804142618_create_console_port_templates.rb +1 -1
- data/db/migrate/20160804164301_create_power_port_templates.rb +1 -1
- data/db/migrate/20160805080626_create_console_server_port_templates.rb +1 -1
- data/db/migrate/20160805084726_create_power_outlet_templates.rb +1 -1
- data/db/migrate/20160805100411_create_device_bay_templates.rb +1 -1
- data/db/migrate/20160809091611_create_device_bays.rb +1 -1
- data/db/migrate/20160809103211_create_power_outlets.rb +1 -1
- data/db/migrate/20160809104325_create_power_ports.rb +1 -1
- data/db/migrate/20160809112815_create_console_server_ports.rb +1 -1
- data/db/migrate/20160809113846_create_console_ports.rb +1 -1
- data/db/migrate/20160816224805_create_device_modules.rb +1 -1
- data/db/migrate/20160824212010_add_host_ref_to_devices.rb +1 -1
- data/db/migrate/20160828200938_add_ip_address_to_device_interfaces.rb +1 -1
- data/db/migrate/20160905211522_create_management_devices.rb +1 -1
- data/db/migrate/20160906205605_rename_field_in_management_devices.rb +1 -1
- data/db/migrate/20160909205537_add_name_index_to_racks.rb +1 -1
- data/db/migrate/20160920221011_remove_index_from_devices.rb +1 -1
- data/db/migrate/20170824122025_add_side_to_device.rb +1 -1
- data/db/migrate/20170918202630_add_racksize_to_device.rb +1 -1
- data/db/migrate/20170922110137_create_comments.rb +2 -2
- data/db/migrate/20170922174725_renaming_comments.rb +1 -1
- data/db/migrate/20170924194247_rename_device_comments_column.rb +1 -1
- data/db/migrate/20170929101032_add_parent_id_to_comments.rb +1 -1
- data/db/migrate/20171001130802_fix_parent_id_column_in_comments.rb +1 -1
- data/db/migrate/20171004221349_add_user_id_to_comments.rb +1 -1
- data/lib/foreman_datacenter/engine.rb +1 -1
- data/lib/foreman_datacenter/version.rb +1 -1
- data/lib/tasks/test_tasks.rake +13 -0
- data/test/controllers/foreman_datacenter/rack_groups_contoller_test.rb +91 -0
- data/test/controllers/foreman_datacenter/racks_contoller_test.rb +91 -0
- data/test/controllers/foreman_datacenter/sites_contoller_test.rb +91 -0
- data/test/fixtures/foreman_datacenter/rack_groups.yml +11 -0
- data/test/fixtures/foreman_datacenter/racks.yml +19 -0
- data/test/fixtures/foreman_datacenter/sites.yml +19 -0
- data/test/integration/foreman_datacenter/rack_group_test.rb +25 -0
- data/test/integration/foreman_datacenter/rack_test.rb +25 -0
- data/test/integration/foreman_datacenter/site_test.rb +29 -0
- metadata +34 -2
@@ -20,7 +20,7 @@
|
|
20
20
|
<div class="panel-heading">
|
21
21
|
<strong>Platform</strong>
|
22
22
|
</div>
|
23
|
-
<table class="
|
23
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
24
24
|
<tbody>
|
25
25
|
<tr>
|
26
26
|
<td>Name</td>
|
@@ -47,7 +47,7 @@
|
|
47
47
|
<!-- Stats -->
|
48
48
|
<div class="panel panel-default">
|
49
49
|
<div class="panel-heading"><strong>Stats</strong></div>
|
50
|
-
<table class="
|
50
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
51
51
|
<tr>
|
52
52
|
<td>Devices</td>
|
53
53
|
<td><%= @platform.devices.length %></td>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% content_for(:title, _("Platforms")) %>
|
2
|
+
<div class="blank-slate-pf">
|
3
|
+
<div class="blank-slate-pf-icon">
|
4
|
+
<%= icon_text("cpu", "", :kind => "pficon") %>
|
5
|
+
</div>
|
6
|
+
<h1><%= _('Platforms') %></h1>
|
7
|
+
<p><%= _("List of platforms (e.g. ipmi, mgmt interface, etc.).") %></p>
|
8
|
+
<p><%= link_to _('Learn more about this in the documentation.'), documentation_url("")%></p>
|
9
|
+
<div class="blank-slate-pf-main-action">
|
10
|
+
<%= new_link(_('Create Platform'), {}, { :class => "btn-lg" }) %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
|
@@ -1,8 +1,7 @@
|
|
1
1
|
<% title _("Rack Groups") %>
|
2
|
-
|
3
|
-
<% title_actions display_link_if_authorized(_("New Rack Group"), hash_for_new_rack_group_path, class: 'btn btn-success') %>
|
2
|
+
<% title_actions display_link_if_authorized(_("Create Rack Group"), hash_for_new_rack_group_path, class: 'btn btn-primary'), help_button %>
|
4
3
|
|
5
|
-
<table class="
|
4
|
+
<table class="<%= table_css_classes 'table-two-pane' %>">
|
6
5
|
<thead>
|
7
6
|
<tr>
|
8
7
|
<th>Name</th>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<div class="panel-heading">
|
20
20
|
<strong>Rack Group</strong>
|
21
21
|
</div>
|
22
|
-
<table class="
|
22
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
23
23
|
<tbody>
|
24
24
|
<tr>
|
25
25
|
<td>Name</td>
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<!-- Stats -->
|
47
47
|
<div class="panel panel-default">
|
48
48
|
<div class="panel-heading"><strong>Stats</strong></div>
|
49
|
-
<table class="
|
49
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
50
50
|
<tr>
|
51
51
|
<td>Racks</td>
|
52
52
|
<td><%= @rack_group.racks.length %></td>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% content_for(:title, _("Rack Groups")) %>
|
2
|
+
<div class="blank-slate-pf">
|
3
|
+
<div class="blank-slate-pf-icon">
|
4
|
+
<%= icon_text("domain", "", :kind => "pficon") %>
|
5
|
+
</div>
|
6
|
+
<h1><%= _('Rack Groups') %></h1>
|
7
|
+
<p><%= _("Document here group of racks (e.g. one room where this group of racks is stored).") %></p>
|
8
|
+
<p><%= link_to _('Learn more about this in the documentation.'), documentation_url("")%></p>
|
9
|
+
<div class="blank-slate-pf-main-action">
|
10
|
+
<%= new_link(_('Create Rack Group'), {}, { :class => "btn-lg" }) %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
|
@@ -1,28 +1,25 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="panel
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
</div>
|
26
|
-
<div><h6 class="text-right">* side is not defined</h6></div>
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading"><strong>Devices</strong></div>
|
3
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
4
|
+
<tbody>
|
5
|
+
<% @rack.positioned_devices.each do |positions, devices| %>
|
6
|
+
<tr>
|
7
|
+
<td class="col-md-1"><%= raw(positions.map{|p| "#{p}U"}.join("<br />")) %></td>
|
8
|
+
<td class="col-md-4">
|
9
|
+
<% unless devices.empty? %>
|
10
|
+
<% devices.each do |d| %>
|
11
|
+
<div class="<%= "text-" + ((d.side == "full" or d.side.nil?) ? "center" : "right") + " pull-" + ((d.side == "full" or d.side.nil?) ? "center" : d.side) %>">
|
12
|
+
<span class="<%= "label " + d.device_role.color.downcase.gsub(" ","") %>"> </span>
|
13
|
+
<%= link_to d.name, device_path(d) %>
|
14
|
+
<% if d.side.nil? %>
|
15
|
+
*
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
</td>
|
21
|
+
</tr>
|
22
|
+
<% end %>
|
23
|
+
</tbody>
|
24
|
+
</table>
|
27
25
|
</div>
|
28
|
-
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading"><strong>Unpositioned Devices</strong></div>
|
3
|
+
<table class="table table-hover panel-body">
|
4
|
+
<tbody>
|
5
|
+
<% @rack.unpositioned_devices.each do |d| %>
|
6
|
+
<tr>
|
7
|
+
<td class="col-md-4">
|
8
|
+
<div class="<%= "text-" + ((d.side == "full" or d.side.nil?) ? "center" : "right") + " pull-" + ((d.side == "full" or d.side.nil?) ? "center" : d.side) %>">
|
9
|
+
<span class="<%= "label " + d.device_role.color.downcase.gsub(" ","") %>"> </span>
|
10
|
+
<%= link_to d.name, device_path(d) %>
|
11
|
+
<% if d.side.nil? %>
|
12
|
+
*
|
13
|
+
<% end %>
|
14
|
+
</div>
|
15
|
+
</td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</tbody>
|
19
|
+
</table>
|
20
|
+
</div>
|
@@ -1,10 +1,9 @@
|
|
1
1
|
<% javascript 'foreman_datacenter/racks' %>
|
2
2
|
|
3
3
|
<% title _("Racks") %>
|
4
|
-
|
5
|
-
<% title_actions display_link_if_authorized(_("New Rack"), hash_for_new_rack_path, class: 'btn btn-success') %>
|
4
|
+
<% title_actions display_link_if_authorized(_("Create Rack"), hash_for_new_rack_path, class: 'btn btn-primary'), help_button %>
|
6
5
|
|
7
|
-
<table class="
|
6
|
+
<table class="<%= table_css_classes 'table-two-pane' %>">
|
8
7
|
<thead>
|
9
8
|
<tr>
|
10
9
|
<th>Name</th>
|
@@ -1,3 +1,5 @@
|
|
1
|
+
<% stylesheet 'foreman_datacenter/device_roles' %>
|
2
|
+
|
1
3
|
<% title h("Rack #{@rack.name}") %>
|
2
4
|
|
3
5
|
<% title_actions display_link_if_authorized(
|
@@ -20,7 +22,7 @@
|
|
20
22
|
<div class="panel-heading">
|
21
23
|
<strong>Rack</strong>
|
22
24
|
</div>
|
23
|
-
<table class="
|
25
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
24
26
|
<tbody>
|
25
27
|
<tr>
|
26
28
|
<td>Site</td>
|
@@ -67,7 +69,14 @@
|
|
67
69
|
</div>
|
68
70
|
</div>
|
69
71
|
|
70
|
-
|
71
|
-
|
72
|
+
|
73
|
+
<div class="col-md-5">
|
74
|
+
<!-- Devices -->
|
75
|
+
<%= render "device_position", rack: @rack %>
|
76
|
+
|
77
|
+
<!-- Unpositioned Devices -->
|
78
|
+
<%= render "unpositioned_devices", rack: @rack if @rack.unpositioned_devices.count != 0 %>
|
79
|
+
<div><h6 class="text-right">* side is not defined</h6></div>
|
80
|
+
</div>
|
72
81
|
|
73
82
|
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% content_for(:title, _("Racks")) %>
|
2
|
+
<div class="blank-slate-pf">
|
3
|
+
<div class="blank-slate-pf-icon">
|
4
|
+
<%= icon_text("enterprise", "", :kind => "pficon") %>
|
5
|
+
</div>
|
6
|
+
<h1><%= _('Racks') %></h1>
|
7
|
+
<p><%= _("List of all racks across all datacenters.") %></p>
|
8
|
+
<p><%= link_to _('Learn more about this in the documentation.'), documentation_url("")%></p>
|
9
|
+
<div class="blank-slate-pf-main-action">
|
10
|
+
<%= new_link(_('Create Rack'), {}, { :class => "btn-lg" }) %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
|
@@ -1,8 +1,7 @@
|
|
1
1
|
<% title _("Sites") %>
|
2
|
-
|
3
|
-
<% title_actions display_link_if_authorized(_("New Site"), hash_for_new_site_path, class: 'btn btn-success') %>
|
2
|
+
<% title_actions display_link_if_authorized(_("Create Site"), hash_for_new_site_path, class: 'btn btn-primary'), help_button %>
|
4
3
|
|
5
|
-
<table class="
|
4
|
+
<table class="<%= table_css_classes 'table-two-pane' %>">
|
6
5
|
<thead>
|
7
6
|
<tr>
|
8
7
|
<th>Name</th>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<div class="panel-heading">
|
21
21
|
<strong>Site</strong>
|
22
22
|
</div>
|
23
|
-
<table class="
|
23
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
24
24
|
<tbody>
|
25
25
|
<tr>
|
26
26
|
<td>Facility</td>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<div class="panel-heading">
|
57
57
|
<strong>Stats</strong>
|
58
58
|
</div>
|
59
|
-
<table class="
|
59
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
60
60
|
<tbody>
|
61
61
|
<tr>
|
62
62
|
<td>Racks</td>
|
@@ -75,7 +75,7 @@
|
|
75
75
|
<div class="panel-heading">
|
76
76
|
<strong>Rack Groups</strong>
|
77
77
|
</div>
|
78
|
-
<table class="
|
78
|
+
<table class="<%= table_css_classes 'table-hover panel-body' %>">
|
79
79
|
<tbody>
|
80
80
|
<% @site.rack_groups.each do |rack_group| %>
|
81
81
|
<tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% content_for(:title, _("Sites")) %>
|
2
|
+
<div class="blank-slate-pf">
|
3
|
+
<div class="blank-slate-pf-icon">
|
4
|
+
<%= icon_text("map-marker", "", :kind => "fa") %>
|
5
|
+
</div>
|
6
|
+
<h1><%= _('Sites') %></h1>
|
7
|
+
<p><%= _("List of all physical locations (datacenters) where servers are stored.") %></p>
|
8
|
+
<p><%= link_to _('Learn more about this in the documentation.'), documentation_url("")%></p>
|
9
|
+
<div class="blank-slate-pf-main-action">
|
10
|
+
<%= new_link(_('Create Site'), {}, { :class => "btn-lg" }) %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
|