Merge pull request #1255 from Freika/dev

0.26.6
This commit is contained in:
Evgenii Burmakin 2025-05-22 19:16:44 +02:00 committed by GitHub
commit d9edc967ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 55 additions and 34 deletions

View file

@ -1 +1 @@
0.26.5
0.26.6

View file

@ -74,6 +74,6 @@ jobs:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
platforms: linux/amd64,linux/arm64,linux/arm/v8,linux/arm/v7,linux/arm/v6
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

View file

@ -4,6 +4,19 @@ 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.26.6 - 2025-05-22
## Added
- armv8 to docker build. #1249
## Changed
- Points are now being created in the `points` queue. #1243
- Route opacity is now being displayed as percentage in the map settings. #462 #1224
- Exported GeoJSON file now contains coordinates as floats instead of strings, as per RFC 7946. #762
- Fog of war now can be set to 200 meter per point. #630
# 0.26.5 - 2025-05-20
## Fixed

View file

@ -180,7 +180,7 @@ GEM
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
json (2.10.2)
json (2.12.0)
json-schema (5.0.1)
addressable (~> 2.8)
jwt (2.10.1)
@ -197,7 +197,7 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.4)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
lograge (0.14.0)
@ -251,8 +251,8 @@ GEM
optimist (3.2.0)
orm_adapter (0.5.0)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.7.4)
parallel (1.27.0)
parser (3.3.8.0)
ast (~> 2.4.1)
racc
patience_diff (1.2.0)
@ -282,7 +282,7 @@ GEM
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.8.1)
rack (3.1.13)
rack (3.1.15)
rack-session (2.1.0)
base64 (>= 0.1.0)
rack (>= 3.0.0)
@ -371,7 +371,7 @@ GEM
rswag-ui (2.16.0)
actionpack (>= 5.2, < 8.1)
railties (>= 5.2, < 8.1)
rubocop (1.75.2)
rubocop (1.75.6)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
@ -382,15 +382,15 @@ GEM
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.44.0)
rubocop-ast (1.44.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-rails (2.31.0)
rubocop-rails (2.32.0)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sentry-rails (5.23.0)

View file

@ -2,7 +2,7 @@
class Api::V1::Maps::TileUsageController < ApiController
def create
Maps::TileUsage::Track.new(current_api_user.id, tile_usage_params[:count].to_i).call
Metrics::Maps::TileUsage::Track.new(current_api_user.id, tile_usage_params[:count].to_i).call
head :ok
end

View file

@ -46,6 +46,7 @@ export default class extends BaseController {
this.userSettings = JSON.parse(this.element.dataset.user_settings);
this.clearFogRadius = parseInt(this.userSettings.fog_of_war_meters) || 50;
this.fogLinethreshold = parseInt(this.userSettings.fog_of_war_threshold) || 90;
// Store route opacity as decimal (0-1) internally
this.routeOpacity = parseFloat(this.userSettings.route_opacity) || 0.6;
this.distanceUnit = this.userSettings.distance_unit || "km";
this.pointsRenderingMode = this.userSettings.points_rendering_mode || "raw";
@ -726,16 +727,16 @@ export default class extends BaseController {
// Form HTML
div.innerHTML = `
<form id="settings-form" style="overflow-y: auto; height: 36rem; width: 12rem;">
<label for="route-opacity">Route Opacity</label>
<label for="route-opacity">Route Opacity, %</label>
<div class="join">
<input type="number" class="input input-ghost join-item focus:input-ghost input-xs input-bordered w-full max-w-xs" id="route-opacity" name="route_opacity" min="0" max="1" step="0.1" value="${this.routeOpacity}">
<input type="number" class="input input-ghost join-item focus:input-ghost input-xs input-bordered w-full max-w-xs" id="route-opacity" name="route_opacity" min="10" max="100" step="10" value="${Math.round(this.routeOpacity * 100)}">
<label for="route_opacity_info" class="btn-xs join-item ">?</label>
</div>
<label for="fog_of_war_meters">Fog of War radius</label>
<div class="join">
<input type="number" class="join-item input input-ghost focus:input-ghost input-xs input-bordered w-full max-w-xs" id="fog_of_war_meters" name="fog_of_war_meters" min="5" max="100" step="1" value="${this.clearFogRadius}">
<input type="number" class="join-item input input-ghost focus:input-ghost input-xs input-bordered w-full max-w-xs" id="fog_of_war_meters" name="fog_of_war_meters" min="5" max="200" step="1" value="${this.clearFogRadius}">
<label for="fog_of_war_meters_info" class="btn-xs join-item">?</label>
</div>
@ -863,12 +864,16 @@ export default class extends BaseController {
event.preventDefault();
console.log('Form submitted');
// Convert percentage to decimal for route_opacity
const opacityValue = event.target.route_opacity.value.replace('%', '');
const decimalOpacity = parseFloat(opacityValue) / 100;
fetch(`/api/v1/settings?api_key=${this.apiKey}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
settings: {
route_opacity: event.target.route_opacity.value,
route_opacity: decimalOpacity.toString(),
fog_of_war_meters: event.target.fog_of_war_meters.value,
fog_of_war_threshold: event.target.fog_of_war_threshold.value,
meters_between_routes: event.target.meters_between_routes.value,
@ -940,6 +945,7 @@ export default class extends BaseController {
// Update the local settings
this.userSettings = { ...this.userSettings, ...newSettings };
// Store the value as decimal internally, but display as percentage in UI
this.routeOpacity = parseFloat(newSettings.route_opacity) || 0.6;
this.clearFogRadius = parseInt(newSettings.fog_of_war_meters) || 50;

View file

@ -3,7 +3,7 @@
class Overland::BatchCreatingJob < ApplicationJob
include PointValidation
queue_as :default
queue_as :points
def perform(params, user_id)
data = Overland::Params.new(params).call

View file

@ -3,7 +3,7 @@
class Owntracks::PointCreatingJob < ApplicationJob
include PointValidation
queue_as :default
queue_as :points
def perform(point_params, user_id)
parsed_params = OwnTracks::Params.new(point_params).call

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class Points::CreateJob < ApplicationJob
queue_as :default
queue_as :points
def perform(params, user_id)
data = Points::Params.new(params, user_id).call

View file

@ -14,7 +14,7 @@ class Points::GeojsonSerializer
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [point.lon.to_s, point.lat.to_s]
coordinates: [point.lon, point.lat]
},
properties: PointSerializer.new(point).call
}

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
class Maps::TileUsage::Track
class Metrics::Maps::TileUsage::Track
def initialize(user_id, count = 1)
@user_id = user_id
@count = count

View file

@ -13,7 +13,7 @@ class Users::SafeSettings
'time_threshold_minutes' => 30,
'merge_threshold_minutes' => 15,
'live_map_enabled' => true,
'route_opacity' => 0.6,
'route_opacity' => 60,
'immich_url' => nil,
'immich_api_key' => nil,
'photoprism_url' => nil,

View file

@ -1,6 +1,7 @@
---
:concurrency: <%= ENV.fetch("BACKGROUND_PROCESSING_CONCURRENCY", 10) %>
:queues:
- points
- default
- imports
- exports

View file

@ -29,6 +29,7 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: dawarich_development
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d dawarich_development" ]

File diff suppressed because one or more lines are too long

View file

@ -5,11 +5,11 @@ require 'rails_helper'
RSpec.describe 'Api::V1::Maps::TileUsage', type: :request do
describe 'POST /api/v1/maps/tile_usage' do
let(:tile_count) { 5 }
let(:track_service) { instance_double(Maps::TileUsage::Track) }
let(:track_service) { instance_double(Metrics::Maps::TileUsage::Track) }
let(:user) { create(:user) }
before do
allow(Maps::TileUsage::Track).to receive(:new).with(user.id, tile_count).and_return(track_service)
allow(Metrics::Maps::TileUsage::Track).to receive(:new).with(user.id, tile_count).and_return(track_service)
allow(track_service).to receive(:call)
end
@ -19,7 +19,7 @@ RSpec.describe 'Api::V1::Maps::TileUsage', type: :request do
params: { tile_usage: { count: tile_count } },
headers: { 'Authorization' => "Bearer #{user.api_key}" }
expect(Maps::TileUsage::Track).to have_received(:new).with(user.id, tile_count)
expect(Metrics::Maps::TileUsage::Track).to have_received(:new).with(user.id, tile_count)
expect(track_service).to have_received(:call)
expect(response).to have_http_status(:ok)
end

View file

@ -20,7 +20,7 @@ RSpec.describe Points::GeojsonSerializer do
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [point.lon.to_s, point.lat.to_s]
coordinates: [point.lon, point.lat]
},
properties: PointSerializer.new(point).call
}

View file

@ -3,7 +3,7 @@
require 'rails_helper'
require 'prometheus_exporter/client'
RSpec.describe Maps::TileUsage::Track do
RSpec.describe Metrics::Maps::TileUsage::Track do
describe '#call' do
subject(:track) { described_class.new(user_id, tile_count).call }

View file

@ -18,7 +18,7 @@ RSpec.describe Users::SafeSettings do
time_threshold_minutes: 30,
merge_threshold_minutes: 15,
live_map_enabled: true,
route_opacity: 0.6,
route_opacity: 60,
immich_url: nil,
immich_api_key: nil,
photoprism_url: nil,
@ -42,7 +42,7 @@ RSpec.describe Users::SafeSettings do
'time_threshold_minutes' => 45,
'merge_threshold_minutes' => 20,
'live_map_enabled' => false,
'route_opacity' => 0.8,
'route_opacity' => 80,
'immich_url' => 'https://immich.example.com',
'immich_api_key' => 'immich-key',
'photoprism_url' => 'https://photoprism.example.com',
@ -64,7 +64,7 @@ RSpec.describe Users::SafeSettings do
"time_threshold_minutes" => 45,
"merge_threshold_minutes" => 20,
"live_map_enabled" => false,
"route_opacity" => 0.8,
"route_opacity" => 80,
"immich_url" => "https://immich.example.com",
"immich_api_key" => "immich-key",
"photoprism_url" => "https://photoprism.example.com",
@ -92,7 +92,7 @@ RSpec.describe Users::SafeSettings do
expect(safe_settings.time_threshold_minutes).to eq(30)
expect(safe_settings.merge_threshold_minutes).to eq(15)
expect(safe_settings.live_map_enabled).to be true
expect(safe_settings.route_opacity).to eq(0.6)
expect(safe_settings.route_opacity).to eq(60)
expect(safe_settings.immich_url).to be_nil
expect(safe_settings.immich_api_key).to be_nil
expect(safe_settings.photoprism_url).to be_nil
@ -113,7 +113,7 @@ RSpec.describe Users::SafeSettings do
'time_threshold_minutes' => 45,
'merge_threshold_minutes' => 20,
'live_map_enabled' => false,
'route_opacity' => 0.8,
'route_opacity' => 80,
'immich_url' => 'https://immich.example.com',
'immich_api_key' => 'immich-key',
'photoprism_url' => 'https://photoprism.example.com',
@ -132,7 +132,7 @@ RSpec.describe Users::SafeSettings do
expect(safe_settings.time_threshold_minutes).to eq(45)
expect(safe_settings.merge_threshold_minutes).to eq(20)
expect(safe_settings.live_map_enabled).to be false
expect(safe_settings.route_opacity).to eq(0.8)
expect(safe_settings.route_opacity).to eq(80)
expect(safe_settings.immich_url).to eq('https://immich.example.com')
expect(safe_settings.immich_api_key).to eq('immich-key')
expect(safe_settings.photoprism_url).to eq('https://photoprism.example.com')