diff --git a/src/interface/web/app/settings/page.tsx b/src/interface/web/app/settings/page.tsx index 8e05d588..685b4009 100644 --- a/src/interface/web/app/settings/page.tsx +++ b/src/interface/web/app/settings/page.tsx @@ -10,6 +10,8 @@ import { useUserConfig, ModelOptions, UserConfig } from "../common/auth"; import { isValidPhoneNumber } from 'libphonenumber-js'; import { Button } from "@/components/ui/button"; +import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/input-otp"; +import { Input } from "@/components/ui/input"; import { Card, CardContent, @@ -17,20 +19,18 @@ import { CardHeader, } from "@/components/ui/card"; import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuTrigger, + DropdownMenu, + DropdownMenuContent, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { Table, TableBody, TableCell, - TableHead, - TableHeader, TableRow, - } from "@/components/ui/table" +} from "@/components/ui/table" import { ArrowRight, @@ -42,22 +42,25 @@ import { FileMagnifyingGlass, Trash, Copy, - PlusCircle, CreditCard, CheckCircle, NotionLogo, GithubLogo, Files, WhatsappLogo, - ExclamationMark + ExclamationMark, + Plugs, + CloudSlash, + Laptop, + Plus, + FloppyDisk, + PlugsConnected, + ArrowCircleUp, } from "@phosphor-icons/react"; import NavMenu from "../components/navMenu/navMenu"; import SidePanel from "../components/sidePanel/chatHistorySidePanel"; import Loading from "../components/loading/loading"; -import { ExternalLinkIcon } from "lucide-react"; -import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/input-otp"; -import { Input } from "@/components/ui/input"; interface DropdownComponentProps { @@ -73,7 +76,7 @@ const DropdownComponent: React.FC = ({ items, selected,
- @@ -323,128 +326,197 @@ export default function SettingsView() { }>
-
Profile
+
Profile
Name - +

What should Khoj refer to you as?

+
- +
-
Content
+
Content
- Files - + Files + Manage your synced files - - + + - Github - - Set repositories to index + Github + + Set Github repositories to index - - + + Notion - + Sync your Notion pages - - + +
-
Features
+
Models
+ {userConfig.chat_model_options.length > 0 && ( Chat - + +

Pick the chat model to generate text responses

-
+ + {!userConfig.is_active && ( +

Subscribe to switch model

+ )} +
+ + )} + {userConfig.search_model_options.length > 0 && ( Search - + +

Pick the search model to find your documents

+ + {!userConfig.is_active && ( +

Subscribe to switch model

+ )} +
+ )} + {userConfig.paint_model_options.length > 0 && ( Paint - + +

Pick the paint model to generate image responses

+ + {!userConfig.is_active && ( +

Subscribe to switch model

+ )} +
+ )} + {userConfig.voice_model_options.length > 0 && ( Voice - + +

Pick the voice model to generate speech responses

+ + {!userConfig.is_active && ( +

Subscribe to switch model

+ )} +
+ )}
-
Clients
-
+
Clients
+
- API Keys - + + + API Keys + + + +

- Access Khoj from your Desktop App, Obsidian plugin, and more. + Access Khoj from the Desktop, Obsidian, Emacs apps and more.

- - - Name - Token - Actions - - {apiKeys.map((key) => ( - {key.name} - {`${key.token.slice(0, 4)}...${key.token.slice(-4)}`} - - - + {key.name} + + + {`${key.token.slice(0, 6)}...${key.token.slice(-4)}`} + +
+ copyAPIKey(key.token)}/> + deleteAPIKey(key.token)}/> +
))} @@ -452,9 +524,6 @@ export default function SettingsView() {
-
@@ -468,17 +537,17 @@ export default function SettingsView() { )} -

+

Connect your number to chat with Khoj on WhatsApp. Learn more about the integration here.

{numberValidationState === PhoneNumberValidationState.VerifyOTP && ( -
+ <>

{`Enter the OTP sent to your WhatsApp number: ${number}`}

setNumberValidationState(PhoneNumberValidationState.Verified)} > @@ -491,16 +560,17 @@ export default function SettingsView() { -
+ ) || ( -
+ <> setNumber(e.target.value)} - value={number} + value={number || ""} placeholder="Enter your WhatsApp number" - className="w-full border border-gray-300 rounded-lg p-4" + className="w-full border border-gray-300 rounded-lg px-4 py-6" /> -
+ )}
@@ -508,7 +578,6 @@ export default function SettingsView() { {numberValidationState === PhoneNumberValidationState.VerifyOTP && ( )} @@ -532,68 +601,66 @@ export default function SettingsView() {
-
Billing
+
Billing
Subscription - {(userConfig.subscription_state === "subscribed" || userConfig.subscription_state === "unsubscribed") && ( - - )} - + +

Current Plan

{userConfig.subscription_state === "trial" && ( -
-

You are on a 14 day trial of the Khoj Futurist plan

-

See pricing for details

-
+ <> +

Futurist Trial

+

You are on a 14 day trial of the Khoj Futurist plan

+

See pricing for details

+ ) || userConfig.subscription_state === "subscribed" && ( -
-

You are subscribed to Khoj Futurist

-

Subscription will renew on { userConfig.subscription_renewal_date }

-
+ <> +

Futurist

+

Subscription renews on { userConfig.subscription_renewal_date }

+ ) || userConfig.subscription_state === "unsubscribed" && ( -
-

You are subscribed to Khoj Futurist

-

Subscription will expire on { userConfig.subscription_renewal_date }

-
+ <> +

Futurist

+

Subscription ends on { userConfig.subscription_renewal_date }

+ ) || userConfig.subscription_state === "expired" && ( -
-

Subscribe to the Khoj Futurist plan

+ <> +

Trial

{userConfig.subscription_renewal_date && ( -

Your subscription expired on { userConfig.subscription_renewal_date }

+

Your subscription expired on { userConfig.subscription_renewal_date }

) || ( -

See pricing for details

+

See pricing for details

)} -
+ )}
{(userConfig.subscription_state == "subscribed") && ( ) || (userConfig.subscription_state == "unsubscribed") && ( ) || ( )}