diff --git a/frontend/package.json b/frontend/package.json index eb3af3cf..75bbf868 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,8 +12,10 @@ "dependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.1.1", "@metamask/jazzicon": "^2.0.0", + "@phosphor-icons/react": "^2.0.13", "buffer": "^6.0.3", "he": "^1.2.0", + "lodash.debounce": "^4.0.8", "markdown-it": "^13.0.1", "pluralize": "^8.0.0", "react": "^18.2.0", diff --git a/frontend/public/fonts/AvenirNext.ttf b/frontend/public/fonts/AvenirNext.ttf deleted file mode 100644 index 271ee1bc..00000000 Binary files a/frontend/public/fonts/AvenirNext.ttf and /dev/null differ diff --git a/frontend/public/fonts/PlusJakartaSans.ttf b/frontend/public/fonts/PlusJakartaSans.ttf new file mode 100644 index 00000000..bdd49850 Binary files /dev/null and b/frontend/public/fonts/PlusJakartaSans.ttf differ diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index b6cfc7eb..2b48a363 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -4,6 +4,7 @@ import { ContextWrapper } from "./AuthContext"; import PrivateRoute, { AdminRoute } from "./components/PrivateRoute"; import { ToastContainer } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; +import Login from "./pages/Login"; const Main = lazy(() => import("./pages/Main")); const InvitePage = lazy(() => import("./pages/Invite")); @@ -13,21 +14,63 @@ const AdminInvites = lazy(() => import("./pages/Admin/Invitations")); const AdminWorkspaces = lazy(() => import("./pages/Admin/Workspaces")); const AdminChats = lazy(() => import("./pages/Admin/Chats")); const AdminSystem = lazy(() => import("./pages/Admin/System")); -const AdminAppearance = lazy(() => import("./pages/Admin/Appearance")); -const AdminApiKeys = lazy(() => import("./pages/Admin/ApiKeys")); +const GeneralAppearance = lazy(() => + import("./pages/GeneralSettings/Appearance") +); +const GeneralApiKeys = lazy(() => import("./pages/GeneralSettings/ApiKeys")); + +const GeneralLLMPreference = lazy(() => + import("./pages/GeneralSettings/LLMPreference") +); +const GeneralVectorDatabase = lazy(() => + import("./pages/GeneralSettings/VectorDatabase") +); +const GeneralExportImport = lazy(() => + import("./pages/GeneralSettings/ExportImport") +); +const GeneralSecurity = lazy(() => import("./pages/GeneralSettings/Security")); + +const OnboardingFlow = lazy(() => import("./pages/OnboardingFlow")); export default function App() { return ( }> - } /> + } /> + } /> } /> } /> + {/* General Routes */} + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + {/* Admin Routes */} } /> - } - /> - } - /> + + {/* Onboarding Flow */} + } /> diff --git a/frontend/src/components/AdminSidebar/index.jsx b/frontend/src/components/AdminSidebar/index.jsx deleted file mode 100644 index a583cb32..00000000 --- a/frontend/src/components/AdminSidebar/index.jsx +++ /dev/null @@ -1,323 +0,0 @@ -import React, { useEffect, useRef, useState } from "react"; -import { - BookOpen, - Eye, - GitHub, - Key, - Mail, - Menu, - MessageSquare, - Settings, - Users, - X, -} from "react-feather"; -import IndexCount from "../Sidebar/IndexCount"; -import LLMStatus from "../Sidebar/LLMStatus"; -import paths from "../../utils/paths"; -import Discord from "../Icons/Discord"; -import useLogo from "../../hooks/useLogo"; - -export default function AdminSidebar() { - const { logo } = useLogo(); - const sidebarRef = useRef(null); - - return ( - <> -
-
- {/* Header Information */} -
-
- Logo -
-
- - - -
-
- - {/* Primary Body */} -
-
-
-
-
-
-
-
- - -
-
- - {/* Footer */} - -
-
-
-
- - ); -} - -export function SidebarMobileHeader() { - const { logo } = useLogo(); - const sidebarRef = useRef(null); - const [showSidebar, setShowSidebar] = useState(false); - const [showBgOverlay, setShowBgOverlay] = useState(false); - - useEffect(() => { - function handleBg() { - if (showSidebar) { - setTimeout(() => { - setShowBgOverlay(true); - }, 300); - } else { - setShowBgOverlay(false); - } - } - handleBg(); - }, [showSidebar]); - - return ( - <> -
- -
- Logo -
-
-
-
setShowSidebar(false)} - /> -
-
- {/* Header Information */} -
-
- Logo -
-
- - - -
-
- - {/* Primary Body */} -
-
-
-
-
-
-
-
- - -
-
- - {/* Footer */} - -
-
-
-
-
- - ); -} - -const Option = ({ btnText, icon, href }) => { - const isActive = window.location.pathname === href; - return ( -
- - {icon} -

- {btnText} -

-
-
- ); -}; diff --git a/frontend/src/components/ChatBubble/index.jsx b/frontend/src/components/ChatBubble/index.jsx index 7ae52cb6..610f9037 100644 --- a/frontend/src/components/ChatBubble/index.jsx +++ b/frontend/src/components/ChatBubble/index.jsx @@ -1,28 +1,33 @@ import React from "react"; +import Jazzicon from "../UserIcon"; +import { userFromStorage } from "../../utils/request"; +import { + AI_BACKGROUND_COLOR, + USER_BACKGROUND_COLOR, +} from "../../utils/constants"; export default function ChatBubble({ message, type, popMsg }) { const isUser = type === "user"; + const backgroundColor = isUser ? USER_BACKGROUND_COLOR : AI_BACKGROUND_COLOR; return ( -
+
- {message && ( -

+

+ + + {message} -

- )} +
+
); diff --git a/frontend/src/components/DefaultChat/index.jsx b/frontend/src/components/DefaultChat/index.jsx index 1e993a4d..bfd0fbdc 100644 --- a/frontend/src/components/DefaultChat/index.jsx +++ b/frontend/src/components/DefaultChat/index.jsx @@ -8,6 +8,12 @@ import { isMobile } from "react-device-detect"; import { SidebarMobileHeader } from "../Sidebar"; import ChatBubble from "../ChatBubble"; import System from "../../models/system"; +import Jazzicon from "../UserIcon"; +import { userFromStorage } from "../../utils/request"; +import { + AI_BACKGROUND_COLOR, + USER_BACKGROUND_COLOR, +} from "../../utils/constants"; export default function DefaultChatContainer() { const [mockMsgs, setMockMessages] = useState([]); @@ -30,201 +36,265 @@ export default function DefaultChatContainer() { const MESSAGES = [
-
-

- Welcome to AnythingLLM, AnythingLLM is an open-source AI tool by - Mintplex Labs that turns anything into a trained chatbot you - can query and chat with. AnythingLLM is a BYOK (bring-your-own-keys) - software so there is no subscription, fee, or charges for this - software outside of the services you want to use with it. -

-
-
-
, +
+
+ - -
-
-

- AnythingLLM is the easiest way to put powerful AI products like - OpenAi, GPT-4, LangChain, PineconeDB, ChromaDB, and other services - together in a neat package with no fuss to increase your - productivity by 100x. -

-
-
-
, - - -
-
-

- AnythingLLM can run totally locally on your machine with little - overhead you wont even notice it's there! No GPU needed. Cloud and - on-premises installation is available as well. -
- The AI tooling ecosystem gets more powerful everyday. AnythingLLM - makes it easy to use. -

- - -

- Create an issue on Github -

-
-
-
-
, - - -
-
-

- How do I get started?! -

-
-
-
, - - -
-
-

- It's simple. All collections are organized into buckets we call{" "} - "Workspaces". Workspaces are buckets of files, documents, - images, PDFs, and other files which will be transformed into - something LLM's can understand and use in conversation. -
-
- You can add and remove files at anytime. -

- -
-
-
, - - -
-
-

- Is this like an AI dropbox or something? What about chatting? It is - a chatbot isn't it? -

-
-
-
, - - -
-
-

- AnythingLLM is more than a smarter Dropbox. -
-
- AnythingLLM offers two ways of talking with your data: -
-
- Query: Your chats will return data or inferences found with - the documents in your workspace it has access to. Adding more - documents to the Workspace make it smarter! -
-
- Conversational: Your documents + your on-going chat history - both contribute to the LLM knowledge at the same time. Great for - appending real-time text-based info or corrections and - misunderstandings the LLM might have. -
-
- You can toggle between either mode in the middle of chatting! -

-
-
-
, - - -
-
-

- Wow, this sounds amazing, let me try it out already! -

-
-
-
, - - - + , + + +
+
+
+ + + - -

- Contact Mintplex Labs -

-
+ AnythingLLM is the easiest way to put powerful AI products like + OpenAi, GPT-4, LangChain, PineconeDB, ChromaDB, and other services + together in a neat package with no fuss to increase your + productivity by 100x. + +
+
+
+ , + + +
+
+
+ +
+ + AnythingLLM can run totally locally on your machine with little + overhead you wont even notice it's there! No GPU needed. Cloud + and on-premises installation is available as well. +
+ The AI tooling ecosystem gets more powerful everyday. + AnythingLLM makes it easy to use. +
+ + +

Create an issue on Github

+
+
+
+
+
+
, + + +
+
+
+ + + + How do I get started?! + +
+
+
+
, + + +
+
+
+ +
+ + It's simple. All collections are organized into buckets we call{" "} + "Workspaces". Workspaces are buckets of files, documents, + images, PDFs, and other files which will be transformed into + something LLM's can understand and use in conversation. +
+
+ You can add and remove files at anytime. +
+ + +
+
+
+
+
, + + +
+
+
+ + + + Is this like an AI dropbox or something? What about chatting? It + is a chatbot isn't it? + +
+
+
+
, + + +
+
+
+ + + + AnythingLLM is more than a smarter Dropbox. +
+
+ AnythingLLM offers two ways of talking with your data: +
+
+ Query: Your chats will return data or inferences found with + the documents in your workspace it has access to. Adding more + documents to the Workspace make it smarter! +
+
+ Conversational: Your documents + your on-going chat history + both contribute to the LLM knowledge at the same time. Great for + appending real-time text-based info or corrections and + misunderstandings the LLM might have. +
+
+ You can toggle between either mode{" "} + in the middle of chatting! +
+
+
+
+
, + + +
+
+
+ + + + Wow, this sounds amazing, let me try it out already! + +
+
+
+
, + + +
+
@@ -259,7 +329,7 @@ export default function DefaultChatContainer() { return (
{isMobile && } {fetchedMessages.length === 0 diff --git a/frontend/src/components/EditingChatBubble/index.jsx b/frontend/src/components/EditingChatBubble/index.jsx index 7d738ee0..1cbe4430 100644 --- a/frontend/src/components/EditingChatBubble/index.jsx +++ b/frontend/src/components/EditingChatBubble/index.jsx @@ -14,25 +14,27 @@ export default function EditingChatBubble({ return (
- {isUser && ( - - )} +
setIsEditing(true)} > @@ -45,23 +47,16 @@ export default function EditingChatBubble({ setIsEditing(false); }} autoFocus + className="w-full" /> ) : ( tempMessage && ( -

+

{tempMessage}

) )}
- {!isUser && ( - - )}
); } diff --git a/frontend/src/components/Icons/Discord.jsx b/frontend/src/components/Icons/Discord.jsx deleted file mode 100644 index ebc55ed1..00000000 --- a/frontend/src/components/Icons/Discord.jsx +++ /dev/null @@ -1,15 +0,0 @@ -export default function Discord({ className = "" }) { - return ( - - - - - - - ); -} diff --git a/frontend/src/components/LLMProviderOption/index.jsx b/frontend/src/components/LLMProviderOption/index.jsx new file mode 100644 index 00000000..3c3ed446 --- /dev/null +++ b/frontend/src/components/LLMProviderOption/index.jsx @@ -0,0 +1,37 @@ +export default function LLMProviderOption({ + name, + link, + description, + value, + image, + checked = false, + onClick, +}) { + return ( +
onClick(value)}> + + +
+ ); +} diff --git a/frontend/src/components/Modals/Settings/ApiKey/index.jsx b/frontend/src/components/Modals/LegacySettings/ApiKey/index.jsx similarity index 100% rename from frontend/src/components/Modals/Settings/ApiKey/index.jsx rename to frontend/src/components/Modals/LegacySettings/ApiKey/index.jsx diff --git a/frontend/src/components/Modals/Settings/Appearance/index.jsx b/frontend/src/components/Modals/LegacySettings/Appearance/index.jsx similarity index 96% rename from frontend/src/components/Modals/Settings/Appearance/index.jsx rename to frontend/src/components/Modals/LegacySettings/Appearance/index.jsx index 92f210d5..4ce1078b 100644 --- a/frontend/src/components/Modals/Settings/Appearance/index.jsx +++ b/frontend/src/components/Modals/LegacySettings/Appearance/index.jsx @@ -3,8 +3,7 @@ import useLogo from "../../../../hooks/useLogo"; import usePrefersDarkMode from "../../../../hooks/usePrefersDarkMode"; import System from "../../../../models/system"; import EditingChatBubble from "../../../EditingChatBubble"; -import AnythingLLMLight from "../../../../media/logo/anything-llm-light.png"; -import AnythingLLMDark from "../../../../media/logo/anything-llm-dark.png"; +import AnythingLLM from "../../../../media/logo/anything-llm.png"; import showToast from "../../../../utils/toast"; export default function Appearance() { @@ -120,11 +119,7 @@ export default function Appearance() { src={logo} alt="Uploaded Logo" className="w-48 h-48 object-contain mr-6" - onError={(e) => - (e.target.src = prefersDarkMode - ? AnythingLLMLight - : AnythingLLMDark) - } + onError={(e) => (e.target.src = AnythingLLM)} />
diff --git a/frontend/src/components/Modals/Settings/ExportImport/index.jsx b/frontend/src/components/Modals/LegacySettings/ExportImport/index.jsx similarity index 100% rename from frontend/src/components/Modals/Settings/ExportImport/index.jsx rename to frontend/src/components/Modals/LegacySettings/ExportImport/index.jsx diff --git a/frontend/src/components/Modals/Settings/LLMSelection/index.jsx b/frontend/src/components/Modals/LegacySettings/LLMSelection/index.jsx similarity index 98% rename from frontend/src/components/Modals/Settings/LLMSelection/index.jsx rename to frontend/src/components/Modals/LegacySettings/LLMSelection/index.jsx index 9d930a7b..7fd07516 100644 --- a/frontend/src/components/Modals/Settings/LLMSelection/index.jsx +++ b/frontend/src/components/Modals/LegacySettings/LLMSelection/index.jsx @@ -115,10 +115,7 @@ export default function LLMSelection({ required={true} className="bg-gray-50 border border-gray-500 text-gray-900 text-sm rounded-lg block w-full p-2.5 dark:bg-stone-700 dark:border-slate-200 dark:placeholder-stone-500 dark:text-slate-200" > - {[ - "gpt-3.5-turbo", - "gpt-4", - ].map((model) => { + {["gpt-3.5-turbo", "gpt-4"].map((model) => { return (