feat: Worker V2 Flet GUI mit Feature-Parität und neuem Installer

This commit is contained in:
Hitonabi
2026-07-26 22:01:27 +02:00
parent e165e2a0d3
commit 9a151f3d8b
7 changed files with 507 additions and 737 deletions
Binary file not shown.
+22 -18
View File
@@ -482,8 +482,8 @@ function Do-Install {
$poolArg = if ($slots -le 1) { "--pool=solo" } else { "--pool=threads --concurrency=$slots" }
Log "Gleichzeitige Auftraege: $slots"
$trayBat = "@echo off`r`ncd /d `"%~dp0`"`r`nset REDIS_URL=redis://${rHost}:6379/0`r`nset DATABASE_URL=postgresql://rippy:rippy@${rHost}:5432/rippy`r`nset API_URL=http://${rHost}:8000`r`nset WORKER_NAME=$wName`r`nset RIPPY_TRAY_HOST=$rHost`r`nset RIPPY_SLOTS=$slots`r`nset TZ=UTC`r`n${mapZeile}set PATH=%~dp0;%PATH%`r`nstart `"`" venv\Scripts\pythonw.exe tray.py"
Set-Content -Path "start-tray.bat" -Value $trayBat -Encoding ASCII
$trayBat = "@echo off`r`ncd /d `"%~dp0`"`r`nset REDIS_URL=redis://${rHost}:6379/0`r`nset DATABASE_URL=postgresql://rippy:rippy@${rHost}:5432/rippy`r`nset API_URL=http://${rHost}:8000`r`nset WORKER_NAME=$wName`r`nset RIPPY_TRAY_HOST=$rHost`r`nset RIPPY_SLOTS=$slots`r`nset TZ=UTC`r`n${mapZeile}set PATH=%~dp0;%PATH%`r`nstart `"`" venv\Scripts\pythonw.exe gui.py"
Set-Content -Path "start-gui.bat" -Value $trayBat -Encoding ASCII
$workBat = "@echo off`r`ncd /d `"%~dp0`"`r`nset REDIS_URL=redis://${rHost}:6379/0`r`nset DATABASE_URL=postgresql://rippy:rippy@${rHost}:5432/rippy`r`nset API_URL=http://${rHost}:8000`r`nset WORKER_NAME=$wName`r`nset RIPPY_SLOTS=$slots`r`nset TZ=UTC`r`n${mapZeile}set PATH=%~dp0;%PATH%`r`nvenv\Scripts\celery.exe -A celery_app worker --loglevel=info -Q transcode $poolArg -n ${wName}@%%h"
Set-Content -Path "start-worker.bat" -Value $workBat -Encoding ASCII
@@ -565,9 +565,15 @@ if (-not `$schreibbar -and -not `$istAdmin) {
}
# 1. Alles beenden, was aus diesem Ordner läuft (Tray, celery, HandBrake).
Get-CimInstance Win32_Process | Where-Object {
`$_.ExecutablePath -like "`$ordner*"
} | ForEach-Object { Stop-Process -Id `$_.ProcessId -Force -ErrorAction SilentlyContinue }
#
# Der Tray-Prozess (pythonw.exe tray.py) kann mehrere Instanzen haben.
# Wir filtern via WMI anhand der CommandLine.
Get-WmiObject Win32_Process | Where-Object {
`$_.ExecutablePath -like "`$PSScriptRoot*" -or `$_.CommandLine -like "*gui.py*" -or `$_.CommandLine -like "*tray.py*"
} | ForEach-Object {
Write-Host "Beende Worker-Prozess: PID `$(`$_.ProcessId) (`$(`$_.Name))"
Stop-Process -Id `$_.ProcessId -Force -ErrorAction SilentlyContinue
}
Start-Sleep 3
# 2. Verknüpfungen entfernen Autostart UND Desktop, jeweils an BEIDEN möglichen
@@ -619,7 +625,7 @@ Start-Process cmd.exe -ArgumentList '/c timeout /t 4 /nobreak >nul & rd /s /q "'
try {
# Der Pfad zur .bat muss in Anführungszeichen, falls Leerzeichen drin sind.
# schtasks erwartet diese Escaped-Anführungszeichen: \"C:\Pfad\...\"
$aktion = "\`"$InstallDir\start-tray.bat\`""
$aktion = "\`"$InstallDir\start-gui.bat\`""
$process = Start-Process schtasks -ArgumentList "/create /tn `"RippyWorker`" /tr $aktion /sc ONLOGON /rl HIGHEST /f" -NoNewWindow -Wait -PassThru
if ($process.ExitCode -eq 0) {
@@ -655,20 +661,18 @@ Start-Process cmd.exe -ArgumentList '/c timeout /t 4 /nobreak >nul & rd /s /q "'
} else {
[Environment]::GetFolderPath("Desktop")
}
$wsh = New-Object -ComObject WScript.Shell
$lnk = $wsh.CreateShortcut((Join-Path $desktopDir "Rippy Worker.lnk"))
$lnk.TargetPath = (Join-Path $InstallDir "start-tray.bat")
$lnk.WorkingDirectory = $InstallDir
$lnk.Description = "Rippy Encoding-Worker starten (Symbol neben der Uhr)"
$lnk.WindowStyle = 7 # minimiert, damit die .bat nicht aufblitzt
$ico = Join-Path $InstallDir "rippy.ico"
if (Test-Path $ico) { $lnk.IconLocation = $ico }
$lnk.Save()
$wshell = New-Object -ComObject WScript.Shell
$lnk = Join-Path $desktopDir "Rippy Worker.lnk"
$sh = $wshell.CreateShortcut($lnk)
$sh.TargetPath = Join-Path $InstallDir "start-gui.bat"
$sh.WorkingDirectory = $InstallDir
$sh.IconLocation = Join-Path $InstallDir "rippy.ico"
$sh.Save()
Log "Verknüpfung 'Rippy Worker' auf dem Desktop angelegt."
} catch {
Log "HINWEIS: Desktop-Verknüpfung ging nicht ($($_.Exception.Message))."
Log " Der Worker ist trotzdem fertig — starten über"
Log " $InstallDir\start-tray.bat"
Log " $InstallDir\start-gui.bat"
}
}
@@ -702,8 +706,8 @@ $btnMap.Add_Click({
})
$btnInstall.Add_Click({ Do-Install })
$btnStart.Add_Click({
Start-Process -FilePath (Join-Path $InstallDir "start-tray.bat") -WindowStyle Hidden
[System.Windows.Forms.MessageBox]::Show("Worker gestartet - Symbol erscheint unten rechts neben der Uhr.", "Rippy")
Start-Process -FilePath (Join-Path $InstallDir "start-gui.bat") -WindowStyle Hidden
[System.Windows.Forms.MessageBox]::Show("Worker-Dashboard gestartet.", "Rippy")
$form.Close()
})
+20 -22
View File
@@ -1,4 +1,4 @@
# Rippy: Nativer Windows-Transcode-Worker - Installation OHNE Docker.
# Rippy: Nativer Windows-Transcode-Worker - Installation OHNE Docker.
#
# Was das Skript tut (alles nach -InstallDir, Standard "C:\Program Files\Rippy Worker"):
# 1. Prüft Python (3.10+), legt ein venv an, installiert die Abhängigkeiten
@@ -190,10 +190,10 @@ venv\Scripts\celery.exe -A celery_app worker --loglevel=info -Q transcode $poolA
"@
Set-Content -Path "start-worker.bat" -Value $bat -Encoding ASCII
# 7. Tray-Start (empfohlen): Symbol neben der Uhr, kein Konsolenfenster
# 7. GUI-Start (empfohlen): Modernes natives Fenster, kein Konsolenfenster
$trayBat = @"
@echo off
rem Rippy-Worker mit Tray-Symbol - verbindet sich mit $RippyHost
rem Rippy-Worker GUI - verbindet sich mit $RippyHost
cd /d "%~dp0"
set REDIS_URL=redis://${RippyHost}:6379/0
set DATABASE_URL=postgresql://rippy:rippy@${RippyHost}:5432/rippy
@@ -203,10 +203,10 @@ set RIPPY_TRAY_HOST=$RippyHost
set RIPPY_SLOTS=$Slots
set TZ=UTC
${mapZeile}set PATH=%~dp0;%PATH%
start "" venv\Scripts\pythonw.exe tray.py
start "" venv\Scripts\pythonw.exe gui.py
"@
Set-Content -Path "start-tray.bat" -Value $trayBat -Encoding ASCII
Write-Host "start-worker.bat + start-tray.bat erzeugt."
Set-Content -Path "start-gui.bat" -Value $trayBat -Encoding ASCII
Write-Host "start-worker.bat + start-gui.bat erzeugt."
# 8. Deinstaller - MUSS-Kriterium: rückstandsfrei entfernbar
$uninstall = @"
@@ -245,7 +245,7 @@ if (-not `$schreibbar -and -not `$istAdmin) {
}
Get-CimInstance Win32_Process | Where-Object {
`$_.ExecutablePath -like "`$PSScriptRoot*"
`$_.ExecutablePath -like "`$PSScriptRoot*" -or `$_.CommandLine -like "*gui.py*" -or `$_.CommandLine -like "*tray.py*"
} | ForEach-Object { Stop-Process -Id `$_.ProcessId -Force -ErrorAction SilentlyContinue }
Start-Sleep 2
# Autostart-Verknüpfung entfernen - BEIDE möglichen Orte, weil die
@@ -324,23 +324,21 @@ if ($Autostart) {
# eine Warnung; der Worker läuft davon unberührt.
if (-not $KeineDesktopVerknuepfung) {
try {
$programme = [Environment]::GetFolderPath("ProgramFiles")
$maschinenweit = $ziel.StartsWith($programme, "OrdinalIgnoreCase")
$desktopDir = if ($maschinenweit) {
[Environment]::GetFolderPath("CommonDesktopDirectory")
if ($KeineDesktopVerknuepfung) {
Write-Host "Desktop-Verknüpfung auf Wunsch übersprungen."
} else {
[Environment]::GetFolderPath("Desktop")
$desktop = Join-Path ([Environment]::GetFolderPath("Desktop")) "Rippy Worker.lnk"
$wshell = New-Object -ComObject WScript.Shell
$shortcut = $wshell.CreateShortcut($desktop)
$shortcut.TargetPath = (Join-Path $ziel "start-gui.bat")
$shortcut.WorkingDirectory = $ziel
$shortcut.WindowStyle = 7
if (Test-Path (Join-Path $ziel "rippy.ico")) {
$shortcut.IconLocation = (Join-Path $ziel "rippy.ico")
}
$shortcut.Save()
Write-Host "Desktop-Verknüpfung 'Rippy Worker' erstellt."
}
$wsh = New-Object -ComObject WScript.Shell
$lnk = $wsh.CreateShortcut((Join-Path $desktopDir "Rippy Worker.lnk"))
$lnk.TargetPath = (Join-Path $ziel "start-tray.bat")
$lnk.WorkingDirectory = $ziel
$lnk.Description = "Rippy Encoding-Worker starten (Symbol neben der Uhr)"
$lnk.WindowStyle = 7
$ico = Join-Path $ziel "rippy.ico"
if (Test-Path $ico) { $lnk.IconLocation = $ico }
$lnk.Save()
Write-Host "Verknüpfung 'Rippy Worker' auf dem Desktop angelegt."
} catch {
Write-Host "HINWEIS: Desktop-Verknüpfung ging nicht ($($_.Exception.Message))." -ForegroundColor Yellow
}