adds Dockerfiles
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import * as noUiSlider from "noUiSlider";
|
||||
import * as noUiSlider from "nouislider";
|
||||
import "nouislider/dist/nouislider.css";
|
||||
import { createEventDispatcher, onMount } from "svelte";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import noUiSlider from "noUiSlider";
|
||||
import noUiSlider from "nouislider";
|
||||
import "nouislider/dist/nouislider.css";
|
||||
import { createEventDispatcher, onMount } from "svelte";
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"german": "Deutsch",
|
||||
"hero_section_0_text": "Entdecke spannende Routen, speichere deine Favoriten und erlebe die Schönheit der Natur. Finde dein nächstes Abenteuer!",
|
||||
"hero_section_1_text": "Hier sind einige Routen, die dir gefallen könnten. Oder du wirfst einen Blick auf die vollständige Liste.",
|
||||
"hero_section_2_text": "Wusstest due schon? Du kannst nicht nur deine Wanderwege speichern. Es gibt viele Kategorien für alle deine Abenteuer.",
|
||||
"hero_section_2_text": "Wusstest due schon? Du kannst nicht nur deine Routen speichern. Es gibt viele Kategorien für alle deine Abenteuer.",
|
||||
"icon": "Icon",
|
||||
"imperial": "Amerikanisch",
|
||||
"language": "Sprache",
|
||||
@@ -77,7 +77,7 @@
|
||||
"save": "Speichern",
|
||||
"save-trail": "Route speichern",
|
||||
"search-cities": "Städte suchen",
|
||||
"search-for-trails-places": "Suche nach Wegen, Orten",
|
||||
"search-for-trails-places": "Suche nach Routen, Orten",
|
||||
"search-trails": "Route suchen",
|
||||
"select-list": "Liste auswählen",
|
||||
"settings": "Einstellungen",
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { PUBLIC_MEILISEARCH_URL } from '$env/static/public'
|
||||
import { PUBLIC_MEILISEARCH_API_TOKEN } from '$env/static/public'
|
||||
import { env } from '$env/dynamic/public'
|
||||
|
||||
import { MeiliSearch } from 'meilisearch'
|
||||
import { pb } from './pocketbase'
|
||||
|
||||
export function createInstance() {
|
||||
if (pb.authStore.model) {
|
||||
return new MeiliSearch({ host: PUBLIC_MEILISEARCH_URL, apiKey: pb.authStore.model.token })
|
||||
return new MeiliSearch({ host: env.PUBLIC_MEILISEARCH_URL, apiKey: pb.authStore.model.token })
|
||||
}
|
||||
return new MeiliSearch({ host: PUBLIC_MEILISEARCH_URL, apiKey: PUBLIC_MEILISEARCH_API_TOKEN })
|
||||
return new MeiliSearch({ host: env.PUBLIC_MEILISEARCH_URL, apiKey: env.PUBLIC_MEILISEARCH_API_TOKEN })
|
||||
}
|
||||
|
||||
export function regenerateInstance() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { PUBLIC_POCKETBASE_URL } from '$env/static/public'
|
||||
import { env } from '$env/dynamic/public'
|
||||
import PocketBase from 'pocketbase'
|
||||
|
||||
export function createInstance() {
|
||||
return new PocketBase(PUBLIC_POCKETBASE_URL)
|
||||
return new PocketBase(env.PUBLIC_POCKETBASE_URL)
|
||||
}
|
||||
|
||||
export const pb = createInstance()
|
||||
@@ -15,8 +15,8 @@ export const trail: Writable<Trail> = writable(new Trail(""));
|
||||
|
||||
export const editTrail: Writable<Trail> = writable(new Trail(""));
|
||||
|
||||
export async function trails_index(data: { perPage: number } = { perPage: 5 }) {
|
||||
const response: Trail[] = (await pb.collection('trails').getList<Trail>(1, data.perPage, { expand: "category,waypoints,summit_logs" })).items
|
||||
export async function trails_index(data: { perPage: number, random?: boolean } = { perPage: 5, random: false }) {
|
||||
const response: Trail[] = (await pb.collection('trails').getList<Trail>(1, data.perPage, { expand: "category,waypoints,summit_logs", sort: data.random ? "@random" : "" })).items
|
||||
|
||||
for (const trail of response) {
|
||||
setFileURLs(trail);
|
||||
@@ -87,7 +87,7 @@ export async function trails_search_bounding_box(northEast: LatLng, southWest: L
|
||||
const trailIds = response.hits.map((h) => h.id);
|
||||
|
||||
if (trailIds.length == 0) {
|
||||
const currentTrails : Trail[] = get(trails);
|
||||
const currentTrails: Trail[] = get(trails);
|
||||
trails.set([]);
|
||||
return compareObjectArrays<Trail>(currentTrails, []);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export async function trails_show(id: string, loadGPX?: boolean) {
|
||||
|
||||
response._photoFiles = [];
|
||||
|
||||
trail.set(response);
|
||||
trail.set(response);
|
||||
|
||||
return response;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ export async function trails_update(oldTrail: Trail, newTrail: Trail, formData:
|
||||
formData.append("waypoints", unchangedWaypoint.id!);
|
||||
}
|
||||
|
||||
const summitLogUpdates = compareObjectArrays<SummitLog>(oldTrail.expand.summit_logs ?? [], newTrail.expand.summit_logs ?? []);
|
||||
const summitLogUpdates = compareObjectArrays<SummitLog>(oldTrail.expand.summit_logs ?? [], newTrail.expand.summit_logs ?? []);
|
||||
|
||||
for (const summitLog of summitLogUpdates.added) {
|
||||
const model = await summit_logs_create(summitLog);
|
||||
@@ -307,7 +307,7 @@ function setFileURLs(trail: Trail) {
|
||||
}
|
||||
}
|
||||
|
||||
function compareObjectArrays<T extends { id?: string }>(oldArray: T[], newArray: T[]) {
|
||||
function compareObjectArrays<T extends { id?: string }>(oldArray: T[], newArray: T[]) {
|
||||
const newObjects = [];
|
||||
const updatedObjects = [];
|
||||
const unchangedObjects = [];
|
||||
|
||||
Reference in New Issue
Block a user