diff options
Diffstat (limited to 'app/models/project_services/prometheus_service.rb')
-rw-r--r-- | app/models/project_services/prometheus_service.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/app/models/project_services/prometheus_service.rb b/app/models/project_services/prometheus_service.rb index 3f90d841d58..f2f71547e03 100644 --- a/app/models/project_services/prometheus_service.rb +++ b/app/models/project_services/prometheus_service.rb @@ -27,6 +27,10 @@ class PrometheusService < MonitoringService false end + def editable? + !prometheus_installed? || manual_configuration? + end + def title 'Prometheus' end @@ -40,19 +44,13 @@ class PrometheusService < MonitoringService end def fields + return [] unless editable? [ { - type: 'fieldset', + type: 'checkbox', name: 'manual_configuration', - legend: 'Manual Configuration', - fields: [ - { - type: 'checkbox', - name: 'manual_configuration', - title: s_('PrometheusService|Active'), - required: true - } - ] + title: s_('PrometheusService|Active'), + required: true }, { type: 'text', |