Permalink
Browse files

add params to entry, color different params value, hotkey p to change…

… from inline to list layout
  • Loading branch information...
1 parent f96c9fd commit 4e2a1b778bcb98cfb86afcf6d0c65d2121d8ff2a @omenking omenking committed Aug 3, 2012
@@ -30,6 +30,8 @@ class App.Routers.Log extends Backbone.Router
@index()
toggle_side: =>
$('.wrapper').toggleClass 'filter'
+ toggle_params: =>
+ $('body').toggleClass 'pretty_params'
hotkeys: =>
m = Mousetrap
m.bind '\\ n' , @toggle_side
@@ -38,6 +40,7 @@ class App.Routers.Log extends Backbone.Router
m.bind String(i) , _.bind @log.entries_index.number_hotkey, @, String(i) for i in [0..9]
m.bind 'shift+g' , _.bind @log.entries_index.goto_number, @, 'bottom'
m.bind 'g g' , _.bind @log.entries_index.goto_number, @, 'top'
+ m.bind 'p' , @toggle_params
m.bind ['o','enter'], @log.entries_index.toggle_open
index: =>
App.column = @partial '.column', 'shared/filters'

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -18,8 +18,22 @@ class App.Views.Entries.Entry extends Backbone.View
@el_template 'entries/entry'
@color_ms()
@color_marker()
+ @params()
@backtrace()
@lines()
+ params:->
+ params = @model.get 'params'
+ html = _.map params, (v,k)->
+ boolean = v is true or v is false
+ number = !isNaN(parseFloat(v)) && isFinite(v)
+ kind = if boolean then 'boolean'
+ else if number then 'number'
+ else
+ v = "'#{v}'"
+ 'string'
+
+ "<span class='param'><span class='key'>#{k}</span><span class='colon'>:</span> <span class='value #{kind}'>#{v}</span></span>"
+ $(@el).find('.params').html html.join('')
backtrace:->
backtrace = @model.get 'backtrace'
if backtrace
@@ -45,17 +45,50 @@
:color rgb(50,250,100)
.datetime
:color rgb(120,120,120)
- .lines, .backtrace_lines
+ .lines, .backtrace_lines, .params
:display none
&.ignore
:display none
&.selected
:background rgb(55,55,55)
&.open
- .lines, .backtrace_lines
+ .lines, .backtrace_lines, .params
:display block
:padding-bottom 10px
.position_marker
:background rgb(255,0,0)
:height 2px
:margin 2px 0
+
+.params
+ :padding 5px
+ :top 0px
+ :font-size 12px
+ .key
+ :color rgb(160,160,160)
+ .value
+ :margin
+ :left 5px
+ :right 10px
+ .string
+ :color rgb(0,200,100)
+ .number
+ :color rgb(0,100,200)
+ .boolean
+ :color rgb(200,200,0)
+
+
+body.pretty_params
+ .open
+ .params
+ .param
+ :display block
+ //:display table
+ //:border-collapse collapse
+ //:border none
+ //.param
+ //:display table-row
+ //span
+ //:display table-cell
+ //.key, .colon
+ //:width 1%
@@ -28,7 +28,10 @@ def set_values event
self.error = payload[:exception].present?
self.duration = event.duration.to_f.round(2)
self.id = event.transaction_id
- self.params = payload[:params]
+ params = payload[:params]
+ params.delete 'controller'
+ params.delete 'action'
+ self.params = params
self.start_time = event.time.to_s :entry
self.end_time = event.end.to_s :entry
end
@@ -83,6 +86,7 @@ def finalize(event)
def to_json
methods = %w{controller
+ params
action
path
method
@@ -7,6 +7,7 @@
.path {{path}}
.datetime {{start_time}}
.ms {{duration}}ms
+ .params
.lines
.backtrace_lines
.clear
@@ -1,5 +1,5 @@
Rails.application.routes.draw do
mount Rubyception::Engine => "/rubyception"
- root to: 'tasks#index'
+ root to: 'tasks#index', all_done: true, project_name: 'Zeus', tasks_count: 235
end

0 comments on commit 4e2a1b7

Please sign in to comment.