mongodb_logger 0.1.4 → 0.1.5

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 (38) hide show
  1. data/README.md +1 -1
  2. data/SUPPORTED_RAILS_VERSIONS +3 -1
  3. data/config.ru +1 -1
  4. data/examples/server_config.yml +1 -0
  5. data/lib/mongodb_logger/logger.rb +2 -1
  6. data/lib/mongodb_logger/server/coffee/{application.coffee → logs.coffee} +59 -8
  7. data/lib/mongodb_logger/server/content_for.rb +58 -0
  8. data/lib/mongodb_logger/server/model/additional_filter.rb +70 -0
  9. data/lib/mongodb_logger/server/model/filter.rb +52 -32
  10. data/lib/mongodb_logger/server/public/images/date.png +0 -0
  11. data/lib/mongodb_logger/server/public/images/external.png +0 -0
  12. data/lib/mongodb_logger/server/public/javascripts/{application.js → logs.js} +68 -10
  13. data/lib/mongodb_logger/server/public/javascripts/vendors/highlight.pack.js +1 -0
  14. data/lib/mongodb_logger/server/public/javascripts/{jquery-1.7.min.js → vendors/jquery-1.7.min.js} +0 -0
  15. data/lib/mongodb_logger/server/public/javascripts/{jquery-ui-1.8.16.effects.min.js → vendors/jquery-ui-1.8.16.effects.min.js} +0 -0
  16. data/lib/mongodb_logger/server/public/javascripts/vendors/jquery.pjax.js +264 -0
  17. data/lib/mongodb_logger/server/public/stylesheets/all.css +2 -1
  18. data/lib/mongodb_logger/server/public/stylesheets/group-buttons.css +27 -29
  19. data/lib/mongodb_logger/server/public/stylesheets/group-forms.css +1 -1
  20. data/lib/mongodb_logger/server/public/stylesheets/group-tables.css +29 -1
  21. data/lib/mongodb_logger/server/public/stylesheets/highlight/zenburn.css +115 -0
  22. data/lib/mongodb_logger/server/public/stylesheets/layout.css +32 -10
  23. data/lib/mongodb_logger/server/public/stylesheets/library.css +169 -19
  24. data/lib/mongodb_logger/server/view_helpers.rb +35 -0
  25. data/lib/mongodb_logger/server/views/layout.erb +31 -7
  26. data/lib/mongodb_logger/server/views/overview.erb +40 -51
  27. data/lib/mongodb_logger/server/views/shared/_dynamic_filter.erb +30 -0
  28. data/lib/mongodb_logger/server/views/shared/_log.erb +6 -6
  29. data/lib/mongodb_logger/server/views/shared/_log_info.erb +9 -7
  30. data/lib/mongodb_logger/server/views/shared/_message_tabs.erb +15 -0
  31. data/lib/mongodb_logger/server/views/shared/_tabs.erb +2 -2
  32. data/lib/mongodb_logger/server/views/shared/_tail_panel.erb +13 -0
  33. data/lib/mongodb_logger/server/views/shared/_top_panel.erb +7 -0
  34. data/lib/mongodb_logger/server/views/show_log.erb +31 -15
  35. data/lib/mongodb_logger/server.rb +17 -3
  36. data/lib/mongodb_logger/version.rb +1 -1
  37. data/mongodb_logger.gemspec +9 -9
  38. metadata +47 -36
@@ -55,30 +55,32 @@ a:hover, a:active {
55
55
  }
56
56
 
57
57
  .notice {
58
+ position: relative;
59
+ top: 1px;
58
60
  width: 10px;
59
61
  height: 10px;
60
62
  display: inline-block;
61
- margin-right: 4px;
62
- margin-left: -14px;
63
- background: url(../images/success.png) no-repeat 0 0;
64
- }
65
-
66
- .arrow-down {
67
- padding-right: 15px;
68
- background: url(../images/arrow-down.png) no-repeat 100% 50%;
69
- }
70
-
71
- .notice.new {
72
- background: url(../images/newlog.png) no-repeat 0 0;
63
+ margin-right: 5px;
64
+ margin-left: -17px;
65
+ /* background: url(../images/success.png) no-repeat 0 0; */
73
66
  }
74
67
 
75
68
  .error {
69
+ position: relative;
70
+ top: 1px;
76
71
  width: 10px;
77
72
  height: 10px;
78
73
  display: inline-block;
74
+ margin-right: 5px;
75
+ margin-left: -17px;
79
76
  background: url(../images/failure.png) no-repeat 0 0;
80
77
  }
81
78
 
79
+ .arrow-down {
80
+ padding-right: 15px;
81
+ background: url(../images/arrow-down.png) no-repeat 100% 50%;
82
+ }
83
+
82
84
  code {
83
85
  display: block;
84
86
  overflow: auto;
@@ -128,6 +130,7 @@ code {
128
130
  line-height: 24px;
129
131
  font-weight: bold;
130
132
  cursor: pointer;
133
+ text-shadow: 0 1px 0 #fff;
131
134
  border-bottom: 1px solid #bbb;
132
135
  background: rgb(238,238,238);
133
136
  background: -moz-linear-gradient(top, rgba(238,238,238,1) 0%, rgba(211,211,211,1) 100%);
@@ -142,14 +145,14 @@ code {
142
145
 
143
146
  .logs-time {
144
147
  width: 200px;
145
- padding: 7px 15px;
148
+ padding: 7px 15px 7px 30px;
146
149
  -moz-box-sizing: border-box;
147
150
  -webkit-box-sizing: border-box;
148
151
  box-sizing: border-box;
149
152
  font: 12px arial, sans-serif;
150
153
  vertical-align: middle;
151
154
  border: 1px solid #bbb;
152
- background-color: #fff;
155
+ background: #fff url(../images/date.png) no-repeat 9px 50%;
153
156
  border-radius: 3px;
154
157
  box-shadow: 0 1px 2px #e6e6e6 inset, 0 1px 0 #fff;
155
158
  }
@@ -163,11 +166,158 @@ code {
163
166
  display: none;
164
167
  }
165
168
 
166
- #logs_list{
167
- table-layout: fixed;
168
- }
169
-
170
169
 
171
170
  .wrap_text {
172
171
  word-wrap: break-word;
173
- }
172
+ }
173
+
174
+ li.message_tab {
175
+ cursor: pointer;
176
+ cursor: hand;
177
+ }
178
+
179
+ .tab_content.hidden {
180
+ display:none;
181
+ }
182
+
183
+
184
+ .message_tabs {
185
+ height: 30px;
186
+ position: relative;
187
+ background: rgb(238,238,238);
188
+ border: 1px solid #ADB4B8;
189
+ background: -moz-linear-gradient(top, rgba(238,238,238,1) 0%, rgba(204,204,204,1) 100%);
190
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(238,238,238,1)), color-stop(100%,rgba(204,204,204,1)));
191
+ background: -webkit-linear-gradient(top, rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
192
+ background: -o-linear-gradient(top, rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
193
+ background: -ms-linear-gradient(top, rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
194
+ background: linear-gradient(top, rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
195
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 );
196
+ }
197
+
198
+ .message_tabs li.message_tab {
199
+ float: left;
200
+ padding: 0 20px;
201
+ height: 30px;
202
+ line-height: 30px;
203
+ font-size: 14px;
204
+ border-right: 1px solid #bbb;
205
+ border-top: 0;
206
+ color: #333;
207
+ background: transparent;
208
+ }
209
+
210
+ .message_tabs li:hover {
211
+ background: -moz-linear-gradient(top, rgba(255,255,255,0.62) 0%, rgba(23,146,212,0.5) 100%);
212
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.62)), color-stop(100%,rgba(23,146,212,0.5)));
213
+ background: -webkit-linear-gradient(top, rgba(255,255,255,0.62) 0%,rgba(23,146,212,0.5) 100%);
214
+ background: -o-linear-gradient(top, rgba(255,255,255,0.62) 0%,rgba(23,146,212,0.5) 100%);
215
+ background: -ms-linear-gradient(top, rgba(255,255,255,0.62) 0%,rgba(23,146,212,0.5) 100%);
216
+ background: linear-gradient(top, rgba(255,255,255,0.62) 0%,rgba(23,146,212,0.5) 100%);
217
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9effffff', endColorstr='#801792d4',GradientType=0 );
218
+
219
+ }
220
+
221
+ .message_tabs li.active {
222
+ background: #f4f4f4;
223
+ box-shadow: 0 2px 5px #ccc inset;
224
+ text-shadow: 0 1px 0 #fff;
225
+ }
226
+
227
+ a[target="_blank"] {
228
+ display: inline-block;
229
+ background: url(../images/external.png) no-repeat 0 3px;
230
+ padding-left: 17px;
231
+ }
232
+
233
+ .not-implemented {
234
+ opacity: 0.3;
235
+ cursor: default;
236
+ }
237
+
238
+ .not-implemented:hover {
239
+ background: none !important;
240
+ }
241
+
242
+ .log-num {
243
+ padding: 3px 7px 1px;
244
+ background-color: #5E3B22;
245
+ font-size: 11px;
246
+ color: #fff;
247
+ border-radius: 20px;
248
+ box-shadow: 0 2px 3px rgba(0,0,0, 0.4) inset, 0 1px 0 rgba(255,255,255, 0.2);
249
+ }
250
+
251
+ .progress {
252
+ height: 14px;
253
+ position: absolute;
254
+ bottom: 4px;
255
+ left: 10px;
256
+ right: 10px;
257
+ font-size: 10px;
258
+ background: rgb(230,234,220);
259
+ background: -moz-linear-gradient(top, rgba(230,234,220,1) 0%, rgba(223,234,197,1) 100%);
260
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(230,234,220,1)), color-stop(100%,rgba(223,234,197,1)));
261
+ background: -webkit-linear-gradient(top, rgba(230,234,220,1) 0%,rgba(223,234,197,1) 100%);
262
+ background: -o-linear-gradient(top, rgba(230,234,220,1) 0%,rgba(223,234,197,1) 100%);
263
+ background: -ms-linear-gradient(top, rgba(230,234,220,1) 0%,rgba(223,234,197,1) 100%);
264
+ background: linear-gradient(top, rgba(230,234,220,1) 0%,rgba(223,234,197,1) 100%);
265
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e6eadc', endColorstr='#dfeac5',GradientType=0 );
266
+ border-radius: 3px;
267
+ box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset;
268
+ }
269
+
270
+ .used {
271
+ height: 14px;
272
+ position: absolute;
273
+ left: 0;
274
+ top: 0;
275
+ border-radius: 3px;
276
+ background: rgb(191,210,85);
277
+ background: -moz-linear-gradient(top, rgba(191,210,85,1) 0%, rgba(142,185,42,1) 50%, rgba(114,170,0,1) 51%, rgba(158,203,45,1) 100%);
278
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(191,210,85,1)), color-stop(50%,rgba(142,185,42,1)), color-stop(51%,rgba(114,170,0,1)), color-stop(100%,rgba(158,203,45,1)));
279
+ background: -webkit-linear-gradient(top, rgba(191,210,85,1) 0%,rgba(142,185,42,1) 50%,rgba(114,170,0,1) 51%,rgba(158,203,45,1) 100%);
280
+ background: -o-linear-gradient(top, rgba(191,210,85,1) 0%,rgba(142,185,42,1) 50%,rgba(114,170,0,1) 51%,rgba(158,203,45,1) 100%);
281
+ background: -ms-linear-gradient(top, rgba(191,210,85,1) 0%,rgba(142,185,42,1) 50%,rgba(114,170,0,1) 51%,rgba(158,203,45,1) 100%);
282
+ background: linear-gradient(top, rgba(191,210,85,1) 0%,rgba(142,185,42,1) 50%,rgba(114,170,0,1) 51%,rgba(158,203,45,1) 100%);
283
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bfd255', endColorstr='#9ecb2d',GradientType=0 );
284
+
285
+ }
286
+
287
+ .size {
288
+ font-size: 10px;
289
+ position: absolute;
290
+ right: 5px;
291
+ top: 3px;
292
+ z-index: 2;
293
+ color: #000;
294
+ text-shadow: none;
295
+ }
296
+
297
+ .add {
298
+ color: #333;
299
+ text-decoration: none;
300
+ }
301
+
302
+ .warning {
303
+ position: absolute;
304
+ bottom: 1px;
305
+ padding: 3px 0;
306
+ clear: both;
307
+ width: 100%;
308
+ font-size: 10px;
309
+ background-color: #FCF6C4;
310
+ color: black;
311
+ text-shadow: none;
312
+ }
313
+
314
+ .warning p {
315
+ padding: 0 10px;
316
+ }
317
+
318
+ a.more {
319
+ padding-left: 0;
320
+ background: none;
321
+ font-weight: bold;
322
+ }
323
+
@@ -1,6 +1,41 @@
1
1
  # view helpers
2
2
  module Sinatra::ViewHelpers
3
3
 
4
+ def pretty_hash(hash)
5
+ begin
6
+ Marshal::dump(hash)
7
+ h(hash.to_yaml).gsub(" ", "  ")
8
+ rescue Exception => e # errors from Marshal or YAML
9
+ # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback
10
+ h(object.inspect)
11
+ end
12
+ end
13
+
14
+ # TODO: improve this
15
+ def number_to_human_size(number, precision = 2)
16
+ number = begin
17
+ Float(number)
18
+ rescue ArgumentError, TypeError
19
+ return number
20
+ end
21
+ case
22
+ when number.to_i == 1 then
23
+ "1 Byte"
24
+ when number < 1024 then
25
+ "%d Bytes" % number
26
+ when number < 1048576 then
27
+ "%.#{precision}f KB" % (number / 1024)
28
+ when number < 1073741824 then
29
+ "%.#{precision}f MB" % (number / 1048576)
30
+ when number < 1099511627776 then
31
+ "%.#{precision}f GB" % (number / 1073741824)
32
+ else
33
+ "%.#{precision}f TB" % (number / 1099511627776)
34
+ end.sub(/([0-9]\.\d*?)0+ /, '\1 ' ).sub(/\. /,' ')
35
+ rescue
36
+ nil
37
+ end
38
+
4
39
  def text_field_tag(object, name, options = {})
5
40
  value = ""
6
41
  value = options.delete(:value) if options[:value]
@@ -1,27 +1,51 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>MongoDB logger</title>
4
+ <title>MongoDB Logger</title>
5
5
  <link href="<%=u 'stylesheets/all.css' %>" media="screen" rel="stylesheet" type="text/css">
6
- <script src="<%=u 'javascripts/jquery-1.7.min.js' %>" type="text/javascript"></script>
7
- <script src="<%=u 'javascripts/jquery-ui-1.8.16.effects.min.js' %>" type="text/javascript"></script>
8
- <script src="<%=u 'javascripts/application.js' %>" type="text/javascript"></script>
6
+
7
+ <script src="<%=u 'javascripts/vendors/jquery-1.7.min.js' %>" type="text/javascript"></script>
8
+ <script src="<%=u 'javascripts/vendors/jquery-ui-1.8.16.effects.min.js' %>" type="text/javascript"></script>
9
+ <script src="<%=u 'javascripts/vendors/jquery.pjax.js' %>" type="text/javascript"></script>
10
+ <script src="<%=u 'javascripts/vendors/highlight.pack.js' %>" type="text/javascript"></script>
11
+ <script src="<%=u 'javascripts/logs.js' %>" type="text/javascript"></script>
9
12
  </head>
10
13
  <body>
11
14
  <div class="page">
12
15
  <div class="header">
13
16
  <div class="wrapper">
14
- <a href="<%=h url_path("overview") %>" class="logo"><img src="<%=u 'images/logo.png'%>" alt="MongoDB Logger"></a> <span class="logger ">logger</span>
17
+ <div class="unit-right stats">
18
+ <div class="unit size2of3">
19
+ <div class="ptxs pls"><strong>DB:</strong> <%=h @db.name %></div>
20
+ <div class="pls"><strong>Collection:</strong> <%=h @collection.name %></div>
21
+ </div> <!-- unit -->
22
+ <div class="unit size1of3">
23
+ <div class="pts prs txtR">
24
+ <span id="db_collection_count" class="log-num"><%=h @collection_stats["count"] %></span></div>
25
+ </div> <!-- unit -->
26
+ <% if @collection_stats["capped"] && 1 == @collection_stats["capped"] %>
27
+
28
+ <div class="progress">
29
+ <span class="size"><%=h number_to_human_size(@collection_stats["size"]) %> of <%=h number_to_human_size(@collection_stats["storageSize"]) %></span>
30
+ <div class="used" style="width: <%=((@collection_stats["size"].to_f / @collection_stats["storageSize"].to_f) * 100).round%>%"></div>
31
+ </div> <!-- progress -->
32
+
33
+ <% else %>
34
+ <div class="warning"><p>You do not use capped collection for logs.
35
+ <a href="http://www.mongodb.org/display/DOCS/Capped+Collections" target="_blank" class="more">More info.</a></p>
36
+ </div>
37
+ <% end %>
38
+ </div>
39
+ <a href="<%=h url_path("overview") %>" class="logo" data-pjax='#main_pjax'><img src="<%=u 'images/logo.png'%>" alt="MongoDB Logger"></a> <span class="logger ">logger</span>
15
40
  </div> <!-- wrapper -->
16
41
  </div> <!-- header -->
17
42
  <div class="content">
18
43
  <div class="wrapper">
19
- <div class="mainbox">
44
+ <div id="main_pjax" class="mainbox">
20
45
  <%= yield %>
21
46
  </div> <!-- mainbox -->
22
47
  </div> <!-- wrapper -->
23
48
  </div> <!-- content -->
24
-
25
49
  </div>
26
50
 
27
51
  </body>
@@ -1,23 +1,8 @@
1
- <div class="topline">
2
- <%= partial(:"shared/tabs") %>
3
- <div class="unit-right">
4
- <div id="tail_logs_block">
5
- <div class="initial">
6
- <a id="tail_logs_link" href="#" data-url="<%=h url_path("tail_logs") %>" class="button mts mrs">
7
- <span class="start" data-url="<%=h url_path("tail_logs") %>">Tail</span>
8
- </a>
9
- </div>
10
- <div class="info">
11
- <span id="tail_logs_time" class="logs-time mrs"></span>
12
- <a id="tail_logs_stop_link" href="#" class="button negative mts mrs">
13
- <span class="stop">Stop</span>
14
- </a>
15
- </div>
16
- </div>
17
- </div> <!-- unit-right -->
18
-
19
- <div id="ajax_loader"><img src="<%=u 'images/spinner.gif'%>" alt="loading..."></div>
20
- </div> <!-- topline -->
1
+ <% content_for :right_top_panel do %>
2
+ <%= partial(:"shared/tail_panel") %>
3
+ <% end %>
4
+
5
+ <%= partial(:"shared/top_panel") %>
21
6
 
22
7
  <div class="outer">
23
8
  <div class="unit size3of4">
@@ -38,43 +23,47 @@
38
23
  </div>
39
24
  <div class="unit size1of3">
40
25
  <div class="unit size1of2">
41
- <%= label_tag @filter, :limit, "Limit of logs" %>
42
- <%= select_tag @filter, :limit, [50, 100, 200, 500, 1000] %>
43
- </div> <!-- unit -->
26
+ <div class="prm">
27
+ <%= select_tag @filter, :limit, [50, 100, 200, 500, 1000] %>
28
+ </div> <!-- prm -->
29
+ </div> <!-- unit -->
44
30
  <div class="unit size1of2">
45
- <div class="plm">
46
- <%= submit_tag :submit, "Filter", :class => "button primary" %>
47
- </div> <!-- plm -->
48
- </div> <!-- unit -->
49
- </div>
50
- </div> <!-- outer -->
51
- <div class="outer mvs">
52
- <div class="unit size1of3">
53
- <div class="unit size1of2">
54
- <div class="prm">
55
- <%= text_field_tag @filter, :application_name, :placeholder => "Application Name" %>
31
+ <div class="prm">
32
+ <%= text_field_tag @filter, :application_name, :placeholder => "Application Name" %>
33
+ </div>
56
34
  </div>
57
35
  </div>
58
- <div class="unit size1of2">
59
- <div class="prm">
60
- <%= text_field_tag @filter, :ip, :placeholder => "IP" %>
36
+ <div class="unit size1of3">
37
+ <div class="unit size1of2">
38
+ <div class="prm">
39
+ <%= text_field_tag @filter, :ip, :placeholder => "IP" %>
40
+ </div>
61
41
  </div>
62
- </div>
63
- </div>
64
- <div class="unit size1of3">
65
- <div class="unit size1of2">
66
- <div class="prm ptxs">
42
+ <div class="unit size1of2">
67
43
  <%= check_box_tag @filter, :is_exception %>
68
- <%= label_tag @filter, :is_exception, "Filter exceptions" %>
69
- </div>
70
- </div>
71
- <div class="unit size1of2">
72
- <div class="ptxs plm">
73
- <a href="<%=h url_path("overview") %>">Clear</a>
74
- </div> <!-- ptxs -->
44
+ <%= label_tag @filter, :is_exception, "Exceptions" %>
45
+ </div> <!-- unit -->
75
46
  </div> <!-- unit -->
76
- </div> <!-- unit -->
77
47
  </div> <!-- outer -->
48
+
49
+ <div class="outer">
50
+ <ul id="more_filter_list">
51
+ <% @filter.more_filters.each_with_index do |f_filter, index| %>
52
+ <li>
53
+ <%= partial(:"shared/dynamic_filter", :object => f_filter) %>
54
+ </li>
55
+ <% end %>
56
+ </ul>
57
+ <div class="mbs">
58
+ <a id="add_more_filter" href="<%=h url_path("add_filter") %>" class="add">+ Add Filter</a>
59
+ </div>
60
+
61
+ </div> <!-- outer -->
62
+
63
+ <div class="outer">
64
+ <%= submit_tag :submit, "Filter", :class => "button primary mrs" %> <a href="<%=h url_path("overview") %>">Clear</a>
65
+ </div> <!-- outer -->
66
+
78
67
  </form>
79
68
  </div> <!-- filter -->
80
69
 
@@ -86,8 +75,8 @@
86
75
  <th>Received</th>
87
76
  <th>Controller</th>
88
77
  <th>Action</th>
78
+ <th>Method</th>
89
79
  <th>IP</th>
90
- <th>URL</th>
91
80
  <th>Runtime</th>
92
81
  </tr>
93
82
 
@@ -0,0 +1,30 @@
1
+ <div class="outer mvs">
2
+ <div class="unit size1of3">
3
+ <div class="unit size1of2">
4
+ <div class="prm">
5
+ <%= select_tag dynamic_filter, :type, MongodbLogger::ServerModel::AdditionalFilter::VAR_TYPES %>
6
+ </div> <!-- prm -->
7
+ </div> <!-- unit -->
8
+ <div class="unit size1of2">
9
+ <div class="prm">
10
+ <%= text_field_tag dynamic_filter, :key, :placeholder => "key" %>
11
+ </div> <!-- prm -->
12
+ </div> <!-- unit -->
13
+ </div>
14
+ <div class="unit size1of3">
15
+ <div class="unit size1of2">
16
+ <div class="prm">
17
+ <%= select_tag dynamic_filter, :condition, MongodbLogger::ServerModel::AdditionalFilter::DEFAULT_CONDITIONS %>
18
+ </div> <!-- prm -->
19
+ </div>
20
+ <div class="unit size1of2">
21
+ <div class="prm">
22
+ <%= text_field_tag dynamic_filter, :value, :placeholder => "value" %>
23
+ </div> <!-- prm -->
24
+ </div>
25
+ </div>
26
+ <div class="unit size1of3">
27
+ <a href="#" class="close_more_filter">Close</a>
28
+ </div> <!-- unit -->
29
+
30
+ </div>
@@ -1,8 +1,8 @@
1
1
  <tr class="log_info" data-url="<%=h url_path("log_info/#{log['_id']}") %>">
2
- <td><span class="<%= log['is_exception'] ? "error" : "notice" %>"></span> <%=h log['request_time']%></td>
3
- <td><%=h log['controller']%></td>
4
- <td><%=h log['action']%></td>
5
- <td><%=h log['ip']%></td>
6
- <td class="url_log"><%=h log['url']%></td>
7
- <td><%=h log['runtime']%></td>
2
+ <td class="td-time"><span class="<%= log['is_exception'] ? "error" : "notice" %>"></span> <%=h log['request_time']%></td>
3
+ <td class="td-controller"><%=h log['controller']%></td>
4
+ <td class="td-action"><%=h log['action']%></td>
5
+ <td class="url_log"><%=h log['method']%></td>
6
+ <td class="td-ip"><%=h log['ip']%></td>
7
+ <td class="td-runtime"><%=h log['runtime']%></td>
8
8
  </tr>
@@ -1,18 +1,18 @@
1
1
  <div class="pas">
2
- <div class="unit-right ptxs">
3
- <a href="<%=h url_path("log/#{log_info['_id']}") %>" target="_blank">More Info</a>
2
+ <div class="unit-right">
3
+ <a href="<%=h url_path("log/#{log_info['_id']}") %>" data-pjax='#main_pjax' class="button small grey">More Info</a>
4
4
  </div> <!-- unit-right -->
5
5
  <h2 class="phs mvs"><span class="<%= log_info['is_exception'] ? 'failure' : 'success' %>">Message</span></h2>
6
6
  <div class="phs wrap_text">
7
- <% if log_info['is_exception'] %>
7
+ <% if log_info['is_exception'] && log_info['messages'] && log_info['messages']['error'] %>
8
8
  Error: <%= log_info['messages']['error'].join("\n").truncate(300, :separator => ' ') %>
9
- <% else %>
9
+ <% elsif log_info['messages'] && log_info['messages']['info'] %>
10
10
  Info: <%= log_info['messages']['info'].join("\n").truncate(300, :separator => ' ') %>
11
11
  <% end %>
12
12
  </div> <!-- phs -->
13
- <h2 class="phs mtm mbs">URL</h2>
13
+ <h2 class="phs mtm mbs">URL (method: <%=h log_info['method'] %>)</h2>
14
14
  <div class="phs wrap_text">
15
- <%=h log_info['url']%>
15
+ <a href="<%=h log_info['url']%>" target="_blank"><%=h log_info['url']%></a>
16
16
  </div> <!-- phs -->
17
17
  <h2 class="phs mtm mbs">Received</h2>
18
18
  <div class="phs">
@@ -20,6 +20,8 @@
20
20
  </div> <!-- phs -->
21
21
  <h2 class="phs mtm mbs">IP</h2>
22
22
  <div class="phs">
23
- <%=h log_info['ip']%>
23
+ <a href="http://www.infosniper.net/index.php?ip_address=<%=h log_info['ip']%>&map_source=1&overview_map=1&lang=1&map_type=1&zoom_level=7" target="_blank">
24
+ <%=h log_info['ip']%>
25
+ </a>
24
26
  </div> <!-- phs -->
25
27
  </div> <!-- pas -->
@@ -0,0 +1,15 @@
1
+ <li class="outer pvs phm">
2
+ <div class="unit size1of5">
3
+ <span class="pale">Messages:</span>
4
+ </div> <!-- unit -->
5
+ <div class="unit size4of5">
6
+ <ul class="message_tabs">
7
+ <% message_tabs.each do |key, val| %>
8
+ <li class='message_tab <%='active' if key == message_tabs.keys.first %>' data-tab='tab_<%=key %>'><%=key.capitalize %></li>
9
+ <% end %>
10
+ </ul>
11
+ <% message_tabs.each do |key, val| %>
12
+ <pre class="tab_<%=key %> tab_content <%='hidden' unless key == message_tabs.keys.first %>"><code><%=h (val.is_a?(Array) ? val.join("\n") : val) %></code></pre>
13
+ <% end %>
14
+ </div> <!-- unit -->
15
+ </li>
@@ -1,4 +1,4 @@
1
1
  <ul class="unit">
2
- <li class="active"><a href="<%=h url_path("overview") %>">Logs</a></li>
3
- <li><a href="#">Graphs</a></li>
2
+ <li <%= class_if_current(url_path("overview")) %>><a href="<%=h url_path("overview") %>" data-pjax='#main_pjax'>Logs</a></li>
3
+ <li><a href="#" title="Comming soon..." class="not-implemented">Graphs</a></li>
4
4
  </ul>
@@ -0,0 +1,13 @@
1
+ <div id="tail_logs_block">
2
+ <div class="initial">
3
+ <a id="tail_logs_link" href="#" data-url="<%=h url_path("tail_logs") %>" class="button mts mrs">
4
+ <span class="start" data-url="<%=h url_path("tail_logs") %>">Tail</span>
5
+ </a>
6
+ </div>
7
+ <div class="info">
8
+ <span id="tail_logs_time" class="logs-time mrs"></span>
9
+ <a id="tail_logs_stop_link" href="#" class="button negative mts mrs">
10
+ <span class="stop">Stop</span>
11
+ </a>
12
+ </div>
13
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="topline">
2
+ <%= partial(:"shared/tabs") %>
3
+ <div class="unit-right">
4
+ <% yield_content :right_top_panel %>
5
+ </div> <!-- unit-right -->
6
+ <div id="ajax_loader"><img src="<%=u 'images/spinner.gif'%>" alt="loading..."></div>
7
+ </div> <!-- topline -->