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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user