miniprofiler 0.1.7.2 → 0.1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/Gemfile.lock +1 -1
- data/Rakefile +9 -9
- data/lib/html/includes.css +75 -0
- data/lib/html/includes.js +826 -0
- data/lib/html/includes.less +468 -0
- data/lib/html/includes.tmpl +195 -0
- data/lib/html/jquery.1.7.1.js +4 -0
- data/lib/html/jquery.tmpl.js +486 -0
- data/lib/html/list.css +9 -0
- data/lib/html/list.js +37 -0
- data/lib/html/list.tmpl +34 -0
- data/lib/html/profile_handler.js +62 -0
- data/rack-mini-profiler.gemspec +1 -1
- metadata +21 -11
@@ -0,0 +1,468 @@
|
|
1
|
+
.box-shadow(@dx, @dy, @radius, @color) {
|
2
|
+
-moz-box-shadow: @dx @dy @radius @color;
|
3
|
+
-webkit-box-shadow: @dx @dy @radius @color;
|
4
|
+
box-shadow: @dx @dy @radius @color;
|
5
|
+
}
|
6
|
+
|
7
|
+
@anchorColor: #0077CC;
|
8
|
+
@buttonBorderColor: #888;
|
9
|
+
@numberColor: #111;
|
10
|
+
@textColor: #555;
|
11
|
+
@mutedColor: #aaa;
|
12
|
+
@normalFonts: Helvetica, Arial, sans-serif;
|
13
|
+
@codeFonts: Consolas, monospace, serif;
|
14
|
+
@zindex:2147483640; // near 32bit max 2147483647
|
15
|
+
|
16
|
+
// do some resets
|
17
|
+
.profiler-result, .profiler-queries {
|
18
|
+
color:#555;
|
19
|
+
line-height:1;
|
20
|
+
font-size:12px;
|
21
|
+
|
22
|
+
pre, code, label, table, tbody, thead, tfoot, tr, th, td {
|
23
|
+
margin:0;
|
24
|
+
padding:0;
|
25
|
+
border:0;
|
26
|
+
font-size:100%;
|
27
|
+
font:inherit;
|
28
|
+
vertical-align:baseline;
|
29
|
+
background-color:transparent;
|
30
|
+
overflow:visible;
|
31
|
+
max-height:none;
|
32
|
+
}
|
33
|
+
table {
|
34
|
+
border-collapse:collapse;
|
35
|
+
border-spacing:0;
|
36
|
+
}
|
37
|
+
a, a:hover {
|
38
|
+
cursor:pointer;
|
39
|
+
color:@anchorColor;
|
40
|
+
}
|
41
|
+
a {
|
42
|
+
text-decoration:none;
|
43
|
+
&:hover {
|
44
|
+
text-decoration:underline;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
// styles shared between popup view and full view
|
50
|
+
.profiler-result
|
51
|
+
{
|
52
|
+
|
53
|
+
.profiler-toggle-duration-with-children
|
54
|
+
{
|
55
|
+
float: right;
|
56
|
+
}
|
57
|
+
|
58
|
+
table.profiler-client-timings
|
59
|
+
{
|
60
|
+
margin-top: 10px;
|
61
|
+
}
|
62
|
+
|
63
|
+
font-family:@normalFonts;
|
64
|
+
|
65
|
+
.profiler-label {
|
66
|
+
color:@textColor;
|
67
|
+
overflow:hidden;
|
68
|
+
text-overflow: ellipsis;
|
69
|
+
}
|
70
|
+
|
71
|
+
.profiler-unit {
|
72
|
+
color:@mutedColor;
|
73
|
+
}
|
74
|
+
|
75
|
+
.profiler-trivial {
|
76
|
+
display:none;
|
77
|
+
td, td * {
|
78
|
+
color:@mutedColor !important;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
pre, code, .profiler-number, .profiler-unit {
|
83
|
+
font-family:@codeFonts;
|
84
|
+
}
|
85
|
+
|
86
|
+
.profiler-number {
|
87
|
+
color:@numberColor;
|
88
|
+
}
|
89
|
+
|
90
|
+
.profiler-info {
|
91
|
+
text-align:right;
|
92
|
+
.profiler-name {
|
93
|
+
float:left;
|
94
|
+
}
|
95
|
+
.profiler-server-time {
|
96
|
+
white-space:nowrap;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
.profiler-timings {
|
101
|
+
th {
|
102
|
+
background-color:#fff;
|
103
|
+
color:@mutedColor;
|
104
|
+
text-align:right;
|
105
|
+
}
|
106
|
+
th, td {
|
107
|
+
white-space:nowrap;
|
108
|
+
}
|
109
|
+
.profiler-duration-with-children {
|
110
|
+
display:none;
|
111
|
+
}
|
112
|
+
.profiler-duration {
|
113
|
+
.profiler-number;
|
114
|
+
text-align:right;
|
115
|
+
}
|
116
|
+
.profiler-indent {
|
117
|
+
letter-spacing:4px;
|
118
|
+
}
|
119
|
+
.profiler-queries-show {
|
120
|
+
.profiler-number, .profiler-unit {
|
121
|
+
color:@anchorColor;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
.profiler-queries-duration {
|
125
|
+
padding-left:6px;
|
126
|
+
}
|
127
|
+
.profiler-percent-in-sql {
|
128
|
+
white-space:nowrap;
|
129
|
+
text-align:right;
|
130
|
+
}
|
131
|
+
|
132
|
+
tfoot {
|
133
|
+
td {
|
134
|
+
padding-top:10px;
|
135
|
+
text-align:right;
|
136
|
+
|
137
|
+
a {
|
138
|
+
font-size:95%;
|
139
|
+
display:inline-block;
|
140
|
+
margin-left:12px;
|
141
|
+
|
142
|
+
&:first-child {
|
143
|
+
float:left;
|
144
|
+
margin-left:0px;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
.profiler-queries {
|
152
|
+
font-family:@normalFonts;
|
153
|
+
|
154
|
+
.profiler-stack-trace {
|
155
|
+
margin-bottom:15px;
|
156
|
+
}
|
157
|
+
pre {
|
158
|
+
font-family:@codeFonts;
|
159
|
+
white-space:pre-wrap;
|
160
|
+
}
|
161
|
+
|
162
|
+
th {
|
163
|
+
background-color:#fff;
|
164
|
+
border-bottom:1px solid #555;
|
165
|
+
font-weight:bold;
|
166
|
+
padding:15px;
|
167
|
+
white-space:nowrap;
|
168
|
+
}
|
169
|
+
|
170
|
+
td {
|
171
|
+
padding:15px;
|
172
|
+
text-align:left;
|
173
|
+
background-color:#fff;
|
174
|
+
|
175
|
+
&:last-child {
|
176
|
+
padding-right:25px; // compensate for scrollbars
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
.profiler-odd td {
|
181
|
+
background-color:#e5e5e5;
|
182
|
+
}
|
183
|
+
|
184
|
+
.profiler-since-start, .profiler-duration {
|
185
|
+
text-align:right;
|
186
|
+
}
|
187
|
+
|
188
|
+
.profiler-info div {
|
189
|
+
text-align:right;
|
190
|
+
margin-bottom:5px;
|
191
|
+
}
|
192
|
+
|
193
|
+
.profiler-gap-info, .profiler-gap-info td { background-color: #ccc;}
|
194
|
+
.profiler-gap-info {
|
195
|
+
.profiler-unit {color: #777;}
|
196
|
+
.profiler-info {text-align: right}
|
197
|
+
&.profiler-trivial-gaps {display: none}
|
198
|
+
}
|
199
|
+
|
200
|
+
.profiler-trivial-gap-container { text-align: center;}
|
201
|
+
|
202
|
+
// prettify colors
|
203
|
+
.str{color:maroon}
|
204
|
+
.kwd{color:#00008b}
|
205
|
+
.com{color:gray}
|
206
|
+
.typ{color:#2b91af}
|
207
|
+
.lit{color:maroon}
|
208
|
+
.pun{color:#000}
|
209
|
+
.pln{color:#000}
|
210
|
+
.tag{color:maroon}
|
211
|
+
.atn{color:red}
|
212
|
+
.atv{color:blue}
|
213
|
+
.dec{color:purple}
|
214
|
+
}
|
215
|
+
|
216
|
+
.profiler-warning, .profiler-warning *, .profiler-warning .profiler-queries-show, .profiler-warning .profiler-queries-show .profiler-unit { // i'm no good at css
|
217
|
+
color:#f00;
|
218
|
+
&:hover {
|
219
|
+
color:#f00;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
.profiler-nuclear {
|
224
|
+
.profiler-warning;
|
225
|
+
font-weight:bold;
|
226
|
+
padding-right:2px;
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
// ajaxed-in results will be appended to this
|
231
|
+
.profiler-results
|
232
|
+
{
|
233
|
+
z-index:@zindex + 3;
|
234
|
+
position:fixed;
|
235
|
+
top:0px;
|
236
|
+
|
237
|
+
@radius:10px;
|
238
|
+
|
239
|
+
&.profiler-left {
|
240
|
+
left:0px;
|
241
|
+
|
242
|
+
&.profiler-no-controls .profiler-result:last-child .profiler-button, .profiler-controls {
|
243
|
+
-webkit-border-bottom-right-radius: @radius;
|
244
|
+
-moz-border-radius-bottomright: @radius;
|
245
|
+
border-bottom-right-radius: @radius;
|
246
|
+
}
|
247
|
+
|
248
|
+
.profiler-button, .profiler-controls {
|
249
|
+
border-right: 1px solid @buttonBorderColor;
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
&.profiler-right {
|
254
|
+
right:0px;
|
255
|
+
|
256
|
+
&.profiler-no-controls .profiler-result:last-child .profiler-button, .profiler-controls {
|
257
|
+
-webkit-border-bottom-left-radius: @radius;
|
258
|
+
-moz-border-radius-bottomleft: @radius;
|
259
|
+
border-bottom-left-radius: @radius;
|
260
|
+
}
|
261
|
+
|
262
|
+
.profiler-button, .profiler-controls {
|
263
|
+
border-left: 1px solid @buttonBorderColor;
|
264
|
+
}
|
265
|
+
}
|
266
|
+
|
267
|
+
.profiler-button, .profiler-controls {
|
268
|
+
display:none;
|
269
|
+
z-index:@zindex;
|
270
|
+
border-bottom: 1px solid @buttonBorderColor;
|
271
|
+
background-color:#fff;
|
272
|
+
padding: 4px 7px;
|
273
|
+
text-align:right;
|
274
|
+
cursor:pointer;
|
275
|
+
|
276
|
+
&.profiler-button-active {
|
277
|
+
background-color:maroon;
|
278
|
+
|
279
|
+
.profiler-number, .profiler-nuclear {
|
280
|
+
color:#fff;
|
281
|
+
font-weight:bold;
|
282
|
+
}
|
283
|
+
.profiler-unit {
|
284
|
+
color:#fff;
|
285
|
+
font-weight:normal;
|
286
|
+
}
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
.profiler-controls {
|
291
|
+
display: block;
|
292
|
+
font-size:12px;
|
293
|
+
font-family: @codeFonts;
|
294
|
+
cursor:default;
|
295
|
+
text-align: center;
|
296
|
+
|
297
|
+
span {
|
298
|
+
border-right: 1px solid @mutedColor;
|
299
|
+
padding-right: 5px;
|
300
|
+
margin-right: 5px;
|
301
|
+
cursor:pointer;
|
302
|
+
}
|
303
|
+
|
304
|
+
span:last-child {
|
305
|
+
border-right: none;
|
306
|
+
}
|
307
|
+
}
|
308
|
+
|
309
|
+
.profiler-popup {
|
310
|
+
display:none;
|
311
|
+
z-index:@zindex + 1;
|
312
|
+
position:absolute;
|
313
|
+
background-color:#fff;
|
314
|
+
border: 1px solid #aaa;
|
315
|
+
padding:5px 10px;
|
316
|
+
text-align:left;
|
317
|
+
line-height:18px;
|
318
|
+
overflow:auto;
|
319
|
+
|
320
|
+
.box-shadow(0px, 1px, 15px, #555);
|
321
|
+
|
322
|
+
.profiler-info {
|
323
|
+
margin-bottom:3px;
|
324
|
+
padding-bottom:2px;
|
325
|
+
border-bottom:1px solid #ddd;
|
326
|
+
|
327
|
+
.profiler-name {
|
328
|
+
font-size:110%;
|
329
|
+
font-weight:bold;
|
330
|
+
.profiler-overall-duration {
|
331
|
+
display:none;
|
332
|
+
}
|
333
|
+
}
|
334
|
+
.profiler-server-time {
|
335
|
+
font-size:95%;
|
336
|
+
}
|
337
|
+
}
|
338
|
+
|
339
|
+
.profiler-timings {
|
340
|
+
|
341
|
+
th, td {
|
342
|
+
padding-left:6px;
|
343
|
+
padding-right:6px;
|
344
|
+
}
|
345
|
+
|
346
|
+
th {
|
347
|
+
font-size:95%;
|
348
|
+
padding-bottom:3px;
|
349
|
+
}
|
350
|
+
|
351
|
+
.profiler-label {
|
352
|
+
max-width:275px;
|
353
|
+
}
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
.profiler-queries {
|
358
|
+
display:none;
|
359
|
+
z-index:@zindex + 3;
|
360
|
+
position:absolute;
|
361
|
+
overflow-y:auto;
|
362
|
+
overflow-x:hidden;
|
363
|
+
background-color:#fff;
|
364
|
+
|
365
|
+
th {
|
366
|
+
font-size:17px;
|
367
|
+
}
|
368
|
+
}
|
369
|
+
|
370
|
+
&.profiler-min .profiler-result {
|
371
|
+
display: none;
|
372
|
+
}
|
373
|
+
|
374
|
+
&.profiler-min .profiler-controls span {
|
375
|
+
display: none;
|
376
|
+
}
|
377
|
+
|
378
|
+
&.profiler-min .profiler-controls .profiler-min-max {
|
379
|
+
border-right: none;
|
380
|
+
padding: 0px;
|
381
|
+
margin: 0px;
|
382
|
+
}
|
383
|
+
}
|
384
|
+
|
385
|
+
// popup results' queries will be displayed in front of this
|
386
|
+
.profiler-queries-bg {
|
387
|
+
z-index:@zindex + 2;
|
388
|
+
display:none;
|
389
|
+
background:#000;
|
390
|
+
opacity:0.7;
|
391
|
+
position:absolute;
|
392
|
+
top:0px;
|
393
|
+
left:0px;
|
394
|
+
min-width:100%;
|
395
|
+
}
|
396
|
+
|
397
|
+
// used when viewing a shared, full page result
|
398
|
+
.profiler-result-full {
|
399
|
+
.profiler-result {
|
400
|
+
|
401
|
+
width:950px;
|
402
|
+
margin:30px auto;
|
403
|
+
|
404
|
+
.profiler-button {
|
405
|
+
display:none;
|
406
|
+
}
|
407
|
+
|
408
|
+
.profiler-popup {
|
409
|
+
|
410
|
+
.profiler-info {
|
411
|
+
font-size: 25px;
|
412
|
+
border-bottom:1px solid @mutedColor;
|
413
|
+
padding-bottom:3px;
|
414
|
+
margin-bottom:25px;
|
415
|
+
|
416
|
+
.profiler-overall-duration {
|
417
|
+
padding-right:20px;
|
418
|
+
font-size:80%;
|
419
|
+
color:#888;
|
420
|
+
}
|
421
|
+
}
|
422
|
+
|
423
|
+
.profiler-timings {
|
424
|
+
td, th {
|
425
|
+
padding-left:8px;
|
426
|
+
padding-right:8px;
|
427
|
+
}
|
428
|
+
th {
|
429
|
+
padding-bottom:7px;
|
430
|
+
}
|
431
|
+
td {
|
432
|
+
font-size:14px;
|
433
|
+
padding-bottom:4px;
|
434
|
+
|
435
|
+
&:first-child {
|
436
|
+
padding-left:10px;
|
437
|
+
}
|
438
|
+
}
|
439
|
+
|
440
|
+
.profiler-label {
|
441
|
+
max-width:550px;
|
442
|
+
}
|
443
|
+
}
|
444
|
+
}
|
445
|
+
|
446
|
+
.profiler-queries {
|
447
|
+
margin:25px 0;
|
448
|
+
table {
|
449
|
+
width:100%;
|
450
|
+
}
|
451
|
+
th {
|
452
|
+
font-size:16px;
|
453
|
+
color:#555;
|
454
|
+
line-height:20px;
|
455
|
+
}
|
456
|
+
|
457
|
+
td {
|
458
|
+
padding:15px 10px;
|
459
|
+
text-align:left;
|
460
|
+
}
|
461
|
+
|
462
|
+
.profiler-info div {
|
463
|
+
text-align:right;
|
464
|
+
margin-bottom:5px;
|
465
|
+
}
|
466
|
+
}
|
467
|
+
}
|
468
|
+
}
|