Commit 206aa022 authored by Martin Wortschack's avatar Martin Wortschack Committed by Dmitriy Zaporozhets

Conditional partial rendering for EE in application settings

parent 3fc25f54
...@@ -337,53 +337,13 @@ ...@@ -337,53 +337,13 @@
= render partial: 'repository_mirrors_form' = render partial: 'repository_mirrors_form'
-# EE-only -# EE-only
- if Gitlab::Geo.license_allows? = render_if_exists 'admin/application_settings/geo', expanded: expanded
%section.settings.as-geo.no-animate#js-geo-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('GitLab Geo')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
= _('Geo allows you to replicate your GitLab instance to other geographical locations.')
.settings-content
= render 'geo'
- if License.feature_available?(:external_authorization_service) = render_if_exists 'admin/application_settings/external_authorization_service_form', expanded: expanded
%section.settings.as-external-auth.no-animate#js-external-auth-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('External authentication')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
= _('External Classification Policy Authorization')
.settings-content
= render 'external_authorization_service_form'
- if License.feature_available?(:elastic_search) = render_if_exists 'admin/application_settings/elasticsearch_form', expanded: expanded
%section.settings.as-elasticsearch.no-animate#js-elasticsearch-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Elasticsearch')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
= _('Elasticsearch intergration. Elasticsearch AWS IAM.')
.settings-content
= render partial: 'elasticsearch_form'
- if Gitlab.com? || Rails.env.development? = render_if_exists 'admin/application_settings/slack', expanded: expanded
%section.settings.as-slack.no-animate#js-slack-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Slack application')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
= _('Slack integration allows you to interact with GitLab via shash commands in a chat window.')
.settings-content
= render partial: 'slack'
= render_if_exists 'admin/application_settings/templates', expanded: expanded = render_if_exists 'admin/application_settings/templates', expanded: expanded
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-elasticsearch-settings'), html: { class: 'fieldset-form' } do |f| - return unless License.feature_available?(:elastic_search)
= form_errors(@application_setting)
%section.settings.as-elasticsearch.no-animate#js-elasticsearch-settings{ class: ('expanded' if expanded) }
%fieldset .settings-header
.sub-section %h4
.form-group = _('Elasticsearch')
.form-check %button.btn.js-settings-toggle{ type: 'button' }
= f.check_box :elasticsearch_indexing, class: 'form-check-input' = expanded ? 'Collapse' : 'Expand'
= f.label :elasticsearch_indexing, class: 'form-check-label' do %p
Elasticsearch indexing = _('Elasticsearch intergration. Elasticsearch AWS IAM.')
.settings-content
- missing = !Gitlab::Elastic::Indexer.experimental_indexer_present?
.form-group = form_for @application_setting, url: admin_application_settings_path(anchor: 'js-elasticsearch-settings'), html: { class: 'fieldset-form' } do |f|
.form-check = form_errors(@application_setting)
= f.check_box :elasticsearch_experimental_indexer, disabled: missing, class: 'form-check-input'
= f.label :elasticsearch_experimental_indexer, class: 'form-check-label' do %fieldset
Use the <a href="https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer">new repository indexer (beta)</a> .sub-section
- if missing .form-group
(not installed) .form-check
= f.check_box :elasticsearch_indexing, class: 'form-check-input'
.form-group = f.label :elasticsearch_indexing, class: 'form-check-label' do
.form-check Elasticsearch indexing
= f.check_box :elasticsearch_search, class: 'form-check-input'
= f.label :elasticsearch_search, class: 'form-check-label' do - missing = !Gitlab::Elastic::Indexer.experimental_indexer_present?
Search with Elasticsearch enabled .form-group
.form-check
.form-group = f.check_box :elasticsearch_experimental_indexer, disabled: missing, class: 'form-check-input'
= f.label :elasticsearch_url, 'URL', class: 'label-bold' = f.label :elasticsearch_experimental_indexer, class: 'form-check-label' do
= f.text_field :elasticsearch_url, value: @application_setting.elasticsearch_url.join(', '), class: 'form-control', placeholder: 'http://localhost:9200' Use the <a href="https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer">new repository indexer (beta)</a>
.form-text.text-muted - if missing
The url to use for connecting to Elasticsearch. Use a comma-separated list to support clustering (e.g., "http://localhost:9200, http://localhost:9201"). (not installed)
.sub-section .form-group
%h4 Elasticsearch AWS IAM credentials .form-check
.form-group = f.check_box :elasticsearch_search, class: 'form-check-input'
.form-check = f.label :elasticsearch_search, class: 'form-check-label' do
= f.check_box :elasticsearch_aws, class: 'form-check-input' Search with Elasticsearch enabled
= f.label :elasticsearch_aws, class: 'form-check-label' do
Using AWS hosted Elasticsearch with IAM credentials .form-group
.form-group = f.label :elasticsearch_url, 'URL', class: 'label-bold'
= f.label :elasticsearch_aws_region, 'AWS region', class: 'label-bold' = f.text_field :elasticsearch_url, value: @application_setting.elasticsearch_url.join(', '), class: 'form-control', placeholder: 'http://localhost:9200'
= f.text_field :elasticsearch_aws_region, value: @application_setting.elasticsearch_aws_region, class: 'form-control' .form-text.text-muted
.form-text.text-muted The url to use for connecting to Elasticsearch. Use a comma-separated list to support clustering (e.g., "http://localhost:9200, http://localhost:9201").
Region that elasticsearch is configured
.sub-section
.form-group %h4 Elasticsearch AWS IAM credentials
= f.label :elasticsearch_aws_access_key, 'AWS Access Key', class: 'label-bold' .form-group
= f.text_field :elasticsearch_aws_access_key, value: @application_setting.elasticsearch_aws_access_key, class: 'form-control' .form-check
.form-text.text-muted = f.check_box :elasticsearch_aws, class: 'form-check-input'
AWS Access Key. Only required if not using role instance credentials = f.label :elasticsearch_aws, class: 'form-check-label' do
Using AWS hosted Elasticsearch with IAM credentials
.form-group .form-group
= f.label :elasticsearch_aws_secret_access_key, 'AWS Secret Access Key', class: 'label-bold' = f.label :elasticsearch_aws_region, 'AWS region', class: 'label-bold'
= f.password_field :elasticsearch_aws_secret_access_key, value: @application_setting.elasticsearch_aws_secret_access_key, class: 'form-control' = f.text_field :elasticsearch_aws_region, value: @application_setting.elasticsearch_aws_region, class: 'form-control'
.form-text.text-muted .form-text.text-muted
AWS Secret Access Key. Only required if not using role instance credentials Region that elasticsearch is configured
= f.submit 'Save changes', class: "btn btn-success" .form-group
= f.label :elasticsearch_aws_access_key, 'AWS Access Key', class: 'label-bold'
= f.text_field :elasticsearch_aws_access_key, value: @application_setting.elasticsearch_aws_access_key, class: 'form-control'
.form-text.text-muted
AWS Access Key. Only required if not using role instance credentials
.form-group
= f.label :elasticsearch_aws_secret_access_key, 'AWS Secret Access Key', class: 'label-bold'
= f.password_field :elasticsearch_aws_secret_access_key, value: @application_setting.elasticsearch_aws_secret_access_key, class: 'form-control'
.form-text.text-muted
AWS Secret Access Key. Only required if not using role instance credentials
= f.submit 'Save changes', class: "btn btn-success"
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-external-auth-settings'), html: { class: 'fieldset-form' } do |f| - return unless License.feature_available?(:external_authorization_service)
= form_errors(@application_setting)
%fieldset %section.settings.as-external-auth.no-animate#js-external-auth-settings{ class: ('expanded' if expanded) }
.form-group .settings-header
.form-check %h4
= f.check_box :external_authorization_service_enabled, class: 'form-check-input' = _('External authentication')
= f.label :external_authorization_service_enabled, class: 'form-check-label' do %button.btn.js-settings-toggle{ type: 'button' }
= _('Enable classification control using an external service') = expanded ? 'Collapse' : 'Expand'
%span.form-text.text-muted %p
= external_authorization_description = _('External Classification Policy Authorization')
= link_to icon('question-circle'), help_page_path('user/admin_area/settings/external_authorization') .settings-content
.form-group
= f.label :external_authorization_service_url, _('Service URL'), class: 'label-bold'
= f.text_field :external_authorization_service_url, class: 'form-control'
%span.form-text.text-muted
= external_authorization_url_help_text
.form-group
= f.label :external_authorization_service_timeout, _('External authorization request timeout'), class: 'label-bold'
= f.number_field :external_authorization_service_timeout, class: 'form-control', min: 0.001, max: 10, step: 0.001
%span.form-text.text-muted
= external_authorization_timeout_help_text
= f.label :external_auth_client_cert, _('Client authentication certificate'), class: 'label-bold'
= f.text_area :external_auth_client_cert, class: 'form-control'
%span.form-text.text-muted
= external_authorization_client_certificate_help_text
.form-group
= f.label :external_auth_client_key, _('Client authentication key'), class: 'label-bold'
= f.text_area :external_auth_client_key, class: 'form-control'
%span.form-text.text-muted
= external_authorization_client_key_help_text
.form-group
= f.label :external_auth_client_key_pass, _('Client authentication key password'), class: 'label-bold'
= f.password_field :external_auth_client_key_pass, class: 'form-control'
%span.form-text.text-muted
= external_authorization_client_pass_help_text
.form-group
= f.label :external_authorization_service_default_label, _('Default classification label'), class: 'label-bold'
= f.text_field :external_authorization_service_default_label, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success" = form_for @application_setting, url: admin_application_settings_path(anchor: 'js-external-auth-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
%fieldset
.form-group
.form-check
= f.check_box :external_authorization_service_enabled, class: 'form-check-input'
= f.label :external_authorization_service_enabled, class: 'form-check-label' do
= _('Enable classification control using an external service')
%span.form-text.text-muted
= external_authorization_description
= link_to icon('question-circle'), help_page_path('user/admin_area/settings/external_authorization')
.form-group
= f.label :external_authorization_service_url, _('Service URL'), class: 'label-bold'
= f.text_field :external_authorization_service_url, class: 'form-control'
%span.form-text.text-muted
= external_authorization_url_help_text
.form-group
= f.label :external_authorization_service_timeout, _('External authorization request timeout'), class: 'label-bold'
= f.number_field :external_authorization_service_timeout, class: 'form-control', min: 0.001, max: 10, step: 0.001
%span.form-text.text-muted
= external_authorization_timeout_help_text
= f.label :external_auth_client_cert, _('Client authentication certificate'), class: 'label-bold'
= f.text_area :external_auth_client_cert, class: 'form-control'
%span.form-text.text-muted
= external_authorization_client_certificate_help_text
.form-group
= f.label :external_auth_client_key, _('Client authentication key'), class: 'label-bold'
= f.text_area :external_auth_client_key, class: 'form-control'
%span.form-text.text-muted
= external_authorization_client_key_help_text
.form-group
= f.label :external_auth_client_key_pass, _('Client authentication key password'), class: 'label-bold'
= f.password_field :external_auth_client_key_pass, class: 'form-control'
%span.form-text.text-muted
= external_authorization_client_pass_help_text
.form-group
= f.label :external_authorization_service_default_label, _('Default classification label'), class: 'label-bold'
= f.text_field :external_authorization_service_default_label, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success"
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f| - return unless Gitlab::Geo.license_allows?
= form_errors(@application_setting)
%fieldset %section.settings.as-geo.no-animate#js-geo-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('GitLab Geo')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p %p
These settings will only take effect if Geo is enabled and require a restart to take effect. = _('Geo allows you to replicate your GitLab instance to other geographical locations.')
.form-group .settings-content
= f.label :geo_status_timeout, 'Connection timeout', class: 'label-bold'
= f.number_field :geo_status_timeout, class: 'form-control' = form_for @application_setting, url: admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f|
.form-text.text-muted = form_errors(@application_setting)
The amount of seconds after which a request to get a secondary node
status will time out. %fieldset
%p
= f.submit 'Save changes', class: "btn btn-success" These settings will only take effect if Geo is enabled and require a restart to take effect.
.form-group
= f.label :geo_status_timeout, 'Connection timeout', class: 'label-bold'
= f.number_field :geo_status_timeout, class: 'form-control'
.form-text.text-muted
The amount of seconds after which a request to get a secondary node
status will time out.
= f.submit 'Save changes', class: "btn btn-success"
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-slack-settings'), html: { class: 'fieldset-form' } do |f| - return unless Gitlab.com? || Rails.env.development?
= form_errors(@application_setting)
%fieldset %section.settings.as-slack.no-animate#js-slack-settings{ class: ('expanded' if expanded) }
.form-group .settings-header
.form-check %h4
= f.check_box :slack_app_enabled, class: 'form-check-input' = _('Slack application')
= f.label :slack_app_enabled, class: 'form-check-label' do %button.btn.js-settings-toggle{ type: 'button' }
Enable Slack application = expanded ? 'Collapse' : 'Expand'
.form-text.text-muted %p
This option is only available on GitLab.com = _('Slack integration allows you to interact with GitLab via shash commands in a chat window.')
.form-group .settings-content
= f.label :slack_app_id, 'APP_ID', class: 'label-bold'
= f.text_field :slack_app_id, class: 'form-control' = form_for @application_setting, url: admin_application_settings_path(anchor: 'js-slack-settings'), html: { class: 'fieldset-form' } do |f|
.form-group = form_errors(@application_setting)
= f.label :slack_app_secret, 'APP_SECRET', class: 'label-bold'
= f.text_field :slack_app_secret, class: 'form-control' %fieldset
.form-group .form-group
= f.label :slack_app_verification_token, 'Verification token', class: 'label-bold' .form-check
= f.text_field :slack_app_verification_token, class: 'form-control' = f.check_box :slack_app_enabled, class: 'form-check-input'
= f.label :slack_app_enabled, class: 'form-check-label' do
Enable Slack application
.form-text.text-muted
This option is only available on GitLab.com
.form-group
= f.label :slack_app_id, 'APP_ID', class: 'label-bold'
= f.text_field :slack_app_id, class: 'form-control'
.form-group
= f.label :slack_app_secret, 'APP_SECRET', class: 'label-bold'
= f.text_field :slack_app_secret, class: 'form-control'
.form-group
= f.label :slack_app_verification_token, 'Verification token', class: 'label-bold'
= f.text_field :slack_app_verification_token, class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success"
= f.submit 'Save changes', class: "btn btn-success"
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