logs_explorer 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9438b83ae3cd49cbd27568a2fbf25c165ef5baea3f9d69d5f722767de7700428
4
- data.tar.gz: ec1cf1c492604374a0b1ea4f950bf451cb9673a8963e1deb6145f0f74122d5c9
3
+ metadata.gz: b0352fc92295e7fdfc885087bb9e9619138dd98a73fe535f76b4c2e0c017b0a8
4
+ data.tar.gz: 5fc9f68c654e5a5ca70b2af79b8ca5fd6efda21dd5f78951211617602d1e3d44
5
5
  SHA512:
6
- metadata.gz: c490149b61b09807d319c3c03eee0900aa0fa59ba94868e7a9d2e23dba79e57edb59299b1c5447193cfe5e06251e0968f073f87790098db785fb555824b56c27
7
- data.tar.gz: b23c998d612830a9a6d30aa91eb499d9e9e67fc07a75d96442852b6c0e567e76d2cfc1701e37323f6f7142f3118663c4880ccdf746b7f4708271b745f4565f16
6
+ metadata.gz: aea31509f38e4350e69f19d046a2c95c93bcb8b7f1b2ea04a2e2c3010d1edf65eeb8c73b92d1d3c6b3dea7df5b00550c437779a5f74677df4a18aa58a6e961a7
7
+ data.tar.gz: 780f9afcce08e08d3786e51721afd759926bc03a301f6b722e5562f16570048e5c43485bab7f083ff98b7fb427a09bdc80e2241b72c4ba299dc10a1f64f11cb1
data/README.md CHANGED
@@ -53,6 +53,12 @@ LogsExplorer.setup do |config|
53
53
  end if defined?(LogsExplorer)
54
54
  ```
55
55
 
56
+ To execute rake task from the browser console, use the following syntax:
57
+ ```ruby
58
+ Rake::Task['task_name'].execute # or
59
+ Rake::Task['task_name'].invoke
60
+ ```
61
+
56
62
  You can use configuration options above to protect access to the logs for a specific user or by HTTP BASIC auth.
57
63
 
58
64
  Please note, that this is not a real Rails console as we used, it's basically evaluating Ruby code sent to the server (stateless).
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" ?><svg height="48" id="arrow-bottom" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg"><defs><style>
2
+ .vi-primary {
3
+ fill: #FF6E6E;
4
+ }
5
+
6
+ .vi-primary, .vi-accent {
7
+ stroke: #fff;
8
+ stroke-linecap: round;
9
+ stroke-width: 0;
10
+ fill-rule: evenodd;
11
+ }
12
+
13
+ .vi-accent {
14
+ fill: #0C0058;
15
+ }
16
+ </style></defs><path class="vi-primary" d="M26,10V30l5-5,3,3L24,38,14,28l3-3,5,5V10h4Z"/><path class="vi-accent" d="M22,18h4V10H22v8Z"/></svg>
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ Rails.application.class.parent_name.constantize::Application.load_tasks if defined?(Rails)
3
4
  require_relative './base_controller.rb'
4
5
 
5
6
  module LogsExplorer
@@ -13,6 +13,10 @@ module LogsExplorer
13
13
  @total_lines = log_file.total_lines
14
14
  end
15
15
 
16
+ def download
17
+ send_file log_file.path
18
+ end
19
+
16
20
  def log_file
17
21
  @log_file ||= begin
18
22
  item = LogsExplorer.logs.detect {|e| e[:name] == params[:name]}
@@ -27,6 +27,10 @@
27
27
  <%= icon 'record' %>
28
28
  Clear
29
29
  </a>
30
+ <%= link_to logs_explorer.download_path(name: params[:name]), class: 'button' do %>
31
+ <%= icon 'download' %>
32
+ Download
33
+ <% end %>
30
34
 
31
35
  <span id='three-dots'>
32
36
  <%= icon 'three-dots' %>
data/config/routes.rb CHANGED
@@ -4,6 +4,7 @@ LogsExplorer::Engine.routes.draw do
4
4
  get '/' => 'home#index', as: :home
5
5
  get '/watch' => 'logs#watch', as: :watch
6
6
  get '/watch/changes' => 'logs#changes', as: :changes
7
+ get '/watch/download' => 'logs#download', as: :download
7
8
 
8
9
  get '/console' => 'console#index', as: :console
9
10
  post '/execute' => 'console#execute', as: :execute
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogsExplorer
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logs_explorer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksandr Balakiriev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-27 00:00:00.000000000 Z
11
+ date: 2023-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -77,6 +77,7 @@ files:
77
77
  - README.md
78
78
  - Rakefile
79
79
  - app/assets/config/logs_explorer_manifest.js
80
+ - app/assets/images/download.svg
80
81
  - app/assets/images/eq.svg
81
82
  - app/assets/images/error.svg
82
83
  - app/assets/images/heart.svg