chore: add @ as alias for frontend root (#414)

* chore: add @ as alias for frontend root

* fix: remove bad tag
This commit is contained in:
Timothy Carambat 2023-12-07 09:09:01 -08:00 committed by GitHub
parent 33de34f8dc
commit f48e6b1a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
69 changed files with 259 additions and 307 deletions

View File

@ -2,6 +2,11 @@
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"target": "esnext", "target": "esnext",
"jsx": "react" "jsx": "react",
"paths": {
"@/*": [
"./src/*"
],
}
} }
} }

View File

@ -1,42 +1,40 @@
import React, { lazy, Suspense } from "react"; import React, { lazy, Suspense } from "react";
import { Routes, Route } from "react-router-dom"; import { Routes, Route } from "react-router-dom";
import { ContextWrapper } from "./AuthContext"; import { ContextWrapper } from "@/AuthContext";
import PrivateRoute, { import PrivateRoute, {
AdminRoute, AdminRoute,
ManagerRoute, ManagerRoute,
} from "./components/PrivateRoute"; } from "@/components/PrivateRoute";
import { ToastContainer } from "react-toastify"; import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css"; import "react-toastify/dist/ReactToastify.css";
import Login from "./pages/Login"; import Login from "@/pages/Login";
const Main = lazy(() => import("./pages/Main")); const Main = lazy(() => import("@/pages/Main"));
const InvitePage = lazy(() => import("./pages/Invite")); const InvitePage = lazy(() => import("@/pages/Invite"));
const WorkspaceChat = lazy(() => import("./pages/WorkspaceChat")); const WorkspaceChat = lazy(() => import("@/pages/WorkspaceChat"));
const AdminUsers = lazy(() => import("./pages/Admin/Users")); const AdminUsers = lazy(() => import("@/pages/Admin/Users"));
const AdminInvites = lazy(() => import("./pages/Admin/Invitations")); const AdminInvites = lazy(() => import("@/pages/Admin/Invitations"));
const AdminWorkspaces = lazy(() => import("./pages/Admin/Workspaces")); const AdminWorkspaces = lazy(() => import("@/pages/Admin/Workspaces"));
const AdminSystem = lazy(() => import("./pages/Admin/System")); const AdminSystem = lazy(() => import("@/pages/Admin/System"));
const GeneralChats = lazy(() => import("./pages/GeneralSettings/Chats")); const GeneralChats = lazy(() => import("@/pages/GeneralSettings/Chats"));
const GeneralAppearance = lazy(() => const GeneralAppearance = lazy(() =>
import("./pages/GeneralSettings/Appearance") import("@/pages/GeneralSettings/Appearance")
); );
const GeneralApiKeys = lazy(() => import("./pages/GeneralSettings/ApiKeys")); const GeneralApiKeys = lazy(() => import("@/pages/GeneralSettings/ApiKeys"));
const GeneralLLMPreference = lazy(() => const GeneralLLMPreference = lazy(() =>
import("./pages/GeneralSettings/LLMPreference") import("@/pages/GeneralSettings/LLMPreference")
); );
const GeneralEmbeddingPreference = lazy(() => const GeneralEmbeddingPreference = lazy(() =>
import("./pages/GeneralSettings/EmbeddingPreference") import("@/pages/GeneralSettings/EmbeddingPreference")
); );
const GeneralVectorDatabase = lazy(() => const GeneralVectorDatabase = lazy(() =>
import("./pages/GeneralSettings/VectorDatabase") import("@/pages/GeneralSettings/VectorDatabase")
); );
const GeneralExportImport = lazy(() => const GeneralExportImport = lazy(() =>
import("./pages/GeneralSettings/ExportImport") import("@/pages/GeneralSettings/ExportImport")
); );
const GeneralSecurity = lazy(() => import("./pages/GeneralSettings/Security")); const GeneralSecurity = lazy(() => import("@/pages/GeneralSettings/Security"));
const OnboardingFlow = lazy(() => import("@/pages/OnboardingFlow"));
const OnboardingFlow = lazy(() => import("./pages/OnboardingFlow"));
export default function App() { export default function App() {
return ( return (

View File

@ -1,5 +1,5 @@
import React, { useState, createContext } from "react"; import React, { useState, createContext } from "react";
import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "./utils/constants"; import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "@/utils/constants";
export const AuthContext = createContext(null); export const AuthContext = createContext(null);
export function ContextWrapper(props) { export function ContextWrapper(props) {

View File

@ -1,10 +1,7 @@
import React from "react"; import React from "react";
import Jazzicon from "../UserIcon"; import Jazzicon from "../UserIcon";
import { userFromStorage } from "../../utils/request"; import { userFromStorage } from "@/utils/request";
import { import { AI_BACKGROUND_COLOR, USER_BACKGROUND_COLOR } from "@/utils/constants";
AI_BACKGROUND_COLOR,
USER_BACKGROUND_COLOR,
} from "../../utils/constants";
export default function ChatBubble({ message, type, popMsg }) { export default function ChatBubble({ message, type, popMsg }) {
const isUser = type === "user"; const isUser = type === "user";

View File

@ -5,21 +5,17 @@ import {
EnvelopeSimple, EnvelopeSimple,
Plus, Plus,
} from "@phosphor-icons/react"; } from "@phosphor-icons/react";
import NewWorkspaceModal, { import NewWorkspaceModal, {
useNewWorkspaceModal, useNewWorkspaceModal,
} from "../Modals/NewWorkspace"; } from "../Modals/NewWorkspace";
import paths from "../../utils/paths"; import paths from "@/utils/paths";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import { SidebarMobileHeader } from "../Sidebar"; import { SidebarMobileHeader } from "../Sidebar";
import ChatBubble from "../ChatBubble"; import ChatBubble from "../ChatBubble";
import System from "../../models/system"; import System from "@/models/system";
import Jazzicon from "../UserIcon"; import Jazzicon from "../UserIcon";
import { userFromStorage } from "../../utils/request"; import { userFromStorage } from "@/utils/request";
import { import { AI_BACKGROUND_COLOR, USER_BACKGROUND_COLOR } from "@/utils/constants";
AI_BACKGROUND_COLOR,
USER_BACKGROUND_COLOR,
} from "../../utils/constants";
export default function DefaultChatContainer() { export default function DefaultChatContainer() {
const [mockMsgs, setMockMessages] = useState([]); const [mockMsgs, setMockMessages] = useState([]);

View File

@ -1,5 +1,5 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import System from "../../../models/system"; import System from "@/models/system";
export default function LocalAiOptions({ settings }) { export default function LocalAiOptions({ settings }) {
const [basePathValue, setBasePathValue] = useState( const [basePathValue, setBasePathValue] = useState(

View File

@ -1,5 +1,5 @@
import { Info } from "@phosphor-icons/react"; import { Info } from "@phosphor-icons/react";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
export default function AnthropicAiOptions({ settings, showAlert = false }) { export default function AnthropicAiOptions({ settings, showAlert = false }) {
return ( return (

View File

@ -1,5 +1,5 @@
import { Info } from "@phosphor-icons/react"; import { Info } from "@phosphor-icons/react";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
export default function LMStudioOptions({ settings, showAlert = false }) { export default function LMStudioOptions({ settings, showAlert = false }) {
return ( return (

View File

@ -1,7 +1,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Info } from "@phosphor-icons/react"; import { Info } from "@phosphor-icons/react";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
import System from "../../../models/system"; import System from "@/models/system";
export default function LocalAiOptions({ settings, showAlert = false }) { export default function LocalAiOptions({ settings, showAlert = false }) {
const [basePathValue, setBasePathValue] = useState(settings?.LocalAiBasePath); const [basePathValue, setBasePathValue] = useState(settings?.LocalAiBasePath);

View File

@ -1,5 +1,5 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import System from "../../../models/system"; import System from "@/models/system";
export default function OpenAiOptions({ settings }) { export default function OpenAiOptions({ settings }) {
const [inputValue, setInputValue] = useState(settings?.OpenAiKey); const [inputValue, setInputValue] = useState(settings?.OpenAiKey);

View File

@ -1,7 +1,7 @@
import React, { useRef, useState } from "react"; import React, { useRef, useState } from "react";
import { X } from "@phosphor-icons/react"; import { X } from "@phosphor-icons/react";
import Workspace from "../../models/workspace"; import Workspace from "@/models/workspace";
import paths from "../../utils/paths"; import paths from "@/utils/paths";
const noop = () => false; const noop = () => false;
export default function NewWorkspaceModal({ hideModal = noop }) { export default function NewWorkspaceModal({ hideModal = noop }) {

View File

@ -1,11 +1,11 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Navigate } from "react-router-dom"; import { Navigate } from "react-router-dom";
import { FullScreenLoader } from "../Preloader"; import { FullScreenLoader } from "../Preloader";
import validateSessionTokenForUser from "../../utils/session"; import validateSessionTokenForUser from "@/utils/session";
import paths from "../../utils/paths"; import paths from "@/utils/paths";
import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "../../utils/constants"; import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "@/utils/constants";
import { userFromStorage } from "../../utils/request"; import { userFromStorage } from "@/utils/request";
import System from "../../models/system"; import System from "@/models/system";
import UserMenu from "../UserMenu"; import UserMenu from "../UserMenu";
// Used only for Multi-user mode only as we permission specific pages based on auth role. // Used only for Multi-user mode only as we permission specific pages based on auth role.

View File

@ -1,8 +1,8 @@
import React, { useEffect, useRef, useState } from "react"; import React, { useEffect, useRef, useState } from "react";
// import IndexCount from "../Sidebar/IndexCount"; // import IndexCount from "../Sidebar/IndexCount";
// import LLMStatus from "../Sidebar/LLMStatus"; // import LLMStatus from "../Sidebar/LLMStatus";
import paths from "../../utils/paths"; import paths from "@/utils/paths";
import useLogo from "../../hooks/useLogo"; import useLogo from "@/hooks/useLogo";
import { import {
DiscordLogo, DiscordLogo,
EnvelopeSimple, EnvelopeSimple,
@ -23,8 +23,8 @@ import {
List, List,
FileCode, FileCode,
} from "@phosphor-icons/react"; } from "@phosphor-icons/react";
import useUser from "../../hooks/useUser"; import useUser from "@/hooks/useUser";
import { USER_BACKGROUND_COLOR } from "../../utils/constants"; import { USER_BACKGROUND_COLOR } from "@/utils/constants";
export default function SettingsSidebar() { export default function SettingsSidebar() {
const { logo } = useLogo(); const { logo } = useLogo();

View File

@ -1,15 +1,15 @@
import React, { useState, useEffect, useCallback } from "react"; import React, { useState, useEffect, useCallback } from "react";
import * as Skeleton from "react-loading-skeleton"; import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css"; import "react-loading-skeleton/dist/skeleton.css";
import Workspace from "../../../models/workspace"; import Workspace from "@/models/workspace";
import ManageWorkspace, { import ManageWorkspace, {
useManageWorkspaceModal, useManageWorkspaceModal,
} from "../../Modals/MangeWorkspace"; } from "../../Modals/MangeWorkspace";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { GearSix, SquaresFour } from "@phosphor-icons/react"; import { GearSix, SquaresFour } from "@phosphor-icons/react";
import truncate from "truncate"; import truncate from "truncate";
import useUser from "../../../hooks/useUser"; import useUser from "@/hooks/useUser";
export default function ActiveWorkspaces() { export default function ActiveWorkspaces() {
const { slug } = useParams(); const { slug } = useParams();

View File

@ -1,7 +1,7 @@
import pluralize from "pluralize"; import pluralize from "pluralize";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import System from "../../models/system"; import System from "@/models/system";
import { numberWithCommas } from "../../utils/numbers"; import { numberWithCommas } from "@/utils/numbers";
export default function IndexCount() { export default function IndexCount() {
const [indexes, setIndexes] = useState(null); const [indexes, setIndexes] = useState(null);

View File

@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { WarningCircle, Circle } from "@phosphor-icons/react"; import { WarningCircle, Circle } from "@phosphor-icons/react";
import System from "../../models/system"; import System from "@/models/system";
export default function LLMStatus() { export default function LLMStatus() {
const [status, setStatus] = useState(null); const [status, setStatus] = useState(null);

View File

@ -12,10 +12,10 @@ import NewWorkspaceModal, {
useNewWorkspaceModal, useNewWorkspaceModal,
} from "../Modals/NewWorkspace"; } from "../Modals/NewWorkspace";
import ActiveWorkspaces from "./ActiveWorkspaces"; import ActiveWorkspaces from "./ActiveWorkspaces";
import paths from "../../utils/paths"; import paths from "@/utils/paths";
import { USER_BACKGROUND_COLOR } from "../../utils/constants"; import { USER_BACKGROUND_COLOR } from "@/utils/constants";
import useLogo from "../../hooks/useLogo"; import useLogo from "@/hooks/useLogo";
import useUser from "../../hooks/useUser"; import useUser from "@/hooks/useUser";
export default function Sidebar() { export default function Sidebar() {
const { user } = useUser(); const { user } = useUser();

View File

@ -1,9 +1,9 @@
import React, { useState, useEffect, useRef } from "react"; import React, { useState, useEffect, useRef } from "react";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import paths from "../../utils/paths"; import paths from "@/utils/paths";
import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "../../utils/constants"; import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "@/utils/constants";
import { Person, SignOut } from "@phosphor-icons/react"; import { Person, SignOut } from "@phosphor-icons/react";
import { userFromStorage } from "../../utils/request"; import { userFromStorage } from "@/utils/request";
export default function UserMenu({ children }) { export default function UserMenu({ children }) {
if (isMobile) return <>{children}</>; if (isMobile) return <>{children}</>;

View File

@ -1,13 +1,10 @@
import { memo, forwardRef } from "react"; import { memo, forwardRef } from "react";
import { Warning } from "@phosphor-icons/react"; import { Warning } from "@phosphor-icons/react";
import Jazzicon from "../../../../UserIcon"; import Jazzicon from "../../../../UserIcon";
import renderMarkdown from "../../../../../utils/chat/markdown"; import renderMarkdown from "@/utils/chat/markdown";
import { userFromStorage } from "../../../../../utils/request"; import { userFromStorage } from "@/utils/request";
import Citations from "../Citation"; import Citations from "../Citation";
import { import { AI_BACKGROUND_COLOR, USER_BACKGROUND_COLOR } from "@/utils/constants";
AI_BACKGROUND_COLOR,
USER_BACKGROUND_COLOR,
} from "../../../../../utils/constants";
import { v4 } from "uuid"; import { v4 } from "uuid";
const HistoricalMessage = forwardRef( const HistoricalMessage = forwardRef(

View File

@ -1,7 +1,7 @@
import { forwardRef, memo } from "react"; import { forwardRef, memo } from "react";
import { Warning } from "@phosphor-icons/react"; import { Warning } from "@phosphor-icons/react";
import Jazzicon from "../../../../UserIcon"; import Jazzicon from "../../../../UserIcon";
import renderMarkdown from "../../../../../utils/chat/markdown"; import renderMarkdown from "@/utils/chat/markdown";
import Citations from "../Citation"; import Citations from "../Citation";
const PromptReply = forwardRef( const PromptReply = forwardRef(

View File

@ -10,7 +10,7 @@ import { isMobile } from "react-device-detect";
import ManageWorkspace, { import ManageWorkspace, {
useManageWorkspaceModal, useManageWorkspaceModal,
} from "../../../Modals/MangeWorkspace"; } from "../../../Modals/MangeWorkspace";
import useUser from "../../../../hooks/useUser"; import useUser from "@/hooks/useUser";
export default function PromptInput({ export default function PromptInput({
workspace, workspace,

View File

@ -1,8 +1,8 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import ChatHistory from "./ChatHistory"; import ChatHistory from "./ChatHistory";
import PromptInput from "./PromptInput"; import PromptInput from "./PromptInput";
import Workspace from "../../../models/workspace"; import Workspace from "@/models/workspace";
import handleChat from "../../../utils/chat"; import handleChat from "@/utils/chat";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import { SidebarMobileHeader } from "../../Sidebar"; import { SidebarMobileHeader } from "../../Sidebar";

View File

@ -1,8 +1,8 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import Workspace from "../../models/workspace"; import Workspace from "@/models/workspace";
import LoadingChat from "./LoadingChat"; import LoadingChat from "./LoadingChat";
import ChatContainer from "./ChatContainer"; import ChatContainer from "./ChatContainer";
import paths from "../../utils/paths"; import paths from "@/utils/paths";
export default function WorkspaceChat({ loading, workspace }) { export default function WorkspaceChat({ loading, workspace }) {
const [history, setHistory] = useState([]); const [history, setHistory] = useState([]);

View File

@ -1,6 +1,6 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import System from "../models/system"; import System from "@/models/system";
import AnythingLLM from "../media/logo/anything-llm.png"; import AnythingLLM from "@/media/logo/anything-llm.png";
export default function useLogo() { export default function useLogo() {
const [logo, setLogo] = useState(""); const [logo, setLogo] = useState("");

View File

@ -1,5 +1,5 @@
import { useContext } from "react"; import { useContext } from "react";
import { AuthContext } from "../AuthContext"; import { AuthContext } from "@/AuthContext";
// interface IStore { // interface IStore {
// store: { // store: {

View File

@ -1,8 +1,8 @@
import React from "react"; import React from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
import { BrowserRouter as Router } from "react-router-dom"; import { BrowserRouter as Router } from "react-router-dom";
import App from "./App.jsx"; import App from "@/App.jsx";
import "./index.css"; import "@/index.css";
const isDev = process.env.NODE_ENV !== "production"; const isDev = process.env.NODE_ENV !== "production";
const REACTWRAP = isDev ? React.Fragment : React.StrictMode; const REACTWRAP = isDev ? React.Fragment : React.StrictMode;

View File

@ -1,5 +1,5 @@
import { API_BASE } from "../utils/constants"; import { API_BASE } from "@/utils/constants";
import { baseHeaders } from "../utils/request"; import { baseHeaders } from "@/utils/request";
const Admin = { const Admin = {
// User Management // User Management

View File

@ -1,4 +1,4 @@
import { API_BASE } from "../utils/constants"; import { API_BASE } from "@/utils/constants";
const Invite = { const Invite = {
checkInvite: async (inviteCode) => { checkInvite: async (inviteCode) => {

View File

@ -1,5 +1,5 @@
import { API_BASE, AUTH_TIMESTAMP } from "../utils/constants"; import { API_BASE, AUTH_TIMESTAMP } from "@/utils/constants";
import { baseHeaders } from "../utils/request"; import { baseHeaders } from "@/utils/request";
const System = { const System = {
ping: async function () { ping: async function () {

View File

@ -1,5 +1,5 @@
import { API_BASE } from "../utils/constants"; import { API_BASE } from "@/utils/constants";
import { baseHeaders } from "../utils/request"; import { baseHeaders } from "@/utils/request";
import { fetchEventSource } from "@microsoft/fetch-event-source"; import { fetchEventSource } from "@microsoft/fetch-event-source";
import { v4 } from "uuid"; import { v4 } from "uuid";

View File

@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { titleCase } from "text-case"; import { titleCase } from "text-case";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
import { Trash } from "@phosphor-icons/react"; import { Trash } from "@phosphor-icons/react";
export default function InviteRow({ invite }) { export default function InviteRow({ invite }) {

View File

@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { X } from "@phosphor-icons/react"; import { X } from "@phosphor-icons/react";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
const DIALOG_ID = `new-invite-modal`; const DIALOG_ID = `new-invite-modal`;

View File

@ -1,13 +1,11 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import * as Skeleton from "react-loading-skeleton"; import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css"; import "react-loading-skeleton/dist/skeleton.css";
import { EnvelopeSimple } from "@phosphor-icons/react"; import { EnvelopeSimple } from "@phosphor-icons/react";
import usePrefersDarkMode from "../../../hooks/usePrefersDarkMode"; import usePrefersDarkMode from "@/hooks/usePrefersDarkMode";
import Admin from "../../../models/admin"; import Admin from "@/models/admin";
import InviteRow from "./InviteRow"; import InviteRow from "./InviteRow";
import NewInviteModal, { NewInviteModalId } from "./NewInviteModal"; import NewInviteModal, { NewInviteModalId } from "./NewInviteModal";

View File

@ -1,10 +1,8 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import Admin from "../../../models/admin"; import Admin from "@/models/admin";
import showToast from "../../../utils/toast"; import showToast from "@/utils/toast";
export default function AdminSystem() { export default function AdminSystem() {
const [saving, setSaving] = useState(false); const [saving, setSaving] = useState(false);

View File

@ -1,7 +1,7 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { X } from "@phosphor-icons/react"; import { X } from "@phosphor-icons/react";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
import { userFromStorage } from "../../../../utils/request"; import { userFromStorage } from "@/utils/request";
import { RoleHintDisplay } from ".."; import { RoleHintDisplay } from "..";
const DIALOG_ID = `new-user-modal`; const DIALOG_ID = `new-user-modal`;

View File

@ -1,6 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { X } from "@phosphor-icons/react"; import { X } from "@phosphor-icons/react";
import Admin from "../../../../../models/admin"; import Admin from "@/models/admin";
import { RoleHintDisplay } from "../.."; import { RoleHintDisplay } from "../..";
export const EditUserModalId = (user) => `edit-user-${user.id}-modal`; export const EditUserModalId = (user) => `edit-user-${user.id}-modal`;

View File

@ -1,6 +1,6 @@
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import { titleCase } from "text-case"; import { titleCase } from "text-case";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
import EditUserModal, { EditUserModalId } from "./EditUserModal"; import EditUserModal, { EditUserModalId } from "./EditUserModal";
import { DotsThreeOutline } from "@phosphor-icons/react"; import { DotsThreeOutline } from "@phosphor-icons/react";

View File

@ -1,14 +1,12 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import * as Skeleton from "react-loading-skeleton"; import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css"; import "react-loading-skeleton/dist/skeleton.css";
import { UserPlus } from "@phosphor-icons/react"; import { UserPlus } from "@phosphor-icons/react";
import Admin from "../../../models/admin"; import Admin from "@/models/admin";
import UserRow from "./UserRow"; import UserRow from "./UserRow";
import useUser from "../../../hooks/useUser"; import useUser from "@/hooks/useUser";
import NewUserModal, { NewUserModalId } from "./NewUserModal"; import NewUserModal, { NewUserModalId } from "./NewUserModal";
export default function AdminUsers() { export default function AdminUsers() {

View File

@ -1,6 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { X } from "@phosphor-icons/react"; import { X } from "@phosphor-icons/react";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
const DIALOG_ID = `new-workspace-modal`; const DIALOG_ID = `new-workspace-modal`;
function hideModal() { function hideModal() {

View File

@ -1,6 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { X } from "@phosphor-icons/react"; import { X } from "@phosphor-icons/react";
import Admin from "../../../../../models/admin"; import Admin from "@/models/admin";
import { titleCase } from "text-case"; import { titleCase } from "text-case";
export const EditWorkspaceUsersModalId = (workspace) => export const EditWorkspaceUsersModalId = (workspace) =>

View File

@ -1,6 +1,6 @@
import { useRef } from "react"; import { useRef } from "react";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
import paths from "../../../../utils/paths"; import paths from "@/utils/paths";
import EditWorkspaceUsersModal, { import EditWorkspaceUsersModal, {
EditWorkspaceUsersModalId, EditWorkspaceUsersModalId,
} from "./EditWorkspaceUsersModal"; } from "./EditWorkspaceUsersModal";

View File

@ -1,13 +1,11 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import * as Skeleton from "react-loading-skeleton"; import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css"; import "react-loading-skeleton/dist/skeleton.css";
import { BookOpen } from "@phosphor-icons/react"; import { BookOpen } from "@phosphor-icons/react";
import usePrefersDarkMode from "../../../hooks/usePrefersDarkMode"; import usePrefersDarkMode from "@/hooks/usePrefersDarkMode";
import Admin from "../../../models/admin"; import Admin from "@/models/admin";
import WorkspaceRow from "./WorkspaceRow"; import WorkspaceRow from "./WorkspaceRow";
import NewWorkspaceModal, { NewWorkspaceModalId } from "./NewWorkspaceModal"; import NewWorkspaceModal, { NewWorkspaceModalId } from "./NewWorkspaceModal";

View File

@ -1,9 +1,9 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
import showToast from "../../../../utils/toast"; import showToast from "@/utils/toast";
import { Trash } from "@phosphor-icons/react"; import { Trash } from "@phosphor-icons/react";
import { userFromStorage } from "../../../../utils/request"; import { userFromStorage } from "@/utils/request";
import System from "../../../../models/system"; import System from "@/models/system";
export default function ApiKeyRow({ apiKey }) { export default function ApiKeyRow({ apiKey }) {
const rowRef = useRef(null); const rowRef = useRef(null);

View File

@ -1,9 +1,9 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { X } from "@phosphor-icons/react"; import { X } from "@phosphor-icons/react";
import Admin from "../../../../models/admin"; import Admin from "@/models/admin";
import paths from "../../../../utils/paths"; import paths from "@/utils/paths";
import { userFromStorage } from "../../../../utils/request"; import { userFromStorage } from "@/utils/request";
import System from "../../../../models/system"; import System from "@/models/system";
const DIALOG_ID = `new-api-key-modal`; const DIALOG_ID = `new-api-key-modal`;

View File

@ -1,17 +1,15 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import * as Skeleton from "react-loading-skeleton"; import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css"; import "react-loading-skeleton/dist/skeleton.css";
import { PlusCircle } from "@phosphor-icons/react"; import { PlusCircle } from "@phosphor-icons/react";
import Admin from "../../../models/admin"; import Admin from "@/models/admin";
import ApiKeyRow from "./ApiKeyRow"; import ApiKeyRow from "./ApiKeyRow";
import NewApiKeyModal, { NewApiKeyModalId } from "./NewApiKeyModal"; import NewApiKeyModal, { NewApiKeyModalId } from "./NewApiKeyModal";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
import { userFromStorage } from "../../../utils/request"; import { userFromStorage } from "@/utils/request";
import System from "../../../models/system"; import System from "@/models/system";
export default function AdminApiKeys() { export default function AdminApiKeys() {
return ( return (

View File

@ -1,14 +1,12 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import Admin from "../../../models/admin"; import Admin from "@/models/admin";
import AnythingLLM from "../../../media/logo/anything-llm.png"; import AnythingLLM from "@/media/logo/anything-llm.png";
import useLogo from "../../../hooks/useLogo"; import useLogo from "@/hooks/useLogo";
import System from "../../../models/system"; import System from "@/models/system";
import EditingChatBubble from "../../../components/EditingChatBubble"; import EditingChatBubble from "@/components/EditingChatBubble";
import showToast from "../../../utils/toast"; import showToast from "@/utils/toast";
import { Plus } from "@phosphor-icons/react"; import { Plus } from "@phosphor-icons/react";
export default function Appearance() { export default function Appearance() {

View File

@ -1,7 +1,7 @@
import { useRef } from "react"; import { useRef } from "react";
import truncate from "truncate"; import truncate from "truncate";
import { X, Trash } from "@phosphor-icons/react"; import { X, Trash } from "@phosphor-icons/react";
import System from "../../../../models/system"; import System from "@/models/system";
export default function ChatRow({ chat }) { export default function ChatRow({ chat }) {
const rowRef = useRef(null); const rowRef = useRef(null);

View File

@ -1,14 +1,12 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import * as Skeleton from "react-loading-skeleton"; import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css"; import "react-loading-skeleton/dist/skeleton.css";
import useQuery from "../../../hooks/useQuery"; import useQuery from "@/hooks/useQuery";
import ChatRow from "./ChatRow"; import ChatRow from "./ChatRow";
import showToast from "../../../utils/toast"; import showToast from "@/utils/toast";
import System from "../../../models/system"; import System from "@/models/system";
const PAGE_SIZE = 20; const PAGE_SIZE = 20;
export default function WorkspaceChats() { export default function WorkspaceChats() {

View File

@ -1,21 +1,19 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import System from "../../../models/system"; import System from "@/models/system";
import showToast from "../../../utils/toast"; import showToast from "@/utils/toast";
import AnythingLLMIcon from "../../../media/logo/anything-llm-icon.png"; import AnythingLLMIcon from "@/media/logo/anything-llm-icon.png";
import OpenAiLogo from "../../../media/llmprovider/openai.png"; import OpenAiLogo from "@/media/llmprovider/openai.png";
import AzureOpenAiLogo from "../../../media/llmprovider/azure.png"; import AzureOpenAiLogo from "@/media/llmprovider/azure.png";
import LocalAiLogo from "../../../media/llmprovider/localai.png"; import LocalAiLogo from "@/media/llmprovider/localai.png";
import PreLoader from "../../../components/Preloader"; import PreLoader from "@/components/Preloader";
import LLMProviderOption from "../../../components/LLMSelection/LLMProviderOption"; import LLMProviderOption from "@/components/LLMSelection/LLMProviderOption";
import ChangeWarningModal from "../../../components/ChangeWarning"; import ChangeWarningModal from "@/components/ChangeWarning";
import OpenAiOptions from "../../../components/EmbeddingSelection/OpenAiOptions"; import OpenAiOptions from "@/components/EmbeddingSelection/OpenAiOptions";
import AzureAiOptions from "../../../components/EmbeddingSelection/AzureAiOptions"; import AzureAiOptions from "@/components/EmbeddingSelection/AzureAiOptions";
import LocalAiOptions from "../../../components/EmbeddingSelection/LocalAiOptions"; import LocalAiOptions from "@/components/EmbeddingSelection/LocalAiOptions";
import NativeEmbeddingOptions from "../../../components/EmbeddingSelection/NativeEmbeddingOptions"; import NativeEmbeddingOptions from "@/components/EmbeddingSelection/NativeEmbeddingOptions";
export default function GeneralEmbeddingPreference() { export default function GeneralEmbeddingPreference() {
const [saving, setSaving] = useState(false); const [saving, setSaving] = useState(false);

View File

@ -1,14 +1,11 @@
import { useEffect, useRef, useState } from "react"; import { useRef, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import Admin from "../../../models/admin"; import showToast from "@/utils/toast";
import showToast from "../../../utils/toast";
import { CloudArrowUp, DownloadSimple } from "@phosphor-icons/react"; import { CloudArrowUp, DownloadSimple } from "@phosphor-icons/react";
import System from "../../../models/system"; import System from "@/models/system";
import { API_BASE } from "../../../utils/constants"; import { API_BASE } from "@/utils/constants";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
export default function GeneralExportImport() { export default function GeneralExportImport() {
const hostname = window?.location?.hostname; const hostname = window?.location?.hostname;

View File

@ -1,22 +1,20 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import System from "../../../models/system"; import System from "@/models/system";
import showToast from "../../../utils/toast"; import showToast from "@/utils/toast";
import OpenAiLogo from "../../../media/llmprovider/openai.png"; import OpenAiLogo from "@/media/llmprovider/openai.png";
import AzureOpenAiLogo from "../../../media/llmprovider/azure.png"; import AzureOpenAiLogo from "@/media/llmprovider/azure.png";
import AnthropicLogo from "../../../media/llmprovider/anthropic.png"; import AnthropicLogo from "@/media/llmprovider/anthropic.png";
import LMStudioLogo from "../../../media/llmprovider/lmstudio.png"; import LMStudioLogo from "@/media/llmprovider/lmstudio.png";
import LocalAiLogo from "../../../media/llmprovider/localai.png"; import LocalAiLogo from "@/media/llmprovider/localai.png";
import PreLoader from "../../../components/Preloader"; import PreLoader from "@/components/Preloader";
import LLMProviderOption from "../../../components/LLMSelection/LLMProviderOption"; import LLMProviderOption from "@/components/LLMSelection/LLMProviderOption";
import OpenAiOptions from "../../../components/LLMSelection/OpenAiOptions"; import OpenAiOptions from "@/components/LLMSelection/OpenAiOptions";
import AzureAiOptions from "../../../components/LLMSelection/AzureAiOptions"; import AzureAiOptions from "@/components/LLMSelection/AzureAiOptions";
import AnthropicAiOptions from "../../../components/LLMSelection/AnthropicAiOptions"; import AnthropicAiOptions from "@/components/LLMSelection/AnthropicAiOptions";
import LMStudioOptions from "../../../components/LLMSelection/LMStudioOptions"; import LMStudioOptions from "@/components/LLMSelection/LMStudioOptions";
import LocalAiOptions from "../../../components/LLMSelection/LocalAiOptions"; import LocalAiOptions from "@/components/LLMSelection/LocalAiOptions";
export default function GeneralLLMPreference() { export default function GeneralLLMPreference() {
const [saving, setSaving] = useState(false); const [saving, setSaving] = useState(false);

View File

@ -1,17 +1,11 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import showToast from "../../../utils/toast"; import showToast from "@/utils/toast";
import System from "../../../models/system"; import System from "@/models/system";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
import { import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "@/utils/constants";
AUTH_TIMESTAMP, import PreLoader from "@/components/Preloader";
AUTH_TOKEN,
AUTH_USER,
} from "../../../utils/constants";
import PreLoader from "../../../components/Preloader";
export default function GeneralSecurity() { export default function GeneralSecurity() {
return ( return (

View File

@ -1,18 +1,16 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import Sidebar, { import Sidebar, { SidebarMobileHeader } from "@/components/SettingsSidebar";
SidebarMobileHeader,
} from "../../../components/SettingsSidebar";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import System from "../../../models/system"; import System from "@/models/system";
import showToast from "../../../utils/toast"; import showToast from "@/utils/toast";
import ChromaLogo from "../../../media/vectordbs/chroma.png"; import ChromaLogo from "@/media/vectordbs/chroma.png";
import PineconeLogo from "../../../media/vectordbs/pinecone.png"; import PineconeLogo from "@/media/vectordbs/pinecone.png";
import LanceDbLogo from "../../../media/vectordbs/lancedb.png"; import LanceDbLogo from "@/media/vectordbs/lancedb.png";
import WeaviateLogo from "../../../media/vectordbs/weaviate.png"; import WeaviateLogo from "@/media/vectordbs/weaviate.png";
import QDrantLogo from "../../../media/vectordbs/qdrant.png"; import QDrantLogo from "@/media/vectordbs/qdrant.png";
import PreLoader from "../../../components/Preloader"; import PreLoader from "@/components/Preloader";
import VectorDBOption from "../../../components/VectorDBOption"; import VectorDBOption from "@/components/VectorDBOption";
import ChangeWarningModal from "../../../components/ChangeWarning"; import ChangeWarningModal from "@/components/ChangeWarning";
export default function GeneralVectorDatabase() { export default function GeneralVectorDatabase() {
const [saving, setSaving] = useState(false); const [saving, setSaving] = useState(false);

View File

@ -1,9 +1,9 @@
import React, { useState } from "react"; import React, { useState } from "react";
import Invite from "../../../models/invite"; import Invite from "@/models/invite";
import paths from "../../../utils/paths"; import paths from "@/utils/paths";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { AUTH_TOKEN, AUTH_USER } from "../../../utils/constants"; import { AUTH_TOKEN, AUTH_USER } from "@/utils/constants";
import System from "../../../models/system"; import System from "@/models/system";
export default function NewUserModal() { export default function NewUserModal() {
const { code } = useParams(); const { code } = useParams();

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { FullScreenLoader } from "../../components/Preloader"; import { FullScreenLoader } from "@/components/Preloader";
import Invite from "../../models/invite"; import Invite from "@/models/invite";
import NewUserModal from "./NewUserModal"; import NewUserModal from "./NewUserModal";
export default function InvitePage() { export default function InvitePage() {

View File

@ -1,8 +1,6 @@
import React from "react"; import React from "react";
import PasswordModal, { import PasswordModal, { usePasswordModal } from "@/components/Modals/Password";
usePasswordModal, import { FullScreenLoader } from "@/components/Preloader";
} from "../../components/Modals/Password";
import { FullScreenLoader } from "../../components/Preloader";
export default function Login() { export default function Login() {
const { loading, mode } = usePasswordModal(); const { loading, mode } = usePasswordModal();

View File

@ -1,12 +1,10 @@
import React from "react"; import React from "react";
import DefaultChatContainer from "../../components/DefaultChat"; import DefaultChatContainer from "@/components/DefaultChat";
import Sidebar from "../../components/Sidebar"; import Sidebar from "@/components/Sidebar";
import PasswordModal, { import PasswordModal, { usePasswordModal } from "@/components/Modals/Password";
usePasswordModal,
} from "../../components/Modals/Password";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import { FullScreenLoader } from "../../components/Preloader"; import { FullScreenLoader } from "@/components/Preloader";
import UserMenu from "../../components/UserMenu"; import UserMenu from "@/components/UserMenu";
export default function Main() { export default function Main() {
const { loading, requiresAuth, mode } = usePasswordModal(); const { loading, requiresAuth, mode } = usePasswordModal();

View File

@ -1,9 +1,9 @@
import React, { memo, useEffect, useState } from "react"; import React, { memo, useEffect, useState } from "react";
import System from "../../../../../models/system"; import System from "@/models/system";
import AnythingLLM from "../../../../../media/logo/anything-llm.png"; import AnythingLLM from "@/media/logo/anything-llm.png";
import useLogo from "../../../../../hooks/useLogo"; import useLogo from "@/hooks/useLogo";
import { Plus } from "@phosphor-icons/react"; import { Plus } from "@phosphor-icons/react";
import showToast from "../../../../../utils/toast"; import showToast from "@/utils/toast";
function AppearanceSetup({ prevStep, nextStep }) { function AppearanceSetup({ prevStep, nextStep }) {
const { logo: _initLogo } = useLogo(); const { logo: _initLogo } = useLogo();

View File

@ -1,7 +1,7 @@
import React, { memo } from "react"; import React, { memo } from "react";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import paths from "../../../../../utils/paths"; import paths from "@/utils/paths";
import Workspace from "../../../../../models/workspace"; import Workspace from "@/models/workspace";
function CreateFirstWorkspace() { function CreateFirstWorkspace() {
const navigate = useNavigate(); const navigate = useNavigate();

View File

@ -1,17 +1,17 @@
import React, { memo, useEffect, useState } from "react"; import React, { memo, useEffect, useState } from "react";
import System from "../../../../../models/system"; import System from "@/models/system";
import AnythingLLMIcon from "../../../../../media/logo/anything-llm-icon.png"; import AnythingLLMIcon from "@/media/logo/anything-llm-icon.png";
import OpenAiLogo from "../../../../../media/llmprovider/openai.png"; import OpenAiLogo from "@/media/llmprovider/openai.png";
import AzureOpenAiLogo from "../../../../../media/llmprovider/azure.png"; import AzureOpenAiLogo from "@/media/llmprovider/azure.png";
import AnthropicLogo from "../../../../../media/llmprovider/anthropic.png"; import AnthropicLogo from "@/media/llmprovider/anthropic.png";
import LMStudioLogo from "../../../../../media/llmprovider/lmstudio.png"; import LMStudioLogo from "@/media/llmprovider/lmstudio.png";
import LocalAiLogo from "../../../../../media/llmprovider/localai.png"; import LocalAiLogo from "@/media/llmprovider/localai.png";
import ChromaLogo from "../../../../../media/vectordbs/chroma.png"; import ChromaLogo from "@/media/vectordbs/chroma.png";
import PineconeLogo from "../../../../../media/vectordbs/pinecone.png"; import PineconeLogo from "@/media/vectordbs/pinecone.png";
import LanceDbLogo from "../../../../../media/vectordbs/lancedb.png"; import LanceDbLogo from "@/media/vectordbs/lancedb.png";
import WeaviateLogo from "../../../../../media/vectordbs/weaviate.png"; import WeaviateLogo from "@/media/vectordbs/weaviate.png";
import QDrantLogo from "../../../../../media/vectordbs/qdrant.png"; import QDrantLogo from "@/media/vectordbs/qdrant.png";
import PreLoader from "../../../../../components/Preloader"; import PreLoader from "@/components/Preloader";
const LLM_SELECTION_PRIVACY = { const LLM_SELECTION_PRIVACY = {
openai: { openai: {

View File

@ -1,15 +1,15 @@
import React, { memo, useEffect, useState } from "react"; import React, { memo, useEffect, useState } from "react";
import AnythingLLMIcon from "../../../../../media/logo/anything-llm-icon.png"; import AnythingLLMIcon from "@/media/logo/anything-llm-icon.png";
import OpenAiLogo from "../../../../../media/llmprovider/openai.png"; import OpenAiLogo from "@/media/llmprovider/openai.png";
import AzureOpenAiLogo from "../../../../../media/llmprovider/azure.png"; import AzureOpenAiLogo from "@/media/llmprovider/azure.png";
import LocalAiLogo from "../../../../../media/llmprovider/localai.png"; import LocalAiLogo from "@/media/llmprovider/localai.png";
import System from "../../../../../models/system"; import System from "@/models/system";
import PreLoader from "../../../../../components/Preloader"; import PreLoader from "@/components/Preloader";
import LLMProviderOption from "../../../../../components/LLMSelection/LLMProviderOption"; import LLMProviderOption from "@/components/LLMSelection/LLMProviderOption";
import OpenAiOptions from "../../../../../components/EmbeddingSelection/OpenAiOptions"; import OpenAiOptions from "@/components/EmbeddingSelection/OpenAiOptions";
import AzureAiOptions from "../../../../../components/EmbeddingSelection/AzureAiOptions"; import AzureAiOptions from "@/components/EmbeddingSelection/AzureAiOptions";
import LocalAiOptions from "../../../../../components/EmbeddingSelection/LocalAiOptions"; import LocalAiOptions from "@/components/EmbeddingSelection/LocalAiOptions";
import NativeEmbeddingOptions from "../../../../../components/EmbeddingSelection/NativeEmbeddingOptions"; import NativeEmbeddingOptions from "@/components/EmbeddingSelection/NativeEmbeddingOptions";
function EmbeddingSelection({ nextStep, prevStep, currentStep }) { function EmbeddingSelection({ nextStep, prevStep, currentStep }) {
const [embeddingChoice, setEmbeddingChoice] = useState("native"); const [embeddingChoice, setEmbeddingChoice] = useState("native");

View File

@ -1,17 +1,17 @@
import React, { memo, useEffect, useState } from "react"; import React, { memo, useEffect, useState } from "react";
import OpenAiLogo from "../../../../../media/llmprovider/openai.png"; import OpenAiLogo from "@/media/llmprovider/openai.png";
import AzureOpenAiLogo from "../../../../../media/llmprovider/azure.png"; import AzureOpenAiLogo from "@/media/llmprovider/azure.png";
import AnthropicLogo from "../../../../../media/llmprovider/anthropic.png"; import AnthropicLogo from "@/media/llmprovider/anthropic.png";
import LMStudioLogo from "../../../../../media/llmprovider/lmstudio.png"; import LMStudioLogo from "@/media/llmprovider/lmstudio.png";
import LocalAiLogo from "../../../../../media/llmprovider/localai.png"; import LocalAiLogo from "@/media/llmprovider/localai.png";
import System from "../../../../../models/system"; import System from "@/models/system";
import PreLoader from "../../../../../components/Preloader"; import PreLoader from "@/components/Preloader";
import LLMProviderOption from "../../../../../components/LLMSelection/LLMProviderOption"; import LLMProviderOption from "@/components/LLMSelection/LLMProviderOption";
import OpenAiOptions from "../../../../../components/LLMSelection/OpenAiOptions"; import OpenAiOptions from "@/components/LLMSelection/OpenAiOptions";
import AzureAiOptions from "../../../../../components/LLMSelection/AzureAiOptions"; import AzureAiOptions from "@/components/LLMSelection/AzureAiOptions";
import AnthropicAiOptions from "../../../../../components/LLMSelection/AnthropicAiOptions"; import AnthropicAiOptions from "@/components/LLMSelection/AnthropicAiOptions";
import LMStudioOptions from "../../../../../components/LLMSelection/LMStudioOptions"; import LMStudioOptions from "@/components/LLMSelection/LMStudioOptions";
import LocalAiOptions from "../../../../../components/LLMSelection/LocalAiOptions"; import LocalAiOptions from "@/components/LLMSelection/LocalAiOptions";
function LLMSelection({ nextStep, prevStep, currentStep }) { function LLMSelection({ nextStep, prevStep, currentStep }) {
const [llmChoice, setLLMChoice] = useState("openai"); const [llmChoice, setLLMChoice] = useState("openai");

View File

@ -1,10 +1,6 @@
import React, { useState, memo } from "react"; import React, { useState, memo } from "react";
import System from "../../../../../models/system"; import System from "@/models/system";
import { import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "@/utils/constants";
AUTH_TIMESTAMP,
AUTH_TOKEN,
AUTH_USER,
} from "../../../../../utils/constants";
import debounce from "lodash.debounce"; import debounce from "lodash.debounce";
// Multi-user mode step // Multi-user mode step

View File

@ -1,10 +1,6 @@
import React, { memo, useState } from "react"; import React, { memo, useState } from "react";
import System from "../../../../../models/system"; import System from "@/models/system";
import { import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "@/utils/constants";
AUTH_TIMESTAMP,
AUTH_TOKEN,
AUTH_USER,
} from "../../../../../utils/constants";
import debounce from "lodash.debounce"; import debounce from "lodash.debounce";
function PasswordProtection({ nextStep, prevStep }) { function PasswordProtection({ nextStep, prevStep }) {

View File

@ -1,13 +1,13 @@
import React, { memo, useEffect, useState } from "react"; import React, { memo, useEffect, useState } from "react";
import VectorDBOption from "../../../../../components/VectorDBOption"; import VectorDBOption from "@/components/VectorDBOption";
import ChromaLogo from "../../../../../media/vectordbs/chroma.png"; import ChromaLogo from "@/media/vectordbs/chroma.png";
import PineconeLogo from "../../../../../media/vectordbs/pinecone.png"; import PineconeLogo from "@/media/vectordbs/pinecone.png";
import LanceDbLogo from "../../../../../media/vectordbs/lancedb.png"; import LanceDbLogo from "@/media/vectordbs/lancedb.png";
import WeaviateLogo from "../../../../../media/vectordbs/weaviate.png"; import WeaviateLogo from "@/media/vectordbs/weaviate.png";
import QDrantLogo from "../../../../../media/vectordbs/qdrant.png"; import QDrantLogo from "@/media/vectordbs/qdrant.png";
import System from "../../../../../models/system"; import System from "@/models/system";
import PreLoader from "../../../../../components/Preloader"; import PreLoader from "@/components/Preloader";
function VectorDatabaseConnection({ nextStep, prevStep, currentStep }) { function VectorDatabaseConnection({ nextStep, prevStep, currentStep }) {
const [vectorDB, setVectorDB] = useState("lancedb"); const [vectorDB, setVectorDB] = useState("lancedb");

View File

@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import OnboardingModal, { OnboardingModalId } from "./OnboardingModal"; import OnboardingModal, { OnboardingModalId } from "./OnboardingModal";
import useLogo from "../../hooks/useLogo"; import useLogo from "@/hooks/useLogo";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
export default function OnboardingFlow() { export default function OnboardingFlow() {

View File

@ -1,13 +1,11 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { default as WorkspaceChatContainer } from "../../components/WorkspaceChat"; import { default as WorkspaceChatContainer } from "@/components/WorkspaceChat";
import Sidebar from "../../components/Sidebar"; import Sidebar from "@/components/Sidebar";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import Workspace from "../../models/workspace"; import Workspace from "@/models/workspace";
import PasswordModal, { import PasswordModal, { usePasswordModal } from "@/components/Modals/Password";
usePasswordModal,
} from "../../components/Modals/Password";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import { FullScreenLoader } from "../../components/Preloader"; import { FullScreenLoader } from "@/components/Preloader";
export default function WorkspaceChat() { export default function WorkspaceChat() {
const { loading, requiresAuth, mode } = usePasswordModal(); const { loading, requiresAuth, mode } = usePasswordModal();

View File

@ -1,5 +1,5 @@
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import usePrefersDarkMode from "../hooks/usePrefersDarkMode"; import usePrefersDarkMode from "@/hooks/usePrefersDarkMode";
// Additional Configs (opts) // Additional Configs (opts)
// You can also pass valid ReactToast params to override the defaults. // You can also pass valid ReactToast params to override the defaults.

View File

@ -1,4 +1,5 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import { fileURLToPath, URL } from "url";
import postcss from './postcss.config.js' import postcss from './postcss.config.js'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import dns from 'dns' import dns from 'dns'
@ -30,6 +31,7 @@ export default defineConfig({
], ],
resolve: { resolve: {
alias: [ alias: [
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) },
{ {
process: "process/browser", process: "process/browser",
stream: "stream-browserify", stream: "stream-browserify",