Say local engine in the import dialog and the offline errors
A tester saw "raw files are demosaiced by the server" and read it as an upload to someone else's machine. In desktop mode the decoder runs in the bundle on this PC, so the import dialog, the join page and the "cannot reach" error now say local engine, while team-server installs keep the server wording.
This commit is contained in:
@@ -2540,6 +2540,7 @@ export default function App() {
|
|||||||
initialFiles={pendingFiles}
|
initialFiles={pendingFiles}
|
||||||
existing={photos}
|
existing={photos}
|
||||||
cloud={cloudUser ? { uploadOriginal, push: pushPhoto } : null}
|
cloud={cloudUser ? { uploadOriginal, push: pushPhoto } : null}
|
||||||
|
local={localMode}
|
||||||
onNeedServer={() => {
|
onNeedServer={() => {
|
||||||
setImportOpen(false);
|
setImportOpen(false);
|
||||||
setCloudError(null);
|
setCloudError(null);
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ interface Props {
|
|||||||
immichEnabled?: boolean;
|
immichEnabled?: boolean;
|
||||||
onCreateImmichGallery?: (eventId: string) => Promise<EventRecord>;
|
onCreateImmichGallery?: (eventId: string) => Promise<EventRecord>;
|
||||||
cloud?: CloudImport | null;
|
cloud?: CloudImport | null;
|
||||||
|
/** Desktop bundle: the decoder runs on this PC rather than a team server. */
|
||||||
|
local?: boolean;
|
||||||
onNeedServer: () => void;
|
onNeedServer: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,6 +34,7 @@ export default function ImportModal({
|
|||||||
immichEnabled = false,
|
immichEnabled = false,
|
||||||
onCreateImmichGallery,
|
onCreateImmichGallery,
|
||||||
cloud,
|
cloud,
|
||||||
|
local = false,
|
||||||
onNeedServer,
|
onNeedServer,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const startId = initialEventId !== 'all' && initialEventId !== 'unsorted' ? initialEventId : events[0]?.id ?? '__new';
|
const startId = initialEventId !== 'all' && initialEventId !== 'unsorted' ? initialEventId : events[0]?.id ?? '__new';
|
||||||
@@ -278,7 +281,8 @@ export default function ImportModal({
|
|||||||
<strong>Drop photos here</strong>
|
<strong>Drop photos here</strong>
|
||||||
<p className="muted">
|
<p className="muted">
|
||||||
or click to choose files. JPEG, PNG, WebP, AVIF, TIFF and camera raw (CR2, CR3, NEF,
|
or click to choose files. JPEG, PNG, WebP, AVIF, TIFF and camera raw (CR2, CR3, NEF,
|
||||||
ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs the team server.
|
ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs{' '}
|
||||||
|
{local ? 'the local engine' : 'the team server'}.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
@@ -329,18 +333,24 @@ export default function ImportModal({
|
|||||||
<strong>
|
<strong>
|
||||||
{rawCount} raw file{rawCount === 1 ? '' : 's'} cannot be read by the browser.
|
{rawCount} raw file{rawCount === 1 ? '' : 's'} cannot be read by the browser.
|
||||||
</strong>{' '}
|
</strong>{' '}
|
||||||
They are decoded by the team server, so sign in before importing — or import them later
|
{local
|
||||||
from the library.
|
? 'They are decoded by the local engine on this PC. Check that Luminary is running, then import again.'
|
||||||
<button className="btn primary small banner-action" onClick={onNeedServer} disabled={busy}>
|
: 'They are decoded by the team server, so sign in before importing — or import them later from the library.'}
|
||||||
Sign in to the server
|
{!local && (
|
||||||
</button>
|
<button className="btn primary small banner-action" onClick={onNeedServer} disabled={busy}>
|
||||||
|
Sign in to the server
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{rawCount > 0 && cloud && (
|
{rawCount > 0 && cloud && (
|
||||||
<div className="banner info">
|
<div className="banner info">
|
||||||
Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each file
|
{local
|
||||||
usually takes 2–4 seconds.
|
? 'Raw files are demosaiced by the Luminary local engine (LibRaw) on this PC, a few ' +
|
||||||
|
'at a time in parallel. Each file usually takes 2–4 seconds, and nothing leaves your computer.'
|
||||||
|
: 'Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each ' +
|
||||||
|
'file usually takes 2–4 seconds.'}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ LUMINARY
|
|||||||
{loadError && (
|
{loadError && (
|
||||||
<>
|
<>
|
||||||
<span className="join-eyebrow">Invite</span>
|
<span className="join-eyebrow">Invite</span>
|
||||||
<h1>Can’t reach the server</h1>
|
<h1>Can’t reach Luminary</h1>
|
||||||
<p className="muted">{loadError}</p>
|
<p className="muted">{loadError}</p>
|
||||||
<a className="btn ghost wide" href="/">
|
<a className="btn ghost wide" href="/">
|
||||||
Go to Luminary
|
Go to Luminary
|
||||||
|
|||||||
+16
-1
@@ -35,6 +35,17 @@ export interface UploadResult {
|
|||||||
note?: string | null;
|
note?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True once /api/health reports LUMINARY_LOCAL=1: the engine runs inside this
|
||||||
|
* app's own folder, so copy must not send users looking for a remote server.
|
||||||
|
*/
|
||||||
|
let localEngine = false;
|
||||||
|
|
||||||
|
/** Whether this app talks to the engine in its own bundle (desktop mode). */
|
||||||
|
export function isLocalEngine(): boolean {
|
||||||
|
return localEngine;
|
||||||
|
}
|
||||||
|
|
||||||
export class ApiError extends Error {
|
export class ApiError extends Error {
|
||||||
status: number;
|
status: number;
|
||||||
constructor(message: string, status: number) {
|
constructor(message: string, status: number) {
|
||||||
@@ -48,7 +59,10 @@ export async function request<T>(path: string, init?: RequestInit): Promise<T> {
|
|||||||
try {
|
try {
|
||||||
res = await fetch(path, { credentials: 'same-origin', ...init });
|
res = await fetch(path, { credentials: 'same-origin', ...init });
|
||||||
} catch {
|
} catch {
|
||||||
throw new ApiError('Cannot reach the Luminary server', 0);
|
throw new ApiError(
|
||||||
|
localEngine ? 'Cannot reach the Luminary local engine' : 'Cannot reach the Luminary server',
|
||||||
|
0,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
let message = `Request failed (${res.status})`;
|
let message = `Request failed (${res.status})`;
|
||||||
@@ -78,6 +92,7 @@ export async function getHealth(): Promise<Health | null> {
|
|||||||
const res = await fetch('/api/health', { credentials: 'same-origin' });
|
const res = await fetch('/api/health', { credentials: 'same-origin' });
|
||||||
if (!res.ok) return null;
|
if (!res.ok) return null;
|
||||||
const body = (await res.json()) as Health;
|
const body = (await res.json()) as Health;
|
||||||
|
localEngine = body?.local === true;
|
||||||
return body?.ok ? body : null;
|
return body?.ok ? body : null;
|
||||||
} catch {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user