rails_mini_profiler 0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +302 -0
  4. data/app/assets/config/rails_mini_profiler_manifest.js +1 -0
  5. data/app/assets/javascripts/rails_mini_profiler.js +15 -0
  6. data/app/assets/stylesheets/rails_mini_profiler/application.css +16 -0
  7. data/app/controllers/rails_mini_profiler/application_controller.rb +33 -0
  8. data/app/controllers/rails_mini_profiler/flamegraphs_controller.rb +23 -0
  9. data/app/controllers/rails_mini_profiler/profiled_requests_controller.rb +68 -0
  10. data/app/helpers/rails_mini_profiler/application_helper.rb +23 -0
  11. data/app/helpers/rails_mini_profiler/profiled_requests_helper.rb +16 -0
  12. data/app/javascript/images/bookmark.svg +10 -0
  13. data/app/javascript/images/chart.svg +12 -0
  14. data/app/javascript/images/check.svg +3 -0
  15. data/app/javascript/images/chevron.svg +3 -0
  16. data/app/javascript/images/delete.svg +9 -0
  17. data/app/javascript/images/filter.svg +1 -0
  18. data/app/javascript/images/graph.svg +11 -0
  19. data/app/javascript/images/logo.svg +18 -0
  20. data/app/javascript/images/logo_variant.svg +32 -0
  21. data/app/javascript/images/search.svg +9 -0
  22. data/app/javascript/images/setting.svg +10 -0
  23. data/app/javascript/images/show.svg +11 -0
  24. data/app/javascript/js/checklist_controller.js +48 -0
  25. data/app/javascript/js/enable_controller.js +24 -0
  26. data/app/javascript/js/filter_controller.js +44 -0
  27. data/app/javascript/js/search_controller.js +18 -0
  28. data/app/javascript/js/select_controller.js +47 -0
  29. data/app/javascript/packs/rails-mini-profiler.js +88 -0
  30. data/app/javascript/stylesheets/components/page_header/page_header.scss +3 -0
  31. data/app/javascript/stylesheets/components/pagination.scss +55 -0
  32. data/app/javascript/stylesheets/components/profiled_request_table/placeholder.scss +33 -0
  33. data/app/javascript/stylesheets/components/profiled_request_table/profiled_request_table.scss +179 -0
  34. data/app/javascript/stylesheets/flamegraph.scss +10 -0
  35. data/app/javascript/stylesheets/flashes.scss +15 -0
  36. data/app/javascript/stylesheets/navbar.scss +44 -0
  37. data/app/javascript/stylesheets/profiled_requests.scss +89 -0
  38. data/app/javascript/stylesheets/rails-mini-profiler.scss +205 -0
  39. data/app/javascript/stylesheets/traces.scss +82 -0
  40. data/app/models/rails_mini_profiler/application_record.rb +17 -0
  41. data/app/models/rails_mini_profiler/controller_trace.rb +37 -0
  42. data/app/models/rails_mini_profiler/flamegraph.rb +37 -0
  43. data/app/models/rails_mini_profiler/instantiation_trace.rb +37 -0
  44. data/app/models/rails_mini_profiler/profiled_request.rb +65 -0
  45. data/app/models/rails_mini_profiler/render_partial_trace.rb +37 -0
  46. data/app/models/rails_mini_profiler/render_template_trace.rb +37 -0
  47. data/app/models/rails_mini_profiler/rmp_trace.rb +35 -0
  48. data/app/models/rails_mini_profiler/sequel_trace.rb +37 -0
  49. data/app/models/rails_mini_profiler/trace.rb +46 -0
  50. data/app/presenters/rails_mini_profiler/base_presenter.rb +25 -0
  51. data/app/presenters/rails_mini_profiler/controller_trace_presenter.rb +18 -0
  52. data/app/presenters/rails_mini_profiler/instantiation_trace_presenter.rb +14 -0
  53. data/app/presenters/rails_mini_profiler/profiled_request_presenter.rb +38 -0
  54. data/app/presenters/rails_mini_profiler/render_partial_trace_presenter.rb +11 -0
  55. data/app/presenters/rails_mini_profiler/render_template_trace_presenter.rb +15 -0
  56. data/app/presenters/rails_mini_profiler/rmp_trace_presenter.rb +9 -0
  57. data/app/presenters/rails_mini_profiler/sequel_trace_presenter.rb +69 -0
  58. data/app/presenters/rails_mini_profiler/trace_presenter.rb +61 -0
  59. data/app/search/rails_mini_profiler/base_search.rb +67 -0
  60. data/app/search/rails_mini_profiler/profiled_request_search.rb +34 -0
  61. data/app/views/layouts/rails_mini_profiler/application.html.erb +15 -0
  62. data/app/views/layouts/rails_mini_profiler/flamegraph.html.erb +11 -0
  63. data/app/views/models/_flamegraph.json.jb +3 -0
  64. data/app/views/models/_profiled_request.jb +3 -0
  65. data/app/views/models/_trace.jb +3 -0
  66. data/app/views/rails_mini_profiler/badge.html.erb +37 -0
  67. data/app/views/rails_mini_profiler/flamegraphs/show.html.erb +13 -0
  68. data/app/views/rails_mini_profiler/flamegraphs/show.json.jb +3 -0
  69. data/app/views/rails_mini_profiler/profiled_requests/index.html.erb +9 -0
  70. data/app/views/rails_mini_profiler/profiled_requests/index.json.jb +3 -0
  71. data/app/views/rails_mini_profiler/profiled_requests/shared/_trace.html.erb +40 -0
  72. data/app/views/rails_mini_profiler/profiled_requests/shared/header/_header.erb +20 -0
  73. data/app/views/rails_mini_profiler/profiled_requests/shared/table/_placeholder.erb +12 -0
  74. data/app/views/rails_mini_profiler/profiled_requests/shared/table/_table.erb +14 -0
  75. data/app/views/rails_mini_profiler/profiled_requests/shared/table/_table_head.erb +125 -0
  76. data/app/views/rails_mini_profiler/profiled_requests/shared/table/_table_row.erb +21 -0
  77. data/app/views/rails_mini_profiler/profiled_requests/show.html.erb +40 -0
  78. data/app/views/rails_mini_profiler/profiled_requests/show.json.jb +5 -0
  79. data/app/views/rails_mini_profiler/shared/_flashes.html.erb +8 -0
  80. data/app/views/rails_mini_profiler/shared/_head.erb +13 -0
  81. data/app/views/rails_mini_profiler/shared/_navbar.html.erb +15 -0
  82. data/config/routes.rb +11 -0
  83. data/db/migrate/20210621185018_create_rmp.rb +46 -0
  84. data/lib/generators/rails_mini_profiler/USAGE +2 -0
  85. data/lib/generators/rails_mini_profiler/install_generator.rb +40 -0
  86. data/lib/generators/rails_mini_profiler/templates/rails_mini_profiler.js.erb +13 -0
  87. data/lib/generators/rails_mini_profiler/templates/rails_mini_profiler.rb.erb +29 -0
  88. data/lib/rails_mini_profiler/badge.rb +84 -0
  89. data/lib/rails_mini_profiler/configuration/storage.rb +47 -0
  90. data/lib/rails_mini_profiler/configuration/user_interface.rb +48 -0
  91. data/lib/rails_mini_profiler/configuration.rb +65 -0
  92. data/lib/rails_mini_profiler/engine.rb +34 -0
  93. data/lib/rails_mini_profiler/flamegraph_guard.rb +47 -0
  94. data/lib/rails_mini_profiler/guard.rb +57 -0
  95. data/lib/rails_mini_profiler/logger.rb +25 -0
  96. data/lib/rails_mini_profiler/middleware.rb +74 -0
  97. data/lib/rails_mini_profiler/models/base_model.rb +23 -0
  98. data/lib/rails_mini_profiler/redirect.rb +33 -0
  99. data/lib/rails_mini_profiler/request_context.rb +86 -0
  100. data/lib/rails_mini_profiler/request_wrapper.rb +69 -0
  101. data/lib/rails_mini_profiler/response_wrapper.rb +32 -0
  102. data/lib/rails_mini_profiler/tracing/controller_tracer.rb +15 -0
  103. data/lib/rails_mini_profiler/tracing/null_trace.rb +7 -0
  104. data/lib/rails_mini_profiler/tracing/sequel_tracer.rb +37 -0
  105. data/lib/rails_mini_profiler/tracing/sequel_tracker.rb +37 -0
  106. data/lib/rails_mini_profiler/tracing/subscriptions.rb +34 -0
  107. data/lib/rails_mini_profiler/tracing/trace.rb +45 -0
  108. data/lib/rails_mini_profiler/tracing/trace_factory.rb +37 -0
  109. data/lib/rails_mini_profiler/tracing/tracer.rb +31 -0
  110. data/lib/rails_mini_profiler/tracing/view_tracer.rb +12 -0
  111. data/lib/rails_mini_profiler/tracing.rb +11 -0
  112. data/lib/rails_mini_profiler/user.rb +40 -0
  113. data/lib/rails_mini_profiler/version.rb +5 -0
  114. data/lib/rails_mini_profiler.rb +79 -0
  115. data/lib/tasks/rails_mini_profiler_tasks.rake +8 -0
  116. data/public/rails_mini_profiler/speedscope/LICENSE +21 -0
  117. data/public/rails_mini_profiler/speedscope/demangle-cpp.1768f4cc.js +4 -0
  118. data/public/rails_mini_profiler/speedscope/demangle-cpp.1768f4cc.js.map +1 -0
  119. data/public/rails_mini_profiler/speedscope/favicon-16x16.f74b3187.png +0 -0
  120. data/public/rails_mini_profiler/speedscope/favicon-32x32.bc503437.png +0 -0
  121. data/public/rails_mini_profiler/speedscope/file-format-schema.json +324 -0
  122. data/public/rails_mini_profiler/speedscope/import.e3a73ef4.js +117 -0
  123. data/public/rails_mini_profiler/speedscope/import.e3a73ef4.js.map +1 -0
  124. data/public/rails_mini_profiler/speedscope/index.html +2 -0
  125. data/public/rails_mini_profiler/speedscope/release.txt +3 -0
  126. data/public/rails_mini_profiler/speedscope/reset.8c46b7a1.css +2 -0
  127. data/public/rails_mini_profiler/speedscope/reset.8c46b7a1.css.map +1 -0
  128. data/public/rails_mini_profiler/speedscope/source-map.438fa06b.js +24 -0
  129. data/public/rails_mini_profiler/speedscope/source-map.438fa06b.js.map +1 -0
  130. data/public/rails_mini_profiler/speedscope/speedscope.026f36b0.js +200 -0
  131. data/public/rails_mini_profiler/speedscope/speedscope.026f36b0.js.map +1 -0
  132. data/vendor/assets/images/bookmark.svg +10 -0
  133. data/vendor/assets/images/chart.svg +12 -0
  134. data/vendor/assets/images/check.svg +3 -0
  135. data/vendor/assets/images/chevron.svg +3 -0
  136. data/vendor/assets/images/delete.svg +9 -0
  137. data/vendor/assets/images/filter.svg +1 -0
  138. data/vendor/assets/images/graph.svg +11 -0
  139. data/vendor/assets/images/logo.svg +18 -0
  140. data/vendor/assets/images/logo_variant.svg +32 -0
  141. data/vendor/assets/images/search.svg +9 -0
  142. data/vendor/assets/images/setting.svg +10 -0
  143. data/vendor/assets/images/show.svg +11 -0
  144. data/vendor/assets/javascripts/rails-mini-profiler.css +1 -0
  145. data/vendor/assets/javascripts/rails-mini-profiler.js +1 -0
  146. metadata +248 -0
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsMiniProfiler
4
+ module ApplicationHelper
5
+ include Pagy::Frontend
6
+
7
+ def present(model, presenter_class = nil, **kwargs)
8
+ klass = presenter_class || "#{model.class}Presenter".constantize
9
+ presenter = klass.new(model, self, **kwargs)
10
+ yield(presenter) if block_given?
11
+ presenter
12
+ end
13
+
14
+ def inline_svg(path, options = {})
15
+ if defined?(Webpacker::Engine)
16
+ path = "media/images/#{path}"
17
+ inline_svg_pack_tag(path, options)
18
+ else
19
+ inline_svg_tag(path, options)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsMiniProfiler
4
+ module ProfiledRequestsHelper
5
+ include ApplicationHelper
6
+
7
+ def formatted_duration(duration)
8
+ duration = (duration.to_f / 100)
9
+ duration < 1 ? duration : duration.round
10
+ end
11
+
12
+ def formatted_allocations(allocations)
13
+ number_to_human(allocations, units: { unit: '', thousand: 'k', million: 'M', billion: 'B', trillion: 'T' })
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Iconly/Bulk/Bookmark</title>
4
+ <g id="Iconly/Bulk/Bookmark" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="Bookmark" transform="translate(4.000000, 2.000000)" fill="#000000" fill-rule="nonzero">
6
+ <path d="M7.99117971,16.6215262 L1.49944873,19.8641008 C1.00920819,20.1302192 0.397682727,19.9525481 0.123484013,19.4643313 C0.043404087,19.3108374 0.00105752372,19.1402321 -5.24025268e-14,18.9668404 L-5.24025268e-14,11.7088036 C-5.24025268e-14,12.4283887 0.405733186,12.872577 1.47298787,13.3700679 L7.99117971,16.6215262 Z" id="Bookmark-2" opacity="0.400000006"></path>
7
+ <path d="M11.0694598,0 C13.7772878,0 15.9735391,1.06605192 16,3.79336809 L16,3.79336809 L16,18.9668404 C15.998918,19.1374024 15.9565307,19.3051222 15.876516,19.4554476 C15.7479482,19.7006536 15.5259405,19.8826876 15.2614691,19.959752 C14.9969977,20.0368164 14.7127851,20.0022901 14.4740904,19.8641008 L14.4740904,19.8641008 L7.99117971,16.6215262 L1.47298787,13.3700679 C0.405733186,12.872577 8.17124146e-14,12.4283887 8.17124146e-14,11.7088036 L8.17124146e-14,11.7088036 L8.17124146e-14,3.79336809 C8.17124146e-14,1.06605192 2.19625138,0 4.8952591,0 L4.8952591,0 Z M11.7486218,6.04096089 L4.22491731,6.04096089 C3.79137074,6.04096089 3.4399118,6.39494927 3.4399118,6.83161607 C3.4399118,7.26828286 3.79137074,7.62227124 4.22491731,7.62227124 L4.22491731,7.62227124 L11.7486218,7.62227124 C12.1821684,7.62227124 12.5336273,7.26828286 12.5336273,6.83161607 C12.5336273,6.39494927 12.1821684,6.04096089 11.7486218,6.04096089 L11.7486218,6.04096089 Z"></path>
8
+ </g>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Iconly/Bulk/Chart</title>
4
+ <g id="Iconly/Bulk/Chart" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="Chart" transform="translate(2.000000, 2.000000)" fill="currentColor" fill-rule="nonzero">
6
+ <path d="M14.6755556,0 L5.33333333,0 C1.92888889,0 0,1.92888889 0,5.33333333 L0,14.6666667 C0,18.0711111 1.92888889,20 5.33333333,20 L14.6755556,20 C18.08,20 20,18.0711111 20,14.6666667 L20,5.33333333 C20,1.92888889 18.08,0 14.6755556,0" id="Fill-1" opacity="0.400000006"></path>
7
+ <path d="M5.36871111,7.36897778 C4.91537778,7.36897778 4.54204444,7.74231111 4.54204444,8.20453333 L4.54204444,15.0756444 C4.54204444,15.5289778 4.91537778,15.9023111 5.36871111,15.9023111 C5.83093333,15.9023111 6.20426667,15.5289778 6.20426667,15.0756444 L6.20426667,8.20453333 C6.20426667,7.74231111 5.83093333,7.36897778 5.36871111,7.36897778" id="Fill-4"></path>
8
+ <path d="M10.0353778,4.08897778 C9.58204444,4.08897778 9.20871111,4.46231111 9.20871111,4.92453333 L9.20871111,15.0756444 C9.20871111,15.5289778 9.58204444,15.9023111 10.0353778,15.9023111 C10.4976,15.9023111 10.8709333,15.5289778 10.8709333,15.0756444 L10.8709333,4.92453333 C10.8709333,4.46231111 10.4976,4.08897778 10.0353778,4.08897778" id="Fill-6"></path>
9
+ <path d="M14.6399111,10.9956444 C14.1776889,10.9956444 13.8043556,11.3689778 13.8043556,11.8312 L13.8043556,15.0756444 C13.8043556,15.5289778 14.1776889,15.9023111 14.6310222,15.9023111 C15.0932444,15.9023111 15.4665778,15.5289778 15.4665778,15.0756444 L15.4665778,11.8312 C15.4665778,11.3689778 15.0932444,10.9956444 14.6399111,10.9956444" id="Fill-8"></path>
10
+ </g>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path fill="currentColor" d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 407.437 407.437">
2
+ <path fill="currentColor" d="M386.258 91.567l-182.54 181.945L21.179 91.567 0 112.815 203.718 315.87l203.719-203.055z"/>
3
+ </svg>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <g id="Iconly/Bulk/Delete" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
4
+ <g id="Delete" transform="translate(3.000000, 2.000000)" fill="currentColor" fill-rule="nonzero">
5
+ <path d="M16.6432894,7.4884379 C16.6432894,7.55643552 16.1103307,14.2971996 15.8059218,17.1341003 C15.6153015,18.8750394 14.492976,19.9310024 12.8094878,19.9610014 C11.5159931,19.9900003 10.2497298,20 9.00389021,20 C7.68121893,20 6.38772423,19.9900003 5.13215907,19.9610014 C3.50507888,19.9220027 2.38178085,18.8450404 2.2008861,17.1341003 C1.88772423,14.2871999 1.36449103,7.55643552 1.35476551,7.4884379 C1.34503998,7.28344508 1.41117355,7.0884519 1.54538578,6.93045743 C1.67765291,6.78446254 1.86827318,6.69646562 2.06861898,6.69646562 L15.9391614,6.69646562 C16.1385347,6.69646562 16.3194294,6.78446254 16.4623946,6.93045743 C16.5956343,7.0884519 16.6627404,7.28344508 16.6432894,7.4884379" id="Fill-1" opacity="0.400000006"></path>
6
+ <path d="M18,3.97686081 C18,3.56587519 17.67614,3.24388646 17.2871191,3.24388646 L14.371407,3.24388646 C13.77815,3.24388646 13.2626972,2.82190123 13.1304301,2.22692206 L12.9670413,1.49794757 C12.7384915,0.616978406 11.9497515,-1.50990331e-14 11.0647288,-1.50990331e-14 L6.93624379,-1.50990331e-14 C6.04149557,-1.50990331e-14 5.26053598,0.616978406 5.0232332,1.54594589 L4.87054247,2.22792202 C4.73730279,2.82190123 4.22185001,3.24388646 3.62956559,3.24388646 L0.713853469,3.24388646 C0.323859952,3.24388646 0,3.56587519 0,3.97686081 L0,4.35684751 C0,4.75783348 0.323859952,5.08982186 0.713853469,5.08982186 L17.2871191,5.08982186 C17.67614,5.08982186 18,4.75783348 18,4.35684751 L18,3.97686081 Z" id="Fill-4"></path>
7
+ </g>
8
+ </g>
9
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-filter"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon></svg>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
+ <g id="Iconly/Bulk/Graph" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
4
+ <g id="Graph" transform="translate(2.000000, 2.000000)" fill="currentColor" fill-rule="nonzero">
5
+ <path d="M8.152754,3.55552761 C8.20368413,3.65919399 8.237323,3.77020981 8.2523868,3.88433813 L8.53082191,8.02425688 L8.53082191,8.02425688 L8.66903307,10.1050779 C8.67046167,10.3190591 8.7040335,10.5316649 8.76866587,10.7360386 C8.9355965,11.1325559 9.33716333,11.3845716 9.77405142,11.3669994 L16.4313342,10.9315476 C16.7196104,10.9267943 16.9980001,11.0346143 17.2052401,11.2312807 C17.3779401,11.3951693 17.4894372,11.6095651 17.524563,11.8401601 L17.5363525,11.9801866 C17.260866,15.7948982 14.4591587,18.9766559 10.6523561,19.797994 C6.84555351,20.6193322 2.94186389,18.8842999 1.06070995,15.534895 C0.518387516,14.5618191 0.179650312,13.4922526 0.0643819183,12.388978 C0.0162285779,12.0623771 -0.00497451535,11.7324952 0.000979225624,11.4025464 C-0.00496594783,7.31273376 2.90747021,3.77695779 6.98433295,2.92456686 C7.47500829,2.84816493 7.95602805,3.10792111 8.152754,3.55552761 Z"
6
+ id="Path"></path>
7
+ <path d="M10.8700123,0.000819186003 C15.42989,0.11682655 19.2623146,3.39578782 20,7.81229094 L19.9929553,7.84487576 L19.9929553,7.84487576 L19.9728274,7.89227188 L19.9756317,8.0223616 C19.9651826,8.19471218 19.8986437,8.36053991 19.7839681,8.49448471 C19.6645145,8.63401054 19.5013145,8.72903004 19.3215929,8.76590816 L19.2119951,8.78094898 L11.5312118,9.27860816 C11.2757261,9.30380455 11.0213466,9.22142251 10.8313499,9.05195453 C10.6730193,8.91073121 10.5717997,8.72009233 10.543203,8.5146766 L10.0276622,0.845062436 C10.0186901,0.819128783 10.0186901,0.791015148 10.0276622,0.765081496 C10.0347061,0.553672114 10.127765,0.353839855 10.2860482,0.210229821 C10.4443315,0.0666197874 10.6546487,-0.00880036929 10.8700123,0.000819186003 Z"
8
+ id="Path" opacity="0.400000006"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,18 @@
1
+ <svg id='logo' xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1070" height="1070" viewBox="0 0 1070 1070" version="1.1">
2
+ <style>#logo path{fill:none;stroke-width:64;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4}</style>
3
+ <defs>
4
+ <linearGradient id="shadow">
5
+ <stop offset="0" style="stop-color:#ffffff"/>
6
+ <stop offset="1" style="stop-color:#e5e7eb"/>
7
+ </linearGradient>
8
+ <linearGradient xlink:href="#shadow" id="vertical1" gradientUnits="userSpaceOnUse" x1="279" y1="855" x2="279" y2="791"/>
9
+ <linearGradient xlink:href="#shadow" id="vertical2" gradientUnits="userSpaceOnUse" x1="407" y1="855" x2="407" y2="791"/>
10
+ <linearGradient xlink:href="#shadow" id="angled" gradientUnits="userSpaceOnUse" x1="919" y1="663" x2="791" y2="535"/>
11
+ </defs>
12
+ <path d="m279 791v64" stroke="url(#vertical1)"/>
13
+ <path d="m407 791v64" stroke="url(#vertical2)"/>
14
+ <path d="m599 791c-30.074 0-64 18.798-64 64" stroke="#fff"/>
15
+ <path d="m791 535c15.784 70.529 40.556 124.09 128 128-14.698 70.947-39.743 124.835-128 128h-64c-34.335 7.22-63.695 19.822-64 64" style="stroke-linejoin:round;stroke:url(#angled)"/>
16
+ <circle cx="727" cy="663" r="32" fill="#fff"/>
17
+ <path d="m151 791h202c78.323 0 129.769-51.336 182-128 52.231-76.664 96.239-126.245 192-128h67.286c0 0-4.243-24-6.422-31-2.18-7-5.583 23-10.475 11-4.892-12-11.273-66-19.41-81-8.137-15-18.029 9-29.942-7C716.122 411 702.187 373 685.964 340 669.741 325 651.23 351 630.165 339 609.101 327 585.482 277 559.043 270 532.604 263 503.345 299 471 299 438.655 299 409.396 263 382.957 270.125 356.518 277.25 342.899 317.5 321.835 330 300.77 342.5 262.259 337.25 246.036 353.375 229.813 369.5 235.878 407 223.964 425c-11.914 18-41.806 16.5-49.942 34.625-8.137 18.125 5.482 65.875 0.59 82.375-4.892 16.5-24.295 31.75-26.475 44.875C145.957 600 161 611 161 619c0 21.333-20 42.667-20 64 0 21.333 20 26.667 20 48 0 21.333-5.959 39.677-10 60z" stroke="#fff"/>
18
+ </svg>
@@ -0,0 +1,32 @@
1
+ <svg id="logo-variant" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1070" height="1070" viewBox="0 0 1070 1070" version="1.1">
2
+ <style>#logo-variant path{fill:none;stroke-width:64;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4}</style>
3
+ <defs>
4
+ <linearGradient id="lightShadow">
5
+ <stop offset="0" style="stop-color:#c22121;stop-opacity:1"/>
6
+ <stop offset="1" style="stop-color:#9c1a1a;stop-opacity:0"/>
7
+ </linearGradient>
8
+ <linearGradient id="darkShadow">
9
+ <stop offset="0" style="stop-color:#9c1a1a;stop-opacity:1"/>
10
+ <stop offset="1" style="stop-color:#9c1a1a;stop-opacity:0"/>
11
+ </linearGradient>
12
+ <linearGradient id="pinkToOrange">
13
+ <stop offset="0" style="stop-color:#f21d88"/>
14
+ <stop offset="0.8" style="stop-color:#dc2626"/>
15
+ <stop offset="1" style="stop-color:#f23c1d"/>
16
+ </linearGradient>
17
+ <linearGradient xlink:href="#pinkToOrange" id="default" gradientUnits="userSpaceOnUse" x1="1246.198" y1="1275.081" x2="111.563" y2="237.888"/>
18
+ <linearGradient xlink:href="#pinkToOrange" id="eye" gradientUnits="userSpaceOnUse" x1="660" y1="738.714" x2="761.286" y2="637.429"/>
19
+ <linearGradient xlink:href="#darkShadow" id="leftLeg" gradientUnits="userSpaceOnUse" x1="279" y1="791" x2="279" y2="855"/>
20
+ <linearGradient xlink:href="#darkShadow" id="rightLeg" gradientUnits="userSpaceOnUse" x1="407" y1="791" x2="407" y2="855"/>
21
+ <linearGradient xlink:href="#lightShadow" id="nose" gradientUnits="userSpaceOnUse" x1="794.286" y1="535" x2="919" y2="663"/>
22
+ </defs>
23
+ <circle r="32" cy="663" cx="727" style="fill:url(#eye)"/>
24
+ <path d="m279 791v64" style="stroke:url(#default)"/>
25
+ <path d="m279 791.505v64" style="stroke:url(#leftLeg)"/>
26
+ <path d="m407 791v64" style="stroke:url(#default)"/>
27
+ <path d="m407 791v64" style="stroke:url(#rightLeg)"/>
28
+ <path d="m599 791c-30.074 0-64 18.798-64 64" style="stroke:url(#default)"/>
29
+ <path d="m791 535c15.784 70.529 40.556 124.09 128 128-14.698 70.947-39.743 124.835-128 128h-64c-34.335 7.22-63.695 19.822-64 64" style="stroke-linejoin:round;stroke:url(#default)"/>
30
+ <path d="m791 535c15.784 70.529 40.556 124.09 128 128-14.698 70.947-39.743 124.835-128 128h-64c-34.335 7.22-63.695 19.822-64 64" style="stroke-linejoin:round;stroke:url(#nose)"/>
31
+ <path d="m151 791h202c78.323 0 129.769-51.336 182-128 52.231-76.664 96.239-126.245 192-128h67.286c0 0-4.243-24-6.422-31-2.18-7-5.583 23-10.475 11-4.892-12-11.273-66-19.41-81-8.137-15-18.029 9-29.942-7C716.122 411 702.187 373 685.964 340 669.741 325 651.23 351 630.165 339 609.101 327 585.482 277 559.043 270 532.604 263 503.345 299 471 299 438.655 299 409.396 263 382.957 270.125 356.518 277.25 342.899 317.5 321.835 330 300.77 342.5 262.259 337.25 246.036 353.375 229.813 369.5 235.878 407 223.964 425c-11.914 18-41.806 16.5-49.942 34.625-8.137 18.125 5.482 65.875 0.59 82.375-4.892 16.5-24.295 31.75-26.475 44.875C145.957 600 161 611 161 619c0 21.333-20 42.667-20 64 0 21.333 20 26.667 20 48 0 21.333-5.959 39.677-10 60z" style="stroke:url(#default)"/>
32
+ </svg>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <g id="Iconly/Bulk/Search" stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd">
4
+ <g id="Search" transform="translate(2.000000, 2.000000)" fill="currentColor" fill-rule="nonzero">
5
+ <ellipse id="Ellipse_746" cx="8.59921927" cy="8.65324385" rx="8.59921927" ry="8.65324385"></ellipse>
6
+ <path fill="currentColor" d="M18.674623,19.9552573 C18.3405833,19.9444414 18.0229443,19.8069986 17.7853553,19.5704698 L15.7489321,17.1901566 C15.3123366,16.7908936 15.2766365,16.1123232 15.668898,15.6689038 L15.668898,15.6689038 C15.8525005,15.4831065 16.1021409,15.3786387 16.3625268,15.3786387 C16.6229128,15.3786387 16.8725531,15.4831065 17.0561557,15.6689038 L19.6172468,17.7181208 C19.9861582,18.0957076 20.0999999,18.656254 19.9078887,19.1492153 C19.7157774,19.6421767 19.2536179,19.9754211 18.7279791,20 L18.674623,19.9552573 Z" id="Path_34202" opacity="0.400000006"></path>
7
+ </g>
8
+ </g>
9
+ </svg>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Iconly/Bulk/Setting</title>
4
+ <g id="Iconly/Bulk/Setting" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="Setting" transform="translate(2.499897, 2.000100)" fill="#000000" fill-rule="nonzero">
6
+ <path d="M9.51207539,12.83 C7.9076023,12.83 6.60971643,11.58 6.60971643,10.01 C6.60971643,8.44 7.9076023,7.18 9.51207539,7.18 C11.1165485,7.18 12.3837756,8.44 12.3837756,10.01 C12.3837756,11.58 11.1165485,12.83 9.51207539,12.83" id="Path"></path>
7
+ <path d="M18.730131,12.37 C18.5359591,12.07 18.2600306,11.77 17.9023455,11.58 C17.6161974,11.44 17.4322451,11.21 17.2687319,10.94 C16.7475337,10.08 17.0541209,8.95 17.9227847,8.44 C18.944742,7.87 19.2717684,6.6 18.6790331,5.61 L17.9943217,4.43 C17.411806,3.44 16.1343592,3.09 15.1226214,3.67 C14.2232989,4.15 13.0684871,3.83 12.5472888,2.98 C12.3837756,2.7 12.2917995,2.4 12.3122386,2.1 C12.3428973,1.71 12.2202625,1.34 12.0363101,1.04 C11.6581859,0.42 10.9734745,0 10.217226,0 L8.77626608,0 C8.03023719,0.02 7.34552574,0.42 6.96740151,1.04 C6.77322961,1.34 6.6608143,1.71 6.68125344,2.1 C6.70169259,2.4 6.60971643,2.7 6.44620325,2.98 C5.92500498,3.83 4.77019314,4.15 3.88109021,3.67 C2.85913283,3.09 1.59190568,3.44 0.999170395,4.43 L0.314458948,5.61 C-0.26805676,6.6 0.0589696023,7.87 1.07070741,8.44 C1.93937119,8.95 2.2459584,10.08 1.73497971,10.94 C1.56124696,11.21 1.37729463,11.44 1.09114656,11.58 C0.743681049,11.77 0.437093834,12.07 0.273580653,12.37 C-0.104543579,12.99 -0.0841044313,13.77 0.2940198,14.42 L0.999170395,15.62 C1.37729463,16.26 2.08244522,16.66 2.81825454,16.66 C3.16572005,16.66 3.574503,16.56 3.90152936,16.36 C4.15701871,16.19 4.46360592,16.13 4.80085186,16.13 C5.81258967,16.13 6.6608143,16.96 6.68125344,17.95 C6.68125344,19.1 7.62145424,20 8.8069248,20 L10.1967868,20 C11.3720378,20 12.3122386,19.1 12.3122386,17.95 C12.3428973,16.96 13.191122,16.13 14.2028598,16.13 C14.5298861,16.13 14.8364734,16.19 15.1021823,16.36 C15.4292086,16.56 15.827772,16.66 16.1854571,16.66 C16.9110468,16.66 17.6161974,16.26 17.9943217,15.62 L18.7096918,14.42 C19.0775965,13.75 19.1082552,12.99 18.730131,12.37" id="Path" opacity="0.400000006"></path>
8
+ </g>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
+ <g id="Iconly/Bulk/Show" stroke="none" stroke-width="1" fill-rule="evenodd">
4
+ <g id="Show" transform="translate(2.000000, 4.000000)" fill="currentColor" fill-rule="nonzero">
5
+ <path d="M10,0 C12.0682927,0 14.0292683,0.717575758 15.7365854,2.04606061 C17.4439024,3.36387879 18.897561,5.29454545 19.9414634,7.70909091 C20.0195122,7.89236364 20.0195122,8.10666667 19.9414634,8.28121212 C17.8536585,13.110303 14.1365854,16 10,16 L10,16 L9.9902439,16 C5.86341463,16 2.14634146,13.110303 0.0585365854,8.28121212 C-0.0195121951,8.10666667 -0.0195121951,7.89236364 0.0585365854,7.70909091 C2.14634146,2.8790303 5.86341463,0 9.9902439,0 L9.9902439,0 Z M10,4.12121212 C7.84390244,4.12121212 6.09756098,5.8569697 6.09756098,8 C6.09756098,10.1333333 7.84390244,11.8690909 10,11.8690909 C12.1463415,11.8690909 13.8926829,10.1333333 13.8926829,8 C13.8926829,5.8569697 12.1463415,4.12121212 10,4.12121212 Z"
6
+ id="Fill-1" opacity="0.400000006"></path>
7
+ <path d="M12.4309268,7.99689697 C12.4309268,9.32538182 11.3382439,10.4114424 10.0016585,10.4114424 C8.65531707,10.4114424 7.56263415,9.32538182 7.56263415,7.99689697 C7.56263415,7.83204848 7.58214634,7.67786667 7.61141463,7.52271515 L7.66019512,7.52271515 C8.74312195,7.52271515 9.62117073,6.66938182 9.66019512,5.60174545 C9.7675122,5.58332121 9.88458537,5.57265455 10.0016585,5.57265455 C11.3382439,5.57265455 12.4309268,6.65871515 12.4309268,7.99689697"
8
+ id="Fill-4"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,48 @@
1
+ import { Controller } from "stimulus";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["count"];
5
+
6
+ connect() {
7
+ this.setCount();
8
+ }
9
+
10
+ checkAll() {
11
+ this.setAllCheckboxes(true);
12
+ this.setCount();
13
+ }
14
+
15
+ checkNone() {
16
+ this.setAllCheckboxes(false);
17
+ this.setCount();
18
+ }
19
+
20
+ onChecked() {
21
+ this.setCount();
22
+ }
23
+
24
+ setAllCheckboxes(checked) {
25
+ this.checkboxes.forEach((el) => {
26
+ const checkbox = el;
27
+
28
+ if (!checkbox.disabled) {
29
+ checkbox.checked = checked;
30
+ }
31
+ });
32
+ }
33
+
34
+ setCount() {
35
+ if (this.hasCountTarget) {
36
+ const count = this.selectedCheckboxes.length;
37
+ this.countTarget.innerHTML = `${count} selected`;
38
+ }
39
+ }
40
+
41
+ get selectedCheckboxes() {
42
+ return this.checkboxes.filter((c) => c.checked);
43
+ }
44
+
45
+ get checkboxes() {
46
+ return new Array(...this.element.querySelectorAll("input[type=checkbox]"));
47
+ }
48
+ }
@@ -0,0 +1,24 @@
1
+ import { Controller } from 'stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = ["enable"];
5
+
6
+ enable() {
7
+ this.enableTarget.disabled = false;
8
+ }
9
+
10
+ disable() {
11
+ this.enableTarget.disabled = true;
12
+ }
13
+
14
+ change(event) {
15
+ if (event.type.match(/rmp:select:.*/)) {
16
+ if (event.detail.count > 0) {
17
+ this.enable();
18
+ }
19
+ else {
20
+ this.disable()
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,44 @@
1
+ import { Controller } from "stimulus";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["filter"];
5
+
6
+ apply() {
7
+ location.href = `${window.location.pathname}?${this.params}`;
8
+ }
9
+
10
+ post() {
11
+ const token = document.head.querySelector(
12
+ 'meta[name="csrf-token"]'
13
+ ).content;
14
+ const path = `${window.location.pathname}/destroy_all?${this.params}`;
15
+ fetch(path, {
16
+ method: "DELETE",
17
+ redirect: "follow",
18
+ headers: {
19
+ "Content-Type": "application/json",
20
+ credentials: "same-origin",
21
+ },
22
+ body: JSON.stringify({ authenticity_token: token }),
23
+ }).then((response) => {
24
+ if (response.redirected) {
25
+ window.location.href = response.url;
26
+ }
27
+ });
28
+ }
29
+
30
+ get params() {
31
+ return this.activeFilterTargets()
32
+ .map((t) => `${t.name}=${t.value}`)
33
+ .join("&");
34
+ }
35
+
36
+ activeFilterTargets() {
37
+ return this.filterTargets.filter(function (target) {
38
+ if (target.type === "checkbox" || target.type === "radio")
39
+ return target.checked;
40
+
41
+ return target.value.length > 0;
42
+ });
43
+ }
44
+ }
@@ -0,0 +1,18 @@
1
+ import { Controller } from "stimulus";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["field"];
5
+
6
+ clear(){
7
+ this.eventTarget.value = null;
8
+ window.dispatchEvent(new CustomEvent('search-controller:submit', {}))
9
+ }
10
+
11
+ submit(event) {
12
+ event.preventDefault();
13
+
14
+ if (event.key === 'Enter' || event.type === 'click') {
15
+ window.dispatchEvent(new CustomEvent('search-controller:submit', {}))
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,47 @@
1
+ import { Controller } from 'stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = ['all', 'selectable']
5
+
6
+ selectAll (event) {
7
+ const checked = event.target.checked
8
+ this.allTarget.indeterminate = false
9
+ this._setAllCheckboxes(checked)
10
+ this._dispatch('change', { count: this.selectedCount })
11
+ }
12
+
13
+ onSelected () {
14
+ this.allTarget.indeterminate = !!this._indeterminate
15
+ this._dispatch('change', { count: this.selectedCount })
16
+ }
17
+
18
+ get selectedCount () {
19
+ return this.selected.length
20
+ }
21
+
22
+ get selected () {
23
+ return this.selectables.filter((c) => c.checked)
24
+ }
25
+
26
+ get selectables () {
27
+ return new Array(...this.selectableTargets)
28
+ }
29
+
30
+ _setAllCheckboxes (checked) {
31
+ this.selectables.forEach((el) => {
32
+ const checkbox = el
33
+
34
+ if (!checkbox.disabled) {
35
+ checkbox.checked = checked
36
+ }
37
+ })
38
+ }
39
+
40
+ get _indeterminate () {
41
+ return this.selected.length !== this.selectableTargets.length && this.selected.length > 0
42
+ }
43
+
44
+ _dispatch (name, detail) {
45
+ window.dispatchEvent(new CustomEvent(`rmp:select:${name}`, { bubbles: true, detail }))
46
+ }
47
+ }
@@ -0,0 +1,88 @@
1
+ import '../stylesheets/rails-mini-profiler.scss'
2
+
3
+ import tippy from 'tippy.js'
4
+ import 'tippy.js/dist/tippy.css'
5
+
6
+ import { Application } from 'stimulus'
7
+ import { Dropdown } from 'tailwindcss-stimulus-components'
8
+ import Checklist from '../js/checklist_controller'
9
+ import Selectable from '../js/select_controller'
10
+ import Filter from '../js/filter_controller'
11
+ import Search from '../js/search_controller'
12
+ import Enable from '../js/enable_controller'
13
+
14
+ const application = Application.start();
15
+
16
+ application.register('dropdown', Dropdown)
17
+ application.register('checklist', Checklist)
18
+ application.register('selectable', Selectable)
19
+ application.register('filters', Filter)
20
+ application.register('search', Search)
21
+ application.register('enable', Enable)
22
+
23
+
24
+ function setupTraceSearch() {
25
+ const traceNameSearch = document.getElementById('trace-search')
26
+ if (traceNameSearch) {
27
+ traceNameSearch.addEventListener('keyup', function (event) {
28
+ if (event.key === 'Enter') {
29
+ event.preventDefault()
30
+ document.getElementById('trace-form').submit()
31
+ }
32
+ })
33
+ }
34
+ }
35
+
36
+ function setupRequestTable() {
37
+ const profiledRequestTable = document.getElementById('profiled-requests-table');
38
+ if (profiledRequestTable) {
39
+ const rows = profiledRequestTable.rows;
40
+ for (let i = 1; i < rows.length; i++) {
41
+ const currentRow = profiledRequestTable.rows[i]
42
+ const link = currentRow.dataset.link
43
+ const createClickHandler = function () {
44
+ return function () {
45
+ window.location.href = link
46
+ }
47
+ }
48
+ if (link) {
49
+ currentRow.onclick = createClickHandler(currentRow)
50
+
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ function setupTraceBars () {
57
+ const traceBars = document.querySelectorAll('.trace-bar')
58
+ traceBars.forEach((bar) => {
59
+ const popover = bar.children[0]
60
+ tippy(bar, {
61
+ trigger: 'click',
62
+ content: popover,
63
+ theme: 'rmp',
64
+ maxWidth: '700px',
65
+ placement: 'bottom',
66
+ interactive: true,
67
+ onShow (instance) {
68
+ instance.popper.querySelector('.popover-close').addEventListener('click', () => {
69
+ instance.hide()
70
+ })
71
+ },
72
+ onHide (instance) {
73
+ instance.popper.querySelector('.popover-close').removeEventListener('click', () => {
74
+ instance.hide()
75
+ })
76
+ },
77
+ })
78
+ })
79
+ }
80
+
81
+
82
+ // Trace Bar Popovers
83
+ document.addEventListener('DOMContentLoaded', () => {
84
+ setupRequestTable();
85
+ setupTraceBars();
86
+ setupTraceSearch();
87
+ }, false)
88
+