summaryrefslogtreecommitdiff
path: root/app/views/clusters/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 15:09:39 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 15:09:39 +0000
commitdc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch)
tree70945aa6721a271fc8057efa13c3216a03fbac45 /app/views/clusters/clusters
parentcd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff)
downloadgitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views/clusters/clusters')
-rw-r--r--app/views/clusters/clusters/_advanced_settings_container.html.haml6
-rw-r--r--app/views/clusters/clusters/_advanced_settings_tab.html.haml6
-rw-r--r--app/views/clusters/clusters/_applications.html.haml1
-rw-r--r--app/views/clusters/clusters/_applications_tab.html.haml5
-rw-r--r--app/views/clusters/clusters/_configure.html.haml26
-rw-r--r--app/views/clusters/clusters/_details.html.haml11
-rw-r--r--app/views/clusters/clusters/_details_tab.html.haml5
-rw-r--r--app/views/clusters/clusters/_gitlab_integration_form.html.haml (renamed from app/views/clusters/clusters/_form.html.haml)19
-rw-r--r--app/views/clusters/clusters/_provider_details_form.html.haml58
-rw-r--r--app/views/clusters/clusters/show.html.haml22
10 files changed, 119 insertions, 40 deletions
diff --git a/app/views/clusters/clusters/_advanced_settings_container.html.haml b/app/views/clusters/clusters/_advanced_settings_container.html.haml
new file mode 100644
index 00000000000..8aae9bfa462
--- /dev/null
+++ b/app/views/clusters/clusters/_advanced_settings_container.html.haml
@@ -0,0 +1,6 @@
+- if can_admin_cluster?(current_user, @cluster)
+ .settings.expanded.border-0.m-0
+ %p
+ = s_('ClusterIntegration|Advanced options on this Kubernetes cluster’s integration')
+ .settings-content#advanced-settings-section
+ = render 'clusters/clusters/advanced_settings'
diff --git a/app/views/clusters/clusters/_advanced_settings_tab.html.haml b/app/views/clusters/clusters/_advanced_settings_tab.html.haml
new file mode 100644
index 00000000000..b491a64e43d
--- /dev/null
+++ b/app/views/clusters/clusters/_advanced_settings_tab.html.haml
@@ -0,0 +1,6 @@
+- active = params[:tab] == 'settings'
+
+- if can_admin_cluster?(current_user, @cluster)
+ %li.nav-item{ role: 'presentation' }
+ %a#cluster-settings-tab.nav-link{ class: active_when(active), href: clusterable.cluster_path(@cluster.id, params: {tab: 'settings'}) }
+ %span= _('Advanced Settings')
diff --git a/app/views/clusters/clusters/_applications.html.haml b/app/views/clusters/clusters/_applications.html.haml
new file mode 100644
index 00000000000..f83a414a0aa
--- /dev/null
+++ b/app/views/clusters/clusters/_applications.html.haml
@@ -0,0 +1 @@
+.cluster-applications-table#js-cluster-applications
diff --git a/app/views/clusters/clusters/_applications_tab.html.haml b/app/views/clusters/clusters/_applications_tab.html.haml
new file mode 100644
index 00000000000..e1455b0f60a
--- /dev/null
+++ b/app/views/clusters/clusters/_applications_tab.html.haml
@@ -0,0 +1,5 @@
+- active = params[:tab] == 'apps'
+
+%li.nav-item{ role: 'presentation' }
+ %a#cluster-apps-tab.nav-link.qa-applications{ class: active_when(active), href: clusterable.cluster_path(@cluster.id, params: {tab: 'apps'}) }
+ %span= _('Applications')
diff --git a/app/views/clusters/clusters/_configure.html.haml b/app/views/clusters/clusters/_configure.html.haml
deleted file mode 100644
index 4ce00c67866..00000000000
--- a/app/views/clusters/clusters/_configure.html.haml
+++ /dev/null
@@ -1,26 +0,0 @@
-%section#cluster-integration
- - unless @cluster.status_name.in? %i/scheduled creating/
- = render 'form'
-
-- unless @cluster.status_name.in? %i/scheduled creating/
- = render_if_exists 'projects/clusters/prometheus_graphs'
-
- .cluster-applications-table#js-cluster-applications
-
- %section.settings#js-cluster-details{ class: ('expanded' if expanded) }
- .settings-header
- %h4= s_('ClusterIntegration|Kubernetes cluster details')
- %button.btn.js-settings-toggle{ type: 'button' }
- = expanded ? _('Collapse') : _('Expand')
- %p= s_('ClusterIntegration|See and edit the details for your Kubernetes cluster')
- .settings-content
- = render 'clusters/platforms/kubernetes/form', cluster: @cluster, platform: @cluster.platform_kubernetes, update_cluster_url_path: clusterable.cluster_path(@cluster)
-
- %section.settings.no-animate#js-cluster-advanced-settings{ class: ('expanded' if expanded) }
- .settings-header
- %h4= _('Advanced settings')
- %button.btn.js-settings-toggle{ type: 'button' }
- = expanded ? _('Collapse') : _('Expand')
- %p= s_("ClusterIntegration|Advanced options on this Kubernetes cluster's integration")
- .settings-content#advanced-settings-section
- = render 'advanced_settings'
diff --git a/app/views/clusters/clusters/_details.html.haml b/app/views/clusters/clusters/_details.html.haml
new file mode 100644
index 00000000000..fb0a1aaebc4
--- /dev/null
+++ b/app/views/clusters/clusters/_details.html.haml
@@ -0,0 +1,11 @@
+%section#cluster-integration
+ = render 'gitlab_integration_form'
+
+ %section.settings.no-animate{ class: ('expanded' if expanded) }
+ .settings-header
+ %h4= s_('ClusterIntegration|Provider details')
+ %button.btn.js-settings-toggle{ type: 'button' }
+ = expanded ? _('Collapse') : _('Expand')
+ %p= s_('ClusterIntegration|See and edit the details for your Kubernetes cluster')
+ .settings-content
+ = render 'provider_details_form', cluster: @cluster, platform: @cluster.platform_kubernetes, update_cluster_url_path: clusterable.cluster_path(@cluster)
diff --git a/app/views/clusters/clusters/_details_tab.html.haml b/app/views/clusters/clusters/_details_tab.html.haml
new file mode 100644
index 00000000000..564c5103d34
--- /dev/null
+++ b/app/views/clusters/clusters/_details_tab.html.haml
@@ -0,0 +1,5 @@
+- active = params[:tab] == 'details' || !params[:tab].present?
+
+%li.nav-item{ role: 'presentation' }
+ %a#cluster-details-tab.nav-link.qa-details{ class: active_when(active), href: clusterable.cluster_path(@cluster.id, params: {tab: 'details'}) }
+ %span= _('Details')
diff --git a/app/views/clusters/clusters/_form.html.haml b/app/views/clusters/clusters/_gitlab_integration_form.html.haml
index 40fc7d110fc..2489f78b403 100644
--- a/app/views/clusters/clusters/_form.html.haml
+++ b/app/views/clusters/clusters/_gitlab_integration_form.html.haml
@@ -1,11 +1,12 @@
-= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster, html: { class: 'cluster_integration_form' } do |field|
+= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster, html: { class: 'js-cluster-integration-form' } do |field|
= form_errors(@cluster)
.form-group
- %h5= s_('ClusterIntegration|Integration status')
- %label.append-bottom-0.js-cluster-enable-toggle-area
- = render "shared/buttons/project_feature_toggle", is_checked: @cluster.enabled?, label: s_("ClusterIntegration|Toggle Kubernetes cluster"), disabled: !can?(current_user, :update_cluster, @cluster), data: { qa_selector: 'integration_status_toggle' } do
- = field.hidden_field :enabled, { class: 'js-project-feature-toggle-input'}
- .form-text.text-muted= s_('ClusterIntegration|Enable or disable GitLab\'s connection to your Kubernetes cluster.')
+ .d-flex.align-items-center
+ %h4.pr-2.m-0
+ = s_('ClusterIntegration|GitLab Integration')
+ %label.append-bottom-0.js-cluster-enable-toggle-area{ title: s_('ClusterIntegration|Enable or disable GitLab\'s connection to your Kubernetes cluster.'), data: { toggle: 'tooltip', container: 'body' } }
+ = render "shared/buttons/project_feature_toggle", is_checked: @cluster.enabled?, label: s_("ClusterIntegration|Toggle Kubernetes cluster"), disabled: !can?(current_user, :update_cluster, @cluster), data: { qa_selector: 'integration_status_toggle' } do
+ = field.hidden_field :enabled, { class: 'js-project-feature-toggle-input'}
.form-group
%h5= s_('ClusterIntegration|Environment scope')
@@ -17,7 +18,8 @@
- 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 *
+ %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
@@ -29,7 +31,8 @@
= 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 }
%span{ :class => ["js-ingress-domain-help-text", ("hide" unless @cluster.application_ingress_external_ip.present?)] }
= s_('ClusterIntegration|Alternatively')
- %code{ :class => "js-ingress-domain-snippet" } #{@cluster.application_ingress_external_ip}.nip.io
+ %code{ :class => "js-ingress-domain-snippet" }
+ = s_('ClusterIntegration|%{external_ip}.nip.io').html_safe % { external_ip: @cluster.application_ingress_external_ip }
= s_('ClusterIntegration| can be used instead of a custom domain.')
- custom_domain_url = help_page_path('user/clusters/applications.md', anchor: 'pointing-your-dns-at-the-external-endpoint')
- custom_domain_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: custom_domain_url }
diff --git a/app/views/clusters/clusters/_provider_details_form.html.haml b/app/views/clusters/clusters/_provider_details_form.html.haml
new file mode 100644
index 00000000000..dd7d6182e3c
--- /dev/null
+++ b/app/views/clusters/clusters/_provider_details_form.html.haml
@@ -0,0 +1,58 @@
+= bootstrap_form_for cluster, url: update_cluster_url_path, html: { class: 'js-provider-details gl-show-field-errors' },
+ 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
+
+ = 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
+
+ - show_token_btn = (platform_field.button s_('ClusterIntegration|Show'),
+ type: 'button', class: 'js-show-cluster-token btn btn-default')
+ - copy_token_btn = clipboard_button(text: platform.token, title: s_('ClusterIntegration|Copy Service Token'),
+ class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields?
+
+ = platform_field.text_field :token, type: 'password', class: 'js-select-on-focus js-cluster-token',
+ required: true, title: s_('ClusterIntegration|Service token is required.'),
+ readonly: cluster.read_only_kubernetes_platform_fields?,
+ label: s_('ClusterIntegration|Service Token'), label_class: 'label-bold',
+ input_group_class: 'gl-field-error-anchor', append: show_token_btn + copy_token_btn
+
+ = 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-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-text.text-muted
+ = s_('ClusterIntegration|Allow GitLab to manage namespace and service accounts for this cluster.')
+ = link_to _('More information'), help_page_path('user/project/clusters/index.md', anchor: 'gitlab-managed-clusters'), target: '_blank'
+
+ - if cluster.allow_user_defined_namespace?
+ = render('clusters/clusters/namespace', platform_field: platform_field)
+
+ .form-group
+ = field.submit s_('ClusterIntegration|Save changes'), class: 'btn btn-success'
diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml
index e1f011a3225..4aa5b6af636 100644
--- a/app/views/clusters/clusters/show.html.haml
+++ b/app/views/clusters/clusters/show.html.haml
@@ -5,8 +5,6 @@
- manage_prometheus_path = edit_project_service_path(@cluster.project, 'prometheus') if @project
- cluster_environments_path = clusterable.environments_cluster_path(@cluster)
-- expanded = expanded_by_default?
-
- status_path = clusterable.cluster_status_cluster_path(@cluster.id, format: :json) if can?(current_user, :admin_cluster, @cluster)
.edit-cluster-form.js-edit-cluster-form{ data: { status_path: status_path,
install_helm_path: clusterable.install_applications_cluster_path(@cluster, :helm),
@@ -44,7 +42,19 @@
%h4= @cluster.name
= render 'banner'
- - if cluster_environments_path.present?
- = render_if_exists 'clusters/clusters/cluster_environments', expanded: expanded
- - else
- = render 'configure', expanded: expanded
+ - if cluster_created?(@cluster)
+ .js-toggle-container
+ %ul.nav-links.mobile-separator.nav.nav-tabs{ role: 'tablist' }
+ = render 'details_tab'
+ = render_if_exists 'clusters/clusters/environments_tab'
+ = render_if_exists 'clusters/clusters/health_tab'
+ = render 'applications_tab'
+ = render 'advanced_settings_tab'
+
+ .tab-content.py-3
+ .tab-pane.active{ role: 'tabpanel' }
+ = render_cluster_info_tab_content(params[:tab], expanded_by_default?)
+
+
+
+