Skip to content

Commit

Permalink
add quick actions to workspace view
Browse files Browse the repository at this point in the history
remove workspace console.log
  • Loading branch information
timothycarambat committed Jan 18, 2024
1 parent 91eb6ee commit bb46198
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
1 change: 0 additions & 1 deletion backend/endpoints/v1/workspaces/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ function workspaceEndpoints(app) {
return;
}

console.log(workspace);
const value = await WorkspaceDocument[methods[statistic]](
"workspace_id",
workspace.id
Expand Down
1 change: 0 additions & 1 deletion backend/utils/vectordatabases/providers/weaviate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class Weaviate {
var totalVectors = 0;
for (const collection of collections) {
if (!collection || !collection.name) continue;
console.log({ dim: await this.indexDimensions(collection.name) });
totalVectors +=
(await this.namespaceWithClient(client, collection.name))
?.vectorCount || 0;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/WorkspaceDashboard/Statistics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Statistics = ({
}, [organization?.slug, workspace?.slug]);

return (
<div className="flex w-full justify-between">
<div className="flex w-[calc(100%-217px)] justify-between">
<div className="-mt-6 ml-4 w-full rounded-xl border-2 border-white/20 px-5 py-2 text-sky-400">
<div className="flex items-center justify-between whitespace-nowrap">
<span className="font-jetbrains uppercase text-white">
Expand All @@ -82,7 +82,7 @@ const Statistics = ({
</div>
</div>

<div className=" -mt-6 ml-4 mr-24 w-fit min-w-[303px] rounded-xl border-2 border-white/20 px-5 py-2 text-sky-400">
<div className=" -mt-6 ml-4 w-fit min-w-[303px] rounded-xl border-2 border-white/20 px-5 py-2 text-sky-400">
<div className="flex items-center justify-between">
<span className="font-jetbrains whitespace-nowrap text-white">
ID:{' '}
Expand Down
21 changes: 14 additions & 7 deletions frontend/src/pages/WorkspaceDashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import qDrantLogo from '../../images/vectordbs/qdrant.png';
import WeaviateLogo from '../../images/vectordbs/weaviate.png';
import SyncConnectorModal from '../../components/Modals/SyncConnectorModal';
import UpdateConnectorModal from '../../components/Modals/UpdateConnectorModal';
import QuickActionsSidebar from '../Dashboard/QuickActionSidebar';

export default function WorkspaceDashboard() {
const { user } = useUser();
Expand Down Expand Up @@ -130,8 +131,8 @@ export default function WorkspaceDashboard() {
deleteWorkspace={deleteWorkspace}
/>
}
hasQuickActions={true}
>
<Statistics organization={organization} workspace={workspace} />
{!!organization && (
<div className="mb-4 grid grid-cols-1 gap-4 md:grid-cols-2 md:gap-6 xl:grid-cols-4 2xl:gap-7.5">
<SyncConnectorModal
Expand All @@ -146,12 +147,18 @@ export default function WorkspaceDashboard() {
</div>
)}

<DocumentsList
knownConnector={connector}
organization={organization}
workspace={workspace}
workspaces={workspaces}
/>
<Statistics organization={organization} workspace={workspace} />
<div className="mt-4 flex w-full">
<div className="mr-6.5 w-full">
<DocumentsList
knownConnector={connector}
organization={organization}
workspace={workspace}
workspaces={workspaces}
/>
</div>
<QuickActionsSidebar organization={organization} />
</div>
<CloneWorkspaceModal workspace={workspace} />
</AppLayout>
);
Expand Down
5 changes: 1 addition & 4 deletions workers/functions/deleteEmbedding/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,15 @@ async function cleanupCacheFile(documentVector) {
const document = await WorkspaceDocument.get({
id: Number(documentVector.document_id),
});
console.log({ document });
if (!document) return;
const digestFilename = WorkspaceDocument.vectorFilename(document);
const existingInfo = await cachedVectorInformation(digestFilename);

console.log({ digestFilename, existingInfoExists: existingInfo.exists });
if (!existingInfo.exists) return;

const updatedData = existingInfo.chunks.filter(
(obj) => obj.vectorDbId !== documentVector.vectorId
);
console.log({ updatedData: updatedData });

await storeVectorResult(updatedData, digestFilename);
return;
}
Expand Down

0 comments on commit bb46198

Please sign in to comment.