runit-man 2.4.8 → 2.4.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/i18n/en.yml +5 -4
- data/i18n/ru.yml +5 -4
- data/lib/runit-man/app.rb +2 -2
- data/lib/runit-man/helpers.rb +12 -8
- data/lib/runit-man/service_info/logger.rb +1 -0
- data/lib/runit-man/service_info/svlogd.rb +1 -0
- data/lib/runit-man/version.rb +1 -1
- data/views/log_downloads.haml +2 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/i18n/en.yml
CHANGED
@@ -73,10 +73,11 @@ en:
|
|
73
73
|
file_name: File name
|
74
74
|
file_size: File size
|
75
75
|
about_utc: All times for log files are represented in UTC.
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
B: B
|
77
|
+
KB: KB
|
78
|
+
MB: MB
|
79
|
+
GB: GB
|
80
|
+
TB: TB
|
80
81
|
view_file:
|
81
82
|
raw: Raw
|
82
83
|
title: 'File %{file} on %{host}'
|
data/i18n/ru.yml
CHANGED
@@ -75,10 +75,11 @@ ru:
|
|
75
75
|
file_name: Имя файла
|
76
76
|
file_size: Размер файла
|
77
77
|
about_utc: Все времена для файлов представлены в формате UTC.
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
78
|
+
B: Б
|
79
|
+
KB: КБ
|
80
|
+
MB: МБ
|
81
|
+
GB: ГБ
|
82
|
+
TB: ТБ
|
82
83
|
view_file:
|
83
84
|
raw: Текст
|
84
85
|
title: 'Файл %{file} на %{host}'
|
data/lib/runit-man/app.rb
CHANGED
@@ -243,11 +243,11 @@ class RunitMan::App < Sinatra::Base
|
|
243
243
|
}
|
244
244
|
end
|
245
245
|
|
246
|
-
get %r[\A/([^/]+)/log\-download/(.+)\z] do |name, file_name|
|
246
|
+
get %r[\A/([^/]+)/log\-download/((.+)/)(.+)\z] do |name, file_date_wd, file_date, file_name|
|
247
247
|
srv = ServiceInfo.klass[name]
|
248
248
|
return not_found if srv.nil? || !srv.logged?
|
249
249
|
|
250
|
-
f = srv.all_log_file_locations.detect { |f| f[:name] == file_name }
|
250
|
+
f = srv.all_log_file_locations.detect { |f| ( f[:name] == file_name ) && ( f[:subdir] == file_date ) }
|
251
251
|
return not_found unless f
|
252
252
|
|
253
253
|
send_file(f[:path], :type => 'text/plain', :disposition => 'attachment', :filename => f[:label], :last_modified => f[:modified].httpdate)
|
data/lib/runit-man/helpers.rb
CHANGED
@@ -87,22 +87,26 @@ module Helpers
|
|
87
87
|
|
88
88
|
KILOBYTE = 1024
|
89
89
|
MEGABYTE = 1024 * KILOBYTE
|
90
|
-
GIGABYTE =
|
90
|
+
GIGABYTE = 1024 * MEGABYTE
|
91
|
+
TERABYTE = 1024 * GIGABYTE
|
91
92
|
|
92
93
|
def human_bytes(bytes)
|
93
94
|
sign = (bytes >= 0) ? '' : '-'
|
94
|
-
suffix = '
|
95
|
+
suffix = 'B'
|
95
96
|
bytes = bytes.abs.to_f
|
96
97
|
|
97
|
-
if bytes
|
98
|
+
if bytes >= TERABYTE
|
99
|
+
bytes /= TERABYTE
|
100
|
+
suffix = 'TB'
|
101
|
+
elsif bytes >= GIGABYTE
|
98
102
|
bytes /= GIGABYTE
|
99
|
-
suffix = '
|
100
|
-
elsif bytes
|
103
|
+
suffix = 'GB'
|
104
|
+
elsif bytes >= MEGABYTE
|
101
105
|
bytes /= MEGABYTE
|
102
|
-
suffix = '
|
103
|
-
elsif bytes
|
106
|
+
suffix = 'MB'
|
107
|
+
elsif bytes >= KILOBYTE
|
104
108
|
bytes /= KILOBYTE
|
105
|
-
suffix = '
|
109
|
+
suffix = 'KB'
|
106
110
|
end
|
107
111
|
|
108
112
|
bytes = ((bytes * 100 + 0.5).to_i.to_f / 100)
|
data/lib/runit-man/version.rb
CHANGED
data/views/log_downloads.haml
CHANGED
@@ -18,6 +18,7 @@
|
|
18
18
|
%td= h(f[:label])
|
19
19
|
%td{:title=>h(f[:size])}= h(human_bytes(f[:size]))
|
20
20
|
%td
|
21
|
-
|
21
|
+
- filenamewithsubdir = f[:subdir] ? h(f[:subdir])+'/'+h(f[:name]) : h(f[:name])
|
22
|
+
%a{:href=>"/#{h(name)}/log-download/#{filenamewithsubdir}"}
|
22
23
|
= h(t('runit.services.log.download'))
|
23
24
|
…
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runit-man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yajl-ruby
|
@@ -340,7 +340,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
340
340
|
version: '0'
|
341
341
|
segments:
|
342
342
|
- 0
|
343
|
-
hash:
|
343
|
+
hash: 375963765489978018
|
344
344
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
345
345
|
none: false
|
346
346
|
requirements:
|
@@ -349,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
349
349
|
version: '0'
|
350
350
|
segments:
|
351
351
|
- 0
|
352
|
-
hash:
|
352
|
+
hash: 375963765489978018
|
353
353
|
requirements:
|
354
354
|
- none
|
355
355
|
rubyforge_project:
|