From 737c4727b05feea01804cac01d154654926e76f2 Mon Sep 17 00:00:00 2001 From: ecwu Date: Wed, 25 Dec 2024 15:12:26 +0800 Subject: [PATCH] Enhance Menubar with additional items and improved layout for better user experience --- src/pages/App.tsx | 95 ++++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/src/pages/App.tsx b/src/pages/App.tsx index 9f9f061..6add87f 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -50,6 +50,7 @@ import { MenubarMenu, MenubarSeparator, MenubarShortcut, + MenubarCheckboxItem, MenubarTrigger, } from "@/components/ui/menubar"; @@ -69,6 +70,10 @@ import { WholeWordIcon, EllipsisIcon, CogIcon, + Menu, + ReceiptIcon, + WalletIcon, + RulerIcon, } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { ModeToggle } from "@/components/mode-toggle"; @@ -313,10 +318,10 @@ export function App() {
+

{chatStore.model}

-

{chatStore.model}

{" "} {chatStore.totalTokens.toString()} @@ -341,57 +346,61 @@ export function App() {
- - - - {chatStore.model} - - - - {models[chatStore.model]?.price?.prompt * 1000 * 1000} - $ / 1M input tokens - - - - - - - {chatStore.streamMode ? Tr("STREAM") : Tr("FETCH")} - - - STREAM/FETCH - - {" "} {chatStore.totalTokens} - - - Max: {chatStore.maxTokens} - - - - - - {chatStore.postBeginIndex} - - - - Max:{" "} - {chatStore.history.filter(({ hide }) => !hide).length} - - - - - - + {chatStore.cost.toFixed(4)} - Accumulated: ${getTotalCost().toFixed(2)} + + Max Length: {chatStore.maxTokens} + + + Price:{" "} + {models[chatStore.model]?.price?.prompt * 1000 * 1000} + $ / 1M input tokens + + + + Total: {getTotalCost().toFixed(2)}$ + + + + {chatStore.streamMode ? ( + <> + {Tr("STREAM")}· + + {Tr("FETCH")} + + + ) : ( + <> + + {Tr("STREAM")} + + ·{Tr("FETCH")} + + )} + + + + {chatStore.postBeginIndex} /{" "} + {chatStore.history.length} + + + + Switch to Model (TODO): + + + gpt-4o + + gpt-o1 + gpt-o1-mini + gpt-o3