From d231b36a49ba0abd418a3783aa336b526c752411 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 17 Apr 2017 21:47:29 -0700 Subject: [PATCH] Spin globe icon when retrieving Geo node status Closes #1977 --- app/assets/javascripts/geo_nodes.js | 4 ++++ app/assets/stylesheets/pages/geo_nodes.scss | 4 ++++ app/helpers/ee/geo_helper.rb | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/geo_nodes.js b/app/assets/javascripts/geo_nodes.js index 67e26ffaacb452..ec76379866c29b 100644 --- a/app/assets/javascripts/geo_nodes.js +++ b/app/assets/javascripts/geo_nodes.js @@ -3,6 +3,7 @@ import './smart_interval'; const healthyClass = 'geo-node-icon-healthy'; const unhealthyClass = 'geo-node-icon-unhealthy'; +const unknownClass = 'geo-node-icon-unknown'; class GeoNodeStatus { constructor(el) { @@ -40,6 +41,9 @@ class GeoNodeStatus { } setStatusIcon(healthy) { + this.$icon.removeClass('fa-spin'); + this.$icon.removeClass(unknownClass); + if (healthy) { this.$icon.removeClass(unhealthyClass) .addClass(healthyClass) diff --git a/app/assets/stylesheets/pages/geo_nodes.scss b/app/assets/stylesheets/pages/geo_nodes.scss index e536fdc8bebfeb..95291d5af2a939 100644 --- a/app/assets/stylesheets/pages/geo_nodes.scss +++ b/app/assets/stylesheets/pages/geo_nodes.scss @@ -6,6 +6,10 @@ color: $gl-danger; } +.geo-node-icon-unknown { + color: $gl-warning; +} + .geo-node-icon-disabled { color: $gray-darkest; } diff --git a/app/helpers/ee/geo_helper.rb b/app/helpers/ee/geo_helper.rb index 303207b029472c..4b3983b9f00f2b 100644 --- a/app/helpers/ee/geo_helper.rb +++ b/app/helpers/ee/geo_helper.rb @@ -4,10 +4,10 @@ def node_status_icon(node) if node.primary? icon 'star fw', class: 'has-tooltip', title: 'Primary node' else - status = node.enabled? ? 'healthy' : 'disabled' + status = node.enabled? ? 'unknown' : 'disabled' icon 'globe fw', - class: "js-geo-node-icon geo-node-icon-#{status} has-tooltip", + class: "js-geo-node-icon fa-spin geo-node-icon-#{status} has-tooltip", title: status.capitalize end end -- GitLab