Duplicate flows and dashboards: POST /flows/{name}/duplicate and /dashboards/{name}/duplicate copy the working copy into {name}_copy (then _copy_2, ...) as an unpublished draft with " (copy)" on the title. A flow copy takes its node sources as drafts and leaves origin and runtime.json behind; copying code nodes is a superuser's (the save check, now taking the replaced copy). Client regenerated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 09:21:30 +02:00
co-authored by Claude Opus 5.5
parent 8b1a456cd3
commit 8a868e0f26
9 changed files with 215 additions and 9 deletions
+12
View File
@@ -201,6 +201,18 @@ async def delete_dashboard(
return Message(message=f"Deleted dashboard '{name}'")
@router.post("/{name}/duplicate", response_model=DashboardDef)
async def duplicate_dashboard(name: str, store: DashboardStoreDep) -> Any:
"""Copy a dashboard into a new one that is only a draft, named after it.
No history limits to apply, as for a new dashboard: nothing published moved.
"""
try:
return await run_in_threadpool(store.duplicate, name)
except DashboardNotFound:
raise HTTPException(status_code=404, detail=f"No dashboard named '{name}'")
@router.post("/{name}/rename", response_model=DashboardDef)
async def rename_dashboard(
name: str, body: RenameRequest, store: DashboardStoreDep