Commit 310ae687 authored by Mike Greiling's avatar Mike Greiling

hide prometheus manual integration form when auto config is active

parent 0b47134e
...@@ -27,6 +27,10 @@ class PrometheusService < MonitoringService ...@@ -27,6 +27,10 @@ class PrometheusService < MonitoringService
false false
end end
def editable?
!prometheus_installed? || manual_configuration?
end
def title def title
'Prometheus' 'Prometheus'
end end
...@@ -40,19 +44,13 @@ class PrometheusService < MonitoringService ...@@ -40,19 +44,13 @@ class PrometheusService < MonitoringService
end end
def fields def fields
return [] unless editable?
[ [
{ {
type: 'fieldset', type: 'checkbox',
name: 'manual_configuration', name: 'manual_configuration',
legend: 'Manual Configuration', title: s_('PrometheusService|Active'),
fields: [ required: true
{
type: 'checkbox',
name: 'manual_configuration',
title: s_('PrometheusService|Active'),
required: true
}
]
}, },
{ {
type: 'text', type: 'text',
......
.row.prepend-top-default.append-bottom-default %h4
%p Auto configuration
- unless @service.manual_configuration?
- if @service.prometheus_installed? .prepend-top-default.append-bottom-default
= link_to 'Manage installed Prometheus', project_clusters_path(@project), class: 'btn btn-cancel' - unless @service.manual_configuration?
- else - if @service.prometheus_installed?
= link_to 'Install Prometheus', project_clusters_path(@project), class: 'btn btn-cancel' = link_to 'Manage clusters', project_clusters_path(@project), class: 'btn'
- else - else
To automatically install prometheus disable manual configuration = link_to 'Install Prometheus on clusters', project_clusters_path(@project), class: 'btn btn-success'
- else
.well
To enable the installation of Prometheus on your clusters, deactivate the manual configuration below
%hr
%h4.append-bottom-default
Manual configuration
- unless @service.editable?
.well
To enable manual configuration, uninstall Prometheus from your clusters
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment