Nový DB helper bez ORM: app/db/scheduled_scripts.py
Nové route/UI: app/routes/scheduled_scripts.py
Router registrovaný v app/main.py
Menu doplněné v app/templates/layout.py
Job filtr rozšířený o run_script v app/routes/jobs.py
Implementováno:
GET /portal/scheduled-scripts
GET /portal/scheduled-scripts/{id}
GET/POST /portal/scheduled-scripts/new
GET/POST /portal/scheduled-scripts/{id}/edit
POST /portal/scheduled-scripts/{id}/run-now
POST /portal/scheduled-scripts/{id}/toggle
POST /portal/scheduled-scripts/{id}/delete
Ruční spuštění vytváří run_script job přes existující create_job(...) se source="portal_manual" a payloadem podle zadání. Mazání je blokované, pokud is_running = 1. Validace script_name, schedule_type a timeout_seconds je v route vrstvě.
Audit eventy jsou přidané:
scheduled_script.created
scheduled_script.updated
scheduled_script.deleted
scheduled_script.enabled
scheduled_script.disabled
scheduled_script.run_now
This commit is contained in:
JiriUhlir
2026-06-03 12:18:39 +02:00
parent 46f8024d4e
commit f7a8007af8
5 changed files with 632 additions and 2 deletions
+1
View File
@@ -20,6 +20,7 @@ def page(title: str, body: str, user=None) -> str:
<button type="button" class="nav-menu-button">Provoz</button>
<div class="nav-menu-panel">
<a href="/portal/jobs">Úlohy</a>
<a href="/portal/scheduled-scripts">Pl&aacute;novan&eacute; skripty</a>
<a href="/portal/deployments">Nasazení</a>
<a href="/portal/incidents">Incidenty</a>
<a href="/portal/workers">Workery</a>