Commit 34547732 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Display flash notice about Geo node on all admin screens

parent 00ec40e0
...@@ -2,10 +2,18 @@ ...@@ -2,10 +2,18 @@
# #
# Automatically sets the layout and ensures an administrator is logged in # Automatically sets the layout and ensures an administrator is logged in
class Admin::ApplicationController < ApplicationController class Admin::ApplicationController < ApplicationController
include ActionView::Helpers::UrlHelper
before_action :authenticate_admin! before_action :authenticate_admin!
before_action :display_geo_information
layout 'admin' layout 'admin'
def authenticate_admin! def authenticate_admin!
render_404 unless current_user.is_admin? render_404 unless current_user.is_admin?
end end
def display_geo_information
return unless Gitlab::Geo.secondary?
primary_node = link_to('primary node', Gitlab::Geo.primary_node.url)
flash.now[:notice] = "You are in a Geo secondary node (read-only). To make any change you must visit the #{primary_node}.".html_safe
end
end end
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