Skip to content

Commit 93d191f

Browse files
Merge branch 'master' of github.com:Mintplex-Labs/anything-llm
2 parents 1ed3cb5 + 409ac54 commit 93d191f

File tree

34 files changed

+213
-3
lines changed

34 files changed

+213
-3
lines changed

docker/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ GID='1000'
390390
#------ Exa Search ----------- https://www.exa.ai/
391391
# AGENT_EXA_API_KEY=
392392

393+
#------ Perplexity Search ----------- [https://console.perplexity.ai](https://console.perplexity.ai)
394+
# AGENT_PERPLEXITY_API_KEY=
395+
393396
###########################################
394397
######## Other Configurations ############
395398
###########################################

frontend/src/components/Modals/ManageWorkspace/Documents/Directory/FolderRow/index.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { middleTruncate } from "@/utils/directories";
55

66
export default function FolderRow({
77
item,
8+
totalItems = 0,
89
selected,
910
onRowClick,
1011
toggleSelection,
@@ -60,6 +61,11 @@ export default function FolderRow({
6061
<p className="whitespace-nowrap overflow-show max-w-[400px]">
6162
{middleTruncate(item.name, 35)}
6263
</p>
64+
{totalItems > 0 && (
65+
<span className="text-theme-text-secondary text-[10px] font-medium ml-1.5 shrink-0">
66+
({totalItems})
67+
</span>
68+
)}
6369
</div>
6470
<p className="col-span-2 pl-3.5" />
6571
<p className="col-span-2 pl-2" />

frontend/src/components/Modals/ManageWorkspace/Documents/Directory/index.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ function Directory({
193193
setContextMenu({ visible: false, x: 0, y: 0 });
194194
};
195195

196+
const totalDocCount = (files?.items ?? []).reduce((acc, folder) => {
197+
if (folder.type === "folder") return folder.items.length + acc;
198+
return acc;
199+
}, 0);
200+
196201
return (
197202
<>
198203
<div className="px-8 pb-8" onContextMenu={handleContextMenu}>
@@ -232,6 +237,13 @@ function Directory({
232237
<div className="relative w-[560px] h-[310px] bg-theme-settings-input-bg rounded-2xl overflow-hidden border border-theme-modal-border">
233238
<div className="absolute top-0 left-0 right-0 z-10 rounded-t-2xl text-theme-text-primary text-xs grid grid-cols-12 py-2 px-8 border-b border-white/20 light:border-theme-modal-border bg-theme-settings-input-bg">
234239
<p className="col-span-6">Name</p>
240+
{totalDocCount > 0 && (
241+
<p className="col-span-6 text-right text-theme-text-secondary">
242+
{t(`connectors.directory.total-documents`, {
243+
count: totalDocCount,
244+
})}
245+
</p>
246+
)}
235247
</div>
236248

237249
<div className="overflow-y-auto h-full pt-8">
@@ -249,6 +261,7 @@ function Directory({
249261
<FolderRow
250262
key={index}
251263
item={item}
264+
totalItems={item.items?.length ?? 0}
252265
selected={isSelected(
253266
item.id,
254267
item.type === "folder" ? item : null
@@ -310,7 +323,6 @@ function Directory({
310323
</div>
311324
)}
312325
</div>
313-
314326
<UploadFile
315327
workspace={workspace}
316328
fetchKeys={fetchKeys}

frontend/src/components/Modals/ManageWorkspace/Documents/WorkspaceDirectory/index.jsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ function WorkspaceDirectory({
2828
}) {
2929
const { t } = useTranslation();
3030
const [selectedItems, setSelectedItems] = useState({});
31+
const embeddedDocCount = (files?.items ?? []).reduce(
32+
(sum, folder) => sum + (folder.items?.length ?? 0),
33+
0
34+
);
3135

3236
const toggleSelection = (item) => {
3337
setSelectedItems((prevSelectedItems) => {
@@ -101,7 +105,6 @@ function WorkspaceDirectory({
101105
<div className="shrink-0 w-3 h-3" />
102106
<p className="ml-[7px] text-theme-text-primary">Name</p>
103107
</div>
104-
<p className="col-span-2" />
105108
</div>
106109
<div className="w-full h-[calc(100%-40px)] flex items-center justify-center flex-col gap-y-5">
107110
<PreLoader />
@@ -157,7 +160,13 @@ function WorkspaceDirectory({
157160
)}
158161
<p className="ml-[7px] text-theme-text-primary">Name</p>
159162
</div>
160-
<p className="col-span-2" />
163+
{embeddedDocCount > 0 && (
164+
<p className="col-span-2 text-right text-theme-text-secondary pr-2">
165+
{t(`connectors.directory.total-documents`, {
166+
count: embeddedDocCount,
167+
})}
168+
</p>
169+
)}
161170
</div>
162171
<div className="overflow-y-auto h-[calc(100%-40px)]">
163172
{files.items.some((folder) => folder.items.length > 0) ||

frontend/src/locales/ar/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ const TRANSLATIONS = {
590590
remove_selected: "حذف المحدد",
591591
costs: "*تكلفة ثابتة لإنشاء التمثيلات",
592592
save_embed: "حفظ و تضمين",
593+
"total-documents_one": "{{count}}",
594+
"total-documents_other": "{{count}} المستندات",
593595
},
594596
upload: {
595597
"processor-offline": "غير متاح",

frontend/src/locales/cs/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ const TRANSLATIONS = {
728728
remove_selected: "Odebrat vybrané",
729729
costs: "*Jednorázové náklady pro embeddingy",
730730
save_embed: "Uložit a vložit",
731+
"total-documents_one": "{{count}} dokument",
732+
"total-documents_other": "{{count}} dokumenty",
731733
},
732734
upload: {
733735
"processor-offline": "Procesor dokumentů nedostupný",

frontend/src/locales/da/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ const TRANSLATIONS = {
597597
remove_selected: "Fjern valgte",
598598
costs: "*Engangsomkostning for indlejringer",
599599
save_embed: "Gem og indlejr",
600+
"total-documents_one": "{{count}} dokument",
601+
"total-documents_other": "{{count}} dokumenter",
600602
},
601603
upload: {
602604
"processor-offline": "Dokumentbehandler utilgængelig",

frontend/src/locales/de/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ const TRANSLATIONS = {
705705
remove_selected: "Ausgewähltes entfernen",
706706
costs: "*Einmalige Kosten für das Einbetten",
707707
save_embed: "Speichern und Einbetten",
708+
"total-documents_one": "{{count}} Dokument",
709+
"total-documents_other": "{{count}} Dokumente",
708710
},
709711
upload: {
710712
"processor-offline": "Dokumentenprozessor nicht verfügbar",

frontend/src/locales/en/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,8 @@ const TRANSLATIONS = {
715715
directory: {
716716
"my-documents": "My Documents",
717717
"new-folder": "New Folder",
718+
"total-documents_one": "{{count}} document",
719+
"total-documents_other": "{{count}} documents",
718720
"search-document": "Search for document",
719721
"no-documents": "No Documents",
720722
"move-workspace": "Move to Workspace",

frontend/src/locales/es/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,8 @@ const TRANSLATIONS = {
715715
remove_selected: "Eliminar seleccionados",
716716
costs: "*Costo único por incrustaciones",
717717
save_embed: "Guardar e incrustar",
718+
"total-documents_one": "{{count}} documento",
719+
"total-documents_other": "{{count}} documentos",
718720
},
719721
upload: {
720722
"processor-offline": "Procesador de documentos no disponible",

0 commit comments

Comments
 (0)