fix: add description to API Access dialog and link it to API Keys on settings (#8912)
* Add description to modal when autologin is on and change from A to CustomLink * Changed place of custom link * Made settings back button go back to previous page
This commit is contained in:
parent
e486f6ac21
commit
30c678b293
3 changed files with 17 additions and 37 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { CustomBanner } from "@/customization/components/custom-banner";
|
import { CustomBanner } from "@/customization/components/custom-banner";
|
||||||
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
|
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
|
||||||
|
import { To } from "react-router-dom";
|
||||||
import { Button } from "../../ui/button";
|
import { Button } from "../../ui/button";
|
||||||
import { Separator } from "../../ui/separator";
|
import { Separator } from "../../ui/separator";
|
||||||
import ForwardedIconComponent from "../genericIconComponent";
|
import ForwardedIconComponent from "../genericIconComponent";
|
||||||
|
|
@ -17,7 +18,7 @@ export default function PageLayout({
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
button?: React.ReactNode;
|
button?: React.ReactNode;
|
||||||
betaIcon?: boolean;
|
betaIcon?: boolean;
|
||||||
backTo?: string;
|
backTo?: To;
|
||||||
}) {
|
}) {
|
||||||
const navigate = useCustomNavigate();
|
const navigate = useCustomNavigate();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
import { CustomAPIGenerator } from "@/customization/components/custom-api-generator";
|
import { CustomAPIGenerator } from "@/customization/components/custom-api-generator";
|
||||||
|
import { CustomLink } from "@/customization/components/custom-link";
|
||||||
import useSaveFlow from "@/hooks/flows/use-save-flow";
|
import useSaveFlow from "@/hooks/flows/use-save-flow";
|
||||||
import useAuthStore from "@/stores/authStore";
|
import useAuthStore from "@/stores/authStore";
|
||||||
import useFlowsManagerStore from "@/stores/flowsManagerStore";
|
import useFlowsManagerStore from "@/stores/flowsManagerStore";
|
||||||
|
|
@ -110,21 +111,17 @@ export default function ApiModal({
|
||||||
<BaseModal.Trigger asChild>{children}</BaseModal.Trigger>
|
<BaseModal.Trigger asChild>{children}</BaseModal.Trigger>
|
||||||
<BaseModal.Header
|
<BaseModal.Header
|
||||||
description={
|
description={
|
||||||
autoLogin ? undefined : (
|
|
||||||
<>
|
|
||||||
<span className="pr-2">
|
<span className="pr-2">
|
||||||
API access requires an API key. You can{" "}
|
API access requires an API key. You can{" "}
|
||||||
<a
|
<CustomLink
|
||||||
href="/settings/api-keys"
|
to="/settings/api-keys"
|
||||||
className="text-accent-pink-foreground"
|
className="text-accent-pink-foreground"
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
create an API key
|
create an API key
|
||||||
</a>{" "}
|
</CustomLink>{" "}
|
||||||
in settings.
|
in settings.
|
||||||
</span>
|
</span>
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
|
|
@ -167,25 +164,7 @@ export default function ApiModal({
|
||||||
setOpen={setOpenTweaks}
|
setOpen={setOpenTweaks}
|
||||||
size="medium-small-tall"
|
size="medium-small-tall"
|
||||||
>
|
>
|
||||||
<BaseModal.Header
|
<BaseModal.Header>
|
||||||
description={
|
|
||||||
autoLogin ? undefined : (
|
|
||||||
<>
|
|
||||||
<span className="pr-2">
|
|
||||||
API access requires an API key. You can{" "}
|
|
||||||
<a
|
|
||||||
href="/settings/api-keys"
|
|
||||||
className="text-accent-pink-foreground"
|
|
||||||
>
|
|
||||||
{" "}
|
|
||||||
create an API key
|
|
||||||
</a>{" "}
|
|
||||||
in settings.
|
|
||||||
</span>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<IconComponent name="SlidersHorizontal" className="text-f h-6 w-6" />
|
<IconComponent name="SlidersHorizontal" className="text-f h-6 w-6" />
|
||||||
<span className="pl-2">Input Schema</span>
|
<span className="pl-2">Input Schema</span>
|
||||||
</BaseModal.Header>
|
</BaseModal.Header>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import {
|
||||||
} from "@/customization/feature-flags";
|
} from "@/customization/feature-flags";
|
||||||
import useAuthStore from "@/stores/authStore";
|
import useAuthStore from "@/stores/authStore";
|
||||||
import { useStoreStore } from "@/stores/storeStore";
|
import { useStoreStore } from "@/stores/storeStore";
|
||||||
import { Outlet } from "react-router-dom";
|
import { Outlet, To } from "react-router-dom";
|
||||||
import ForwardedIconComponent from "../../components/common/genericIconComponent";
|
import ForwardedIconComponent from "../../components/common/genericIconComponent";
|
||||||
import PageLayout from "../../components/common/pageLayout";
|
import PageLayout from "../../components/common/pageLayout";
|
||||||
export default function SettingsPage(): JSX.Element {
|
export default function SettingsPage(): JSX.Element {
|
||||||
|
|
@ -89,7 +89,7 @@ export default function SettingsPage(): JSX.Element {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageLayout
|
<PageLayout
|
||||||
backTo={"/"}
|
backTo={-1 as To}
|
||||||
title="Settings"
|
title="Settings"
|
||||||
description="Manage the general settings for Langflow."
|
description="Manage the general settings for Langflow."
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue