gitlab-org--gitlab-foss/app/views/projects/clusters/show.html.haml

77 lines
3.7 KiB
Text
Raw Normal View History

.row.prepend-top-default.edit-cluster-form.js-edit-cluster-form{ data: { check_status: status_namespace_project_cluster_path(@cluster.project.namespace, @cluster.project, @cluster.id, format: :json),
edit_path: namespace_project_cluster_path(@project.namespace, @project, @cluster.id, format: :json),
can_update: 'true',
cluster_status: '' }}
2017-10-02 07:41:46 -04:00
= render 'sidebar'
.col-lg-8
%h4.prepend-top-0
= s_('ClusterIntegration|Enable cluster integration')
%p
-#TODO: if can?(current_user, :update_cluster, @cluster)
-# if :enabled
= s_('ClusterIntegration|Disabling cluster integration will not affect your cluster. It will only temporarily turn off GitLab\'s conection to it.')
-# else
= s_('ClusterIntegration|Missing test/state in mockups.')
-# else !can?(current_user, :update_cluster, @cluster)
-# if :enabled
= s_('ClusterIntegration|Cluster integration is enabled for this project.')
-# else
= s_('ClusterIntegration|Cluster integration is disabled for this project.')
2017-10-02 11:53:26 -04:00
%label.toggle-wrapper
%button{ type: 'button', class: 'js-toggle-cluster project-feature-toggle', 'aria-label': 'Toggle', data: { 'enabled-text': 'Enabled', 'disabled-text': 'Disabled' } }
2017-10-02 07:41:46 -04:00
-# if can?(current_user, :update_cluster, @cluster)
2017-10-02 11:53:26 -04:00
.form-group
%button{ type: 'button', class: 'js-edit-cluster-button btn btn-success'}
= s_('ClusterIntegration|Save changes')
2017-10-02 11:53:26 -04:00
2017-10-02 07:41:46 -04:00
-# if can?(current_user, :update_cluster, @cluster)
.form_group
%label
= s_('ClusterIntegration|Google container engine')
2017-10-02 11:53:26 -04:00
- link_gke = link_to(s_('ClusterIntegration|Manage your cluster on GKE'), '', target: '_blank', rel: 'noopener noreferrer')
.hidden.js-cluster-error
%p
= s_('ClusterIntegration|This cluster was set up on Google Container Engine. %{link_gke}').html_safe % { link_gke: link_gke }
.alert.alert-info{ role: 'alert' }
= s_('ClusterIntegration|Something went wrong while creating your cluster on Google Container Engine.')
.hidden.js-cluster-success
%p
= s_('ClusterIntegration|This cluster was set up on Google Container Engine. %{link_gke}').html_safe % { link_gke: link_gke }
.alert.alert-info{ role: 'alert' }
= s_('ClusterIntegration|Cluster was successfully created on Google Container Engine.')
.hidden.js-cluster-creating
%p
= s_('ClusterIntegration|This cluster was set up on Google Container Engine. %{link_gke}').html_safe % { link_gke: link_gke }
.alert.alert-info{ role: 'alert' }
= s_('ClusterIntegration|Cluster is being created on Google Container Engine...')
2017-10-02 07:41:46 -04:00
.form_group
%label
= s_('ClusterIntegration|Cluster name')
.input-group
%input.form-control{ value: @cluster.gcp_cluster_name, disabled: true}
2017-10-02 07:41:46 -04:00
%span.input-group-addon.clipboard-addon
= clipboard_button(text: @cluster.gcp_cluster_name, title: s_('ClusterIntegration|Copy cluster name'))
2017-10-02 07:41:46 -04:00
%br
-# - if can?(current_user, :admin_cluster, @cluster)
.well.form_group
%label.text-danger
= s_('ClusterIntegration|Remove cluster integration')
%p
= s_('ClusterIntegration|Removing cluster integration will remove the cluster configuration you have added to this project. It will not delete your project.')
= link_to(s_('ClusterIntegration|Remove integration'), namespace_project_cluster_path(@project.namespace, @project, @cluster.id), method: :delete, class: 'btn btn-danger')
%br
2017-10-02 11:53:26 -04:00
= link_to "Enable", namespace_project_cluster_path(@project.namespace, @project, @cluster.id), method: :put
%br
= link_to "Disable", namespace_project_cluster_path(@project.namespace, @project, @cluster.id, cluster: {enabled: 'false'}), method: :put