From 313f777e44b2fbb64d35e5685a10d0d51173a432 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Mon, 17 Aug 2026 15:37:54 -0400 Subject: [PATCH] rename routes from inference to ai-gateway --- messages/en-US.json | 4 ++-- server/lib/aiInferenceResource.ts | 2 ++ .../[niceId]/{inference => ai-gateway}/page.tsx | 2 ++ .../settings/resources/private/[niceId]/layout.tsx | 2 +- .../[niceId]/{inference => ai-gateway}/page.tsx | 2 ++ .../settings/resources/public/[niceId]/layout.tsx | 2 +- src/components/AiProviderAttachments.tsx | 13 ++++++++++--- src/lib/queries.ts | 2 ++ 8 files changed, 22 insertions(+), 7 deletions(-) rename src/app/[orgId]/settings/resources/private/[niceId]/{inference => ai-gateway}/page.tsx (99%) rename src/app/[orgId]/settings/resources/public/[niceId]/{inference => ai-gateway}/page.tsx (99%) diff --git a/messages/en-US.json b/messages/en-US.json index ea227ebe2..021f4c10d 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -288,7 +288,7 @@ "noCountryFound": "No country found.", "siteSelectionDescription": "This site will provide connectivity to the target.", "resourceType": "Resource Type", - "resourceTypeDescription": "This controls the resource protocol and how it will be rendered in the browser. This can’t be changed later.", + "resourceTypeDescription": "This controls the resource protocol and can’t be changed later.", "resourceTypeSearch": "Search resource types...", "resourceTypeNotFound": "No resource type found", "resourceTypeHttpDescription": "Proxy web traffic over HTTPS using a domain name", @@ -4322,4 +4322,4 @@ "sessionToolbarShow": "Show toolbar", "sessionToolbarHide": "Hide toolbar", "actionUpdateSiteApprovals": "Update Site Approvals" -} \ No newline at end of file +} diff --git a/server/lib/aiInferenceResource.ts b/server/lib/aiInferenceResource.ts index d38683b59..72c37af23 100644 --- a/server/lib/aiInferenceResource.ts +++ b/server/lib/aiInferenceResource.ts @@ -339,6 +339,7 @@ export async function listPublicResourceAiProviders(resourceId: number) { return db .select({ providerId: resourceAiProviders.providerId, + niceId: aiProviders.niceId, name: aiProviders.name, type: aiProviders.type, enabled: resourceAiProviders.enabled, @@ -357,6 +358,7 @@ export async function listSiteResourceAiProviders(siteResourceId: number) { return db .select({ providerId: siteResourceAiProviders.providerId, + niceId: aiProviders.niceId, name: aiProviders.name, type: aiProviders.type, enabled: siteResourceAiProviders.enabled, diff --git a/src/app/[orgId]/settings/resources/private/[niceId]/inference/page.tsx b/src/app/[orgId]/settings/resources/private/[niceId]/ai-gateway/page.tsx similarity index 99% rename from src/app/[orgId]/settings/resources/private/[niceId]/inference/page.tsx rename to src/app/[orgId]/settings/resources/private/[niceId]/ai-gateway/page.tsx index e824cc105..8907c442d 100644 --- a/src/app/[orgId]/settings/resources/private/[niceId]/inference/page.tsx +++ b/src/app/[orgId]/settings/resources/private/[niceId]/ai-gateway/page.tsx @@ -68,6 +68,7 @@ export default function PrivateResourceInferencePage() { providers: z.array( z.object({ providerId: z.number().int().positive(), + niceId: z.string(), name: z.string(), accessMode: z.enum(["inherit", "select"]), enabled: z.boolean(), @@ -131,6 +132,7 @@ export default function PrivateResourceInferencePage() { "providers", attachedQuery.data.map((provider) => ({ providerId: provider.providerId, + niceId: provider.niceId, name: provider.name, accessMode: provider.accessMode, enabled: provider.enabled, diff --git a/src/app/[orgId]/settings/resources/private/[niceId]/layout.tsx b/src/app/[orgId]/settings/resources/private/[niceId]/layout.tsx index e4bb32ef7..735848d01 100644 --- a/src/app/[orgId]/settings/resources/private/[niceId]/layout.tsx +++ b/src/app/[orgId]/settings/resources/private/[niceId]/layout.tsx @@ -62,7 +62,7 @@ export default async function PrivateResourceLayout( }, { title: t(modeSettingsKey), - href: `/{orgId}/settings/resources/private/{niceId}/${siteResource.mode}` + href: `/{orgId}/settings/resources/private/{niceId}/${siteResource.mode === "inference" ? "ai-gateway" : siteResource.mode}` }, { title: t("authentication"), diff --git a/src/app/[orgId]/settings/resources/public/[niceId]/inference/page.tsx b/src/app/[orgId]/settings/resources/public/[niceId]/ai-gateway/page.tsx similarity index 99% rename from src/app/[orgId]/settings/resources/public/[niceId]/inference/page.tsx rename to src/app/[orgId]/settings/resources/public/[niceId]/ai-gateway/page.tsx index 7de441995..763e2d69d 100644 --- a/src/app/[orgId]/settings/resources/public/[niceId]/inference/page.tsx +++ b/src/app/[orgId]/settings/resources/public/[niceId]/ai-gateway/page.tsx @@ -61,6 +61,7 @@ export default function PublicResourceInferencePage() { providers: z.array( z.object({ providerId: z.number().int().positive(), + niceId: z.string(), name: z.string(), accessMode: z.enum(["inherit", "select"]), enabled: z.boolean(), @@ -111,6 +112,7 @@ export default function PublicResourceInferencePage() { form.reset({ providers: attachedQuery.data.map((provider) => ({ providerId: provider.providerId, + niceId: provider.niceId, name: provider.name, accessMode: provider.accessMode, enabled: provider.enabled, diff --git a/src/app/[orgId]/settings/resources/public/[niceId]/layout.tsx b/src/app/[orgId]/settings/resources/public/[niceId]/layout.tsx index ed69a22b0..b5a36c56c 100644 --- a/src/app/[orgId]/settings/resources/public/[niceId]/layout.tsx +++ b/src/app/[orgId]/settings/resources/public/[niceId]/layout.tsx @@ -89,7 +89,7 @@ export default async function ResourceLayout(props: ResourceLayoutProps) { }, { title: t(`${resource.mode}Settings`), - href: `/{orgId}/settings/resources/public/{niceId}/${resource.mode}` + href: `/{orgId}/settings/resources/public/{niceId}/${resource.mode === "inference" ? "ai-gateway" : resource.mode}` } ]; diff --git a/src/components/AiProviderAttachments.tsx b/src/components/AiProviderAttachments.tsx index 87d61dd96..2af6c7371 100644 --- a/src/components/AiProviderAttachments.tsx +++ b/src/components/AiProviderAttachments.tsx @@ -49,6 +49,7 @@ import { z } from "zod"; export type AiProviderAttachmentValue = { providerId: number; + niceId: string; name: string; accessMode: "inherit" | "select"; enabled: boolean; @@ -88,7 +89,7 @@ export function AiProviderAttachments({ const editing = value.find((v) => v.providerId === editingProviderId); - function addProvider(providerId: number, name: string) { + function addProvider(providerId: number, niceId: string, name: string) { if (value.some((v) => v.providerId === providerId)) { return; } @@ -96,6 +97,7 @@ export function AiProviderAttachments({ ...value, { providerId, + niceId, name, accessMode: "inherit", enabled: true, @@ -168,7 +170,11 @@ export function AiProviderAttachments({ - addProvider(provider.providerId, provider.name) + addProvider( + provider.providerId, + provider.niceId, + provider.name + ) } > {provider.name} @@ -445,6 +451,7 @@ function EditAttachmentCredenza({ function onSubmit(values: EditFormValues) { onSave({ providerId: attachment.providerId, + niceId: attachment.niceId, name: attachment.name, accessMode: values.accessMode, enabled: attachment.enabled, @@ -576,7 +583,7 @@ function EditAttachmentCredenza({ asChild > {t("viewProviderSettings")} diff --git a/src/lib/queries.ts b/src/lib/queries.ts index c8c682200..581d537f2 100644 --- a/src/lib/queries.ts +++ b/src/lib/queries.ts @@ -1558,6 +1558,7 @@ export const resourceQueries = { AxiosResponse<{ providers: Array<{ providerId: number; + niceId: string; name: string; type: string; enabled: boolean; @@ -1579,6 +1580,7 @@ export const resourceQueries = { AxiosResponse<{ providers: Array<{ providerId: number; + niceId: string; name: string; type: string; enabled: boolean;