diff --git a/frontend/src/components/Modals/MangeWorkspace/CannotRemoveModal/index.jsx b/frontend/src/components/Modals/MangeWorkspace/CannotRemoveModal/index.jsx index a66442fd..51028aab 100644 --- a/frontend/src/components/Modals/MangeWorkspace/CannotRemoveModal/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/CannotRemoveModal/index.jsx @@ -1,10 +1,7 @@ import React from "react"; import { titleCase } from "text-case"; -export default function CannotRemoveModal({ - hideModal, - vectordb, -}) { +export default function CannotRemoveModal({ hideModal, vectordb }) { return ( ); -} \ No newline at end of file +} diff --git a/frontend/src/components/Modals/MangeWorkspace/Directory/index.jsx b/frontend/src/components/Modals/MangeWorkspace/Directory/index.jsx index b2eb4125..b444f979 100644 --- a/frontend/src/components/Modals/MangeWorkspace/Directory/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/Directory/index.jsx @@ -147,4 +147,4 @@ export default function Directory({ )} ); -} \ No newline at end of file +} diff --git a/frontend/src/components/Modals/MangeWorkspace/index.jsx b/frontend/src/components/Modals/MangeWorkspace/index.jsx index 4c3cde12..675e622e 100644 --- a/frontend/src/components/Modals/MangeWorkspace/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/index.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { X } from 'react-feather'; +import { X } from "react-feather"; import System from "../../../models/system"; import Workspace from "../../../models/workspace"; import paths from "../../../utils/paths"; @@ -18,7 +18,7 @@ export default function ManageWorkspace({ hideModal = noop, workspace }) { const [originalDocuments, setOriginalDocuments] = useState([]); const [selectedFiles, setSelectFiles] = useState([]); const [vectordb, setVectorDB] = useState(null); - const [showingNoRemovalModal, setShowingNoRemovalModal] = useState(false) + const [showingNoRemovalModal, setShowingNoRemovalModal] = useState(false); useEffect(() => { async function fetchKeys() { @@ -29,7 +29,7 @@ export default function ManageWorkspace({ hideModal = noop, workspace }) { setDirectories(localFiles); setOriginalDocuments([...originalDocs]); setSelectFiles([...originalDocs]); - setVectorDB(settings?.VectorDB) + setVectorDB(settings?.VectorDB); setLoading(false); } fetchKeys(); @@ -99,7 +99,7 @@ export default function ManageWorkspace({ hideModal = noop, workspace }) { return isFolder ? originalDocuments.some((doc) => doc.includes(filepath.split("/")[0])) : originalDocuments.some((doc) => doc.includes(filepath)); - } + }; const toggleSelection = (filepath) => { const isFolder = !filepath.includes("/"); @@ -108,7 +108,7 @@ export default function ManageWorkspace({ hideModal = noop, workspace }) { if (isSelected(filepath)) { // Certain vector DBs do not contain the ability to delete vectors // so we cannot remove from these. The user will have to clear the entire workspace. - if (['lancedb'].includes(vectordb) && isOriginalDoc(filepath)) { + if (["lancedb"].includes(vectordb) && isOriginalDoc(filepath)) { setShowingNoRemovalModal(true); return false; } diff --git a/frontend/src/components/Modals/Password.jsx b/frontend/src/components/Modals/Password.jsx new file mode 100644 index 00000000..67f554f8 --- /dev/null +++ b/frontend/src/components/Modals/Password.jsx @@ -0,0 +1,119 @@ +import React, { useState, useEffect, useRef } from "react"; +import System from "../../models/system"; + +export default function PasswordModal() { + const [loading, setLoading] = useState(false); + const formEl = useRef(null); + const [error, setError] = useState(null); + const handleLogin = async (e) => { + setError(null); + setLoading(true); + e.preventDefault(); + const data = {}; + + const form = new FormData(formEl.current); + for (var [key, value] of form.entries()) data[key] = value; + const { valid, token, message } = await System.requestToken(data); + if (valid && !!token) { + window.localStorage.setItem("anythingllm_authtoken", token); + window.location.reload(); + } else { + setError(message); + setLoading(false); + } + setLoading(false); + }; + + return ( +
diff --git a/frontend/src/components/Sidebar/Placeholder/index.jsx b/frontend/src/components/Sidebar/Placeholder/index.jsx new file mode 100644 index 00000000..5f81c0d4 --- /dev/null +++ b/frontend/src/components/Sidebar/Placeholder/index.jsx @@ -0,0 +1,134 @@ +import React, { useRef } from "react"; +import { + BookOpen, + Briefcase, + Cpu, + GitHub, + Key, + Plus, + AlertCircle, +} from "react-feather"; +import * as Skeleton from "react-loading-skeleton"; +import "react-loading-skeleton/dist/skeleton.css"; +import paths from "../../../utils/paths"; + +export default function Sidebar() { + const sidebarRef = useRef(null); + + // const handleWidthToggle = () => { + // if (!sidebarRef.current) return false; + // sidebarRef.current.classList.add('translate-x-[-100%]') + // } + + return ( + <> +
+ AnythingLLM +
+LLM
++ offline +
++ Managed cloud hosting +
+ + ++ Enterprise Installation +
+ +