Commit 71e26d3a authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Only show actions and primary label on primary node; hide error if healthy

parent 056ddf5c
...@@ -37,7 +37,9 @@ class GeoNodeStatus { ...@@ -37,7 +37,9 @@ class GeoNodeStatus {
this.$repositoriesFailed.html(status.repositories_failed_count); this.$repositoriesFailed.html(status.repositories_failed_count);
this.$lfsObjectsSynced.html(`${status.lfs_objects_synced_count}/${status.lfs_objects_count} (${status.lfs_objects_synced_in_percentage})`); this.$lfsObjectsSynced.html(`${status.lfs_objects_synced_count}/${status.lfs_objects_count} (${status.lfs_objects_synced_in_percentage})`);
this.$attachmentsSynced.html(`${status.attachments_synced_count}/${status.attachments_count} (${status.attachments_synced_in_percentage})`); this.$attachmentsSynced.html(`${status.attachments_synced_count}/${status.attachments_count} (${status.attachments_synced_in_percentage})`);
if (status.health !== 'Healthy') { if (status.health === 'Healthy') {
this.$health.html('');
} else {
this.$health.html(`<code class="geo-health">${status.health}</code>`); this.$health.html(`<code class="geo-health">${status.health}</code>`);
} }
......
...@@ -18,7 +18,7 @@ module EE ...@@ -18,7 +18,7 @@ module EE
def node_class(node) def node_class(node)
klass = [] klass = []
klass << 'js-geo-secondary-node' if node.secondary? klass << 'js-geo-secondary-node' if node.secondary?
klass << ' node-disabled' unless node.enabled? klass << 'node-disabled' unless node.enabled?
klass klass
end end
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
.node-block .node-block
= node_status_icon(node) = node_status_icon(node)
%strong= node.url %strong= node.url
- if node.primary?
.node-badge.primary-node Primary
- if current_node?(node) - if current_node?(node)
.node-badge.current-node Current node .node-badge.current-node Current node
- if node.primary?
.node-badge.primary-node 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' }
...@@ -51,10 +51,11 @@ ...@@ -51,10 +51,11 @@
%p %p
.js-health .js-health
.node-actions - if current_node?(node) == node.primary?
- if Gitlab::Geo.license_allows? .node-actions
- if node.missing_oauth_application? - if Gitlab::Geo.license_allows?
= link_to "Repair authentication", repair_admin_geo_node_path(node), method: :post, title: 'OAuth application is missing', class: 'btn btn-default btn-sm' - if node.missing_oauth_application?
- if node.secondary? = link_to "Repair authentication", repair_admin_geo_node_path(node), method: :post, title: 'OAuth application is missing', class: 'btn btn-default btn-sm'
= toggle_node_button(node) - if node.secondary?
= link_to "Remove", admin_geo_node_path(node), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm' = toggle_node_button(node)
= link_to "Remove", admin_geo_node_path(node), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm'
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