Commit 82941cf8 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Improve UX of geo page

parent d368100f
.geo-node-icon-healthy { .geo-node-healthy {
color: $gl-success; color: $gl-success;
} }
.geo-node-icon-unhealthy { .geo-node-unhealthy {
color: $gl-danger; color: $gl-danger;
} }
.geo-node-icon-disabled { .geo-node-disabled {
color: $gray-darkest; color: $gray-darkest;
} }
.well-list.geo-nodes {
li {
position: relative;
&:hover {
background: $white-light;
}
}
}
.node-info {
font-weight: bold;
color: $gl-text-color;
}
.geo-health {
display: inline-block;
margin-top: 5px;
}
.primary-node-badge {
color: $white-light;
background-color: $blue-300;
display: inline-block;
margin-left: 5px;
padding: 0 5px;
border-radius: 3px;
}
.node-actions {
position: absolute;
right: 15px;
top: 10px;
@media (max-width: $screen-xs-max) {
position: initial;
margin-top: 10px;
}
.btn:not(:first-of-type) {
margin-left: 10px;
}
}
module EE module EE
module GeoHelper module GeoHelper
def node_status_icon(node) def node_status_icon(node)
if node.primary? unless node.primary?
icon 'star fw', class: 'has-tooltip', title: 'Primary node'
else
status = node.enabled? ? 'healthy' : 'disabled' status = node.enabled? ? 'healthy' : 'disabled'
icon 'globe fw', icon 'check fw',
class: "js-geo-node-icon geo-node-icon-#{status} has-tooltip", class: "js-geo-node-icon geo-node-#{status} has-tooltip",
title: status.capitalize title: status.capitalize
end end
end end
def node_status(node)
status = node.enabled? ? 'healthy' : 'disabled'
content_tag :span, class: "geo-node-#{status}" do
status.capitalize
end
end
def toggle_node_button(node) def toggle_node_button(node)
btn_class, title, data = btn_class, title, data =
if node.enabled? if node.enabled?
['warning', 'Disable node', { confirm: 'Disabling a node stops the sync process. Are you sure?' }] ['warning', 'Disable', { confirm: 'Disabling a node stops the sync process. Are you sure?' }]
else else
['success', 'Enable node'] ['success', 'Enable']
end end
link_to icon('power-off fw', text: title), link_to title,
toggle_admin_geo_node_path(node), toggle_admin_geo_node_path(node),
method: :post, method: :post,
class: "btn btn-sm btn-#{btn_class} prepend-left-10 has-tooltip", class: "btn btn-sm btn-#{btn_class}",
title: title, title: title,
data: data data: data
end end
......
...@@ -17,41 +17,41 @@ ...@@ -17,41 +17,41 @@
%ul.well-list.geo-nodes %ul.well-list.geo-nodes
- @nodes.each do |node| - @nodes.each do |node|
%li{ id: dom_id(node), class: ('js-geo-secondary-node' if node.secondary?), data: { status_url: status_admin_geo_node_path(node) } } %li{ id: dom_id(node), class: ('js-geo-secondary-node' if node.secondary?), data: { status_url: status_admin_geo_node_path(node) } }
.list-item-name .node-block
%span
= node_status_icon(node) = node_status_icon(node)
%strong= node.url %strong= node.url
- if node.primary? - if node.primary?
.primary-node-badge Primary
%span.help-block Primary node %span.help-block Primary node
- else - else
.js-geo-node-status{ style: 'display: none' } .js-geo-node-status{ style: 'display: none' }
%p
%span.help-block
Health Status:
%span= node_status(node)
%p %p
%span.help-block %span.help-block
Repositories synced: Repositories synced:
%span.js-repositories-synced %span.node-info.js-repositories-synced
%p %p
%span.help-block %span.help-block
Repositories failed: Repositories failed:
%span.js-repositories-failed %span.node-info.js-repositories-failed
%p %p
%span.help-block %span.help-block
LFS objects synced: LFS objects synced:
%span.js-lfs-objects-synced %span.node-info.js-lfs-objects-synced
%p %p
%span.help-block %span.help-block
Attachments synced: Attachments synced:
%span.js-attachments-synced %span.node-info.js-attachments-synced
%p %p
%span.help-block.js-health %code.geo-health.js-health
.pull-right .node-actions
- if Gitlab::Geo.license_allows? - if Gitlab::Geo.license_allows?
- if node.missing_oauth_application? - if node.missing_oauth_application?
= link_to repair_admin_geo_node_path(node), method: :post, title: 'OAuth application is missing', class: 'btn btn-default btn-sm prepend-left-10' do = link_to "Repair authentication", repair_admin_geo_node_path(node), method: :post, title: 'OAuth application is missing', class: 'btn btn-default btn-sm'
= icon('exclamation-triangle fw')
Repair authentication
- if node.secondary? - if node.secondary?
= toggle_node_button(node) = toggle_node_button(node)
= link_to admin_geo_node_path(node), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm prepend-left-10' do = link_to "Remove", admin_geo_node_path(node), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm'
= icon 'trash'
Remove
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment