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:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user