peephole 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ea3268b56a4ed62613506d02095fc7d8be9fbac
4
- data.tar.gz: eaadaa16856b6a0bdb29e08387ad4936f9464405
3
+ metadata.gz: 78cddca7600297343733b12cac8880dd29172ba8
4
+ data.tar.gz: 66b37510f289bdf360beddcf338b0cbb3fdc6862
5
5
  SHA512:
6
- metadata.gz: 401955834465d9f94e97afe73437b946ab310f6817aa3b07b1d6d6dbc5425f573daa0ac3d42efdbc7c7037facd8c52ed09ed0175ac2c7b87579f9a8549046d1b
7
- data.tar.gz: 0be4f7d7f6ce0bc9f27f4528b1fc9bac0142404ae2c010ee3ccbbd334fad01b43c58984e40d5f97c5b79b5290b19e7e7d95150372bc4017600523d7bce78e525
6
+ metadata.gz: 17ff8e08ba2c0f865b8510b896cb674642256292c713d84678ce64d4b47c4401bb4defaa5829521aabe0ca467493f51c674ce74c7b07fdeafaee3279a9d4d594
7
+ data.tar.gz: b86a309ea1a87a9bcfd95c8375f02f317a01776c23ecac99f8b60a5ac99dc34b1cb5b92db91798fca13519e6fa062f6a5b58310e506ef62e083488de61b664e6
data/README.md CHANGED
@@ -34,7 +34,7 @@ Peephole.configure do |config|
34
34
  # admin_user_signed_in?
35
35
 
36
36
  # authenticate_or_request_with_http_basic do |user, pass|
37
- # user == 'user' && pass == 'pass'
37
+ # user == ENV['PEEPHOLE_USER'] && pass == ENV['PEEPHOLE_PASS']
38
38
  # end
39
39
  end
40
40
  end
@@ -55,5 +55,5 @@ MIT
55
55
 
56
56
  ## Author
57
57
 
58
- [@tnantoka][https://twitter.com/tnantoka]
58
+ [@tnantoka](https://twitter.com/tnantoka)
59
59
 
@@ -1,11 +1,15 @@
1
- #peephole .table pre {
2
- margin-bottom: 0;
3
- }
1
+ /* Modules */
4
2
 
5
3
  #peephole .text-break {
6
4
  word-break: break-all;
7
5
  }
8
6
 
7
+ /* Override */
8
+
9
+ #peephole .table pre {
10
+ margin-bottom: 0;
11
+ }
12
+
9
13
  #peephole .navbar {
10
14
  border-left: 0;
11
15
  border-right: 0;
@@ -19,12 +23,18 @@
19
23
  box-shadow: none;
20
24
  }
21
25
 
26
+ #peephole .pager {
27
+ text-align: left;
28
+ margin-top: 0;
29
+ }
30
+
22
31
  #peephole .btn,
23
32
  #peephole .navbar,
24
33
  #peephole .breadcrumb,
25
34
  #peephole .pager li a,
26
35
  #peephole .well,
27
36
  #peephole pre,
28
- #peephole .label {
37
+ #peephole .label,
38
+ #peephole .form-control {
29
39
  border-radius: 0;
30
40
  }
@@ -35,5 +35,13 @@ module Peephole
35
35
  def loglines(page)
36
36
  Logline.where(path, page)
37
37
  end
38
+
39
+ def size
40
+ File.size(path) / 1024
41
+ end
42
+
43
+ def updated_at
44
+ File.mtime(path)
45
+ end
38
46
  end
39
47
  end
@@ -1,24 +1,37 @@
1
- <nav>
2
- <ul class="pager">
3
- <% if @page == 1 %>
4
- <li class="previous disabled"><a>&larr; Older</a></li>
5
- <% else %>
6
- <li class="previous">
7
- <%= link_to url_for(params.merge(page: @page - 1)) do %>
8
- &larr; Older
1
+ <div class="row">
2
+ <div class="col-sm-10">
3
+ <nav>
4
+ <ul class="pager">
5
+ <% if @page == 1 %>
6
+ <li class="disabled"><a>&larr; Older</a></li>
7
+ <% else %>
8
+ <li>
9
+ <%= link_to url_for(params.merge(page: @page - 1)) do %>
10
+ &larr; Older
11
+ <% end %>
12
+ </li>
9
13
  <% end %>
10
- </li>
11
- <% end %>
12
- <% if @eof %>
13
- <li class="next disabled"><a>Newer &rarr;</a></li>
14
- <% else %>
15
- <li class="next">
16
- <%= link_to url_for(params.merge(page: @page + 1)) do %>
17
- Newer &rarr;
14
+ <% if @eof %>
15
+ <li class="disabled"><a>Newer &rarr;</a></li>
16
+ <% else %>
17
+ <li>
18
+ <%= link_to url_for(params.merge(page: @page + 1)) do %>
19
+ Newer &rarr;
20
+ <% end %>
21
+ </li>
18
22
  <% end %>
19
- </li>
20
- <% end %>
21
- </ul>
22
- </nav>
23
-
23
+ </ul>
24
+ </nav>
25
+ </div>
26
+ <div class="col-sm-2">
27
+ <form action="<%= url_for(params) %>">
28
+ <div class="input-group">
29
+ <input type="number" name="page" value="<%= @page %>" class="form-control" placeholder="Page">
30
+ <span class="input-group-btn">
31
+ <input type="submit" class="btn btn-default" value="Go">
32
+ </span>
33
+ </div>
34
+ </form>
35
+ </div>
36
+ </div>
24
37
 
@@ -7,6 +7,8 @@
7
7
  <% @logfiles.each do |logfile| %>
8
8
  <tr>
9
9
  <td><%= link_to logfile.filename, logfile_path(logfile) %></td>
10
+ <td><%= logfile.size %> KB</td>
11
+ <td><%= logfile.updated_at %></td>
10
12
  <td class="text-right">
11
13
  <%= link_to 'Download', download_logfile_path(logfile), class: 'btn btn-default btn-sm' %>
12
14
  </td>
@@ -1,3 +1,3 @@
1
1
  module Peephole
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peephole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - tnantoka