Desktop: first-run setup wizard + FlyWithLua/Web-API/Lua-status guidance

Adds the four onboarding pieces that were missing:
- flywithlua_present Tauri command + wizard step that checks the plugin and
  links the FlyWithLua NG+ download when it's absent.
- Wizard step explaining how to enable X-Plane's Web/REST API (Settings>Network).
- FlyWithLua-Sync status row in the live diagnostics, from /api/health.lua
  ('N Skripte aktiv' / 'FlyWithLua fehlt' / 'kein X-Plane').
- 4-step guided wizard (X-Plane folder → FlyWithLua → Web-API → install+start)
  that auto-opens on first launch and is reachable via the header Einrichten
  button; the final step hands off to the normal server start (auto-installs Lua).

Verified the wizard DOM flow + the dLua status against a live bridge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 02:43:32 +02:00
parent 3d6d3f710e
commit 5f63c5032c
4 changed files with 178 additions and 2 deletions
+62
View File
@@ -10,6 +10,7 @@
<div class="panel">
<header class="hd">
<div class="brand">G1000<span>·web</span></div>
<button id="setupBtn" class="link" title="Einrichtungs-Assistent">⚙ Einrichten</button>
<div id="status" class="status off"><span class="dot"></span><span id="statusText">Gestoppt</span></div>
</header>
@@ -64,6 +65,7 @@
<div class="diag-row"><span>Verbundene Geräte</span><b id="dClients"></b></div>
<div class="diag-row"><span>Navdata</span><b id="dNav"></b></div>
<div class="diag-row"><span>Datarefs</span><b id="dRefs"></b></div>
<div class="diag-row"><span>FlyWithLua-Sync</span><b id="dLua"></b></div>
</div>
<details class="asp-wrap">
@@ -88,6 +90,66 @@
<button id="updateBtn" class="link">Nach Updates suchen</button>
</footer>
</div>
<!-- First-run setup wizard: links X-Plane, checks FlyWithLua, installs the Lua
scripts, explains the Web-API, then starts. -->
<div id="wizard" class="wiz hidden">
<div class="wiz-box">
<div class="wiz-head">
<b>Einrichtung</b>
<div class="wiz-steps">
<span data-s="1" class="on">1</span><span data-s="2">2</span><span data-s="3">3</span><span data-s="4">4</span>
</div>
<button id="wizClose" class="wiz-x" title="Schließen"></button>
</div>
<!-- Step 1: X-Plane folder -->
<div class="wiz-step" data-step="1">
<h3>1 · X-Plane 12 Ordner</h3>
<p>Wähle deinen X-Plane-12-Ordner. (Demo ohne X-Plane: einfach überspringen.)</p>
<div class="row">
<input id="wizPath" type="text" placeholder="z.B. /Users/du/X-Plane 12" spellcheck="false" />
<button id="wizBrowse" class="btn ghost">Suchen…</button>
</div>
<div id="wizPathHint" class="hint"></div>
</div>
<!-- Step 2: FlyWithLua -->
<div class="wiz-step hidden" data-step="2">
<h3>2 · FlyWithLua NG+</h3>
<p>Für die zweiseitige FMS- und Terrain-Synchronisierung braucht X-Plane das kostenlose Plugin <b>FlyWithLua NG+</b>.</p>
<div id="wizFwl" class="wiz-status"></div>
<p class="wiz-sub">Nicht installiert? <a href="#" id="wizFwlLink">FlyWithLua NG+ herunterladen</a>, in <code>X-Plane/Resources/plugins/</code> entpacken, X-Plane neu starten.</p>
<button id="wizFwlCheck" class="btn ghost sm">Erneut prüfen</button>
</div>
<!-- Step 3: Web API -->
<div class="wiz-step hidden" data-step="3">
<h3>3 · X-Plane Web-API aktivieren</h3>
<p>Damit das Cockpit Daten bekommt, muss X-Planes Web-Server an sein:</p>
<ol class="wiz-ol">
<li>X-Plane → <b>Settings</b><b>Network</b></li>
<li>Bereich <b>„Web/REST API"</b> (X-Plane 12.1.1+)</li>
<li><b>„Enable web server"</b> / API einschalten</li>
</ol>
<p class="wiz-sub">Ob's klappt, siehst du nach dem Start am Status „X-Plane: verbunden".</p>
</div>
<!-- Step 4: install + start -->
<div class="wiz-step hidden" data-step="4">
<h3>4 · Lua installieren & starten</h3>
<p>Beim Start kopiert der Server die Begleit-Skripte automatisch nach <code>FlyWithLua/Scripts/</code> und verbindet sich mit X-Plane.</p>
<label class="toggle"><input id="wizDemo" type="checkbox" /><span>Demo-Modus (ohne X-Plane)</span></label>
<div id="wizResult" class="wiz-status">Bereit.</div>
</div>
<div class="wiz-foot">
<button id="wizBack" class="btn ghost" disabled>Zurück</button>
<button id="wizNext" class="btn primary">Weiter</button>
</div>
</div>
</div>
<script src="main.js"></script>
</body>
</html>