From 7dd1c9ac5e85018b5417e58114626d61bf230fd6 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Mon, 11 May 2026 20:01:57 +0800 Subject: [PATCH] refactor(backends): rename organization_id to owner_principal_id Aligns the InferenceBackend ownership column with the principal-based ownership model used elsewhere (clusters, model_routes). NULL identifies platform-curated rows shared across orgs; a populated value identifies an org-scoped override or custom backend. --- src/pages/backends/components/backend-card.tsx | 2 +- src/pages/backends/config/index.ts | 3 ++- src/pages/backends/config/types.ts | 3 +++ src/pages/backends/index.tsx | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/backends/components/backend-card.tsx b/src/pages/backends/components/backend-card.tsx index dde205c2..28eb4481 100644 --- a/src/pages/backends/components/backend-card.tsx +++ b/src/pages/backends/components/backend-card.tsx @@ -252,7 +252,7 @@ const BackendCard: React.FC = ({ const ownerTag = ( ); if (!source) { diff --git a/src/pages/backends/config/index.ts b/src/pages/backends/config/index.ts index 72e8881f..daa0ef57 100644 --- a/src/pages/backends/config/index.ts +++ b/src/pages/backends/config/index.ts @@ -113,7 +113,8 @@ export const backendActions = [ // An org-scoped override of a built-in IS deletable — deleting // the override is how the user reverts to the Platform row. // Plain custom backends are always deletable. - show: (record: any) => !record.is_built_in || record.organization_id != null + show: (record: any) => + !record.is_built_in || record.owner_principal_id != null } ]; diff --git a/src/pages/backends/config/types.ts b/src/pages/backends/config/types.ts index b14842f1..9c276fcd 100644 --- a/src/pages/backends/config/types.ts +++ b/src/pages/backends/config/types.ts @@ -40,4 +40,7 @@ export interface ListItem extends FormData { recommend_models: string[]; built_in_version_configs?: Record; framework_index_map?: Record; + // Backend owner — NULL for platform-curated rows shared across orgs; + // populated for org-scoped overrides / custom backends. + owner_principal_id?: number | null; } diff --git a/src/pages/backends/index.tsx b/src/pages/backends/index.tsx index 46b99f99..08834aea 100644 --- a/src/pages/backends/index.tsx +++ b/src/pages/backends/index.tsx @@ -173,7 +173,7 @@ const BackendList = () => { // gets a real DELETE. const isPlatformCommunity = item.data.backend_source === BackendSourceValueMap.COMMUNITY && - item.data.organization_id == null; + item.data.owner_principal_id == null; if (isPlatformCommunity) { modalRef.current?.show({ content: 'backends.title',