mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-18 18:23:18 +02:00
rename routes from inference to ai-gateway
This commit is contained in:
+2
@@ -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,
|
||||
@@ -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"),
|
||||
|
||||
+2
@@ -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,
|
||||
@@ -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}`
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -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({
|
||||
<DropdownMenuItem
|
||||
key={provider.providerId}
|
||||
onSelect={() =>
|
||||
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
|
||||
>
|
||||
<Link
|
||||
href={`/${orgId}/settings/ai-providers/${attachment.providerId}`}
|
||||
href={`/${orgId}/settings/ai-providers/${attachment.niceId}`}
|
||||
>
|
||||
{t("viewProviderSettings")}
|
||||
</Link>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user