summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-10-02 20:49:04 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-10-02 20:49:17 +0100
commitfd6776214abb2603ce2fb5dfb078229f0a0195e5 (patch)
tree00566dca0109fa4c1b1575bec80ba1d489c39954 /app/views
parentfd44ac2b14baeafb1a9ea5c761671213dc4cf613 (diff)
downloadgitlab-ce-fd6776214abb2603ce2fb5dfb078229f0a0195e5.tar.gz
Adds toggle button
Adds polling function
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/clusters/edit.html.haml45
1 files changed, 27 insertions, 18 deletions
diff --git a/app/views/projects/clusters/edit.html.haml b/app/views/projects/clusters/edit.html.haml
index 16d864423f5..0f6be36e56a 100644
--- a/app/views/projects/clusters/edit.html.haml
+++ b/app/views/projects/clusters/edit.html.haml
@@ -1,4 +1,7 @@
-.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), edit_path: namespace_project_cluster_path(@project.namespace, @project, @cluster.id)}}
+.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: '' }}
= render 'sidebar'
.col-lg-8
%h4.prepend-top-0
@@ -16,21 +19,37 @@
= s_('ClusterIntegration|Cluster integration is disabled for this project.')
%label.toggle-wrapper
- %button{ type: 'button', class: 'js-toggle-cluster project-feature-toggle', aria: { label: 'Toggle' }, data: { 'enabled-text': 'Enable', 'disabled-text': 'disabled' } }
+ %button{ type: 'button', class: 'js-toggle-cluster project-feature-toggle', 'aria-label': 'Toggle', data: { 'enabled-text': 'Enabled', 'disabled-text': 'Disabled' } }
+ -# if can?(current_user, :update_cluster, @cluster)
.form-group
+ %button{ type: 'button', class: 'js-edit-cluster-button btn btn-success'}
+ = s_('ClusterIntegration|Save changes')
- -# render errors TODO
- #= form_errors(@cluster)
-
-# if can?(current_user, :update_cluster, @cluster)
.form_group
%label
= s_('ClusterIntegration|Google container engine')
- %p
+
- link_gke = link_to(s_('ClusterIntegration|Manage your cluster on GKE'), '', target: '_blank', rel: 'noopener noreferrer')
- = s_('ClusterIntegration|This cluster was not set up on Google Container Engine. %{link_gke}').html_safe % { link_gke: link_gke }
+ .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...')
.form_group
%label
@@ -50,18 +69,8 @@
= link_to(s_('ClusterIntegration|Remove integration'), namespace_project_cluster_path(@project.namespace, @project, @cluster.id), method: :delete, class: 'btn btn-danger')
+
%br
= 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
-
-%br
--# status GET
--# status: The current status of the operation.
--# status_reason: If an error has occurred, a textual description of the error.
-= link_to 'Check status', status_namespace_project_cluster_path(@cluster.project.namespace, @cluster.project, @cluster.id), :remote => true
-%br
--# simply rendering error, if it happened
-status_reason
-%p= @cluster.status_reason
--# Even if we got an error during the creation process, we don't delete cluster objects automatically, because we don't have a method to delete the cluster on gke. So users move to edit page from new page **regardless of validation errors**, and they have to delete the record manually. This is for giving users headsup that a new cluster might remain in gke. /cc @ayufan