Commit 9e19864b authored by Stan Hu's avatar Stan Hu

Fix navigation issues when primary Geo node has been destroyed

parent 59652761
...@@ -12,6 +12,7 @@ class Admin::ApplicationController < ApplicationController ...@@ -12,6 +12,7 @@ class Admin::ApplicationController < ApplicationController
def display_geo_information def display_geo_information
return unless Gitlab::Geo.secondary? return unless Gitlab::Geo.secondary?
return unless Gitlab::Geo.primary_node.present?
primary_node = view_context.link_to('primary node', Gitlab::Geo.primary_node.url) primary_node = view_context.link_to('primary node', Gitlab::Geo.primary_node.url)
flash.now[:notice] = "You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the #{primary_node}.".html_safe flash.now[:notice] = "You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the #{primary_node}.".html_safe
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
= link_to sherlock_transactions_path, class: 'admin-icon', title: 'Sherlock Transactions', = link_to sherlock_transactions_path, class: 'admin-icon', title: 'Sherlock Transactions',
data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('tachometer fw') = icon('tachometer fw')
- if Gitlab::Geo.secondary? - if Gitlab::Geo.secondary? && Gitlab::Geo.primary_node.present?
%li %li
= link_to Gitlab::Geo.primary_node.url, title: 'Go to primary node', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = link_to Gitlab::Geo.primary_node.url, title: 'Go to primary node', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('globe fw') = icon('globe fw')
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