lato 3.12.0 โ 3.13.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 +4 -4
- data/README.md +2 -2
- data/app/jobs/lato/active_storage_cleaner_job.rb +9 -2
- data/app/views/lato/components/_operation.html.erb +8 -8
- data/config/locales/en.yml +6 -0
- data/config/locales/it.yml +6 -0
- data/lib/lato/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8746303f02bdbfbec09b41de82ff16a8b946ad67d760abd9b0638973944d260
|
4
|
+
data.tar.gz: e45f9374b5f00313250cdf8b8c325b0f79c6126c0d7bdfcfa4251949b3215cbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '096b30341931394fd8b0d09617c1484c475440bcc415f76db3fbc389df99574791c77c2913dce9832c0be9de9947f21581e5250d6ef8b48fed1677c43e8d9740'
|
7
|
+
data.tar.gz: 2b759b959aa4dc841987e2e05807f1e841e1887a4057f8d7f1c1abf51d2737964968b54553c4d19d1a92cc93ce9147e8ca4f911e64d4bd9bedaa57fa097bd9aa
|
data/README.md
CHANGED
@@ -17,9 +17,9 @@ The gem is ready to be used with the **latest Rails 7+** features like **[ESM im
|
|
17
17
|
|
18
18
|
<img src="./preview.gif" alt="Lato preview" width="100%">
|
19
19
|
|
20
|
-
## Full documentation
|
20
|
+
## Full documentation
|
21
21
|
|
22
|
-
The full documentation is available at: ๐ ๐ [THIS LINK](
|
22
|
+
The full documentation is available at: ๐ ๐ [THIS LINK](https://auuu.link/s/gh-lato) ๐ ๐
|
23
23
|
|
24
24
|
You can also use the [Lato AI Agent](http://lato.gregoriogalante.com/AI.html) directly on your browser to generate code and get helps with the gem.
|
25
25
|
|
@@ -1,9 +1,16 @@
|
|
1
1
|
module Lato
|
2
2
|
class ActiveStorageCleanerJob < Lato::ApplicationJob
|
3
|
-
def perform
|
3
|
+
def perform(params = {})
|
4
|
+
update_operation_percentage(0)
|
5
|
+
|
4
6
|
# delete all active storage blobs that are not attached to any record with more than 12 hours of life
|
5
|
-
ActiveStorage::Blob.
|
7
|
+
query = ActiveStorage::Blob.where('active_storage_blobs.created_at < ?', 12.hours.ago)
|
8
|
+
totals = query.count
|
9
|
+
runned = 0
|
10
|
+
query.find_in_batches do |blobs|
|
6
11
|
blobs.each(&:purge_later)
|
12
|
+
runned += blobs.size
|
13
|
+
update_operation_percentage((runned.to_f / totals * 100).round)
|
7
14
|
end
|
8
15
|
|
9
16
|
# delete all empty folders in active storage local service (if exists)
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<div data-controller="lato-operation">
|
3
3
|
<% if operation.created_status? %>
|
4
4
|
<div class="text-center">
|
5
|
-
<h2
|
6
|
-
<p
|
5
|
+
<h2><%= I18n.t('lato.operation_title') %></h2>
|
6
|
+
<p><%= I18n.t('lato.operation_subtitle') %></p>
|
7
7
|
<div class="progress" style="height: 20px;">
|
8
8
|
<div class="progress-bar progress-bar-animated progress-bar-striped bg-primary" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
|
9
9
|
</div>
|
@@ -12,8 +12,8 @@
|
|
12
12
|
|
13
13
|
<% if operation.running_status? %>
|
14
14
|
<div class="text-center">
|
15
|
-
<h2
|
16
|
-
<p
|
15
|
+
<h2><%= I18n.t('lato.operation_title') %></h2>
|
16
|
+
<p><%= I18n.t('lato.operation_subtitle') %></p>
|
17
17
|
<% if operation.percentage.nil? %>
|
18
18
|
<div class="progress" style="height: 20px;">
|
19
19
|
<div class="progress-bar progress-bar-animated progress-bar-striped bg-primary" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
|
@@ -31,8 +31,8 @@
|
|
31
31
|
<div class="fs-1 text-success">
|
32
32
|
<i class="bi bi-check-circle"></i>
|
33
33
|
</div>
|
34
|
-
<h2
|
35
|
-
<p
|
34
|
+
<h2><%= I18n.t('lato.operation_completed_title') %></h2>
|
35
|
+
<p><%= I18n.t('lato.operation_completed_subtitle') %></p>
|
36
36
|
|
37
37
|
<% if operation.output_file? %>
|
38
38
|
<%= link_to '', main_app.url_for(operation.output_file), download: true, class: 'd-none', data: { lato_operation_target: 'outputFile' } %>
|
@@ -51,8 +51,8 @@
|
|
51
51
|
<div class="fs-1 text-danger">
|
52
52
|
<i class="bi bi-x-circle"></i>
|
53
53
|
</div>
|
54
|
-
<h2
|
55
|
-
<p
|
54
|
+
<h2><%= I18n.t('lato.operation_failed_title') %></h2>
|
55
|
+
<p><%= I18n.t('lato.operation_failed_subtitle') %></p>
|
56
56
|
<% if operation.output_error? %>
|
57
57
|
<p class="text-danger fw-bold">
|
58
58
|
<%= operation.output_error %>
|
data/config/locales/en.yml
CHANGED
@@ -64,6 +64,12 @@ en:
|
|
64
64
|
confirm_title: Confirm
|
65
65
|
confirm_yes: Yes, confirm
|
66
66
|
confirm_no: No, cancel
|
67
|
+
operation_title: Running operation
|
68
|
+
operation_subtitle: Please wait..
|
69
|
+
operation_completed_title: Operation completed
|
70
|
+
operation_completed_subtitle: The operation has been completed successfully
|
71
|
+
operation_failed_title: Operation failed
|
72
|
+
operation_failed_subtitle: The operation has failed because of an error
|
67
73
|
|
68
74
|
invitation_mailer:
|
69
75
|
invite_mail_subject: You received an invitation
|
data/config/locales/it.yml
CHANGED
@@ -66,6 +66,12 @@ it:
|
|
66
66
|
confirm_title: Conferma
|
67
67
|
confirm_yes: Sรฌ, procedi
|
68
68
|
confirm_no: No, annulla
|
69
|
+
operation_title: Operazione in corso
|
70
|
+
operation_subtitle: Si prega di attendere..
|
71
|
+
operation_completed_title: Operazione completata
|
72
|
+
operation_completed_subtitle: L'operazione รจ stata completata con successo
|
73
|
+
operation_failed_title: Operazione fallita
|
74
|
+
operation_failed_subtitle: Si รจ verificato un errore durante l'operazione
|
69
75
|
|
70
76
|
invitation_mailer:
|
71
77
|
invite_mail_subject: Hai ricevuto un invito
|
data/lib/lato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|