feat(gpu-service): clone an instance template into the caller's scope

Add a Clone action to instance template cards. It reuses the create
flow prefilled from the source, dropping the source id and ownership so
the backend assigns a fresh id and scopes the copy to the caller's own
principal. Clone is offered on every visible template — including
admin-curated Global rows a non-admin can otherwise only view — so
users can fork a Global preset into their own organization without
admin involvement.

The prefilled name defaults to a `-clone` suffix (trimmed to the
63-char limit) so cloning within the same scope doesn't collide on the
unique name. Edit/Delete remain gated on ownership; Clone is always
available.
This commit is contained in:
gitlawr
2026-07-08 16:27:40 +08:00
committed by jialin
parent fdafdfc3d1
commit c025257fea
9 changed files with 72 additions and 12 deletions
@@ -114,6 +114,12 @@ export const templateActions: Array<{
locale: true,
icon: icons.EditOutlined
},
{
label: 'common.button.clone',
key: 'clone',
locale: true,
icon: icons.CopyOutlined
},
{
label: 'common.button.delete',
key: 'delete',