diff options
Diffstat (limited to 'app/views/clusters/clusters/_integration_form.html.haml')
-rw-r--r-- | app/views/clusters/clusters/_integration_form.html.haml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/views/clusters/clusters/_integration_form.html.haml b/app/views/clusters/clusters/_integration_form.html.haml new file mode 100644 index 00000000000..0792ad0085c --- /dev/null +++ b/app/views/clusters/clusters/_integration_form.html.haml @@ -0,0 +1,32 @@ += form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster do |field| + = form_errors(@cluster) + = hidden_clusterable_fields + .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.') + + - if has_multiple_clusters? + .form-group + %h5= s_('ClusterIntegration|Environment scope') + = 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.") + + - if can?(current_user, :update_cluster, @cluster) + .form-group + = field.submit _('Save changes'), class: 'btn btn-success' + + - unless has_multiple_clusters? + %h5= s_('ClusterIntegration|Environment scope') + %p + %code * + is the default environment scope for this cluster. This means that all jobs, regardless of their environment, will use this cluster. + = link_to 'More information', ('https://docs.gitlab.com/ee/user/project/clusters/#setting-the-environment-scope') |