tailog 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/logs/index.erb +4 -4
- data/app/views/logs/list.erb +0 -1
- data/lib/tailog/version.rb +1 -1
- data/lib/tailog.rb +7 -3
- 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: 416d865f7f5f53cb6df3b7b7ebca932defe1fdf2
|
4
|
+
data.tar.gz: 7351b02573c0371d02f2d0fe87500e51ca9f4f10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44327da397ae3ad9df7b8698832df1702b48f89364a9297409ef1132876fcea875700c9aeceab1a0fcbf644b7afe2d7a664fb99a993fc443a6a85264d468bcc5
|
7
|
+
data.tar.gz: e2a43294cc467fb187a57729134ed45eae92d7cf7255539dab12ed09cd88ca87e1558f42c7330aeb45d5fe5f9da6c2c30c99f63ceaaa21c8ee7ae90b37331de3
|
data/app/views/logs/index.erb
CHANGED
@@ -7,9 +7,7 @@
|
|
7
7
|
<h3 class="page-header"><%= file_path %></h3>
|
8
8
|
|
9
9
|
<% File.open file_path do |file| %>
|
10
|
-
<div id="content">
|
11
|
-
<%= erb :'logs/list', locals: { file: file.tail(100).join("\n") } %>
|
12
|
-
</div>
|
10
|
+
<div id="content"></div>
|
13
11
|
<% end %>
|
14
12
|
|
15
13
|
<script type="text/javascript">
|
@@ -31,7 +29,9 @@
|
|
31
29
|
|
32
30
|
if (!data.content) return;
|
33
31
|
var shouldScrollToBottom = $window.scrollTop() + $window.height() == $document.height();
|
34
|
-
$
|
32
|
+
$content
|
33
|
+
.append('<p class="text-info">' + data.server_uuid + '</p>')
|
34
|
+
.append(data.content);
|
35
35
|
|
36
36
|
if (shouldScrollToBottom) {
|
37
37
|
$window.scrollTop($document.height() - $window.height());
|
data/app/views/logs/list.erb
CHANGED
data/lib/tailog/version.rb
CHANGED
data/lib/tailog.rb
CHANGED
@@ -40,9 +40,13 @@ module Tailog
|
|
40
40
|
file_path = File.join Tailog.log_path, params[:file]
|
41
41
|
file = File.open file_path
|
42
42
|
file_size = file.size
|
43
|
-
seek = params[:seek] && params[:seek][Tailog.server_uuid]
|
44
|
-
|
45
|
-
|
43
|
+
tail = if seek = params[:seek] && params[:seek][Tailog.server_uuid]
|
44
|
+
file.seek seek.to_i
|
45
|
+
file
|
46
|
+
else
|
47
|
+
file.tail(100).join("\n")
|
48
|
+
end
|
49
|
+
content = erb :'logs/list', locals: { file: tail }, layout: false
|
46
50
|
file.close
|
47
51
|
rescue => error
|
48
52
|
content = erb :error, locals: { error: error }, layout: false
|