better_rails_debugger 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/app/controllers/better_rails_debugger/group_instances_controller.rb +18 -1
- data/app/helpers/better_rails_debugger/application_helper.rb +9 -0
- data/app/views/better_rails_debugger/group_instances/objects.html.haml +11 -3
- data/lib/better_rails_debugger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44960a042bef701c0cf46fb9f41811088f8e26e6
|
4
|
+
data.tar.gz: fb0817fe00ecf575a21435029f8ce28207fdbb75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fb7362c78580e939169600cba203056d929f01d533f252ff6f4a8fac83a8264a9e018697a1e1633899a7e910ddfaaa78b894b8254e647992348f8cbd93a2ebd
|
7
|
+
data.tar.gz: c6c02323f036fa8846c12ce581f96a82f2afc076906579beb033e272a81d68baaa3caa6789f3ac36b6c7b6e1b4e4fc449a241f8f4286e1acf0431924deb9733d
|
@@ -9,7 +9,24 @@ module BetterRailsDebugger
|
|
9
9
|
redirect_to analysis_groups_path, flash: {error: 'Instance not found'}
|
10
10
|
return
|
11
11
|
end
|
12
|
-
@objects = @instance.objects.order(created_at: 'desc').limit(20)
|
12
|
+
@objects = @instance.objects.order(created_at: 'desc').limit(20)
|
13
|
+
if ['asc', 'desc'].include? params[:order] and ['location', 'memsize', 'class'].include? params[:column]
|
14
|
+
if params[:column] == 'location'
|
15
|
+
@objects = @objects.order({source_file: params[:order], source_line: params[:order]})
|
16
|
+
elsif params[:column] == 'memsize'
|
17
|
+
@objects = @objects.order({memsize: params[:order]})
|
18
|
+
elsif params[:column] == 'class'
|
19
|
+
@objects = @objects.order({class_name: params[:order]})
|
20
|
+
end
|
21
|
+
end
|
22
|
+
if params[:filter].present?
|
23
|
+
@objects = @objects.or({source_file: /.*#{params[:filter]}.*/i},
|
24
|
+
{source_line: /.*#{params[:filter]}.*/i},
|
25
|
+
{memsize: /.*#{params[:filter]}.*/i},
|
26
|
+
{class_name: /.*#{params[:filter]}.*/i})
|
27
|
+
pp @objects
|
28
|
+
end
|
29
|
+
@objects = @objects.paginate(page: (params[:page] || 1), per_page: 20)
|
13
30
|
end
|
14
31
|
|
15
32
|
def code
|
@@ -1,4 +1,13 @@
|
|
1
1
|
module BetterRailsDebugger
|
2
2
|
module ApplicationHelper
|
3
|
+
def order_link(title, column, object)
|
4
|
+
order = params[:order].to_s == 'asc' ? 'desc' : 'asc'
|
5
|
+
link_class = params[:column] == column ? "text-primary" : "text-light"
|
6
|
+
if object.kind_of? GroupInstance
|
7
|
+
link_to title, objects_group_instance_url(object, column: column, order: order), class: link_class
|
8
|
+
else
|
9
|
+
title
|
10
|
+
end
|
11
|
+
end
|
3
12
|
end
|
4
13
|
end
|
@@ -36,12 +36,20 @@
|
|
36
36
|
those objects that are created from the moment that a request arrive to a controller. Everythinng else, like
|
37
37
|
objects created by Middlewares, are not been tracked because performance.
|
38
38
|
|
39
|
+
%h3 Filter
|
40
|
+
%form{url: objects_group_instance_path(@instance, column: params[:column], order: params[:order]), method: "get"}
|
41
|
+
.form-group.d-flex
|
42
|
+
.col-4
|
43
|
+
%input.form-control{name: 'filter', placeholder: 'Filename Memsize or Class', value: params[:filter]}
|
44
|
+
.col-6
|
45
|
+
%button.btn.btn-primary{type: 'submit'} Filter
|
46
|
+
|
39
47
|
%table.table.border.border-secondary.border-top-0
|
40
48
|
%thead.bg-secondary.text-white
|
41
49
|
%tr.d-flex
|
42
|
-
%th.col-8 Location
|
43
|
-
%th.col-2 Memsize
|
44
|
-
%th.col-2 Class
|
50
|
+
%th.col-8= order_link "Location", 'location', @instance
|
51
|
+
%th.col-2= order_link "Memsize", 'memsize', @instance
|
52
|
+
%th.col-2= order_link "Class", 'class', @instance
|
45
53
|
|
46
54
|
%tbody
|
47
55
|
- @objects.each do |object|
|