summaryrefslogtreecommitdiff
path: root/app/views/clusters/clusters/_form.html.haml
blob: 9fb91a3938748300a74026c752603d85a36a52bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster do |field|
  = form_errors(@cluster)
  .form-group
    %h5= s_('ClusterIntegration|Integration status')
    %label.append-bottom-0.js-cluster-enable-toggle-area
      %button{ type: 'button',
        class: "js-project-feature-toggle project-feature-toggle #{'is-checked' if @cluster.enabled?} #{'is-disabled' unless can?(current_user, :update_cluster, @cluster)}",
        "aria-label": s_("ClusterIntegration|Toggle Kubernetes cluster"),
        disabled: !can?(current_user, :update_cluster, @cluster) }
        = field.hidden_field :enabled, { class: 'js-project-feature-toggle-input'}
        %span.toggle-icon
          = sprite_icon('status_success_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-checked')
          = sprite_icon('status_failed_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-unchecked')
      .form-text.text-muted= s_('ClusterIntegration|Enable or disable GitLab\'s connection to your Kubernetes cluster.')

  .form-group
    %h5= s_('ClusterIntegration|Environment scope')
    - if has_multiple_clusters?
      = field.text_field :environment_scope, class: 'col-md-6 form-control js-select-on-focus', placeholder: s_('ClusterIntegration|Environment scope')
      .form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.")
    - else
      = text_field_tag :environment_scope, '*', class: 'col-md-6 form-control disabled', placeholder: s_('ClusterIntegration|Environment scope'), disabled: true
      - environment_scope_url = help_page_path('user/project/clusters/index', anchor: 'base-domain')
      - environment_scope_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: environment_scope_url }
      .form-text.text-muted
        %code *
        = s_("ClusterIntegration| is the default environment scope for this cluster. This means that all jobs, regardless of their environment, will use this cluster. %{environment_scope_start}More information%{environment_scope_end}").html_safe % { environment_scope_start: environment_scope_start, environment_scope_end: '</a>'.html_safe }

  .form-group
    %h5= s_('ClusterIntegration|Base domain')
    = field.text_field :base_domain, class: 'col-md-6 form-control js-select-on-focus qa-base-domain'
    .form-text.text-muted
      - auto_devops_url = help_page_path('topics/autodevops/index')
      - auto_devops_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: auto_devops_url }
      = s_('ClusterIntegration|Specifying a domain will allow you to use Auto Review Apps and Auto Deploy stages for %{auto_devops_start}Auto DevOps%{auto_devops_end}. The domain should have a wildcard DNS configured matching the domain.').html_safe % { auto_devops_start: auto_devops_start, auto_devops_end: '</a>'.html_safe }
      - if @cluster.application_ingress_external_ip.present?
        = s_('ClusterIntegration|Alternatively')
        %code #{@cluster.application_ingress_external_ip}.nip.io
        = s_('ClusterIntegration| can be used instead of a custom domain.')
      - custom_domain_url = help_page_path('user/project/clusters/index', anchor: 'pointing-your-dns-at-the-cluster-ip')
      - custom_domain_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: custom_domain_url }
      = s_('ClusterIntegration| %{custom_domain_start}More information%{custom_domain_end}.').html_safe % { custom_domain_start: custom_domain_start, custom_domain_end: '</a>'.html_safe }

  - if can?(current_user, :update_cluster, @cluster)
    .form-group
      = field.submit _('Save changes'), class: 'btn btn-success qa-save-domain'