Skip to content

Commit

Permalink
Fix and clean vizual. views (servers component alignment + bg colors)
Browse files Browse the repository at this point in the history
  • Loading branch information
B-Rass committed Jul 4, 2024
1 parent ad4b668 commit ab237eb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
9 changes: 9 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ body {

.frame .server {
page-break-inside: avoid;

background-color: var(--bs-light-bg-subtle);
}

.frame {
Expand Down Expand Up @@ -167,6 +169,11 @@ table.card_layout {
background-color: #a2b9ff !important;
}
}

.server-component {
display: inherit;
flex-direction: inherit;
}
}

.portRJ, .portFC, .portSCSI, .portALIM {
Expand Down Expand Up @@ -625,6 +632,8 @@ body {
}

&-sidebar {
font-size: 16px;

&:not(.offcanvas) {
@include media-breakpoint-up(lg) {
position: sticky;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/rooms.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
align-items: center;
justify-content: center;
display: flex;
background-color: #F5F5F5;
background-color: var(--bs-tertiary-bg);
border: 1px solid #e3e3e3;
writing-mode: vertical-rl;
text-orientation: upright;
Expand Down
6 changes: 1 addition & 5 deletions app/helpers/servers_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,10 @@ def ports_by_card(port_type:, port_quantity:, ports_data:, card_id: nil, selecte

html += content_tag(:span,
link_to_port(index + 1, port_data, port_type, card_id, port_id),
class: "port_container d-inline-flex
class: "port_container float-start
#{twin_card_used_ports && port_data && port_data.cable_name && twin_card_used_ports.exclude?(port_data.position) ? "no_client" : ""}
#{twin_card_used_ports && (port_data.blank? || port_data.cable_name.blank?) && twin_card_used_ports.include?(index + 1) ? "unreferenced_client" : ""}
#{selected_port.present? && port_id == selected_port.try(:id) ? "selected" : ""}")

if (index + 1) % MAX_PORTS_PER_LINE == 0 # Every XX ports do
html += '<div style="clear:both;" />'
end
end
html.html_safe
end
Expand Down
12 changes: 5 additions & 7 deletions app/views/servers/_draw_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% server.cards.includes(:ports => :cable).select {|card| card.composant_id == component.id}.each do |card| %>
<% server.cards.includes(ports: :cable).select { |card| card.composant_id == component.id }.each do |card| %>
<% if card.twin_card_id
twin_card = Card.find(card.twin_card_id)
connections = twin_card.ports.map(&:connection)
twin_card_used_ports = []
connections.each {|c| twin_card_used_ports << c.port.position if c && c.port}
end %>
connections.each { |c| twin_card_used_ports << c.port.position if c && c.port }
end %>

<span data-server-name="<%= server.name %>"
<span class="server-component"
data-server-name="<%= server.name %>"
data-server-id="<%= server.id %>"
data-composant-id="<%= card.id %>"
data-composant-type="<%= card.class %>"
Expand All @@ -27,7 +27,5 @@
moved_connections: @moved_connections,
twin_card_used_ports: twin_card_used_ports) %>
<% end %>


</span>
<% end %>
2 changes: 1 addition & 1 deletion app/views/servers/_draw_u_scale_unit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<span class="float-start u_scale position_in_frame <%= u_disponibles.even? ? 'even': 'odd' %>"
<span class="float-start u_scale position_in_frame border-end <%= u_disponibles.even? ? "even": "odd" %>"
title="<%= u_disponibles %>"
style="
<%= "cursor: pointer; " if clickable_lines %>
Expand Down

0 comments on commit ab237eb

Please sign in to comment.