rails_mini_profiler 0.6.0 → 0.7.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -35
  3. data/app/adapters/rails_mini_profiler/database_adapter.rb +16 -0
  4. data/app/controllers/rails_mini_profiler/application_controller.rb +9 -6
  5. data/app/controllers/rails_mini_profiler/profiled_requests_controller.rb +15 -4
  6. data/app/helpers/rails_mini_profiler/profiled_requests_helper.rb +10 -0
  7. data/app/javascript/js/clipboard_controller.js +9 -2
  8. data/app/javascript/js/filter_controller.js +4 -0
  9. data/app/javascript/stylesheets/components/buttons.scss +59 -0
  10. data/app/javascript/stylesheets/components/{profiled_request_table/profiled_request_table.scss → dropdown.scss} +0 -76
  11. data/app/javascript/stylesheets/components/input.scss +10 -0
  12. data/app/javascript/stylesheets/{navbar.scss → components/navbar.scss} +0 -0
  13. data/app/javascript/stylesheets/components/page_header.scss +7 -0
  14. data/app/javascript/stylesheets/components/{profiled_request_table/placeholder.scss → placeholder.scss} +4 -1
  15. data/app/javascript/stylesheets/components/profiled_request_table.scss +55 -0
  16. data/app/javascript/stylesheets/components/trace.scss +93 -0
  17. data/app/javascript/stylesheets/profiled_requests.scss +3 -67
  18. data/app/javascript/stylesheets/rails-mini-profiler.scss +16 -30
  19. data/app/javascript/stylesheets/traces.scss +44 -76
  20. data/app/presenters/rails_mini_profiler/profiled_request_presenter.rb +2 -2
  21. data/app/presenters/rails_mini_profiler/trace_presenter.rb +9 -7
  22. data/app/search/rails_mini_profiler/profiled_request_search.rb +0 -1
  23. data/app/search/rails_mini_profiler/trace_search.rb +27 -0
  24. data/app/views/rails_mini_profiler/profiled_requests/shared/header/_header.erb +1 -2
  25. data/app/views/rails_mini_profiler/profiled_requests/shared/table/_table_head.erb +7 -7
  26. data/app/views/rails_mini_profiler/profiled_requests/{shared → show}/_trace.html.erb +23 -21
  27. data/app/views/rails_mini_profiler/profiled_requests/show/_trace_list.erb +12 -0
  28. data/app/views/rails_mini_profiler/profiled_requests/show/_trace_list_header.erb +87 -0
  29. data/app/views/rails_mini_profiler/profiled_requests/show/_trace_list_placeholder.erb +12 -0
  30. data/app/views/rails_mini_profiler/profiled_requests/show.html.erb +4 -17
  31. data/lib/generators/rails_mini_profiler/templates/rails_mini_profiler.rb.erb +1 -0
  32. data/lib/rails_mini_profiler/configuration/user_interface.rb +18 -0
  33. data/lib/rails_mini_profiler/flamegraph_guard.rb +10 -6
  34. data/lib/rails_mini_profiler/middleware.rb +2 -0
  35. data/lib/rails_mini_profiler/user.rb +1 -1
  36. data/lib/rails_mini_profiler/version.rb +1 -1
  37. data/vendor/assets/javascripts/rails-mini-profiler.css +1 -1
  38. data/vendor/assets/javascripts/rails-mini-profiler.js +1 -1
  39. metadata +25 -9
  40. data/app/javascript/stylesheets/components/page_header/page_header.scss +0 -3
@@ -1,15 +1,4 @@
1
- @import 'components/profiled_request_table/placeholder';
2
- @import 'components/profiled_request_table/profiled_request_table';
3
-
4
- main {
5
- display: flex;
6
- width: 100%;
7
- justify-content: center;
8
- }
9
-
10
- .main-section {
11
- width: var(--main-width);
12
- }
1
+ @import 'components/profiled_request_table';
13
2
 
14
3
  .search-field {
15
4
  box-sizing: border-box;
@@ -18,57 +7,11 @@ main {
18
7
  border-radius: 5px;
19
8
  }
20
9
 
21
- .request-details-data {
22
- display: flex;
23
- padding: 1rem 0;
24
- }
25
-
26
- .request-details-actions {
10
+ .profiled-requests-header {
27
11
  display: flex;
12
+ flex-direction: row;
28
13
  align-items: center;
29
14
  justify-content: space-between;
30
- padding: 0 0 1rem;
31
- margin: 0;
32
- }
33
-
34
- .data-item {
35
- display: flex;
36
- flex-direction: column;
37
- align-items: flex-start;
38
- padding: 0;
39
- margin-right: 3rem;
40
- list-style: none;
41
- }
42
-
43
- .data-item small {
44
- color: var(--grey-400);
45
- }
46
-
47
- .data-item span {
48
- margin: 0.25rem 0;
49
- }
50
-
51
- [class*='request-status-2'],
52
- [class*='request-method-get'] {
53
- background: var(--green-400) !important;
54
- color: white;
55
- }
56
-
57
- [class*='request-status-4'],
58
- [class*='request-method-put'],
59
- [class*='request-method-patch'] {
60
- background: var(--yellow-400) !important;
61
- color: white;
62
- }
63
-
64
- [class*='request-status-5'],
65
- [class*='request-method-delete'] {
66
- background: var(--red-500) !important;
67
- color: white;
68
- }
69
-
70
- .flamegraph-button button {
71
- background: var(--grey-200);
72
15
  }
73
16
 
74
17
  .clear-action button {
@@ -80,10 +23,3 @@ main {
80
23
  background: var(--red-600);
81
24
  }
82
25
  }
83
-
84
- .profiled-requests-header {
85
- display: flex;
86
- flex-direction: row;
87
- align-items: center;
88
- justify-content: space-between;
89
- }
@@ -1,10 +1,15 @@
1
1
  @import 'flashes';
2
2
  @import 'flamegraph';
3
- @import 'navbar';
4
3
  @import 'profiled_requests';
5
4
  @import 'traces';
5
+ @import 'components/buttons';
6
+ @import 'components/input';
7
+ @import 'components/navbar';
6
8
  @import 'components/pagination';
7
- @import 'components/page_header/page_header';
9
+ @import 'components/page_header';
10
+ @import 'components/dropdown';
11
+ @import 'components/placeholder';
12
+ @import 'components/trace';
8
13
  @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');
9
14
 
10
15
  @font-face {
@@ -55,6 +60,9 @@ html {
55
60
  --primary: var(--red-600);
56
61
  --border-color: var(--grey-200);
57
62
  --text-color: var(--grey-900);
63
+ --fw-normal: 400;
64
+ --fw-semibold: 600;
65
+ --fw-bold: 700;
58
66
  }
59
67
 
60
68
  * {
@@ -70,36 +78,14 @@ body {
70
78
  color: var(--text-color);
71
79
  }
72
80
 
73
- button,
74
- .button {
75
- display: inline-block;
76
- padding: 0.5em 0.5em;
77
- border: none;
78
- border-radius: 0.25rem;
79
- cursor: pointer;
80
- font-size: 1rem;
81
- text-align: center;
82
- text-decoration: none;
83
-
84
- &:disabled {
85
- background: var(--grey-200);
86
- cursor: not-allowed;
87
- }
88
- }
89
-
90
- button:hover {
91
- box-shadow: 0 0.25rem 0.25rem 0 var(--grey-50);
81
+ main {
82
+ display: flex;
83
+ width: 100%;
84
+ justify-content: center;
92
85
  }
93
86
 
94
- button.none {
95
- padding: 0;
96
- border: none;
97
- background: none;
98
- outline: none;
99
-
100
- &:hover {
101
- box-shadow: none;
102
- }
87
+ .main-section {
88
+ width: var(--main-width);
103
89
  }
104
90
 
105
91
  /* --------------------------------------- */
@@ -1,110 +1,78 @@
1
- .trace-list {
2
- padding: 0;
3
- margin: 2rem 0;
4
- }
5
-
6
- .trace {
1
+ .profiled-request-details {
7
2
  display: flex;
8
3
  align-items: center;
9
- justify-content: flex-start;
10
- padding: 0.25em 0;
11
- list-style: none;
4
+ justify-content: space-between;
5
+ padding-bottom: 2rem;
12
6
  }
13
7
 
14
- .trace:nth-child(odd) {
15
- background: var(--grey-100);
8
+ .request-details-data {
9
+ display: flex;
16
10
  }
17
11
 
18
- .trace .trace-bar {
19
- position: relative;
20
- height: 16px;
12
+ .data-item {
13
+ display: flex;
14
+ flex-direction: column;
15
+ align-items: flex-start;
21
16
  padding: 0;
22
- margin: 0;
23
- background: linear-gradient(to top right, var(--grey-500), var(--grey-400));
24
- cursor: pointer;
25
- }
26
-
27
- .instantiation-trace .trace-bar {
28
- background: linear-gradient(to top right, var(--green-400), var(--green-300));
29
- }
30
-
31
- .sequel-trace .trace-bar {
32
- background: linear-gradient(to top right, var(--green-500), var(--green-400));
17
+ margin-right: 3rem;
18
+ list-style: none;
33
19
  }
34
20
 
35
- .controller-trace .trace-bar {
36
- background: linear-gradient(to top right, var(--yellow-500), var(--yellow-400));
21
+ .data-item small {
22
+ color: var(--grey-400);
37
23
  }
38
24
 
39
- .render-template-trace .trace-bar,
40
- .render-partial-trace .trace-bar {
41
- background: linear-gradient(to top right, var(--blue-500), var(--blue-400));
25
+ .data-item span {
26
+ margin: 0.25rem 0;
42
27
  }
43
28
 
44
- .trace-name {
45
- overflow: hidden;
46
- box-sizing: border-box;
47
- padding: 0 0.5em;
48
- margin: 0;
49
- color: var(--grey-400);
50
- font-size: 14px;
51
- text-align: right;
52
- text-overflow: ellipsis;
29
+ [class*='request-status-2'],
30
+ [class*='request-method-get'] {
31
+ background: var(--green-400) !important;
32
+ color: white;
53
33
  }
54
34
 
55
- .trace-payload {
56
- margin: 0;
35
+ [class*='request-status-4'],
36
+ [class*='request-method-put'],
37
+ [class*='request-method-patch'] {
38
+ background: var(--yellow-400) !important;
39
+ color: white;
57
40
  }
58
41
 
59
- .sequel-trace-query {
60
- overflow: auto;
61
- max-height: 100px;
62
- padding: 1em 1em;
63
- background: var(--grey-100);
64
- white-space: pre-wrap;
42
+ [class*='request-status-5'],
43
+ [class*='request-method-delete'] {
44
+ background: var(--red-500) !important;
45
+ color: white;
65
46
  }
66
47
 
67
- .sequel-trace-binds {
68
- overflow: auto;
69
- max-height: 100px;
70
- padding: 0.5em 1em;
71
- margin: 0 0 1em 0;
72
- background: var(--grey-50);
73
- font-size: 12px;
74
- white-space: pre-wrap;
48
+ .trace-list {
49
+ padding: 1rem;
50
+ border: 1px solid var(--grey-200);
51
+ border-radius: 5px;
75
52
  }
76
53
 
77
- .trace-table {
54
+ .trace-details-table {
78
55
  width: 100%;
79
56
  border: hidden 1px var(--border-color);
80
57
  margin-top: 1em;
81
58
  border-collapse: collapse;
82
59
  }
83
60
 
84
- .backtrace {
61
+ .trace-details-table tr th {
62
+ font-weight: var(--fw-semibold);
63
+ }
64
+
65
+ .trace-list-header {
85
66
  display: flex;
86
- flex-direction: row;
87
67
  align-items: center;
88
68
  justify-content: space-between;
89
- padding: 0.5em;
90
- background: var(--grey-100);
69
+ padding-bottom: 1rem;
91
70
  }
92
71
 
93
- .backtrace button {
94
- width: 20px;
95
- height: 20px;
96
- padding: 0;
97
- margin: 0;
98
- background: none;
72
+ .trace-list-filters {
73
+ display: flex;
74
+ width: 60%;
75
+ align-items: center;
76
+ justify-content: space-between;
99
77
  color: var(--grey-500);
100
- transition: color 200ms ease-in-out;
101
- }
102
-
103
- .backtrace button.copied {
104
- color: var(--green-400);
105
- }
106
-
107
- .backtrace button svg {
108
- width: 20px;
109
- height: 20px;
110
78
  }
@@ -30,8 +30,8 @@ module RailsMiniProfiler
30
30
 
31
31
  return nil unless model.flamegraph.present?
32
32
 
33
- link_to(flamegraph_path(model.id), title: 'Show Flamegraph', class: 'flamegraph-button') do
34
- content_tag('button', 'Flamegraph')
33
+ link_to(flamegraph_path(model.id), title: 'Show Flamegraph') do
34
+ content_tag('button', 'Flamegraph', class: 'btn-grey')
35
35
  end
36
36
  end
37
37
  end
@@ -2,9 +2,12 @@
2
2
 
3
3
  module RailsMiniProfiler
4
4
  class TracePresenter < BasePresenter
5
- def initialize(trace, view, profiled_request:)
5
+ def initialize(trace, view, context: {})
6
6
  super(trace, view)
7
- @profiled_request = profiled_request
7
+ @start = context[:start]
8
+ @finish = context[:finish]
9
+ @total_duration = context[:total_duration]
10
+ @total_allocations = context[:total_allocations]
8
11
  end
9
12
 
10
13
  def label
@@ -38,7 +41,7 @@ module RailsMiniProfiler
38
41
  end
39
42
 
40
43
  def duration_percent
41
- (model.duration.to_f / @profiled_request.duration * 100).round
44
+ (model.duration.to_f / @total_duration * 100).round
42
45
  end
43
46
 
44
47
  def allocations
@@ -46,16 +49,15 @@ module RailsMiniProfiler
46
49
  end
47
50
 
48
51
  def allocations_percent
49
- (model.allocations.to_f / @profiled_request.allocations * 100).round
52
+ (model.allocations.to_f / @total_allocations * 100).round
50
53
  end
51
54
 
52
55
  def from_start
53
- (model.start - @profiled_request.start).to_f / 100
56
+ (model.start - @start).to_f / 100
54
57
  end
55
58
 
56
59
  def from_start_percent
57
- ((model.start - @profiled_request.start).to_f /
58
- (@profiled_request.finish - @profiled_request.start)).to_f * 100
60
+ ((model.start - @start).to_f / (@finish - @start)).to_f * 100
59
61
  end
60
62
  end
61
63
  end
@@ -27,7 +27,6 @@ module RailsMiniProfiler
27
27
  end
28
28
 
29
29
  option(:duration) do |scope, value|
30
- value = value.tr('>', '').to_i * 100
31
30
  scope.where('duration > :duration', duration: value)
32
31
  end
33
32
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsMiniProfiler
4
+ class TraceSearch < BaseSearch
5
+ option(:name) do |scope, value|
6
+ scope.where(name: value)
7
+ end
8
+
9
+ option(:duration) do |scope, value|
10
+ scope.where('duration > :duration', duration: value)
11
+ end
12
+
13
+ option(:allocations) do |scope, value|
14
+ scope.where('allocations > :allocations', allocations: value)
15
+ end
16
+
17
+ option(:payload) do |scope, value|
18
+ payload_column = DatabaseAdapter.cast_to_text(:payload)
19
+ scope.where("#{payload_column} LIKE ?", "%#{value}%")
20
+ end
21
+
22
+ option(:backtrace) do |scope, value|
23
+ backtrace_column = Adapters::DatabaseAdapter.cast_to_text(:backtrace)
24
+ scope.where("#{backtrace_column} LIKE ?", "%#{value}%")
25
+ end
26
+ end
27
+ end
@@ -12,9 +12,8 @@
12
12
  }) -%>
13
13
  <%= link_to(destroy_all_profiled_requests_url,
14
14
  method: :delete,
15
- class: 'clear-action',
16
15
  data: { confirm: "This will delete all requests. Are you sure?" }) do %>
17
- <%= button_tag('Delete All') %>
16
+ <%= button_tag('Delete All', class: 'btn-red') %>
18
17
  <% end %>
19
18
  </div>
20
19
  </div>
@@ -23,7 +23,7 @@
23
23
  placeholder: 'Search Path',
24
24
  class: 'dropdown-search-field',
25
25
  data: { 'filters-target': 'filter' } %>
26
- <%= form.submit 'Search', class: 'dropdown-search-button', data: { action: 'click->search#submit' } -%>
26
+ <%= form.submit 'Search', class: 'btn-red', data: { action: 'click->search#submit' } -%>
27
27
  <% end %>
28
28
  </div>
29
29
  </div>
@@ -74,7 +74,7 @@
74
74
  </button>
75
75
  </div>
76
76
  </th>
77
- <th style="width: 15%" class="" data-controller="dropdown">
77
+ <th style="width: 15%;" class="" data-controller="dropdown">
78
78
  <button data-action="click->dropdown#toggle click@window->dropdown#hide" data-dropdown-target="button" class="dropdown-toggle none">
79
79
  Media Type <%= inline_svg('filter.svg', class: 'table-filter-icon') %> </button>
80
80
  <div data-controller="checklist" data-dropdown-target="menu" class="dropdown-container hidden">
@@ -97,7 +97,7 @@
97
97
  </button>
98
98
  </div>
99
99
  </th>
100
- <th style="width: 10%" class="text-left" data-controller="dropdown">
100
+ <th style="width: 10%;" class="text-left" data-controller="dropdown">
101
101
  <button data-action="click->dropdown#toggle click@window->dropdown#hide" data-dropdown-target="button" class="dropdown-toggle none">
102
102
  Duration <%= inline_svg('filter.svg', class: 'table-filter-icon') %> </button>
103
103
  <div data-controller="checklist" data-dropdown-target="menu" class="dropdown-container hidden">
@@ -107,12 +107,12 @@
107
107
  Clear filter
108
108
  </button>
109
109
  </div>
110
- <% %w[>100ms >250ms].each do |duration| %>
110
+ <% [100_00, 250_00, 500_00].each do |duration| %>
111
111
  <%= label_tag nil, class: "dropdown-entry" do %>
112
- <%= radio_button_tag 'duration', duration, params.fetch(:duration, []).include?(duration),
112
+ <%= radio_button_tag 'duration', duration.to_s , params.fetch(:duration, []).include?(duration.to_s),
113
113
  class: "",
114
114
  data: { target: "filters.filter" } %>
115
- <%= duration %>
115
+ <%= "> #{duration / 100}ms" %>
116
116
  <% end %>
117
117
  <% end %>
118
118
  <button class="dropdown-footer" data-action="filters#apply">
@@ -120,6 +120,6 @@
120
120
  </button>
121
121
  </div>
122
122
  </th>
123
- <th style="width: 15%" class="text-left">Date</th>
123
+ <th style="width: 15%;" class="text-left">Date</th>
124
124
  </tr>
125
125
  </thead>
@@ -8,7 +8,28 @@
8
8
  </section>
9
9
  <section class="popover-body">
10
10
  <%= trace.payload %>
11
- <table class="trace-table">
11
+
12
+ <% if trace.backtrace %>
13
+ <section class="popover-footer">
14
+ <div
15
+ class="backtrace"
16
+ data-controller="clipboard"
17
+ data-clipboard-filter=".+?(?=:in)"
18
+ data-clipboard-copied-message="Copied" >
19
+ <pre data-clipboard-target="source"><%= trace.backtrace %></pre>
20
+ <button
21
+ title="Copy to clipboard"
22
+ type="button"
23
+ data-action="clipboard#copy"
24
+ data-clipboard-target="button"
25
+ >
26
+ <%= inline_svg('copy.svg') %>
27
+ </button>
28
+ </div>
29
+ </section>
30
+ <% end %>
31
+
32
+ <table class="trace-details-table">
12
33
  <thead>
13
34
  <tr>
14
35
  <th class="text-left"></th>
@@ -30,26 +51,7 @@
30
51
  </table>
31
52
  </section>
32
53
 
33
- <% if trace.backtrace %>
34
- <section class="popover-footer">
35
- <div
36
- class="backtrace"
37
- data-controller="clipboard"
38
- data-clipboard-filter=".+?(?=:in)"
39
- data-clipboard-copied-class="copied"
40
- >
41
- <pre data-clipboard-target="source"><%= trace.backtrace %></pre>
42
- <button
43
- title="Copy to clipboard"
44
- type="button"
45
- data-action="clipboard#copy"
46
- data-clipboard-target="button"
47
- >
48
- <%= inline_svg('copy.svg') %>
49
- </button>
50
- </div>
51
- </section>
52
- <% end %>
54
+
53
55
  </div>
54
56
  </div>
55
57
  </li>
@@ -0,0 +1,12 @@
1
+ <section class="trace-list">
2
+ <%= render "rails_mini_profiler/profiled_requests/show/trace_list_header" %>
3
+ <% if @traces.empty? %>
4
+ <%= render "rails_mini_profiler/profiled_requests/show/trace_list_placeholder" %>
5
+ <% else %>
6
+ <ol>
7
+ <% @traces.each do |trace| %>
8
+ <%= render "rails_mini_profiler/profiled_requests/show/trace", trace: trace %>
9
+ <% end %>
10
+ </ol>
11
+ <% end %>
12
+ </section>
@@ -0,0 +1,87 @@
1
+ <div class="trace-list-header" data-controller="filters">
2
+ <div class="trace-list-filters">
3
+ <%= form_with url: profiled_request_url(@profiled_request.id), method: :get do |form| %>
4
+ <%= form.search_field :payload,
5
+ value: params[:payload],
6
+ placeholder: 'Search Traces...',
7
+ class: 'search-field',
8
+ data: { 'filters-target': 'filter' } %>
9
+ <% end %>
10
+ <div data-controller="dropdown">
11
+ <button data-action="click->dropdown#toggle click@window->dropdown#hide" data-dropdown-target="button" class="dropdown-toggle none" >
12
+ Type <%= inline_svg('filter.svg', class: 'table-filter-icon') %> </button>
13
+ <div data-controller="checklist" data-dropdown-target="menu" class="dropdown-container hidden">
14
+ <div class="dropdown-header">
15
+ Select Type...
16
+ <button class="clear-filters" data-action="checklist#checkNone">
17
+ Clear filter
18
+ </button>
19
+ </div>
20
+ <% trace_names = %w[process_action.action_controller sql.active_record instantiation.active_record render_template.action_view render_partial.action_view] %>
21
+ <% trace_names.each do |name| %>
22
+ <%= label_tag nil, class: "dropdown-entry" do %>
23
+ <%= check_box_tag 'name[]', name, params.fetch(:name, []).include?(name),
24
+ class: "",
25
+ data: { 'filters-target': "filter" } %>
26
+ <%= trace_display_name(name) %>
27
+ <% end %>
28
+ <% end %>
29
+ <button class="dropdown-footer" data-action="filters#apply">
30
+ Apply
31
+ </button>
32
+ </div>
33
+ </div>
34
+
35
+ <div data-controller="dropdown">
36
+ <button data-action="click->dropdown#toggle click@window->dropdown#hide" data-dropdown-target="button" class="dropdown-toggle none">
37
+ Duration <%= inline_svg('filter.svg', class: 'table-filter-icon') %> </button>
38
+ <div data-controller="checklist" data-dropdown-target="menu" class="dropdown-container hidden">
39
+ <div class="dropdown-header">
40
+ Select Duration...
41
+ <button class="clear-filters" data-action="checklist#checkNone filters#apply">
42
+ Clear filter
43
+ </button>
44
+ </div>
45
+ <% [100_00, 250_00, 500_00].each do |duration| %>
46
+ <%= label_tag nil, class: "dropdown-entry" do %>
47
+ <%= radio_button_tag 'duration', duration.to_s, params.fetch(:duration, []).include?(duration.to_s),
48
+ class: "",
49
+ data: { target: "filters.filter" } %>
50
+ <%= "> #{formatted_duration(duration)}ms" %>
51
+ <% end %>
52
+ <% end %>
53
+ <button class="dropdown-footer" data-action="filters#apply">
54
+ Apply
55
+ </button>
56
+ </div>
57
+ </div>
58
+
59
+ <div data-controller="dropdown">
60
+ <button data-action="click->dropdown#toggle click@window->dropdown#hide" data-dropdown-target="button" class="dropdown-toggle none">
61
+ Allocations <%= inline_svg('filter.svg', class: 'table-filter-icon') %> </button>
62
+ <div data-controller="checklist" data-dropdown-target="menu" class="dropdown-container hidden">
63
+ <div class="dropdown-header">
64
+ Select Allocation...
65
+ <button class="clear-filters" data-action="filters#apply">
66
+ Clear filter
67
+ </button>
68
+ </div>
69
+ <!-- https://twitter.com/nateberkopec/status/1442648442149367809-->
70
+ <% [10_000, 100_000, 1_000_000, 10_000_000].each do |allocations| %>
71
+ <%= label_tag nil, class: "dropdown-entry" do %>
72
+ <%= radio_button_tag 'allocations', allocations.to_s, params.fetch(:allocations, []).include?(allocations.to_s),
73
+ class: "",
74
+ data: { target: "filters.filter" } %>
75
+ <%= "> #{formatted_allocations(allocations)}" %>
76
+ <% end %>
77
+ <% end %>
78
+ <button class="dropdown-footer" data-action="filters#apply">
79
+ Apply
80
+ </button>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ <%= link_to(profiled_request_url(@profiled_request.id)) do %>
85
+ <%= button_tag('Clear All', class: 'btn-red') %>
86
+ <% end %>
87
+ </div>
@@ -0,0 +1,12 @@
1
+ <tr class="no-row">
2
+ <td colspan="100%">
3
+ <div class="placeholder">
4
+ <%= inline_svg('logo_variant.svg', class: 'placeholder-image') %>
5
+ <div class="placeholder-text">
6
+ <h2>No Traces found!</h2>
7
+ <p>Modify filters or reload this page</p>
8
+ </div>
9
+ <%= link_to('Clear Filters', profiled_request_url(@profiled_request.id), class: 'placeholder-link') %>
10
+ </div>
11
+ </td>
12
+ </tr>
@@ -1,6 +1,8 @@
1
1
  <section class="page-header">
2
2
  <h1> <%= @profiled_request.request_path %> </h1>
3
+ </section>
3
4
 
5
+ <div class="profiled-request-details">
4
6
  <ul class="request-details-data">
5
7
  <li class="data-item">
6
8
  <small>Method</small>
@@ -18,23 +20,8 @@
18
20
  <small>Allocations</small>
19
21
  <span><%= @profiled_request.allocations %></span>
20
22
  </li>
21
-
22
23
  </ul>
23
-
24
- </section>
25
-
26
- <section class="request-details-actions">
27
- <%= form_with id: 'trace-form', url: profiled_request_url(@profiled_request.id), method: :get do |form| %>
28
- <%= form.search_field :search, id: 'trace-search', placeholder: 'Search Traces...', class: 'search-field' %>
29
- <% end %>
30
24
  <%= @profiled_request.flamegraph_button %>
31
- </section>
25
+ </div>
32
26
 
33
- <section>
34
- <h2>Traces</h2>
35
- <ol class="trace-list">
36
- <% @traces.each do |trace| %>
37
- <%= render "rails_mini_profiler/profiled_requests/shared/trace", trace: trace %>
38
- <% end %>
39
- </ol>
40
- </section>
27
+ <%= render "rails_mini_profiler/profiled_requests/show/trace_list" %>