wackamole 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.bnsignore +16 -0
- data/.gitignore +2 -0
- data/History.txt +4 -0
- data/README.rdoc +88 -0
- data/Rakefile +42 -0
- data/aa.rb +25 -0
- data/aaa.txt +13 -0
- data/bin/wackamole +77 -0
- data/lib/app.rb +63 -0
- data/lib/controllers/dashboard.rb +30 -0
- data/lib/controllers/features.rb +41 -0
- data/lib/controllers/logs.rb +49 -0
- data/lib/controllers/mission.rb +27 -0
- data/lib/controllers/users.rb +41 -0
- data/lib/helpers/dashboard_helper.rb +32 -0
- data/lib/helpers/features_helper.rb +13 -0
- data/lib/helpers/flash_helper.rb +16 -0
- data/lib/helpers/logs_helper.rb +116 -0
- data/lib/helpers/main_helper.rb +182 -0
- data/lib/helpers/mission_helper.rb +59 -0
- data/lib/helpers/rails_helper.rb +7 -0
- data/lib/wackamole.rb +47 -0
- data/lib/wackamole/core_ext/date_time.rb +8 -0
- data/lib/wackamole/core_ext/time.rb +9 -0
- data/lib/wackamole/models/control.rb +132 -0
- data/lib/wackamole/models/feature.rb +74 -0
- data/lib/wackamole/models/log.rb +45 -0
- data/lib/wackamole/models/mission.rb +164 -0
- data/lib/wackamole/models/mole_info.rb +94 -0
- data/lib/wackamole/models/search_filter.rb +192 -0
- data/lib/wackamole/models/user.rb +46 -0
- data/public/favicon.ico +0 -0
- data/public/images/.DS_Store +0 -0
- data/public/images/browsers/.DS_Store +0 -0
- data/public/images/browsers/MSIE 6.png +0 -0
- data/public/images/browsers/MSIE 8.0 +0 -0
- data/public/images/browsers/MSIE 8.0.png +0 -0
- data/public/images/browsers/chrome.png +0 -0
- data/public/images/browsers/firefox.png +0 -0
- data/public/images/browsers/ie 6.0.png +0 -0
- data/public/images/browsers/ie6.jpg +0 -0
- data/public/images/browsers/ie7.jpg +0 -0
- data/public/images/browsers/ie7.png +0 -0
- data/public/images/browsers/msie 6.0.png +0 -0
- data/public/images/browsers/msie 7.0.png +0 -0
- data/public/images/browsers/opera.jpg +0 -0
- data/public/images/browsers/opera.png +0 -0
- data/public/images/browsers/safari.jpg +0 -0
- data/public/images/browsers/safari.png +0 -0
- data/public/images/browsers/unknown_browser.png +0 -0
- data/public/images/close.png +0 -0
- data/public/images/error.png +0 -0
- data/public/images/fade.png +0 -0
- data/public/images/fault_big.png +0 -0
- data/public/images/fault_small.png +0 -0
- data/public/images/feature.png +0 -0
- data/public/images/h300.png +0 -0
- data/public/images/hori_large.png +0 -0
- data/public/images/info_big.png +0 -0
- data/public/images/info_small.png +0 -0
- data/public/images/loading.gif +0 -0
- data/public/images/loading1.gif +0 -0
- data/public/images/mole_error.png +0 -0
- data/public/images/more.gif +0 -0
- data/public/images/next.png +0 -0
- data/public/images/perf_big.png +0 -0
- data/public/images/perf_small.png +0 -0
- data/public/images/powered_by.png +0 -0
- data/public/images/prev.png +0 -0
- data/public/images/row_fade.png +0 -0
- data/public/images/search.png +0 -0
- data/public/images/small_logo.png +0 -0
- data/public/images/spaceball.gif +0 -0
- data/public/images/tick.png +0 -0
- data/public/images/users.png +0 -0
- data/public/images/wackamole_logo.png +0 -0
- data/public/javascripts/.DS_Store +0 -0
- data/public/javascripts/application.js +28 -0
- data/public/javascripts/g.dot.min.js +7 -0
- data/public/javascripts/g.raphael.min.js +7 -0
- data/public/javascripts/jit.js +9052 -0
- data/public/javascripts/jit.min.js +1 -0
- data/public/javascripts/jquery-ui.js +188 -0
- data/public/javascripts/jquery.example.js +160 -0
- data/public/javascripts/jquery.js +19 -0
- data/public/javascripts/jquery.tools.min.js +38 -0
- data/public/javascripts/jquery_ba-url.js +9 -0
- data/public/javascripts/jquery_min.js +19 -0
- data/public/javascripts/jquery_ui_min.js +298 -0
- data/public/javascripts/raphael.min.js +7 -0
- data/public/stylesheets/tabs-slideshow.css +95 -0
- data/public/stylesheets/wackamole.css +684 -0
- data/spec/config/bogus_test.yml +3 -0
- data/spec/config/test.yml +3 -0
- data/spec/core_ext/date_time_spec.rb +8 -0
- data/spec/core_ext/time_spec.rb +12 -0
- data/spec/data/fixtures.rb +92 -0
- data/spec/models/control_spec.rb +98 -0
- data/spec/models/feature_spec.rb +52 -0
- data/spec/models/log_spec.rb +43 -0
- data/spec/models/mission_spec.rb +225 -0
- data/spec/models/moled_info_spec.rb +30 -0
- data/spec/models/search_filter_spec.rb +151 -0
- data/spec/models/user_spec.rb +44 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/wackamole_spec.rb +20 -0
- data/tasks/bones.rake +20 -0
- data/tasks/fixtures.rake +13 -0
- data/tasks/gem.rake +201 -0
- data/tasks/git.rake +40 -0
- data/tasks/notes.rake +27 -0
- data/tasks/post_load.rake +32 -0
- data/tasks/rdoc.rake +54 -0
- data/tasks/rubyforge.rake +55 -0
- data/tasks/setup.rb +290 -0
- data/tasks/spec.rake +54 -0
- data/tasks/svn.rake +46 -0
- data/views/dashboard/_report.erb +118 -0
- data/views/dashboard/index.erb +4 -0
- data/views/dashboard/refresh_js.erb +3 -0
- data/views/features/_rows.erb +26 -0
- data/views/features/filter.js.erb +2 -0
- data/views/features/index.erb +24 -0
- data/views/features/index.js.erb +2 -0
- data/views/layout.erb +47 -0
- data/views/logs/_array.erb +12 -0
- data/views/logs/_hash.erb +14 -0
- data/views/logs/_rows.erb +65 -0
- data/views/logs/filter.js.erb +4 -0
- data/views/logs/index.erb +13 -0
- data/views/logs/index.js.erb +2 -0
- data/views/logs/show.erb +66 -0
- data/views/mission/_report.erb +49 -0
- data/views/mission/index.erb +7 -0
- data/views/mission/refresh_js.erb +3 -0
- data/views/shared/_filter.erb +63 -0
- data/views/shared/_flash.erb +3 -0
- data/views/shared/_search.erb +25 -0
- data/views/shared/_timestamp.erb +1 -0
- data/views/shared/_wait.erb +1 -0
- data/views/shared/flash.js.erb +10 -0
- data/views/users/_rows.erb +26 -0
- data/views/users/filter.js.erb +4 -0
- data/views/users/index.erb +24 -0
- data/views/users/index.js.erb +2 -0
- metadata +347 -0
data/tasks/spec.rake
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
|
2
|
+
require 'spec/rake/verify_rcov'
|
3
|
+
require 'spec/data/fixtures'
|
4
|
+
|
5
|
+
namespace :spec do
|
6
|
+
|
7
|
+
desc 'Run all specs with basic output'
|
8
|
+
Spec::Rake::SpecTask.new(:run) do |t|
|
9
|
+
t.ruby_opts = PROJ.ruby_opts
|
10
|
+
t.spec_opts = PROJ.spec.opts
|
11
|
+
t.spec_files = PROJ.spec.files
|
12
|
+
t.libs += PROJ.libs
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'Run all specs with text output'
|
16
|
+
Spec::Rake::SpecTask.new(:specdoc) do |t|
|
17
|
+
t.ruby_opts = PROJ.ruby_opts
|
18
|
+
t.spec_opts = PROJ.spec.opts + ['--format', 'specdoc']
|
19
|
+
t.spec_files = PROJ.spec.files
|
20
|
+
t.libs += PROJ.libs
|
21
|
+
end
|
22
|
+
|
23
|
+
if HAVE_RCOV
|
24
|
+
desc 'Run all specs with RCov'
|
25
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
26
|
+
t.ruby_opts = PROJ.ruby_opts
|
27
|
+
t.spec_opts = PROJ.spec.opts
|
28
|
+
t.spec_files = PROJ.spec.files
|
29
|
+
t.libs += PROJ.libs
|
30
|
+
t.rcov = true
|
31
|
+
t.rcov_dir = PROJ.rcov.dir
|
32
|
+
t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
|
33
|
+
end
|
34
|
+
|
35
|
+
RCov::VerifyTask.new(:verify) do |t|
|
36
|
+
t.threshold = PROJ.rcov.threshold
|
37
|
+
t.index_html = File.join(PROJ.rcov.dir, 'index.html')
|
38
|
+
t.require_exact_threshold = PROJ.rcov.threshold_exact
|
39
|
+
end
|
40
|
+
|
41
|
+
task :verify => :rcov
|
42
|
+
remove_desc_for_task %w(spec:clobber_rcov)
|
43
|
+
end
|
44
|
+
|
45
|
+
end # namespace :spec
|
46
|
+
|
47
|
+
desc 'Alias to spec:run'
|
48
|
+
task :spec => 'spec:run'
|
49
|
+
|
50
|
+
task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
|
51
|
+
|
52
|
+
end # if HAVE_SPEC_RAKE_SPECTASK
|
53
|
+
|
54
|
+
# EOF
|
data/tasks/svn.rake
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
if HAVE_SVN
|
2
|
+
|
3
|
+
unless PROJ.svn.root
|
4
|
+
info = %x/svn info ./
|
5
|
+
m = %r/^Repository Root:\s+(.*)$/.match(info)
|
6
|
+
PROJ.svn.root = (m.nil? ? '' : m[1])
|
7
|
+
end
|
8
|
+
PROJ.svn.root = File.join(PROJ.svn.root, PROJ.svn.path) unless PROJ.svn.path.empty?
|
9
|
+
|
10
|
+
namespace :svn do
|
11
|
+
|
12
|
+
# A prerequisites task that all other tasks depend upon
|
13
|
+
task :prereqs
|
14
|
+
|
15
|
+
desc 'Show tags from the SVN repository'
|
16
|
+
task :show_tags => 'svn:prereqs' do |t|
|
17
|
+
tags = %x/svn list #{File.join(PROJ.svn.root, PROJ.svn.tags)}/
|
18
|
+
tags.gsub!(%r/\/$/, '')
|
19
|
+
tags = tags.split("\n").sort {|a,b| b <=> a}
|
20
|
+
puts tags
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Create a new tag in the SVN repository'
|
24
|
+
task :create_tag => 'svn:prereqs' do |t|
|
25
|
+
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
|
26
|
+
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
|
27
|
+
|
28
|
+
svn = PROJ.svn
|
29
|
+
trunk = File.join(svn.root, svn.trunk)
|
30
|
+
tag = "%s-%s" % [PROJ.name, PROJ.version]
|
31
|
+
tag = File.join(svn.root, svn.tags, tag)
|
32
|
+
msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
|
33
|
+
|
34
|
+
puts "Creating SVN tag '#{tag}'"
|
35
|
+
unless system "svn cp -m '#{msg}' #{trunk} #{tag}"
|
36
|
+
abort "Tag creation failed"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end # namespace :svn
|
41
|
+
|
42
|
+
task 'gem:release' => 'svn:create_tag'
|
43
|
+
|
44
|
+
end # if PROJ.svn.path
|
45
|
+
|
46
|
+
# EOF
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<div class="section" id="summary">
|
2
|
+
<p class="title">Current status</p>
|
3
|
+
<ul id="summary">
|
4
|
+
<li>
|
5
|
+
<p class="status">Users</p>
|
6
|
+
<div id="user_load" class="load"></div>
|
7
|
+
</li>
|
8
|
+
<li>
|
9
|
+
<p class="status">Features</p>
|
10
|
+
<div id="feature_load" class="load"></div>
|
11
|
+
<li>
|
12
|
+
<p class="status">Performance</p>
|
13
|
+
<p class="result"><%=pluralize( @info[:perf_load], 'issue' )%></p>
|
14
|
+
</li>
|
15
|
+
<li>
|
16
|
+
<p class="status">Uncaught Exceptions</p>
|
17
|
+
<p class="result"><%=pluralize( @info[:fault_load], 'issue' )%></p>
|
18
|
+
</li>
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="section" id="activity">
|
23
|
+
<p class="title">Today's activities</p>
|
24
|
+
<ul class="section">
|
25
|
+
<li>
|
26
|
+
<p id="faults">Faults</p>
|
27
|
+
<% unless zeroed_series?( @info[:fault_series] ) %>
|
28
|
+
<div class="heat" id="svg_faults"></div>
|
29
|
+
<% else %>
|
30
|
+
<p class="no_report">No Issues reported.</p>
|
31
|
+
<% end %>
|
32
|
+
</li>
|
33
|
+
<li>
|
34
|
+
<p id="perfs">Performance</p>
|
35
|
+
<% unless zeroed_series?( @info[:perf_series] ) %>
|
36
|
+
<div class="heat" id="svg_perf"></div>
|
37
|
+
<% else %>
|
38
|
+
<p class='no_report'>No Issues reported.</p>
|
39
|
+
<% end %>
|
40
|
+
</li>
|
41
|
+
<li>
|
42
|
+
<p id="users">Users</p>
|
43
|
+
<% unless zeroed_series?( @info[:user_series] ) %>
|
44
|
+
<div class="heat" id="svg_users"></div>
|
45
|
+
<% else %>
|
46
|
+
<p class='no_report'>No Users reported.</p>
|
47
|
+
<% end %>
|
48
|
+
</li>
|
49
|
+
<li>
|
50
|
+
<p id="features">Features</p>
|
51
|
+
<% unless zeroed_series?( @info[:feature_series] ) %>
|
52
|
+
<div class="heat" id="svg_features"></div>
|
53
|
+
<% else %>
|
54
|
+
<p class="no_report">No Features reported.</p>
|
55
|
+
<% end %>
|
56
|
+
</li>
|
57
|
+
</ul>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<script>
|
61
|
+
function gen_load( name, value, total )
|
62
|
+
{
|
63
|
+
var p = Raphael( name, 300, 20 );
|
64
|
+
var range = Math.ceil( ((value/total)*100)/10 );
|
65
|
+
var x = 2;
|
66
|
+
var y = 2;
|
67
|
+
var spacer = 5;
|
68
|
+
|
69
|
+
for( var i=1; i <= range; i++ )
|
70
|
+
{
|
71
|
+
var l = p.rect( x, y, 10, 16, 2 );
|
72
|
+
l.attr( 'fill', 'green' );
|
73
|
+
l.attr( 'gradient', '45-#0f0-#fff' );
|
74
|
+
l.attr( 'stroke-width', 0 );
|
75
|
+
x += 10 + spacer;
|
76
|
+
|
77
|
+
}
|
78
|
+
var text = p.text( 230, 10, Math.ceil((value/total)*100) + '% (' + value + " of " + total + ')' );
|
79
|
+
text.attr( 'fill' , '#434343' );
|
80
|
+
text.attr( 'font-size', 15 );
|
81
|
+
}
|
82
|
+
|
83
|
+
function gen_heat_map( id, series, symbol )
|
84
|
+
{
|
85
|
+
var r = Raphael( id ),
|
86
|
+
xs = <%= (0..23).to_a.to_json %>,
|
87
|
+
ys = <%= y = [];24.times{ y << 1 };y.to_json %>,
|
88
|
+
axisy = <%= %w[Mon].to_json %>,
|
89
|
+
axisx = <%= %w[12am 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11].to_json %>;
|
90
|
+
|
91
|
+
r.g.dotchart(0, -10, 620, 60, xs, ys, series, {symbol: symbol, max: 10, heat: true, axis: "0 0 1 0", axisxstep: 23, axisystep: 1, axisxlabels: axisx, axisxtype: " ", axisytype: " ", axisylabels: axisy}).hover(function () {
|
92
|
+
this.tag = this.tag || r.g.tag(this.x, this.y, this.value, 0, this.r + 2).insertBefore(this);
|
93
|
+
this.tag.show();
|
94
|
+
}, function () {
|
95
|
+
this.tag && this.tag.hide();
|
96
|
+
});
|
97
|
+
}
|
98
|
+
|
99
|
+
$( function() {
|
100
|
+
$('a.dash').addClass( 'current' );
|
101
|
+
|
102
|
+
gen_load( 'user_load' , <%=@info[:user_load]%>, <%=@info[:total_users]%> );
|
103
|
+
gen_load( 'feature_load', <%=@info[:feature_load]%>, <%=@info[:total_features]%> );
|
104
|
+
|
105
|
+
<% unless zeroed_series?( @info[:fault_series] ) %>
|
106
|
+
gen_heat_map( 'svg_faults' , <%=@info[:fault_series].to_json%> , 'cross' );
|
107
|
+
<% end %>
|
108
|
+
<% unless zeroed_series?( @info[:perf_series] ) %>
|
109
|
+
gen_heat_map( 'svg_perf' , <%=@info[:perf_series].to_json%> , 'diamond' );
|
110
|
+
<% end %>
|
111
|
+
<% unless zeroed_series?( @info[:user_series] ) %>
|
112
|
+
gen_heat_map( 'svg_users' , <%=@info[:user_series].to_json%> , 'disc' );
|
113
|
+
<% end %>
|
114
|
+
<% unless zeroed_series?( @info[:user_series] ) %>
|
115
|
+
gen_heat_map( 'svg_features', <%=@info[:feature_series].to_json%>, 'flower' );
|
116
|
+
<% end %>
|
117
|
+
});
|
118
|
+
</script>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div class="page_entries">
|
2
|
+
<%= page_entries_info @features, :entry_name => 'features' %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div id="content">
|
6
|
+
<table border="0" class="logs">
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th width="25%">Feature</th>
|
10
|
+
<th align='right' width="5%">Totals</th>
|
11
|
+
<tr>
|
12
|
+
</thead>
|
13
|
+
<tbody>
|
14
|
+
<% count=0;@features.each do |row| %>
|
15
|
+
<% color = count % 2 == 0 ? 'transparent' : 'transparent url(/images/fade.png) repeat-x' %>
|
16
|
+
<tr style="background:<%=color%>">
|
17
|
+
<td><b><%=display_context( row[:name] )%></b></td>
|
18
|
+
<td align="right"><b><%=row[:total]%></b></td>
|
19
|
+
</tr>
|
20
|
+
<% count+=1;end %>
|
21
|
+
</tbody>
|
22
|
+
</table>
|
23
|
+
</div>
|
24
|
+
<div class="pages">
|
25
|
+
<%= will_paginate @features, :previous_label => " ", :next_label => " ", :params => { :url => "/features" } %>
|
26
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= partial :'shared/filter' %>
|
2
|
+
|
3
|
+
<div id="features">
|
4
|
+
<%= partial :'features/rows' %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<script>
|
8
|
+
$( function() {
|
9
|
+
$('a.features').addClass( 'current' );
|
10
|
+
|
11
|
+
$('a.nav_link').click( function() {
|
12
|
+
$("a.nav_link").removeClass( "current" );
|
13
|
+
$(this).addClass( 'current' );
|
14
|
+
return true;
|
15
|
+
});
|
16
|
+
|
17
|
+
$('.pagination a').live( 'click', function() {
|
18
|
+
$("#content").html( '<%=partial :"shared/wait"%>' );
|
19
|
+
$.getScript( this.href );
|
20
|
+
return false;
|
21
|
+
});
|
22
|
+
});
|
23
|
+
</script>
|
24
|
+
|
data/views/layout.erb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3
|
+
<head>
|
4
|
+
<title>W A C K a M O L E</title>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<link rel="icon" href="/images/small_logo.png" type="image/x-icon"/>
|
7
|
+
<link rel="shortcut icon" href="/images/small_logo.png" type="image/x-icon"/>
|
8
|
+
<%= stylesheets %w[wackamole] %>
|
9
|
+
<%= javascripts %w[jquery_min jquery_ui_min jquery.tools.min jquery.example application raphael.min g.raphael.min g.dot.min] %>
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body id="body">
|
13
|
+
<div id="overall">
|
14
|
+
<div id="logo" style="margin-bottom:50px">
|
15
|
+
<%= link_to image_tag( 'wackamole_logo.png', :border => 0 ), '/mission' %>
|
16
|
+
</div>
|
17
|
+
<div id="app_info">
|
18
|
+
<% if @app_info %>
|
19
|
+
<ul>
|
20
|
+
<li><<%=@app_info[:app_name]%>></li>
|
21
|
+
<li id="env"><%=@app_info[:stage]%></li>
|
22
|
+
<ul>
|
23
|
+
<% end %>
|
24
|
+
<p id="timestamp"><%=partial :'shared/timestamp'%></p>
|
25
|
+
</div>
|
26
|
+
<div id="main">
|
27
|
+
<div class="flash"></div>
|
28
|
+
<% if @app_info %>
|
29
|
+
<div id='navigation'>
|
30
|
+
<%=link_to "mission control", "/mission" , :class => "site_link land" %> •
|
31
|
+
<%=link_to "dashboard" , "/dashboard/#{@app_info[:app_name]}/#{@app_info[:stage]}", :class => "site_link dash" %> •
|
32
|
+
<%=link_to "logs" , "/logs/1" , :class => "site_link logs" %> •
|
33
|
+
<%=link_to "features" , "/features/1" , :class => "site_link features" %> •
|
34
|
+
<%=link_to "users" , "/users/1" , :class => "site_link users" %>
|
35
|
+
</div>
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
<%= yield %>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="footer" style="text-align:right">
|
42
|
+
<%= link_to image_tag( 'powered_by.png', :border => 0 ), "http://www.rackamole.com", :target => "#" %>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
</body>
|
47
|
+
</html>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<div class="page_entries">
|
2
|
+
<%= page_entries_info @logs, :entry_name => 'log' %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div id="content">
|
6
|
+
<table class="logs">
|
7
|
+
<thead>
|
8
|
+
<th width="20%">Context</th>
|
9
|
+
<th width="5%">Method</th>
|
10
|
+
<th width="20%">User</th>
|
11
|
+
<th width="10%">IP</th>
|
12
|
+
<th width="10%">Server</th>
|
13
|
+
<th width="10%">Date</th>
|
14
|
+
<th align="right" width="5%">Timing</th>
|
15
|
+
<th align="right" width="3%"> </th>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
<% count=0;@logs.each do |log| %>
|
19
|
+
<tr class="<%=row_class_for log['typ'] %>" href="<%="/logs/#{log['_id']}/show"%>" rel='#details'>
|
20
|
+
<td><%=context_for log['fid'] %></td>
|
21
|
+
<td><%=log['met']%></td>
|
22
|
+
<td><%=truncate( user_name_for( log['uid'] ), 30 )%></td>
|
23
|
+
<td><%=log['ip']%></td>
|
24
|
+
<td><%=format_host( log['hos'] )%></td>
|
25
|
+
<td><%=timestamp_for log %></td>
|
26
|
+
<td align="right"><%=request_time( log['rti'] )%></td>
|
27
|
+
<td align="right"><%=browser_icon( log['bro'] )%></td>
|
28
|
+
</tr>
|
29
|
+
<% count+=1;end %>
|
30
|
+
</body>
|
31
|
+
</table>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="pages">
|
35
|
+
<%= will_paginate @logs, :previous_label => " ", :next_label => " ", :params => { :url => "/logs" } %>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div class="overlay" id="details">
|
39
|
+
<div class="ov_content"></div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<script>
|
43
|
+
$( function() {
|
44
|
+
$( "tr[rel]").hover(
|
45
|
+
function() {
|
46
|
+
$(this).addClass( 'highlight' );
|
47
|
+
},
|
48
|
+
function() {
|
49
|
+
$(this).removeClass( 'highlight' );
|
50
|
+
}
|
51
|
+
);
|
52
|
+
$( "tr[rel]" ).overlay( {
|
53
|
+
expose: 'gray',
|
54
|
+
onBeforeLoad: function() {
|
55
|
+
var wrap = this.getContent().find( '.ov_content' );
|
56
|
+
wrap.load( this.getTrigger().attr( 'href' ) );
|
57
|
+
}
|
58
|
+
});
|
59
|
+
$('.pagination a').live( 'click', function() {
|
60
|
+
$("#content").html( '<%=partial :"shared/wait"%>' );
|
61
|
+
$.getScript( this.href );
|
62
|
+
return false;
|
63
|
+
});
|
64
|
+
});
|
65
|
+
</script>
|