mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Change exposed volume
This commit is contained in:
parent
3f68ce5e37
commit
7daac8a887
8 changed files with 146 additions and 65 deletions
45
CHANGELOG.md
45
CHANGELOG.md
|
|
@ -5,6 +5,51 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [0.6.0] — 2024-06-12
|
||||
|
||||
### Added
|
||||
|
||||
- Exports page to list existing exports download them or delete them
|
||||
|
||||
### Changed
|
||||
|
||||
- Exporting process now is done in the background, so user can close the browser tab and come back later to download the file. The status of the export can be checked on the Exports page.
|
||||
|
||||
ℹ️ Deleting Export file will only delete the file, not the points in the database. ℹ️
|
||||
|
||||
⚠️ BREAKING CHANGES: ⚠️
|
||||
|
||||
Volume, exposed to the host machine for placing files to import was changed. See the changes below.
|
||||
|
||||
Path for placing files to import was changed from `tmp/imports` to `public/imports`.
|
||||
|
||||
```diff
|
||||
...
|
||||
|
||||
dawarich_app:
|
||||
image: freikin/dawarich:latest
|
||||
container_name: dawarich_app
|
||||
volumes:
|
||||
- gem_cache:/usr/local/bundle/gems
|
||||
- - tmp:/var/app/tmp
|
||||
+ - public:/var/app/public/imports
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
```diff
|
||||
...
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
gem_cache:
|
||||
shared_data:
|
||||
- tmp:
|
||||
+ public:
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## [0.5.3] — 2024-06-10
|
||||
|
||||
### Added
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,32 +1,47 @@
|
|||
<% content_for :title, "Exports" %>
|
||||
|
||||
<div class="w-full">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex justify-between items-center mb-5">
|
||||
<h1 class="font-bold text-4xl">Exports</h1>
|
||||
</div>
|
||||
|
||||
<div id="imports" class="min-w-full">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @exports.each do |export| %>
|
||||
<div id="exports" class="min-w-full">
|
||||
<% if @exports.empty? %>
|
||||
<div class="hero min-h-80 bg-base-200">
|
||||
<div class="hero-content text-center">
|
||||
<div class="max-w-md">
|
||||
<h1 class="text-5xl font-bold">Hello there!</h1>
|
||||
<p class="py-6">
|
||||
Here you'll find your exports, created on <%= link_to 'Points', points_url, class: 'link' %> page. But now there are none.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><%= export.name %></td>
|
||||
<td><%= export.status %></td>
|
||||
<td>
|
||||
<%= link_to 'Download', export.url, class: "px-4 py-2 bg-blue-500 text-white rounded-md", download: export.name %>
|
||||
<%= 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" %>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @exports.each do |export| %>
|
||||
<tr>
|
||||
<td><%= export.name %></td>
|
||||
<td><%= export.status %></td>
|
||||
<td>
|
||||
<% if export.completed? %>
|
||||
<%= link_to 'Download', export.url, class: "px-4 py-2 bg-blue-500 text-white rounded-md", download: export.name %>
|
||||
<% 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" %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,33 +5,46 @@
|
|||
</div>
|
||||
|
||||
<div id="imports" class="min-w-full">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Processed</th>
|
||||
<th>Doubles</th>
|
||||
<th>Created at</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @imports.each do |import| %>
|
||||
<% if @imports.empty? %>
|
||||
<div class="hero min-h-80 bg-base-200">
|
||||
<div class="hero-content text-center">
|
||||
<div class="max-w-md">
|
||||
<h1 class="text-5xl font-bold">Hello there!</h1>
|
||||
<p class="py-6">
|
||||
Here you'll find your imports, But now there are none. Let's <%= link_to 'create one', new_import_path, class: 'link' %>!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to import.name, import, class: 'underline hover:no-underline' %> (<%= import.source %>)
|
||||
</td>
|
||||
<td>
|
||||
<%= "✅" if import.processed == import.raw_points %>
|
||||
<%= "#{import.processed}/#{import.raw_points}" %>
|
||||
</td>
|
||||
<td><%= import.doubles %></td>
|
||||
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td>
|
||||
<th>Name</th>
|
||||
<th>Processed</th>
|
||||
<th>Doubles</th>
|
||||
<th>Created at</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @imports.each do |import| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to import.name, import, class: 'underline hover:no-underline' %> (<%= import.source %>)
|
||||
</td>
|
||||
<td>
|
||||
<%= "✅" if import.processed == import.raw_points %>
|
||||
<%= "#{import.processed}/#{import.raw_points}" %>
|
||||
</td>
|
||||
<td><%= import.doubles %></td>
|
||||
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,11 +8,24 @@
|
|||
|
||||
<p class='mb-3'>Import takes a while to finish, so you might want to run it in <code>screen</code> session.</p>
|
||||
|
||||
<p>1. Upload your Records.json file to your server</p>
|
||||
<p>2. Copy you Records.json to the <code>tmp</code> folder: <code>$ docker cp Records.json dawarich_app:/var/app/tmp/Records.json</code></p>
|
||||
<p>3. Attach to the docker container: <code>$ docker exec -it dawarich_app sh</code></p>
|
||||
<p>4. Run the rake task: <code>$ bundle exec rake import:big_file['tmp/Records.json','user@example.com']</code></p>
|
||||
<p>5. Wait patiently for process to finish</p>
|
||||
<p class='mt-5 mb-2'>1. Upload your Records.json file to your server</p>
|
||||
<p class='mt-5 mb-2'>2. Copy you Records.json to the <code>tmp</code> folder:
|
||||
<div class="mockup-code">
|
||||
<pre data-prefix="$"><code>docker cp Records.json dawarich_app:/var/app/public/imports/Records.json</code></pre>
|
||||
</div>
|
||||
</p>
|
||||
<p class='mt-5 mb-2'>3. Attach to the docker container:
|
||||
<div class="mockup-code">
|
||||
<pre data-prefix="$"><code>docker exec -it dawarich_app sh</code></pre>
|
||||
</div>
|
||||
</p>
|
||||
<p class='mt-5 mb-2'>4. Run the rake task:
|
||||
<div class="mockup-code">
|
||||
<pre data-prefix="$"><code>bundle exec rake import:big_file['public/imports/Records.json','user@example.com']</code>
|
||||
</pre>
|
||||
</div>
|
||||
</p>
|
||||
<p class='mt-5 mb-2'>5. Wait patiently for process to finish</p>
|
||||
|
||||
<p class='mt-3'>You can monitor progress in <a href="/sidekiq" class="underline">Sidekiq UI</a></p>
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -21,27 +21,22 @@
|
|||
</div>
|
||||
<div class="w-full md:w-2/12">
|
||||
<div class="flex flex-col space-y-2 text-center">
|
||||
<%= link_to "Today", map_path(start_at: Time.current.beginning_of_day, end_at: Time.current.end_of_day), class: "px-4 py-2 bg-blue-500 text-white rounded-md" %>
|
||||
<%= link_to "Today", map_path(start_at: Time.current.beginning_of_day, end_at: Time.current.end_of_day), class: "px-4 py-2 bg-gray-500 text-white rounded-md" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full md:w-2/12">
|
||||
<div class="flex flex-col space-y-2 text-center">
|
||||
<%= link_to "Yesterday", map_path(start_at: Date.yesterday.beginning_of_day, end_at: Date.yesterday.end_of_day), class: "px-4 py-2 bg-blue-500 text-white rounded-md" %>
|
||||
<%= link_to "Yesterday", map_path(start_at: Date.yesterday.beginning_of_day, end_at: Date.yesterday.end_of_day), class: "px-4 py-2 bg-gray-500 text-white rounded-md" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full md:w-2/12">
|
||||
<div class="flex flex-col space-y-2 text-center">
|
||||
<%= link_to "Last 7 days", map_path(start_at: 1.week.ago.beginning_of_day, end_at: Time.current.end_of_day), class: "px-4 py-2 bg-blue-500 text-white rounded-md" %>
|
||||
<%= link_to "Last 7 days", map_path(start_at: 1.week.ago.beginning_of_day, end_at: Time.current.end_of_day), class: "px-4 py-2 bg-gray-500 text-white rounded-md" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div role="alert" class="alert alert-warning">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>
|
||||
<span>Warning: Starting release 0.4.0 it's HIGHLY RECOMMENDED to switch from <code>/api/v1/points</code> to <code>/api/v1/owntracks/points</code> API endpoint. Please read more at <a href="https://github.com/Freika/dawarich/releases/tag/0.4.0" class='underline hover:no-underline'>0.4.0 release notes</a></span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="w-full"
|
||||
data-controller="maps"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
<div class="w-full md:w-2/6">
|
||||
<div class="flex flex-col space-y-2 text-center">
|
||||
<%= link_to 'Export points', exports_path(start_at: @start_at, end_at: @end_at), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure? This will start background process of exporting points withing timeframe, selected between 'Start at' and 'End at' inputs", turbo_method: :post }, class: "px-4 py-2 bg-blue-500 text-white rounded-md" %>
|
||||
<%= link_to 'Export points', exports_path(start_at: @start_at, end_at: @end_at), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure? This will start background process of exporting points withing timeframe, selected between #{@start_at} and #{@end_at}", turbo_method: :post }, class: "px-4 py-2 bg-green-500 text-white rounded-md" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ services:
|
|||
container_name: dawarich_app
|
||||
volumes:
|
||||
- gem_cache:/usr/local/bundle/gems
|
||||
- tmp:/var/app/tmp
|
||||
- public:/var/app/public
|
||||
networks:
|
||||
- dawarich
|
||||
ports:
|
||||
|
|
@ -78,4 +78,4 @@ volumes:
|
|||
db_data:
|
||||
gem_cache:
|
||||
shared_data:
|
||||
tmp:
|
||||
public:
|
||||
|
|
|
|||
Loading…
Reference in a new issue