diff --git a/src/pages/gpu-service/templates/config/index.tsx b/src/pages/gpu-service/templates/config/index.tsx index 1f0d5b09..9e67fa79 100644 --- a/src/pages/gpu-service/templates/config/index.tsx +++ b/src/pages/gpu-service/templates/config/index.tsx @@ -91,19 +91,33 @@ export const stringifyCommand = (tokens?: string[]): string => { .join(' '); }; -export const templateActions = [ +// No ``access`` gates on these menu items: the management page +// queries the list API with ``mine=true``, so every row already +// belongs to a scope the caller can manage — no per-item filtering +// needed here. +// +// ``icon`` is narrowed to ``any`` so the inferred declaration type +// for the array doesn't reach into +// ``@ant-design/icons/lib/components/AntdIcon`` (the internal path +// the antd icon component types live at). The other fields keep +// their precise types. +export const templateActions: Array<{ + label: string; + key: string; + locale: boolean; + icon: any; + danger?: boolean; +}> = [ { label: 'common.button.edit', key: 'edit', locale: true, - access: 'canSeeAdmin', icon: icons.EditOutlined }, { label: 'common.button.delete', key: 'delete', locale: true, - access: 'canSeeAdmin', icon: icons.DeleteOutlined, danger: true } diff --git a/src/pages/gpu-service/templates/index.tsx b/src/pages/gpu-service/templates/index.tsx index 94ac6966..483992e6 100644 --- a/src/pages/gpu-service/templates/index.tsx +++ b/src/pages/gpu-service/templates/index.tsx @@ -45,7 +45,13 @@ const GPUServiceTemplates: React.FC = () => { isInfiniteScroll: true, contentForDelete: intl.formatMessage({ id: 'gpuservice.template' }), defaultQueryParams: { - perPage: 24 + perPage: 24, + // Management view: drop Global rows for non-admin callers — the + // page is a CRUD surface, and admin-curated Global templates + // they can't edit only add visual noise. The instance-create + // picker (uses ``useQueryTemplates`` separately) doesn't set + // this and so still sees Global presets. + mine: true } }); const { openTemplateModalStatus, openTemplateModal, closeTemplateModal } =