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 @@
= render partial: 'repository_mirrors_form'
-# EE-only
- if Gitlab::Geo.license_allows?
%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'
= render_if_exists 'admin/application_settings/geo', expanded: expanded
- if License.feature_available?(:external_authorization_service)
%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'
= render_if_exists 'admin/application_settings/external_authorization_service_form', expanded: expanded
- if License.feature_available?(:elastic_search)
%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'
= render_if_exists 'admin/application_settings/elasticsearch_form', expanded: expanded
- if Gitlab.com? || Rails.env.development?
%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/slack', 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|
= form_errors(@application_setting)
%fieldset
.sub-section
.form-group
.form-check
= f.check_box :elasticsearch_indexing, class: 'form-check-input'
= f.label :elasticsearch_indexing, class: 'form-check-label' do
Elasticsearch indexing
- missing = !Gitlab::Elastic::Indexer.experimental_indexer_present?
.form-group
.form-check
= f.check_box :elasticsearch_experimental_indexer, disabled: missing, class: 'form-check-input'
= f.label :elasticsearch_experimental_indexer, class: 'form-check-label' do
Use the <a href="https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer">new repository indexer (beta)</a>
- if missing
(not installed)
.form-group
.form-check
= f.check_box :elasticsearch_search, class: 'form-check-input'
= f.label :elasticsearch_search, class: 'form-check-label' do
Search with Elasticsearch enabled
.form-group
= f.label :elasticsearch_url, 'URL', class: 'label-bold'
= f.text_field :elasticsearch_url, value: @application_setting.elasticsearch_url.join(', '), class: 'form-control', placeholder: 'http://localhost:9200'
.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").
.sub-section
%h4 Elasticsearch AWS IAM credentials
.form-group
.form-check
= f.check_box :elasticsearch_aws, class: 'form-check-input'
= f.label :elasticsearch_aws, class: 'form-check-label' do
Using AWS hosted Elasticsearch with IAM credentials
.form-group
= f.label :elasticsearch_aws_region, 'AWS region', class: 'label-bold'
= f.text_field :elasticsearch_aws_region, value: @application_setting.elasticsearch_aws_region, class: 'form-control'
.form-text.text-muted
Region that elasticsearch is configured
.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"
- return unless License.feature_available?(:elastic_search)
%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
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-elasticsearch-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
%fieldset
.sub-section
.form-group
.form-check
= f.check_box :elasticsearch_indexing, class: 'form-check-input'
= f.label :elasticsearch_indexing, class: 'form-check-label' do
Elasticsearch indexing
- missing = !Gitlab::Elastic::Indexer.experimental_indexer_present?
.form-group
.form-check
= f.check_box :elasticsearch_experimental_indexer, disabled: missing, class: 'form-check-input'
= f.label :elasticsearch_experimental_indexer, class: 'form-check-label' do
Use the <a href="https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer">new repository indexer (beta)</a>
- if missing
(not installed)
.form-group
.form-check
= f.check_box :elasticsearch_search, class: 'form-check-input'
= f.label :elasticsearch_search, class: 'form-check-label' do
Search with Elasticsearch enabled
.form-group
= f.label :elasticsearch_url, 'URL', class: 'label-bold'
= f.text_field :elasticsearch_url, value: @application_setting.elasticsearch_url.join(', '), class: 'form-control', placeholder: 'http://localhost:9200'
.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").
.sub-section
%h4 Elasticsearch AWS IAM credentials
.form-group
.form-check
= f.check_box :elasticsearch_aws, class: 'form-check-input'
= f.label :elasticsearch_aws, class: 'form-check-label' do
Using AWS hosted Elasticsearch with IAM credentials
.form-group
= f.label :elasticsearch_aws_region, 'AWS region', class: 'label-bold'
= f.text_field :elasticsearch_aws_region, value: @application_setting.elasticsearch_aws_region, class: 'form-control'
.form-text.text-muted
Region that elasticsearch is configured
.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|
= form_errors(@application_setting)
- return unless License.feature_available?(:external_authorization_service)
%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'
%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
= 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|
= form_errors(@application_setting)
- return unless Gitlab::Geo.license_allows?
%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
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"
= _('Geo allows you to replicate your GitLab instance to other geographical locations.')
.settings-content
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
%fieldset
%p
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|
= form_errors(@application_setting)
- return unless Gitlab.com? || Rails.env.development?
%fieldset
.form-group
.form-check
= 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'
%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
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-slack-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
%fieldset
.form-group
.form-check
= 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