2022-04-04 11:22:00 +05:30
- name = _("Service usage data")
- breadcrumb_title name
- page_title name
2023-03-04 22:38:38 +05:30
- add_page_specific_style 'page_bundles/settings'
2022-04-04 11:22:00 +05:30
- payload_class = 'js-service-ping-payload'
2022-11-25 23:54:43 +05:30
%section.js-search-settings-section
%h3= name
2022-04-04 11:22:00 +05:30
2022-11-25 23:54:43 +05:30
- if @service_ping_data_present
2023-03-04 22:38:38 +05:30
= render Pajamas::ButtonComponent.new(button_options: { class: 'js-payload-preview-trigger gl-mr-2', data: { payload_selector: ".#{payload_class}" } }) do
2022-11-25 23:54:43 +05:30
= gl_loading_icon(css_class: 'js-spinner gl-display-none', inline: true)
%span.js-text.gl-display-inline= _('Preview payload')
2023-03-04 22:38:38 +05:30
= render Pajamas::ButtonComponent.new(button_options: { class: 'js-payload-download-trigger gl-mr-2', data: { endpoint: usage_data_admin_application_settings_path(format: :json) } }) do
2022-11-25 23:54:43 +05:30
= gl_loading_icon(css_class: 'js-spinner gl-display-none', inline: true)
%span.js-text.gl-display-inline= _('Download payload')
%pre.js-syntax-highlight.code.highlight.gl-mt-2.gl-display-none{ class: payload_class, data: { endpoint: usage_data_admin_application_settings_path(format: :html) } }
- else
= render Pajamas::AlertComponent.new(variant: :warning,
dismissible: false,
title: _('Service Ping payload not found in the application cache')) do |c|
2022-06-21 17:19:12 +05:30
2022-11-25 23:54:43 +05:30
= c.body do
- enable_service_ping_link_url = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'enable-or-disable-usage-statistics')
- enable_service_ping_link = '<a href="%{url}">'.html_safe % { url: enable_service_ping_link_url }
2023-01-13 00:05:48 +05:30
- generate_manually_link_url = help_page_path('development/service_ping/troubleshooting', anchor: 'generate-service-ping')
2022-11-25 23:54:43 +05:30
- generate_manually_link = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: generate_manually_link_url }
2022-06-21 17:19:12 +05:30
2022-11-25 23:54:43 +05:30
= html_escape(s_('%{enable_service_ping_link_start}Enable%{link_end} or %{generate_manually_link_start}generate%{link_end} Service Ping to preview and download service usage data payload.')) % { enable_service_ping_link_start: enable_service_ping_link, generate_manually_link_start: generate_manually_link, link_end: '</a>'.html_safe }