diff options
author | Maneschi Romain <rmaneschi@gmail.com> | 2019-07-03 16:09:51 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-07-03 16:09:51 +0000 |
commit | def94f5043abe57f453094fa570407e5b806c48a (patch) | |
tree | a96016ceab428c70f55da9fd173b224259388ed0 /app/views | |
parent | 6359a1fabdca65af1c1a514fda44a32bbfe5c4ec (diff) | |
download | gitlab-ce-def94f5043abe57f453094fa570407e5b806c48a.tar.gz |
Add Grafana to Admin > Monitoring menu when enabled
Diffstat (limited to 'app/views')
3 files changed, 33 insertions, 0 deletions
diff --git a/app/views/admin/application_settings/_grafana.html.haml b/app/views/admin/application_settings/_grafana.html.haml new file mode 100644 index 00000000000..b6e02bde895 --- /dev/null +++ b/app/views/admin/application_settings/_grafana.html.haml @@ -0,0 +1,17 @@ += form_for @application_setting, url: admin_application_settings_path(anchor: 'js-grafana-settings'), html: { class: 'fieldset-form' } do |f| + = form_errors(@application_setting) + + %fieldset + %p + = _("Add a Grafana button in the admin sidebar, monitoring section, to access a variety of statistics on the health and performance of GitLab.") + = link_to icon('question-circle'), help_page_path('administration/monitoring/performance/grafana_configuration.md') + .form-group + .form-check + = f.check_box :grafana_enabled, class: 'form-check-input' + = f.label :grafana_enabled, class: 'form-check-label' do + = _('Enable access to Grafana') + .form-group + = f.label :grafana_url, _('Grafana URL'), class: 'label-bold' + = f.text_field :grafana_url, class: 'form-control', placeholder: '/-/grafana' + + = f.submit _('Save changes'), class: "btn btn-success" diff --git a/app/views/admin/application_settings/metrics_and_profiling.html.haml b/app/views/admin/application_settings/metrics_and_profiling.html.haml index 01d61beaf53..55a48da8342 100644 --- a/app/views/admin/application_settings/metrics_and_profiling.html.haml +++ b/app/views/admin/application_settings/metrics_and_profiling.html.haml @@ -24,6 +24,17 @@ .settings-content = render 'prometheus' +%section.settings.as-grafana.no-animate#js-grafana-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Metrics - Grafana') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Enable and configure Grafana.') + .settings-content + = render 'grafana' + %section.settings.qa-performance-bar-settings.as-performance-bar.no-animate#js-performance-bar-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index 83fe871285a..87133c7ba22 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -81,6 +81,11 @@ = link_to admin_requests_profiles_path, title: _('Requests Profiles') do %span = _('Requests Profiles') + - if Gitlab::CurrentSettings.current_application_settings.grafana_enabled? + = nav_link do + = link_to Gitlab::CurrentSettings.current_application_settings.grafana_url, target: '_blank', title: _('Metrics Dashboard') do + %span + = _('Metrics Dashboard') = render_if_exists 'layouts/nav/ee/admin/new_monitoring_sidebar' = nav_link(controller: :broadcast_messages) do |