feat(worker-ui): adjust thumbnails, log view, and button logic to match web dashboard
Ampel / ampel (push) Failing after 40s
Ampel / ampel (push) Failing after 40s
This commit is contained in:
+37
-26
@@ -364,7 +364,7 @@ def main(page: ft.Page):
|
||||
r"^\[.*? (\d{2}:\d{2}:\d{2}),.*?: (INFO|WARNING|ERROR|SUCCESS).*?\] (.*)"
|
||||
)
|
||||
|
||||
log_view = ft.ListView(expand=1, spacing=2, auto_scroll=True)
|
||||
log_view = ft.ListView(expand=1, spacing=0, auto_scroll=True)
|
||||
queue_view = ft.ListView(height=120, spacing=4, auto_scroll=False)
|
||||
|
||||
def add_log(zeile):
|
||||
@@ -395,8 +395,7 @@ def main(page: ft.Page):
|
||||
font_family="Consolas",
|
||||
weight=ft.FontWeight.BOLD,
|
||||
),
|
||||
ft.Text(
|
||||
msg, color=c_text, size=12, font_family="Consolas", expand=True
|
||||
msg, color=c_text, size=12, font_family="Consolas", expand=True, selectable=True
|
||||
),
|
||||
],
|
||||
spacing=10,
|
||||
@@ -405,7 +404,7 @@ def main(page: ft.Page):
|
||||
log_view.controls.append(row)
|
||||
else:
|
||||
log_view.controls.append(
|
||||
ft.Text(z, color=c_muted, size=12, font_family="Consolas")
|
||||
ft.Text(z, color=c_muted, size=12, font_family="Consolas", selectable=True)
|
||||
)
|
||||
|
||||
if len(log_view.controls) > 200:
|
||||
@@ -418,10 +417,7 @@ def main(page: ft.Page):
|
||||
def toggle_worker(e):
|
||||
if not worker_laeuft():
|
||||
worker_starten(add_log)
|
||||
btn_toggle.text = "Worker läuft"
|
||||
btn_toggle.icon = ft.icons.CHECK
|
||||
btn_toggle.bgcolor = "#1e293b"
|
||||
btn_toggle.disabled = True
|
||||
btn_toggle.visible = False
|
||||
page.update()
|
||||
|
||||
btn_toggle = ft.ElevatedButton(
|
||||
@@ -506,11 +502,18 @@ def main(page: ft.Page):
|
||||
active_poster = ft.Image(
|
||||
src="",
|
||||
visible=False,
|
||||
width=64,
|
||||
height=96,
|
||||
border_radius=8,
|
||||
width=72,
|
||||
height=108,
|
||||
border_radius=10,
|
||||
fit=ft.ImageFit.COVER,
|
||||
)
|
||||
active_poster_container = ft.Container(
|
||||
content=active_poster,
|
||||
border=ft.border.all(1, c_warning),
|
||||
border_radius=10,
|
||||
shadow=ft.BoxShadow(spread_radius=1, blur_radius=5, color=ft.colors.with_opacity(0.3, ft.colors.BLACK)),
|
||||
visible=False
|
||||
)
|
||||
|
||||
dashboard_card = ft.Container(
|
||||
content=ft.Column(
|
||||
@@ -520,7 +523,7 @@ def main(page: ft.Page):
|
||||
ft.Container(height=5),
|
||||
ft.Row(
|
||||
[
|
||||
active_poster,
|
||||
active_poster_container,
|
||||
progress_stack,
|
||||
ft.Column(
|
||||
[job_title, eta_text],
|
||||
@@ -632,12 +635,17 @@ def main(page: ft.Page):
|
||||
row_items = []
|
||||
if poster:
|
||||
row_items.append(
|
||||
ft.Image(
|
||||
ft.Container(
|
||||
content=ft.Image(
|
||||
src=poster,
|
||||
width=40,
|
||||
height=60,
|
||||
border_radius=5,
|
||||
width=32,
|
||||
height=48,
|
||||
border_radius=6,
|
||||
fit=ft.ImageFit.COVER,
|
||||
),
|
||||
border=ft.border.all(1, "#334155"),
|
||||
border_radius=6,
|
||||
shadow=ft.BoxShadow(spread_radius=1, blur_radius=3, color=ft.colors.with_opacity(0.3, ft.colors.BLACK))
|
||||
)
|
||||
)
|
||||
row_items.append(
|
||||
@@ -665,7 +673,8 @@ def main(page: ft.Page):
|
||||
progress_percentage.value = "0%"
|
||||
job_title.value = "Nichts in Arbeit"
|
||||
eta_text.value = "Bereit"
|
||||
active_poster.visible = False
|
||||
active_poster_container.visible = False
|
||||
btn_toggle.visible = True
|
||||
btn_toggle.disabled = False
|
||||
btn_toggle.text = "Worker Starten"
|
||||
btn_toggle.icon = ft.icons.PLAY_ARROW
|
||||
@@ -675,7 +684,11 @@ def main(page: ft.Page):
|
||||
status_text.color = c_warning
|
||||
progress_ring.value = 0
|
||||
progress_percentage.value = "0%"
|
||||
active_poster.visible = False
|
||||
active_poster_container.visible = False
|
||||
btn_toggle.visible = True
|
||||
btn_toggle.disabled = True
|
||||
btn_toggle.text = "Warte auf Verbindung..."
|
||||
btn_toggle.bgcolor = "#1e293b"
|
||||
elif job:
|
||||
status_text.value = "Aktiv: Komprimiert"
|
||||
status_text.color = c_success
|
||||
@@ -699,9 +712,11 @@ def main(page: ft.Page):
|
||||
|
||||
if poster:
|
||||
active_poster.src = poster
|
||||
active_poster.visible = True
|
||||
active_poster_container.visible = True
|
||||
else:
|
||||
active_poster.visible = False
|
||||
active_poster_container.visible = False
|
||||
|
||||
btn_toggle.visible = False
|
||||
else:
|
||||
status_text.value = "Verbunden & Bereit"
|
||||
status_text.color = c_accent
|
||||
@@ -709,12 +724,8 @@ def main(page: ft.Page):
|
||||
progress_percentage.value = "0%"
|
||||
job_title.value = "Warte auf Encoder-Aufträge..."
|
||||
eta_text.value = "Nichts in Arbeit"
|
||||
active_poster.visible = False
|
||||
|
||||
btn_toggle.disabled = True
|
||||
btn_toggle.text = "Worker läuft"
|
||||
btn_toggle.icon = ft.icons.CHECK
|
||||
btn_toggle.bgcolor = "#1e293b"
|
||||
active_poster_container.visible = False
|
||||
btn_toggle.visible = False
|
||||
|
||||
page.update()
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user