Commander-Wunsch: die CLI-Installation ist grausam. Jetzt: - install-gui.ps1 (WinForms, ASCII-only): Fenster mit Feldern (Rippy-IP, Worker-Name, Autostart-Checkbox), Install-Knopf mit Live-Log, danach 'Worker starten'-Knopf. Gleiche Schritte wie der CLI-Installer (Worker-Code + HandBrake latest + venv + Tray/Start/Uninstall). Braucht nur Python 3.10+, keine externe GUI-Runtime. - API: GET /worker-setup/windows-gui serviert die GUI; Dockerfile kopiert sie ins worker_dist/. - UI (Worker-Tab, Windows): 'Grafischen Installer herunterladen (.bat)' als Haupt-Weg — die .bat wird CLIENT-seitig mit der eingetragenen LAN-IP erzeugt (Blob-Download), Doppelklick laedt+startet die GUI von Rippy. Der CLI-Befehl bleibt als Profi-Alternative. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { Server, RefreshCw, Copy, CheckCircle, Trash2 } from 'lucide-react'
|
||||
import { Server, RefreshCw, Copy, CheckCircle, Trash2, Download } from 'lucide-react'
|
||||
import { api } from '../lib/api'
|
||||
import { useToast } from '../context/ToastContext'
|
||||
import { Card, CardHeader, CardTitle, CardContent } from './ui/Card'
|
||||
@@ -91,6 +91,30 @@ export default function WorkerVerwaltung() {
|
||||
})
|
||||
}
|
||||
|
||||
// Grafischer Installer: erzeugt eine .bat CLIENT-seitig mit der eingetragenen
|
||||
// LAN-IP (der Browser kennt sie, die API nicht sicher). Doppelklick lädt den
|
||||
// WinForms-Installer von Rippy und startet ihn — kein CLI mehr.
|
||||
const guiInstallerHerunterladen = () => {
|
||||
const host = rippyHost.trim()
|
||||
if (!host) { toast('error', 'Erst die LAN-IP der Rippy-Maschine eintragen'); return }
|
||||
const psInner = `try { Invoke-WebRequest 'http://${host}/api/worker-setup/windows-gui' -OutFile ($env:TEMP + '\\rippy-gui.ps1') -UseBasicParsing; & ($env:TEMP + '\\rippy-gui.ps1') -RippyHost '${host}' } catch { Write-Host $_.Exception.Message -ForegroundColor Red; Read-Host 'Fehler - Enter zum Schliessen' }`
|
||||
const bat = [
|
||||
'@echo off',
|
||||
'title Rippy Worker Setup',
|
||||
'echo.',
|
||||
`echo Starte grafischen Rippy-Worker-Installer von ${host} ...`,
|
||||
'echo.',
|
||||
`powershell -NoProfile -ExecutionPolicy Bypass -STA -Command "${psInner}"`,
|
||||
].join('\r\n')
|
||||
const blob = new Blob([bat], { type: 'application/octet-stream' })
|
||||
const a = document.createElement('a')
|
||||
a.href = URL.createObjectURL(blob)
|
||||
a.download = 'rippy-worker-setup.bat'
|
||||
document.body.appendChild(a); a.click(); a.remove()
|
||||
URL.revokeObjectURL(a.href)
|
||||
toast('success', 'rippy-worker-setup.bat heruntergeladen — doppelklicken zum Installieren')
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Verbundene Worker */}
|
||||
@@ -200,10 +224,27 @@ export default function WorkerVerwaltung() {
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Windows: grafischer Installer als Haupt-Weg (Doppelklick statt CLI) */}
|
||||
{variante === 'windows' && (
|
||||
<div className="rounded-xl p-4 border border-amber-500/30 bg-amber-500/5 space-y-2">
|
||||
<p className="text-sm text-slate-700 dark:text-slate-300">
|
||||
<strong>Einfachster Weg:</strong> grafischen Installer herunterladen, doppelklicken,
|
||||
Fenster ausfüllen, „Installieren". Braucht nur Python 3.10+ auf dem PC — kein Docker, kein git.
|
||||
</p>
|
||||
<Button variant="amber" onClick={guiInstallerHerunterladen} disabled={!rippyHost.trim()}>
|
||||
<Download size={16} /> Grafischen Installer herunterladen (.bat)
|
||||
</Button>
|
||||
<p className="text-xs text-slate-500 dark:text-slate-400">
|
||||
Windows warnt beim Doppelklick evtl. („Windows hat Ihren PC geschützt") → „Weitere Informationen"
|
||||
→ „Trotzdem ausführen". Die .bat lädt den Installer nur von deiner Rippy-Maschine.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="text-xs text-slate-500 dark:text-slate-400">
|
||||
{variante === 'linux'
|
||||
? 'Auf der Linux-Maschine (mit Docker) ausführen — WORKER_NAME frei wählen, unter dem Namen taucht sie oben auf und übernimmt Kompressions-Jobs. GPU wird erkannt und angezeigt.'
|
||||
: 'In einer PowerShell auf dem Windows-PC ausführen (braucht nur Python 3.10+ — kein Docker, kein git). Der Installer holt Worker-Code und HandBrake automatisch.'}
|
||||
: 'Alternativ (für Profis) per PowerShell-Befehl:'}
|
||||
</p>
|
||||
|
||||
<div className="relative rounded-xl p-4 font-mono text-xs whitespace-pre overflow-x-auto bg-slate-900 text-slate-200 border border-slate-800">
|
||||
|
||||
Reference in New Issue
Block a user