Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
310ae687
Commit
310ae687
authored
Jan 31, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide prometheus manual integration form when auto config is active
parent
0b47134e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
app/models/project_services/prometheus_service.rb
app/models/project_services/prometheus_service.rb
+8
-10
app/views/projects/services/prometheus/_help.html.haml
app/views/projects/services/prometheus/_help.html.haml
+19
-8
No files found.
app/models/project_services/prometheus_service.rb
View file @
310ae687
...
@@ -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'
,
name:
'manual_configuration'
,
legend:
'Manual Configuration'
,
fields:
[
{
{
type:
'checkbox'
,
type:
'checkbox'
,
name:
'manual_configuration'
,
name:
'manual_configuration'
,
title:
s_
(
'PrometheusService|Active'
),
title:
s_
(
'PrometheusService|Active'
),
required:
true
required:
true
}
]
},
},
{
{
type:
'text'
,
type:
'text'
,
...
...
app/views/projects/services/prometheus/_help.html.haml
View file @
310ae687
.row.prepend-top-default.append-bottom-default
%h4
%p
Auto configuration
.prepend-top-default.append-bottom-default
-
unless
@service
.
manual_configuration?
-
unless
@service
.
manual_configuration?
-
if
@service
.
prometheus_installed?
-
if
@service
.
prometheus_installed?
=
link_to
'Manage installed Prometheus'
,
project_clusters_path
(
@project
),
class:
'btn btn-cancel
'
=
link_to
'Manage clusters'
,
project_clusters_path
(
@project
),
class:
'btn
'
-
else
-
else
=
link_to
'Install Prometheus'
,
project_clusters_path
(
@project
),
class:
'btn btn-cancel
'
=
link_to
'Install Prometheus on clusters'
,
project_clusters_path
(
@project
),
class:
'btn btn-success
'
-
else
-
else
To automatically install prometheus disable manual configuration
.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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment