-
-
- Documents {totalDocuments! > 0 ? `(${totalDocuments})` : ''}
-
-
- {workspaces.length > 0 ? (
- <>
- {!!knownConnector ? (
+
+
+
+
+
+ |
+ Name
+ |
+
+ Workspace
+ |
+
+ Date
+ |
+
+ Vectors
+ |
+
+ {' '}
+ |
+
+
+ |
+
+
+ {documents?.length > 0 && (
+
+ {documents.map((document, index) => (
+
+ ))}
+
+ )}
+
+
+ {!!!knownConnector && (
+
+
+
+ Connect a Vector Database to get started
+
+
+ Begin by connecting a Vector Database to your organization
+
- ) : (
+
+
+ )}
+
+ {!!knownConnector && workspaces?.length === 0 && (
+
+
+
+ Create a workspace to get started
+
+
+ Workspaces are used to organize your documents
+
- )}
- >
- ) : (
-
+
+
+ )}
+
+ {documents?.length === 0 && workspaces?.length > 0 && (
+
+
+
+ 0 Documents
+
+
+ Upload documents to your workspace
+
+
+
+
)}
- {documents.length > 0 ? (
-
-
-
-
- Document Name
-
-
- Workspace
-
-
- Created
-
-
- Status
-
-
-
-
-
-
- <>
- {documents.map((document) => {
- return (
-
-
-
-
-
-
- {truncate(document.name, 20)}
-
-
-
-
-
-
- {moment(document.createdAt).format('lll')}
-
-
-
-
- Cached
-
-
-
-
-
- );
- })}
- >
-
+
+
+
+ {canUpload ? (
+
) : (
-
-
-
-
You have no documents in any workspaces!
-
- Get started managing documents by adding them to workspaces
- via the UI or code.
-
-
-
-
-
+
)}
-
- {canUpload ? (
-
- ) : (
-
- )}
>
);
}
+
+const Fragment = ({
+ document,
+ index,
+ deleteDocument,
+ organization,
+}: {
+ document: any;
+ index: number;
+ deleteDocument: any;
+ organization: any;
+}) => {
+ return (
+ <>
+
+ |
+
+ {truncate(document?.name, 35)}
+ |
+
+
+
+ {truncate(document.workspace.name, 20) || ''}
+
+
+ |
+ {moment(document?.createdAt).format('lll')} |
+ Cached |
+
+
+ Details
+
+ |
+
+
+
+
+
+
+ |
+
+ >
+ );
+};
diff --git a/frontend/src/pages/Dashboard/QuickActionSidebar/index.tsx b/frontend/src/pages/Dashboard/QuickActionSidebar/index.tsx
new file mode 100644
index 0000000..eb6350f
--- /dev/null
+++ b/frontend/src/pages/Dashboard/QuickActionSidebar/index.tsx
@@ -0,0 +1,84 @@
+import {
+ CaretDown,
+ Key,
+ SpinnerGap,
+ Toolbox,
+ User,
+} from '@phosphor-icons/react';
+import { useState } from 'react';
+import { NavLink } from 'react-router-dom';
+import paths from '../../../utils/paths';
+import useUser from '../../../hooks/useUser';
+
+export default function QuickActionsSidebar({
+ organization,
+}: {
+ organization: any;
+}) {
+ const { user } = useUser();
+ const [quickActionsOpen, setQuickActionsOpen] = useState(true);
+
+ return (
+
+
+
+
+ {user?.role === 'admin' && (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )}
+
+
+
+
+
+ );
+}
diff --git a/frontend/src/pages/Dashboard/Statistics/index.tsx b/frontend/src/pages/Dashboard/Statistics/index.tsx
index f3be2f7..e0c2577 100644
--- a/frontend/src/pages/Dashboard/Statistics/index.tsx
+++ b/frontend/src/pages/Dashboard/Statistics/index.tsx
@@ -1,11 +1,16 @@
import { memo, useState, useEffect } from 'react';
-import PreLoader from '../../../components/Preloader';
import { humanFileSize, nFormatter } from '../../../utils/numbers';
-import moment from 'moment';
import Organization from '../../../models/organization';
import pluralize from 'pluralize';
+import Workspace from '../../../models/workspace';
-const Statistics = ({ organization }: { organization: any }) => {
+const Statistics = ({
+ organization,
+ workspaces,
+}: {
+ organization: any;
+ workspaces: any;
+}) => {
const [documents, setDocuments] = useState({
status: 'loading',
value: 0,
@@ -18,6 +23,10 @@ const Statistics = ({ organization }: { organization: any }) => {
status: 'loading',
value: 0,
});
+ const [dimensions, setDimensions] = useState({
+ status: 'loading',
+ value: '-',
+ });
useEffect(() => {
async function collectStats() {
@@ -32,65 +41,49 @@ const Statistics = ({ organization }: { organization: any }) => {
Organization.stats(organization.slug, 'cache-size').then((json) => {
setCache({ status: 'complete', value: json.value });
});
+ Workspace.stats(organization.slug, workspaces[0].slug, 'dimensions').then(
+ (json) => {
+ setDimensions({ status: 'complete', value: json.value });
+ }
+ );
}
collectStats();
- }, [organization?.slug]);
+ }, [organization?.slug, workspaces[0]?.slug]);
return (
-
-
-
- {documents.status === 'loading' ? (
-
- ) : (
-
-
- {nFormatter(documents.value)}
-
-
- {pluralize('Document', documents.value)}
-
-
- )}
+
+
+
+
+ Documents
+
+
+ {' '}
+
+
+ ({nFormatter(documents.value)})
+
+
-
- {vectors.status === 'loading' ? (
-
- ) : (
-
-
- {nFormatter(vectors.value)}
-
-
- {pluralize('Vector', vectors.value)}
-
-
- )}
-
-
-
- {cache.status === 'loading' ? (
-
- ) : (
-
-
- {humanFileSize(cache.value)}
-
-
Vector Cache (MB)
-
- )}
-
-
-
-
-
- {organization?.lastUpdated
- ? moment(organization.lastUpdated).fromNow()
- : moment(organization.createdAt).fromNow()}
-
-
Last Modified
-
+
+
+
+ {pluralize('Vector', vectors.value)}:{' '}
+
+ {nFormatter(vectors.value)}
+
+
+
+ Vector Cache:{' '}
+
+ {humanFileSize(cache.value)}
+
+
+
+ Dimensions:{' '}
+ {dimensions.value}
+
diff --git a/frontend/src/pages/Dashboard/WorkspacesList/index.tsx b/frontend/src/pages/Dashboard/WorkspacesList/index.tsx
index 7ba65a9..a35bc64 100644
--- a/frontend/src/pages/Dashboard/WorkspacesList/index.tsx
+++ b/frontend/src/pages/Dashboard/WorkspacesList/index.tsx
@@ -20,7 +20,7 @@ export default function WorkspacesList({
totalWorkspaces?: number;
}) {
return (
-
+
diff --git a/frontend/src/pages/Dashboard/index.tsx b/frontend/src/pages/Dashboard/index.tsx
index d3134b7..e01ae59 100644
--- a/frontend/src/pages/Dashboard/index.tsx
+++ b/frontend/src/pages/Dashboard/index.tsx
@@ -1,17 +1,25 @@
-import { FullScreenLoader } from '../../components/Preloader';
+import PreLoader, { FullScreenLoader } from '../../components/Preloader';
import useUser from '../../hooks/useUser';
import { useState, useEffect } from 'react';
import DefaultLayout from '../../layout/DefaultLayout';
import User from '../../models/user';
import paths from '../../utils/paths';
import AppLayout from '../../layout/AppLayout';
-import { useParams } from 'react-router-dom';
+import { NavLink, useParams } from 'react-router-dom';
import Statistics from './Statistics';
-import WorkspacesList from './WorkspacesList';
import DocumentsList from './DocumentsList';
import Organization from '../../models/organization';
-import ApiKeyCard from './ApiKey';
-import ConnectorCard from './Connector';
+import truncate from 'truncate';
+
+import ChromaLogo from '../../images/vectordbs/chroma.png';
+import PineconeLogoInverted from '../../images/vectordbs/pinecone-inverted.png';
+import PineconeLogo from '../../images/vectordbs/pinecone.png';
+import qDrantLogo from '../../images/vectordbs/qdrant.png';
+import WeaviateLogo from '../../images/vectordbs/weaviate.png';
+import { GearSix, Prohibit } from '@phosphor-icons/react';
+import { titleCase } from 'title-case';
+import QuickActionsSidebar from './QuickActionSidebar';
+import { APP_NAME } from '../../utils/constants';
export default function Dashboard() {
const { slug } = useParams();
@@ -25,7 +33,6 @@ export default function Dashboard() {
const [workspaces, setWorkspaces] = useState