log_sense 1.5.0 → 1.5.1

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
  SHA256:
3
- metadata.gz: '0128717b2ba709bc5dfbb7b755762a757c575ad4307159910cc894aaa3b88f42'
4
- data.tar.gz: e05054b8eee79a439f5b077e60bc0d95a3e7706c550853333d7d631c458abf91
3
+ metadata.gz: 1f20a0d2041df1f2414bd0015fff27764c28a89dfd2d45fdb275141638bc5784
4
+ data.tar.gz: 14426b7383fe9b0077c2852f177545384a369f35489aa5d95372c20cbe19732d
5
5
  SHA512:
6
- metadata.gz: 9d9e3dc495f7479292ae96d1bf6298f531258cae74df47ff705aea9613880b0d50aa6a19328f70685484ad1c606bd12a8fb7c87632fe5c9cbefefe4893d9bb4d
7
- data.tar.gz: b417049bcc119ed82ab4c33d007e15804ba85b2485308ca28448fba512814fc5e8b8b215310bfb5c8108fcdc87292322eefc6826b18718fcbc7fced29eea77cb
6
+ metadata.gz: 9defcff35a5b3802d7d1a7db596a30aa01e28d3b9d784619de5f61713a587e427ccce76fcfcd478e946a0822af8d0822b23bad6392c2a71690ccd07250d5cfb7
7
+ data.tar.gz: 8b9143feb4f7508de9b7f60eddacafc4713c064f8bda21ed9ae92de364aa5e94fed36ff6d12f2b2aa108337d92c25868bce21d172397f48ff3c41ed93dc9a2b5
data/CHANGELOG.org CHANGED
@@ -2,15 +2,22 @@
2
2
  #+AUTHOR: Adolfo Villafiorita
3
3
  #+STARTUP: showall
4
4
 
5
+ * 1.5.1
6
+
7
+ - [User] Option --input-files allows to specify input files
8
+ in addition to passing filenames to the command line
9
+ - [User] Minor changes to the layout of HTML reports
10
+ - [User] Add version number in reports
11
+ - [Fixed] Duplicated entries in navigation
12
+ - [Code] Updated and added minitest(s)
13
+
5
14
  * 1.5.0
6
15
 
7
16
  - [User] Present Unique Visits / day as integer
8
17
  - [User] Added Country and Streaks report for rails
9
18
  - [User] Changed Streak report in Apache
10
-
11
19
  - [Gem] Updated DBIP
12
20
  - [Gem] Updated Bundle
13
-
14
21
  - [Code] Refactored all reports, so that they are specified
15
22
  in the same way
16
23
  - [Code] Refactor warning message in textual reports
data/README.org CHANGED
@@ -76,6 +76,7 @@ generated files are then made available on a private area on the web.
76
76
  Usage: log_sense [options] [logfile ...]
77
77
  --title=TITLE Title to use in the report
78
78
  -f, --input-format=FORMAT Input format (either rails or apache)
79
+ -i, --input-files=file,file, Input files (can also be passed directly)
79
80
  -t, --output-format=FORMAT Output format: html, org, txt, sqlite. See below for available formats
80
81
  -o, --output-file=OUTPUT_FILE Output file
81
82
  -b, --begin=DATE Consider entries after or on DATE
@@ -88,7 +89,7 @@ generated files are then made available on a private area on the web.
88
89
  -v, --version Prints version information
89
90
  -h, --help Prints this help
90
91
 
91
- This is version 1.5.0
92
+ This is version 1.5.1
92
93
 
93
94
  Output formats
94
95
  rails parsing can produce the following outputs:
data/exe/log_sense CHANGED
@@ -11,11 +11,18 @@ require 'log_sense.rb'
11
11
  @options = LogSense::OptionsParser.parse ARGV
12
12
  @output_file = @options[:output_file]
13
13
 
14
- if ARGV.map { |x| File.exist?(x) }.include?(false)
15
- $stderr.puts "Error: input file(s) '#{ARGV.reject { |x| File.exist(x) }.join(', ')}' do not exist"
14
+ #
15
+ # Input files can be gotten from an option and from what remains in
16
+ # ARGV
17
+ #
18
+ @input_filenames = @options[:input_filenames] + ARGV
19
+ @non_existing = @input_filenames.reject { |x| File.exist?(x) }
20
+
21
+ unless @non_existing.empty?
22
+ $stderr.puts "Error: input file(s) '#{@non_existing.join(', ')}' do not exist"
16
23
  exit 1
17
24
  end
18
- @input_files = ARGV.empty? ? [$stdin] : ARGV.map { |x| File.open(x, 'r') }
25
+ @input_files = @input_filenames.empty? ? [$stdin] : @input_filenames.map { |x| File.open(x, 'r') }
19
26
 
20
27
  #
21
28
  # Parse Log and Track Statistics
@@ -8,7 +8,7 @@ module LogSense
8
8
  # Emit Data
9
9
  #
10
10
  module Emitter
11
- def self.emit data = {}, options = {}
11
+ def self.emit(data = {}, options = {})
12
12
  @input_format = options[:input_format] || 'apache'
13
13
  @output_format = options[:output_format] || 'html'
14
14
 
@@ -78,12 +78,12 @@ module LogSense
78
78
  data
79
79
  else
80
80
  table_columns = data[0].size
81
- data.map { |x|
82
- (0..table_columns - 1).each.map { |col|
81
+ data.map do |x|
82
+ (0..table_columns - 1).each.map do |col|
83
83
  should_shorten = x[col] && x[col].size > width - 3 && to_shorten.include?(col)
84
84
  should_shorten ? "#{x[col][0..(width - 3)]}..." : x[col]
85
- }
86
- }
85
+ end
86
+ end
87
87
  end
88
88
  end
89
89
 
@@ -98,7 +98,8 @@ module LogSense
98
98
  # datatable_options: specific options for datatable
99
99
  def self.apache_report_specification(data = {})
100
100
  [
101
- { title: 'Daily Distribution',
101
+ {
102
+ title: 'Daily Distribution',
102
103
  header: %w[Day DOW Hits Visits Size],
103
104
  column_alignment: %i[left left right right right],
104
105
  rows: data[:daily_distribution],
@@ -166,9 +167,9 @@ module LogSense
166
167
  'x': {'field': 'Day', 'type': 'temporal'},
167
168
  }
168
169
  }
169
-
170
170
  },
171
- { title: 'Time Distribution',
171
+ {
172
+ title: 'Time Distribution',
172
173
  header: %w[Hour Hits Visits Size],
173
174
  column_alignment: %i[left right right right],
174
175
  rows: data[:time_distribution],
@@ -268,7 +269,8 @@ module LogSense
268
269
  }
269
270
  }
270
271
  },
271
- { title: 'Browsers',
272
+ {
273
+ title: 'Browsers',
272
274
  header: %w[Browser Hits Visits Size],
273
275
  column_alignment: %i[left right right right],
274
276
  rows: data[:browsers],
@@ -294,7 +296,8 @@ module LogSense
294
296
  }
295
297
  }
296
298
  },
297
- { title: 'Platforms',
299
+ {
300
+ title: 'Platforms',
298
301
  header: %w[Platform Hits Visits Size],
299
302
  column_alignment: %i[left right right right],
300
303
  rows: data[:platforms],
@@ -357,8 +360,8 @@ module LogSense
357
360
  k[1],
358
361
  v.map { |x| x[2] }.compact.select { |x| x.match(/\.html?$/) }.size,
359
362
  v.map { |x| x[2] }.compact.reject { |x| x.match(/\.html?$/) }.size,
360
- v.map { |x| x[2] }.compact.select { |x| x.match(/\.html?$/) }.join(' '),
361
- v.map { |x| x[2] }.compact.reject { |x| x.match(/\.html?$/) }.join(' ')
363
+ v.map { |x| x[2] }.compact.select { |x| x.match(/\.html?$/) }.join(' · '),
364
+ v.map { |x| x[2] }.compact.reject { |x| x.match(/\.html?$/) }.join(' · ')
362
365
  ]
363
366
  end,
364
367
  col: 'small-12 cell'
@@ -529,7 +532,7 @@ module LogSense
529
532
  [
530
533
  k,
531
534
  v.map { |x| x[1] }.inject(&:+),
532
- v.map { |x| x[0] }.join(' ')
535
+ v.map { |x| x[0] }.join(' · ')
533
536
  ]
534
537
  end
535
538
  },
@@ -543,7 +546,7 @@ module LogSense
543
546
  k[0],
544
547
  k[1],
545
548
  v.size,
546
- v.map { |x| x[2] }.join(' ')
549
+ v.map { |x| x[2] }.join(' · ')
547
550
  ]
548
551
  end,
549
552
  col: 'small-12 cell'
@@ -22,6 +22,10 @@ module LogSense
22
22
  args[:input_format] = n
23
23
  end
24
24
 
25
+ opts.on('-iFORMAT', '--input-files=file,file,', Array, 'Input files (can also be passed directly)') do |n|
26
+ args[:input_filenames] = n
27
+ end
28
+
25
29
  opts.on('-tFORMAT', '--output-format=FORMAT', String, 'Output format: html, org, txt, sqlite. See below for available formats') do |n|
26
30
  args[:output_format] = n
27
31
  end
@@ -95,6 +99,7 @@ module LogSense
95
99
  opt_parser.parse!(options)
96
100
 
97
101
  args[:limit] ||= limit
102
+ args[:input_filenames] ||= []
98
103
  args[:input_format] ||= 'apache'
99
104
  args[:output_format] ||= 'html'
100
105
  args[:ignore_crawlers] ||= false
@@ -4,6 +4,10 @@
4
4
  <th>CLI Command</th>
5
5
  <td><code><%= data[:command] %></code></td>
6
6
  </tr>
7
+ <tr>
8
+ <th>Version</th>
9
+ <td><code><%= LogSense::VERSION %></code></td>
10
+ </tr>
7
11
  <tr>
8
12
  <th>Ignore crawlers</th>
9
13
  <td><code><%= options[:ignore_crawlers] %></code></td></tr>
@@ -1,6 +1,7 @@
1
1
  <%=
2
2
  table = Terminal::Table.new rows: [
3
3
  ["Command", data[:command] ],
4
+ ["Version", LogSense::VERSION]
4
5
  ]
5
6
  table.style = { border_i: "|" }
6
7
  table
@@ -14,7 +14,8 @@
14
14
 
15
15
  <p>
16
16
  Generated by
17
- <a href="https://github.com/avillafiorita/log_sense">LogSense</a> <br />
17
+ <a href="https://github.com/avillafiorita/log_sense">LogSense</a><br />
18
+ version <%= LogSense::VERSION %><br />
18
19
  on <%= DateTime.now.strftime("%Y-%m-%d %H:%M") %>.<br />
19
20
  <a href='https://db-ip.com'>IP Geolocation by DB-IP</a>
20
21
  </p>
@@ -0,0 +1,144 @@
1
+ body {
2
+ font-family: 'Fira Sans', sans-serif;
3
+ font-size: 12px;
4
+ }
5
+
6
+ #offCanvas {
7
+ color: #DEDEDE;
8
+ background: #1C1C1C;
9
+ border-right: none;
10
+ box-shadow: none;
11
+ padding: 0.5rem;
12
+
13
+ font-size: 14px;
14
+ }
15
+
16
+ #offCanvas a {
17
+ color: #FFFFFF;
18
+ }
19
+
20
+ nav {
21
+ margin-left: 0.5rem;
22
+ }
23
+
24
+ nav h2 {
25
+ padding-left: 0rem;
26
+ }
27
+
28
+ #toggle-button {
29
+ font-size: 2rem;
30
+ margin-left: 1rem;
31
+ }
32
+
33
+ .main-section {
34
+ }
35
+
36
+ h1 {
37
+ font-family: 'Fira Sans', sans-serif;
38
+ font-size: 2rem;
39
+ font-weight: bold;
40
+ }
41
+
42
+ h2 {
43
+ font-family: 'Fira Sans', sans-serif;
44
+ font-size: 1.2rem;
45
+ font-weight: bold;
46
+
47
+ color: white;
48
+ background: #1C1C1C;
49
+
50
+ padding: 0.2rem 0.8rem 0.2rem 0.8rem;
51
+ border-radius: 5px 5px 0px 0px;
52
+ }
53
+
54
+ th {
55
+ padding: 0.2rem 1.2rem 0.2rem 0.2rem !important
56
+ }
57
+
58
+ td {
59
+ padding: 0.2rem 1rem 0.2rem 0.2rem !important;
60
+ }
61
+
62
+ .dataTables_wrapper {
63
+ width: 100%;
64
+ padding: 0.5rem;
65
+ }
66
+
67
+ article {
68
+ margin-top: 1rem;
69
+ border-radius: 5px;
70
+ }
71
+
72
+
73
+ .plot-canvas {
74
+ width: 100%;
75
+ }
76
+
77
+ input, select {
78
+ font-size: 0.8rem !important;
79
+ height: 1.5rem !important;
80
+ padding: 0.2rem 0.4rem 0.2rem 0.4rem !important;
81
+ }
82
+
83
+ .dataTables_info {
84
+ font-size: small;
85
+ color: rgb(202, 202, 202);
86
+ }
87
+
88
+ ul.pagination, li.paginate_button {
89
+ font-size: small;
90
+ margin-top: 0px !important;
91
+ margin-bottom: 0px !important;
92
+ padding-top: 0px !important;
93
+ padding-bottom: 0px !important;
94
+ }
95
+
96
+ .stats-list {
97
+ list-style-type: none;
98
+ clear: left;
99
+ margin: 0;
100
+ padding: 0;
101
+ text-align: center;
102
+ margin-bottom: 30px;
103
+ }
104
+
105
+ .stats-list .stats-list-positive {
106
+ color: #228b22;
107
+ }
108
+
109
+ .stats-list .stats-list-negative {
110
+ color: #a52a2a;
111
+ }
112
+
113
+ .stats-list > li {
114
+ display: inline-block;
115
+ margin-right: 10px;
116
+ padding-right: 10px;
117
+ border-right: 1px solid #cacaca;
118
+ text-align: center;
119
+ font-size: 1.1em;
120
+ font-weight: bold;
121
+ }
122
+
123
+ .stats-list > li:last-child {
124
+ border: none;
125
+ margin: 0;
126
+ padding: 0;
127
+ }
128
+
129
+ .stats-list > li .stats-list-label {
130
+ display: block;
131
+ margin-top: 2px;
132
+ font-size: 0.9em;
133
+ font-weight: normal;
134
+ }
135
+
136
+ .hits, .visits, .size, .count, .s2xx, .s3xx, .so4xx, .total-hits, .total-visits {
137
+ text-align: right !important;
138
+ }
139
+
140
+ td {
141
+ vertical-align: top;
142
+ }
143
+
144
+
@@ -8,13 +8,14 @@
8
8
  <meta charset="utf-8" />
9
9
  <meta http-equiv="x-ua-compatible" content="ie=edge">
10
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
- <meta name="author" content="Log Sense">
12
- <meta name="description" content="Analysis of <%= data[:log_file] %>">
13
11
 
14
- <link rel="preconnect" href="https://fonts.googleapis.com">
15
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
16
- <link href="https://fonts.googleapis.com/css2?family=PT+Sans&display=swap" rel="stylesheet">
12
+ <meta name="author" content="Shair.Tech">
13
+ <meta name="description" content="Analysis of <%= data[:filenames].join(', ') %>">
17
14
 
15
+ <link rel="preconnect" href="https://fonts.googleapis.com">
16
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
17
+ <link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;700&display=swap" rel="stylesheet">
18
+
18
19
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css">
19
20
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/css/foundation.min.css">
20
21
  <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/zf/dt-1.11.3/datatables.min.css"/>
@@ -27,181 +28,45 @@
27
28
  <script src="https://cdn.jsdelivr.net/npm/vega-embed@6.20.2"></script>
28
29
 
29
30
  <style>
30
- body {
31
- font-family: 'PT Sans', sans-serif;
32
- font-size: 80%;
33
- }
34
-
35
- #offCanvas {
36
- color: #DEDEDE;
37
- background: #1C1C1C;
38
- border-right: none;
39
- box-shadow: none;
40
- padding: 0.5rem;
41
- }
42
- #offCanvas a {
43
- color: #FFFFFF;
44
- }
45
-
46
- .contents-button {
47
- font-size: xx-large;
48
- }
49
-
50
- .main-section {
51
- margin-left: 45px;
52
- }
53
-
54
- h1 {
55
- font-size: 1.8rem;
56
- }
57
-
58
- h2 {
59
- font-size: 1.2rem;
60
- }
61
-
62
- th {
63
- padding: 0.2rem 1.2rem 0.2rem 0.2rem !important
64
- }
65
-
66
- td {
67
- padding: 0.2rem 1rem 0.2rem 0.2rem !important;
68
- }
69
-
70
- .hits, .visits, .size, .count, .s2xx, .s3xx, .so4xx, .total-hits, .total-visits {
71
- text-align: right !important;
72
- }
73
-
74
- .card-divider {
75
- padding: 0.2rem 0.4rem 0.2rem 0.4rem;
76
- background: #1C1C1C;
77
- color: white;
78
- }
79
-
80
- input, select {
81
- font-size: 0.8rem !important;
82
- height: 1.5rem !important;
83
- padding: 0.2rem 0.4rem 0.2rem 0.4rem !important;
84
- }
85
-
86
- .dataTables_info {
87
- font-size: small;
88
- color: rgb(202, 202, 202);
89
- }
90
-
91
- ul.pagination, li.paginate_button {
92
- font-size: small;
93
- margin-top: 0px !important;
94
- margin-bottom: 0px !important;
95
- padding-top: 0px !important;
96
- padding-bottom: 0px !important;
97
- }
98
-
99
- .stats-list {
100
- list-style-type: none;
101
- clear: left;
102
- margin: 0;
103
- padding: 0;
104
- text-align: center;
105
- margin-bottom: 30px;
106
- }
107
-
108
- .stats-list .stats-list-positive {
109
- color: #228b22;
110
- }
111
-
112
- .stats-list .stats-list-negative {
113
- color: #a52a2a;
114
- }
115
-
116
- .stats-list > li {
117
- display: inline-block;
118
- margin-right: 10px;
119
- padding-right: 10px;
120
- border-right: 1px solid #cacaca;
121
- text-align: center;
122
- font-size: 1.1em;
123
- font-weight: bold;
124
- }
125
-
126
- .stats-list > li:last-child {
127
- border: none;
128
- margin: 0;
129
- padding: 0;
130
- }
131
-
132
- .stats-list > li .stats-list-label {
133
- display: block;
134
- margin-top: 2px;
135
- font-size: 0.9em;
136
- font-weight: normal;
137
- }
138
-
139
- #streaks-table .ip {
140
- vertical-align: top;
141
- }
142
- #streaks-table .date {
143
- font-weight: bold;
144
- }
145
- #streaks-table .res-title {
146
- font-decoration: underline;
147
- }
31
+ <%= render "stylesheet.css" %>
148
32
  </style>
149
-
150
33
  </head>
151
34
 
152
35
  <body>
153
36
  <div class="off-canvas-wrapper">
154
37
  <div class="off-canvas position-left" id="offCanvas" data-off-canvas>
155
38
  <%= render "navigation.html.erb",
156
- menus: Emitter::apache_report_specification.map { |x| x[:title] } +
157
- ["Streaks", "Command Invocation", "Performance"] %>
39
+ menus: Emitter::apache_report_specification.map { |x| x[:title] } %>
158
40
  </div>
159
-
160
- <div class="off-canvas-content grid-container grid-x fluid" data-off-canvas-content>
161
- <div data-sticky-container>
162
- <div class="sticky" data-sticky data-margin-top="0">
163
- <div class="contents-button">
164
- <i id="hamburger" class="fi-list" data-toggle="offCanvas"></i>
165
- </div>
166
- </div>
167
- </div>
41
+ <div class="off-canvas-content" data-off-canvas-content>
42
+ <button id="toggle-button" type="button" data-toggle="offCanvas">
43
+ &#9776;
44
+ </button>
168
45
 
169
- <section class="main-section">
46
+ <section class="main-section grid-container fluid">
170
47
  <h1><%= options[:title] || "Log Sense Apache Log Report" %></h1>
171
48
 
172
49
  <p><b>Input File(s):</b> <%= data[:filenames].empty? ? "stdin" : data[:filenames].join(", ") %></p>
173
50
 
174
- <div class="grid-x grid-margin-x">
175
- <article class="card small-12 large-6 cell">
176
- <div class="card-divider">
177
- <h2 id="<%= Emitter::slugify "Summary" %>">Summary</h2>
178
- </div>
179
- <div class="card-section">
180
- <%= render "summary.html.erb", data: data %>
181
- </div>
51
+ <div class="grid-x grid-padding-x">
52
+ <article class="small-12 large-6 cell">
53
+ <h2 id="<%= Emitter::slugify "Summary" %>">Summary</h2>
54
+ <%= render "summary.html.erb", data: data %>
182
55
  </article>
183
56
 
184
- <article class="card cell small-12 large-6">
185
- <div class="card-divider">
186
- <h2 id="<%= Emitter::slugify "Summary" %>">Log Structure</h2>
187
- </div>
188
- <div class="card-section">
189
- <%= render "log_structure.html.erb", data: data %>
190
- </div>
57
+ <article class="small-12 large-6 cell">
58
+ <h2 id="<%= Emitter::slugify "Summary" %>">Log Structure</h2>
59
+ <%= render "log_structure.html.erb", data: data %>
191
60
  </article>
192
- </div>
193
61
 
194
- <div class="grid-x grid-margin-x">
195
62
  <% @reports.each_with_index do |report, index| %>
196
- <article class="card cell <%= report[:col] || "small-12 large-6" %>" >
197
- <div class="card-divider">
198
- <h2 id="<%= Emitter::slugify report[:title] %>">
199
- <%= report[:title] %>
200
- </h2>
201
- </div>
63
+ <article class="<%= report[:col] || "small-12 large-6" %> cell">
64
+ <h2 id="<%= Emitter::slugify report[:title] %>"><%= report[:title] %></h2>
65
+
202
66
  <%= render "report_data.html.erb", report: report, index: index %>
203
67
  <% if report[:vega_spec] %>
204
- <div id="<%= "plot-#{index}" %>"></div>
68
+ <div id="<%= "plot-#{index}" %>" class="plot-canvas">
69
+ </div>
205
70
  <script>
206
71
  plot_spec_<%= index %> = Object.assign(
207
72
  <%= report[:vega_spec].to_json %>,
@@ -216,45 +81,35 @@
216
81
  </script>
217
82
  <% end %>
218
83
 
219
- <div class="card-section">
220
- <%= render "output_table.html.erb", report: report, index: index %>
221
- </div>
84
+ <%= render "output_table.html.erb", report: report, index: index %>
222
85
  </article>
223
86
  <% end %>
224
- </div>
225
87
 
226
- <div class="grid-x grid-margin-x">
227
- <div class="cell small-12 large-6">
228
- <article>
229
- <h2 id="<%= Emitter::slugify "Command Invocation" %>">Command Invocation</h2>
230
-
231
- <%= render "command_invocation.html.erb", data: data, options: options %>
232
- </article>
233
- </div>
234
-
235
- <div class="small-12 large-6 cell">
236
- <article>
237
- <h2 id="<%= Emitter::slugify "Performance" %>">Performance</h2>
88
+ <article class="small-12 large-6 cell">
89
+ <h2 id="<%= Emitter::slugify "Command Invocation" %>">Command Invocation</h2>
90
+ <%= render "command_invocation.html.erb", data: data, options: options %>
91
+ </article>
238
92
 
239
- <%= render "performance.html.erb", data: data %>
240
- </article>
241
- </div>
93
+ <article class="small-12 large-6 cell">
94
+ <h2 id="<%= Emitter::slugify "Performance" %>">Performance</h2>
95
+ <%= render "performance.html.erb", data: data %>
96
+ </article>
242
97
  </div>
243
98
  </section>
244
99
  </div>
100
+ </div>
245
101
 
246
- <script type="text/javascript" src="js/vendor/what-input.js"></script>
247
- <script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
248
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/js/foundation.min.js" crossorigin="anonymous"></script>
249
- <script>
250
- $(document).foundation();
102
+ <script type="text/javascript" src="js/vendor/what-input.js"></script>
103
+ <script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
104
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/js/foundation.min.js" crossorigin="anonymous"></script>
105
+ <script>
106
+ $(document).foundation();
251
107
 
252
- $(document).ready(function () {
253
- $('.data-table').each(function () {
254
- $(this).DataTable();
255
- });
108
+ $(document).ready(function () {
109
+ $('.data-table').each(function () {
110
+ $(this).DataTable();
256
111
  });
257
- </script>
258
- </div>
112
+ });
113
+ </script>
259
114
  </body>
260
115
  </html>
@@ -8,12 +8,13 @@
8
8
  <meta charset="utf-8" />
9
9
  <meta http-equiv="x-ua-compatible" content="ie=edge">
10
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
- <meta name="author" content="Log Sense">
12
- <meta name="description" content="Analysis of <%= data[:log_file] %>">
13
11
 
14
- <link rel="preconnect" href="https://fonts.googleapis.com">
15
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
16
- <link href="https://fonts.googleapis.com/css2?family=PT+Sans&display=swap" rel="stylesheet">
12
+ <meta name="author" content="Shair.Tech">
13
+ <meta name="description" content="Analysis of <%= data[:filenames].join(', ') %>">
14
+
15
+ <link rel="preconnect" href="https://fonts.googleapis.com">
16
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
17
+ <link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;700&display=swap" rel="stylesheet">
17
18
 
18
19
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css">
19
20
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/css/foundation.min.css">
@@ -27,126 +28,16 @@
27
28
  <script src="https://cdn.jsdelivr.net/npm/vega-embed@6.20.2"></script>
28
29
 
29
30
  <style>
30
- body {
31
- font-family: 'PT Sans', sans-serif;
32
- font-size: 80%;
33
- }
34
-
31
+ <%= render "stylesheet.css" %>
32
+ </style>
33
+ <style>
35
34
  #offCanvas {
36
- color: #CECECE;
37
- background: #BD000D;
38
- border-right: none;
39
- box-shadow: none;
40
- padding: 0.5rem;
41
- }
42
- #offCanvas a {
43
- color: #FFFFFF;
44
- }
45
-
46
- .contents-button {
47
- font-size: xx-large;
35
+ background: #d30001 !important;
48
36
  }
49
-
50
- .main-section {
51
- margin-left: 45px;
52
- }
53
-
54
- h1 {
55
- font-size: 1.8rem;
56
- }
57
-
58
37
  h2 {
59
- font-size: 1.2rem;
60
- }
61
-
62
- th {
63
- padding: 0.2rem 1.2rem 0.2rem 0.2rem !important
64
- }
65
-
66
- td {
67
- padding: 0.2rem 1rem 0.2rem 0.2rem !important;
68
- }
69
-
70
- .hits, .visits, .size, .count, .s2xx, .s3xx, .so4xx, .total-hits, .total-visits {
71
- text-align: right !important;
72
- }
73
-
74
- .card-divider {
75
- padding: 0.2rem 0.4rem 0.2rem 0.4rem;
76
- background: #D30001;
77
- color: white;
78
- }
79
-
80
- input, select {
81
- font-size: 0.8rem !important;
82
- height: 1.5rem !important;
83
- padding: 0.2rem 0.4rem 0.2rem 0.4rem !important;
84
- }
85
-
86
- .dataTables_info {
87
- font-size: small;
88
- color: rgb(202, 202, 202);
89
- }
90
-
91
- ul.pagination, li.paginate_button {
92
- font-size: small;
93
- margin-top: 0px !important;
94
- margin-bottom: 0px !important;
95
- padding-top: 0px !important;
96
- padding-bottom: 0px !important;
97
- }
98
-
99
- .stats-list {
100
- list-style-type: none;
101
- clear: left;
102
- margin: 0;
103
- padding: 0;
104
- text-align: center;
105
- margin-bottom: 30px;
106
- }
107
-
108
- .stats-list .stats-list-positive {
109
- color: #228b22;
110
- }
111
-
112
- .stats-list .stats-list-negative {
113
- color: #a52a2a;
114
- }
115
-
116
- .stats-list > li {
117
- display: inline-block;
118
- margin-right: 10px;
119
- padding-right: 10px;
120
- border-right: 1px solid #cacaca;
121
- text-align: center;
122
- font-size: 1.1em;
123
- font-weight: bold;
124
- }
125
-
126
- .stats-list > li:last-child {
127
- border: none;
128
- margin: 0;
129
- padding: 0;
130
- }
131
-
132
- .stats-list > li .stats-list-label {
133
- display: block;
134
- margin-top: 2px;
135
- font-size: 0.9em;
136
- font-weight: normal;
137
- }
138
-
139
- #streaks-table .ip {
140
- vertical-align: top;
141
- }
142
- #streaks-table .date {
143
- font-weight: bold;
144
- }
145
- #streaks-table .res-title {
146
- font-decoration: underline;
38
+ background: #d30001 !important;
147
39
  }
148
40
  </style>
149
-
150
41
  </head>
151
42
 
152
43
  <body>
@@ -155,51 +46,35 @@
155
46
  <%= render "navigation.html.erb",
156
47
  menus: Emitter::rails_report_specification.map { |x| x[:title] } %>
157
48
  </div>
158
- <div class="off-canvas-content grid-container grid-x fluid" data-off-canvas-content>
159
- <div data-sticky-container>
160
- <div class="sticky" data-sticky data-margin-top="0">
161
- <div class="contents-button">
162
- <i id="hamburger" class="fi-list" data-toggle="offCanvas"></i>
163
- </div>
164
- </div>
165
- </div>
49
+ <div class="off-canvas-content" data-off-canvas-content>
50
+ <button id="toggle-button" type="button" data-toggle="offCanvas">
51
+ &#9776;
52
+ </button>
166
53
 
167
- <section class="main-section">
54
+ <section class="main-section grid-container fluid">
168
55
  <h1><%= options[:title] || "Log Sense Rails Log Report" %></h1>
169
56
 
170
57
  <p><b>Input File(s):</b> <%= data[:filenames].empty? ? "stdin" : data[:filenames].join(", ") %></p>
171
58
 
172
- <div class="grid-x grid-margin-x">
173
- <article class="card small-12 large-6 cell">
174
- <div class="card-divider">
175
- <h2 id="<%= Emitter::slugify "Summary" %>">Summary</h2>
176
- </div>
177
- <div class="card-section">
178
- <%= render "summary.html.erb", data: data %>
179
- </div>
59
+ <div class="grid-x grid-padding-x">
60
+ <article class="small-12 large-6 cell">
61
+ <h2 id="<%= Emitter::slugify "Summary" %>">Summary</h2>
62
+ <%= render "summary.html.erb", data: data %>
180
63
  </article>
181
64
 
182
- <article class="card cell small-12 large-6">
183
- <div class="card-divider">
184
- <h2 id="<%= Emitter::slugify "Log Structure" %>">Log Structure</h2>
185
- </div>
186
- <div class="card-section">
187
- <%= render "log_structure.html.erb", data: data %>
188
- </div>
65
+ <article class="small-12 large-6 cell">
66
+ <h2 id="<%= Emitter::slugify "Summary" %>">Log Structure</h2>
67
+ <%= render "log_structure.html.erb", data: data %>
189
68
  </article>
190
- </div>
191
69
 
192
- <div class="grid-x grid-margin-x">
193
70
  <% @reports.each_with_index do |report, index| %>
194
- <article class="card cell <%= report[:col] || "small-12 large-6" %>" >
195
- <div class="card-divider">
196
- <h2 id="<%= report[:title].downcase.gsub(' ', '-') %>">
197
- <%= report[:title] %>
198
- </h2>
199
- </div>
71
+ <article class="cell <%= report[:col] || "small-12 large-6" %>" >
72
+ <h2 id="<%= Emitter::slugify report[:title] %>"><%= report[:title] %></h2>
73
+
200
74
  <%= render "report_data.html.erb", report: report, index: index %>
201
75
  <% if report[:vega_spec] %>
202
- <div id="<%= "plot-#{index}" %>"></div>
76
+ <div id="<%= "plot-#{index}" %>" class="plot-canvas">
77
+ </div>
203
78
  <script>
204
79
  plot_spec_<%= index %> = Object.assign(
205
80
  <%= report[:vega_spec].to_json %>,
@@ -213,47 +88,36 @@
213
88
  vegaEmbed('#<%= "plot-#{index}"%>', plot_spec_<%= index %>);
214
89
  </script>
215
90
  <% end %>
216
- <div class="card-section">
217
- <%= render "output_table.html.erb", report: report, index: index %>
218
- </div>
219
- </article>
220
- <% end %>
221
- </div>
222
91
 
223
- <div class="grid-x grid-margin-x">
224
- <div class="cell small-12 large-6">
225
- <article>
226
- <h2 id="<%= Emitter::slugify "Command Invocation" %>">
227
- Command Invocation
228
- </h2>
229
-
230
- <%= render "command_invocation.html.erb", data: data, options: options %>
92
+ <%= render "output_table.html.erb", report: report, index: index %>
231
93
  </article>
232
- </div>
94
+ <% end %>
233
95
 
234
- <div class="small-12 large-6 cell">
235
- <article>
236
- <h2 id="<%= Emitter::slugify "Performance" %>"> Performance</h2>
96
+ <article class="small-12 large-6 cell">
97
+ <h2 id="<%= Emitter::slugify "Command Invocation" %>">Command Invocation</h2>
98
+ <%= render "command_invocation.html.erb", data: data, options: options %>
99
+ </article>
237
100
 
238
- <%= render "performance.html.erb", data: data %>
239
- </article>
240
- </div>
101
+ <article class="small-12 large-6 cell">
102
+ <h2 id="<%= Emitter::slugify "Performance" %>">Performance</h2>
103
+ <%= render "performance.html.erb", data: data %>
104
+ </article>
241
105
  </div>
242
106
  </section>
243
107
  </div>
108
+ </div>
244
109
 
245
- <script type="text/javascript" src="js/vendor/what-input.js"></script>
246
- <script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
247
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/js/foundation.min.js" crossorigin="anonymous"></script>
248
- <script>
249
- $(document).foundation();
110
+ <script type="text/javascript" src="js/vendor/what-input.js"></script>
111
+ <script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
112
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/js/foundation.min.js" crossorigin="anonymous"></script>
113
+ <script>
114
+ $(document).foundation();
250
115
 
251
- $(document).ready(function () {
252
- $('.data-table').each(function () {
253
- $(this).DataTable();
254
- });
116
+ $(document).ready(function () {
117
+ $('.data-table').each(function () {
118
+ $(this).DataTable();
255
119
  });
256
- </script>
257
- </div>
120
+ });
121
+ </script>
258
122
  </body>
259
123
  </html>
@@ -1,3 +1,3 @@
1
1
  module LogSense
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_sense
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adolfo Fibrillation
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-08 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser
@@ -147,6 +147,7 @@ files:
147
147
  - lib/log_sense/templates/_performance.html.erb
148
148
  - lib/log_sense/templates/_performance.txt.erb
149
149
  - lib/log_sense/templates/_report_data.html.erb
150
+ - lib/log_sense/templates/_stylesheet.css
150
151
  - lib/log_sense/templates/_summary.html.erb
151
152
  - lib/log_sense/templates/_summary.txt.erb
152
153
  - lib/log_sense/templates/_warning.txt.erb