This commit is contained in:
Kelorastus
2026-09-23 16:05:19 +02:00
parent 4a92cc0b63
commit 4d620fc5ad
27 changed files with 3571 additions and 104 deletions
+19 -4
View File
@@ -23,6 +23,9 @@
const current = $derived(launcher.settings);
const locked = $derived(launcher.locked);
const saving = $derived(launcher.busy === "settings");
/** A launcher that ships on an ODIAN drive installs on that drive to run ODIAN from it,
* or on a disk of the PC it is plugged into to hand ODIAN over. */
const portable = $derived(s?.portable ?? false);
const busy = $derived(launcher.busy !== null);
const trimmed = $derived<Settings>({
@@ -36,10 +39,12 @@
trimmed.mcp_url !== current.mcp_url ||
trimmed.install_dir !== current.install_dir),
);
/** A drive's launcher needs a folder on a disk: a root or a share holds no install. */
const offDrive = $derived(portable && trimmed.install_dir !== "" && !/^[A-Za-z]:\\.+/.test(trimmed.install_dir));
const siteError = $derived(urlProblem(trimmed.site_url));
const mcpError = $derived(urlProblem(trimmed.mcp_url));
const dirError = $derived(trimmed.install_dir ? null : "Choose where ODIAN is installed.");
const invalid = $derived(siteError !== null || mcpError !== null || dirError !== null);
const invalid = $derived(siteError !== null || mcpError !== null || dirError !== null || offDrive);
function urlProblem(value: string): string | null {
if (!value) return "Required.";
@@ -134,7 +139,7 @@
function installFromDrive() {
open = false;
void launcher.installFromDrive();
void launcher.chooseDrive();
}
function signIn() {
@@ -216,14 +221,24 @@
</button>
</div>
<span id="set-install-dir-help" class={dirty && dirError ? "field-error" : "field-help"}>
{dirty && dirError ? dirError : "Application, database snapshot and map tiles live here."}
{#if offDrive}
Give a folder on a disk, like D:\ODIAN — not a drive's root, and not a network share.
{:else if portable}
On the ODIAN drive this launcher runs from, ODIAN runs from the drive and follows it to the
next PC. A folder on this PC's own disk installs ODIAN onto the PC instead.
{:else}
{dirty && dirError ? dirError : "Application, database snapshot and map tiles live here."}
{/if}
</span>
</div>
</fieldset>
<section class="group" aria-labelledby="set-drive-title">
<h3 id="set-drive-title" class="eyebrow">Install from drive</h3>
<p class="text">Install or update from an ODIAN SSD without reaching the DHP. Pick the drive's root folder.</p>
<p class="text">
Copy ODIAN from an ODIAN SSD into your install folder, without reaching the DHP. Pick the drive,
then choose what to copy.
</p>
<div>
<button type="button" class="btn" disabled={locked || busy} onclick={installFromDrive}>
<Icon name="drive" size={14} /> Install from drive…