mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 01:31:39 -05:00
Add debugging information to the export service
This commit is contained in:
parent
6af4d6d7ef
commit
1257f295be
6 changed files with 22 additions and 5 deletions
|
|
@ -1 +1 @@
|
||||||
0.6.1
|
0.6.2
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,11 @@ Please update your `docker-compose.yml` file to include the following changes:
|
||||||
|
|
||||||
- Fixed a bug where the export file was not being created in the public folder
|
- Fixed a bug where the export file was not being created in the public folder
|
||||||
|
|
||||||
|
---
|
||||||
|
## [0.6.2] — 2024-06-14
|
||||||
|
|
||||||
|
This is a debugging release. No changes were made to the application.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## [0.6.0] — 2024-06-12
|
## [0.6.0] — 2024-06-12
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,12 @@ class Exports::Create
|
||||||
def call
|
def call
|
||||||
export.update!(status: :processing)
|
export.update!(status: :processing)
|
||||||
|
|
||||||
points = time_framed_points(start_at, end_at, user)
|
pp "====Exporting data for #{user.email} from #{start_at} to #{end_at}"
|
||||||
|
|
||||||
|
points = time_framed_points
|
||||||
|
|
||||||
|
pp "====Exporting #{points.count} points"
|
||||||
|
|
||||||
data = ::ExportSerializer.new(points, user.email).call
|
data = ::ExportSerializer.new(points, user.email).call
|
||||||
file_path = Rails.root.join('public', 'exports', "#{export.name}.json")
|
file_path = Rails.root.join('public', 'exports', "#{export.name}.json")
|
||||||
|
|
||||||
|
|
@ -28,7 +33,10 @@ class Exports::Create
|
||||||
|
|
||||||
attr_reader :user, :export, :start_at, :end_at
|
attr_reader :user, :export, :start_at, :end_at
|
||||||
|
|
||||||
def time_framed_points(start_at, end_at, user)
|
def time_framed_points
|
||||||
user.tracked_points.without_raw_data.where('timestamp >= ? AND timestamp <= ?', start_at.to_i, end_at.to_i)
|
user
|
||||||
|
.tracked_points
|
||||||
|
.without_raw_data
|
||||||
|
.where('timestamp >= ? AND timestamp <= ?', start_at.to_i, end_at.to_i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
|
<th>Created at</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -37,6 +38,8 @@
|
||||||
<%= link_to 'Download', export.url, class: "px-4 py-2 bg-blue-500 text-white rounded-md", download: export.name %>
|
<%= link_to 'Download', export.url, class: "px-4 py-2 bg-blue-500 text-white rounded-md", download: export.name %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to 'Delete', export, data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?", turbo_method: :delete }, method: :delete, class: "px-4 py-2 bg-red-500 text-white rounded-md" %>
|
<%= link_to 'Delete', export, data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?", turbo_method: :delete }, method: :delete, class: "px-4 py-2 bg-red-500 text-white rounded-md" %>
|
||||||
|
</td>
|
||||||
|
<td><%= export.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ require_relative '../config/environment'
|
||||||
abort('The Rails environment is running in production mode!') if Rails.env.production?
|
abort('The Rails environment is running in production mode!') if Rails.env.production?
|
||||||
require 'rspec/rails'
|
require 'rspec/rails'
|
||||||
require 'rswag/specs'
|
require 'rswag/specs'
|
||||||
|
require 'sidekiq/testing'
|
||||||
|
|
||||||
require 'rake'
|
require 'rake'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ paths:
|
||||||
lat: 52.502397
|
lat: 52.502397
|
||||||
lon: 13.356718
|
lon: 13.356718
|
||||||
tid: Swagger
|
tid: Swagger
|
||||||
tst: 1718355569
|
tst: 1718385215
|
||||||
servers:
|
servers:
|
||||||
- url: http://{defaultHost}
|
- url: http://{defaultHost}
|
||||||
variables:
|
variables:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue