diff options
Diffstat (limited to 'app/views/clusters/clusters/_provider_details_form.html.haml')
-rw-r--r-- | app/views/clusters/clusters/_provider_details_form.html.haml | 82 |
1 files changed, 46 insertions, 36 deletions
diff --git a/app/views/clusters/clusters/_provider_details_form.html.haml b/app/views/clusters/clusters/_provider_details_form.html.haml index 11277a83e3a..59706b6d8c4 100644 --- a/app/views/clusters/clusters/_provider_details_form.html.haml +++ b/app/views/clusters/clusters/_provider_details_form.html.haml @@ -1,52 +1,62 @@ -= bootstrap_form_for cluster, url: update_cluster_url_path, html: { class: 'js-provider-details gl-show-field-errors' }, += gitlab_ui_form_for cluster, url: update_cluster_url_path, html: { class: 'js-provider-details gl-show-field-errors', role: 'form' }, as: :cluster do |field| - - copy_name_btn = clipboard_button(text: cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'), - class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields? - = field.text_field :name, class: 'js-select-on-focus cluster-name', required: true, - title: s_('ClusterIntegration|Cluster name is required.'), - readonly: cluster.read_only_kubernetes_platform_fields?, - label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold', - input_group_class: 'gl-field-error-anchor', append: copy_name_btn + .form-group + - copy_name_btn = clipboard_button(text: cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'), + class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields? + = field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold required' + .input-group.gl-field-error-anchor + = field.text_field :name, class: 'form-control js-select-on-focus cluster-name', required: true, + title: s_('ClusterIntegration|Cluster name is required.'), + readonly: cluster.read_only_kubernetes_platform_fields?, + append: copy_name_btn = field.fields_for :platform_kubernetes, platform do |platform_field| - - copy_api_url = clipboard_button(text: platform.api_url, title: s_('ClusterIntegration|Copy API URL'), - class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields? - = platform_field.text_field :api_url, class: 'js-select-on-focus', required: true, - title: s_('ClusterIntegration|API URL should be a valid http/https url.'), - readonly: cluster.read_only_kubernetes_platform_fields?, - label: s_('ClusterIntegration|API URL'), label_class: 'label-bold', - input_group_class: 'gl-field-error-anchor', append: copy_api_url - - - copy_ca_cert_btn = clipboard_button(text: platform.ca_cert, title: s_('ClusterIntegration|Copy CA Certificate'), - class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields? - = platform_field.text_area :ca_cert, class: 'js-select-on-focus', rows: '10', - readonly: cluster.read_only_kubernetes_platform_fields?, - placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'), - label: s_('ClusterIntegration|CA Certificate'), label_class: 'label-bold', - input_group_class: 'gl-field-error-anchor', append: copy_ca_cert_btn - - = platform_field.password_field :token, type: 'password', class: 'js-select-on-focus js-cluster-token', - readonly: cluster.read_only_kubernetes_platform_fields?, autocomplete: 'new-password', - label: s_('ClusterIntegration|Enter new Service Token'), label_class: 'label-bold', - input_group_class: 'gl-field-error-anchor' - - = platform_field.form_group :authorization_type do - = platform_field.check_box :authorization_type, { disabled: true, label: s_('ClusterIntegration|RBAC-enabled cluster'), - label_class: 'label-bold', inline: true }, 'rbac', 'abac' + .form-group + - copy_api_url = clipboard_button(text: platform.api_url, title: s_('ClusterIntegration|Copy API URL'), + class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields? + = platform_field.label :api_url, s_('ClusterIntegration|API URL'), class: 'label-bold required' + .input-group.gl-field-error-anchor + = platform_field.text_field :api_url, class: 'form-control js-select-on-focus', required: true, + title: s_('ClusterIntegration|API URL should be a valid http/https url.'), + readonly: cluster.read_only_kubernetes_platform_fields?, + append: copy_api_url + + .form-group + - copy_ca_cert_btn = clipboard_button(text: platform.ca_cert, title: s_('ClusterIntegration|Copy CA Certificate'), + class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields? + = platform_field.label :ca_cert, s_('ClusterIntegration|CA Certificate'), class: 'label-bold' + .input-group.gl-field-error-anchor + = platform_field.text_area :ca_cert, class: 'form-control js-select-on-focus', rows: '10', + readonly: cluster.read_only_kubernetes_platform_fields?, + placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'), + append: copy_ca_cert_btn + + .form-group + = platform_field.label :token, s_('ClusterIntegration|Enter new Service Token'), class: 'label-bold required' + .input-group.gl-field-error-anchor + = platform_field.password_field :token, type: 'password', class: 'form-control js-select-on-focus js-cluster-token', + readonly: cluster.read_only_kubernetes_platform_fields?, autocomplete: 'new-password' + + .form-group + .form-check + = platform_field.check_box :authorization_type, { disabled: true, inline: true, class: 'form-check-input' }, 'rbac', 'abac' + = platform_field.label :authorization_type, s_('ClusterIntegration|RBAC-enabled cluster'), class: 'form-check-label label-bold' .form-text.text-muted = s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).') = s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.') .form-group - = field.check_box :managed, { label: s_('ClusterIntegration|GitLab-managed cluster'), - class: 'js-gl-managed', - label_class: 'label-bold' } + .form-check + = field.check_box :managed, { class: 'js-gl-managed form-check-input' } + = field.label :managed, s_('ClusterIntegration|GitLab-managed cluster'), class: 'form-check-label label-bold' .form-text.text-muted = s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.') = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer' .form-group - = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' } + .form-check + = field.check_box :namespace_per_environment, { class: 'form-check-input' } + = field.label :namespace_per_environment, s_('ClusterIntegration|Namespace per environment'), class: 'form-check-label label-bold' .form-text.text-muted = s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.') = link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer' |