Record / Convert tabs — now gated behind PUBLIC_MOBILE_APP=true. Hidden by default in VPS/dev mode; only show when explicitly opted into the mobile app build.
Edit/Upload UI — split into two concepts:
- PUBLIC_EDIT_URL — the server base URL (empty = use proxy at /api/)
- PUBLIC_EDIT_ENABLED=true — whether to show the edit/upload buttons at all
bincio dev now sets PUBLIC_EDIT_ENABLED=true when instance.db exists (multi-user mode), so the upload button, edit button, and edit drawer all appear. The fetch calls already produce correct relative URLs (${''}/api/upload = /api/upload) which the Vite proxy forwards to bincio serve.
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
export let base: string = '/';
|
||||
export let athlete: AthleteZones | null = null;
|
||||
|
||||
const editUrl = import.meta.env.PUBLIC_EDIT_URL;
|
||||
const editUrl = import.meta.env.PUBLIC_EDIT_URL ?? '';
|
||||
const editEnabled = editUrl !== '' || import.meta.env.PUBLIC_EDIT_ENABLED === 'true';
|
||||
|
||||
let detail: ActivityDetail | null = null;
|
||||
let error = '';
|
||||
@@ -89,7 +90,7 @@
|
||||
|
||||
<svelte:window on:keydown={onKeydown} />
|
||||
|
||||
{#if editOpen && editUrl}
|
||||
{#if editOpen && editEnabled}
|
||||
<EditDrawer activityId={activity.id} {editUrl} on:saved={onSaved} on:close={() => editOpen = false} />
|
||||
{/if}
|
||||
|
||||
@@ -176,7 +177,7 @@
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<h1 class="text-2xl font-bold text-white">{displayTitle}</h1>
|
||||
{#if editUrl}
|
||||
{#if editEnabled}
|
||||
<button
|
||||
class="text-xs px-2 py-0.5 rounded border border-zinc-700 text-zinc-400 hover:border-zinc-500 hover:text-white transition-colors shrink-0"
|
||||
on:click={() => editOpen = true}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
let uploading = false;
|
||||
let fileInput: HTMLInputElement;
|
||||
|
||||
// editUrl is empty in multi-user VPS mode — the Vite proxy forwards /api/* to bincio serve.
|
||||
const api = `${editUrl}/api/activity/${activityId}`;
|
||||
|
||||
async function load() {
|
||||
|
||||
Reference in New Issue
Block a user