diff --git a/server/src/plugins/service-admin-http/routes-admin.ts b/server/src/plugins/service-admin-http/routes-admin.ts index a8d6320..bd588a3 100644 --- a/server/src/plugins/service-admin-http/routes-admin.ts +++ b/server/src/plugins/service-admin-http/routes-admin.ts @@ -1093,6 +1093,13 @@ export function registerAdminRoutes(app: H3, deps: AdminDeps): void { return new Response(null, { status: 302, headers: { location: `/admin/layouts/${layoutId}` } }); }); + app.post("/admin/layouts/:id/clone", (event) => { + const id = Number(getRouterParam(event, "id")); + const clone = deps.repo.cloneLayout(id); + notifyKiosks(); + return new Response(null, { status: 302, headers: { location: `/admin/layouts/${clone.id}` } }); + }); + app.post("/admin/layouts/:id/delete", (event) => { const id = Number(getRouterParam(event, "id")); deps.repo.deleteLayout(id); diff --git a/server/src/web-templates/admin-pages.tsx b/server/src/web-templates/admin-pages.tsx index 6cbca76..654dbf8 100644 --- a/server/src/web-templates/admin-pages.tsx +++ b/server/src/web-templates/admin-pages.tsx @@ -2422,6 +2422,9 @@ export function LayoutEditPage(props: LayoutEditPageProps) { Back +
+ +
Grid: {String(gridCols)}x{String(gridRows)}, {String(cells.length)} cell{cells.length !== 1 ? "s" : ""}