Allow admins to select which groups to replicate per Geo node

parent 7dbb272f
......@@ -21,3 +21,11 @@
%p.help-block
Paste a machine public key here for the GitLab user this node runs on. Read more about how to generate it
= link_to "here", help_page_path("ssh/README")
- if geo_node.persisted? && geo_node.secondary?
.form-group
= form.label :group_ids, 'Groups to replicate', class: 'control-label'
.col-sm-10
= form.select :group_ids, namespaces_options(geo_node.group_ids), { include_hidden: false }, multiple: true, class: 'select2 select-wide', data: { field: 'group_ids' }
.help-block
Choose which groups you wish to replicate.
......@@ -33,6 +33,12 @@
%span.help-block Primary node
- else
= status_loading_icon
- if node.groups.any?
%p
%span.help-block
Groups to replicate:
%strong.node-info
= node_selected_groups_to_replicate(node)
.js-geo-node-status{ style: 'display: none' }
- if node.enabled?
%p
......
......@@ -79,7 +79,7 @@ class Admin::GeoNodesController < Admin::ApplicationController
private
def geo_node_params
params.require(:geo_node).permit(:url, :primary, geo_node_key_attributes: [:key])
params.require(:geo_node).permit(:url, :primary, group_ids: [], geo_node_key_attributes: [:key])
end
def check_license
......
module EE
module GeoHelper
def node_selected_groups_to_replicate(node)
node.groups.sort_by(&:human_name).map(&:human_name).join(', ')
end
def node_status_icon(node)
unless node.primary?
status = node.enabled? ? 'unknown' : 'disabled'
......
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