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.
This commit is contained in:
gitlawr
2026-05-11 20:28:29 +08:00
committed by jialin
parent 125a5be91f
commit 7dd1c9ac5e
4 changed files with 7 additions and 3 deletions
@@ -252,7 +252,7 @@ const BackendCard: React.FC<BackendCardProps> = ({
const ownerTag = (
<PluginExtraFields
name="BackendOwnerTag"
context={{ organizationId: data.organization_id }}
context={{ ownerPrincipalId: data.owner_principal_id }}
/>
);
if (!source) {
+2 -1
View File
@@ -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
}
];
+3
View File
@@ -40,4 +40,7 @@ export interface ListItem extends FormData {
recommend_models: string[];
built_in_version_configs?: Record<string, VersionConfigs>;
framework_index_map?: Record<string, string[]>;
// Backend owner — NULL for platform-curated rows shared across orgs;
// populated for org-scoped overrides / custom backends.
owner_principal_id?: number | null;
}
+1 -1
View File
@@ -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',