mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
(feat:sources) renamed docs,fe
This commit is contained in:
@@ -77,7 +77,7 @@ const LineNumberedTextarea: React.FC<LineNumberedTextareaProps> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface DocumentChunksProps {
|
interface ChunksProps {
|
||||||
documentId: string;
|
documentId: string;
|
||||||
documentName?: string;
|
documentName?: string;
|
||||||
handleGoBack: () => void;
|
handleGoBack: () => void;
|
||||||
@@ -85,7 +85,7 @@ interface DocumentChunksProps {
|
|||||||
renderFileSearch?: () => React.ReactNode;
|
renderFileSearch?: () => React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DocumentChunks: React.FC<DocumentChunksProps> = ({
|
const Chunks: React.FC<ChunksProps> = ({
|
||||||
documentId,
|
documentId,
|
||||||
documentName,
|
documentName,
|
||||||
handleGoBack,
|
handleGoBack,
|
||||||
@@ -406,13 +406,13 @@ const DocumentChunks: React.FC<DocumentChunksProps> = ({
|
|||||||
? `${(totalChunks / 1000000).toFixed(2)}M`
|
? `${(totalChunks / 1000000).toFixed(2)}M`
|
||||||
: totalChunks > 999
|
: totalChunks > 999
|
||||||
? `${(totalChunks / 1000).toFixed(2)}K`
|
? `${(totalChunks / 1000).toFixed(2)}K`
|
||||||
: totalChunks} {t('settings.documents.chunks')}
|
: totalChunks} {t('settings.sources.chunks')}
|
||||||
</div>
|
</div>
|
||||||
<div className="h-full w-[1px] bg-[#D1D9E0] dark:bg-[#6A6A6A]"></div>
|
<div className="h-full w-[1px] bg-[#D1D9E0] dark:bg-[#6A6A6A]"></div>
|
||||||
<div className="flex-1 h-full">
|
<div className="flex-1 h-full">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder={t('settings.documents.searchPlaceholder')}
|
placeholder={t('settings.sources.searchPlaceholder')}
|
||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
onChange={(e) => setSearchTerm(e.target.value)}
|
onChange={(e) => setSearchTerm(e.target.value)}
|
||||||
className="w-full h-full px-3 py-2 bg-transparent border-none outline-none font-normal text-[13.56px] leading-[100%] dark:text-[#E0E0E0]"
|
className="w-full h-full px-3 py-2 bg-transparent border-none outline-none font-normal text-[13.56px] leading-[100%] dark:text-[#E0E0E0]"
|
||||||
@@ -421,14 +421,14 @@ const DocumentChunks: React.FC<DocumentChunksProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
className="bg-purple-30 hover:bg-violets-are-blue flex h-[38px] w-full sm:w-auto min-w-[108px] items-center justify-center rounded-full px-4 text-sm whitespace-normal text-white shrink-0"
|
className="bg-purple-30 hover:bg-violets-are-blue flex h-[38px] w-full sm:w-auto min-w-[108px] items-center justify-center rounded-full px-4 text-sm whitespace-normal text-white shrink-0"
|
||||||
title={t('settings.documents.addNew')}
|
title={t('settings.sources.addNew')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsAddingChunk(true);
|
setIsAddingChunk(true);
|
||||||
setEditingTitle('');
|
setEditingTitle('');
|
||||||
setEditingText('');
|
setEditingText('');
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('settings.documents.addNew')}
|
{t('settings.sources.addNew')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
@@ -441,10 +441,10 @@ const DocumentChunks: React.FC<DocumentChunksProps> = ({
|
|||||||
<div className="col-span-full w-full min-h-[50vh] flex flex-col items-center justify-center text-center text-gray-500 dark:text-gray-400">
|
<div className="col-span-full w-full min-h-[50vh] flex flex-col items-center justify-center text-center text-gray-500 dark:text-gray-400">
|
||||||
<img
|
<img
|
||||||
src={isDarkTheme ? NoFilesDarkIcon : NoFilesIcon}
|
src={isDarkTheme ? NoFilesDarkIcon : NoFilesIcon}
|
||||||
alt={t('settings.documents.noChunksAlt')}
|
alt={t('settings.sources.noChunksAlt')}
|
||||||
className="mx-auto mb-2 h-24 w-24"
|
className="mx-auto mb-2 h-24 w-24"
|
||||||
/>
|
/>
|
||||||
{t('settings.documents.noChunks')}
|
{t('settings.sources.noChunks')}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
filteredChunks.map((chunk, index) => (
|
filteredChunks.map((chunk, index) => (
|
||||||
@@ -460,7 +460,7 @@ const DocumentChunks: React.FC<DocumentChunksProps> = ({
|
|||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex w-full items-center justify-between border-b border-[#D1D9E0] bg-[#F6F8FA] dark:bg-[#27282D] dark:border-[#6A6A6A] px-4 py-3">
|
<div className="flex w-full items-center justify-between border-b border-[#D1D9E0] bg-[#F6F8FA] dark:bg-[#27282D] dark:border-[#6A6A6A] px-4 py-3">
|
||||||
<div className="text-[#59636E] text-sm dark:text-[#E0E0E0]">
|
<div className="text-[#59636E] text-sm dark:text-[#E0E0E0]">
|
||||||
{chunk.metadata.token_count ? chunk.metadata.token_count.toLocaleString() : '-'} {t('settings.documents.tokensUnit')}
|
{chunk.metadata.token_count ? chunk.metadata.token_count.toLocaleString() : '-'} {t('settings.sources.tokensUnit')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="px-4 pt-3 pb-6">
|
<div className="px-4 pt-3 pb-6">
|
||||||
@@ -491,7 +491,7 @@ const DocumentChunks: React.FC<DocumentChunksProps> = ({
|
|||||||
<div className="relative flex flex-col rounded-[5.86px] border border-[#D1D9E0] dark:border-[#6A6A6A] overflow-hidden w-full">
|
<div className="relative flex flex-col rounded-[5.86px] border border-[#D1D9E0] dark:border-[#6A6A6A] overflow-hidden w-full">
|
||||||
<div className="flex w-full items-center justify-between border-b border-[#D1D9E0] bg-[#F6F8FA] dark:bg-[#27282D] dark:border-[#6A6A6A] px-4 py-3">
|
<div className="flex w-full items-center justify-between border-b border-[#D1D9E0] bg-[#F6F8FA] dark:bg-[#27282D] dark:border-[#6A6A6A] px-4 py-3">
|
||||||
<div className="text-[#59636E] text-sm dark:text-[#E0E0E0]">
|
<div className="text-[#59636E] text-sm dark:text-[#E0E0E0]">
|
||||||
{editingChunk.metadata.token_count ? editingChunk.metadata.token_count.toLocaleString() : '-'} {t('settings.documents.tokensUnit')}
|
{editingChunk.metadata.token_count ? editingChunk.metadata.token_count.toLocaleString() : '-'} {t('settings.sources.tokensUnit')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4 overflow-hidden">
|
<div className="p-4 overflow-hidden">
|
||||||
@@ -535,4 +535,4 @@ const DocumentChunks: React.FC<DocumentChunksProps> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DocumentChunks;
|
export default Chunks;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useRef, useEffect } from 'react';
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import DocumentChunks from './DocumentChunks';
|
import Chunks from './Chunks';
|
||||||
import ContextMenu, { MenuOption } from './ContextMenu';
|
import ContextMenu, { MenuOption } from './ContextMenu';
|
||||||
import userService from '../api/services/userService';
|
import userService from '../api/services/userService';
|
||||||
import FileIcon from '../assets/file.svg';
|
import FileIcon from '../assets/file.svg';
|
||||||
@@ -201,19 +201,21 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
): MenuOption[] => {
|
): MenuOption[] => {
|
||||||
const options: MenuOption[] = [];
|
const options: MenuOption[] = [];
|
||||||
|
|
||||||
if (isFile) {
|
|
||||||
options.push({
|
options.push({
|
||||||
icon: EyeView,
|
icon: EyeView,
|
||||||
label: t('settings.documents.view'),
|
label: t('settings.sources.view'),
|
||||||
onClick: (event: React.SyntheticEvent) => {
|
onClick: (event: React.SyntheticEvent) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
if (isFile) {
|
||||||
handleFileClick(name);
|
handleFileClick(name);
|
||||||
|
} else {
|
||||||
|
navigateToDirectory(name);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
iconWidth: 18,
|
iconWidth: 18,
|
||||||
iconHeight: 18,
|
iconHeight: 18,
|
||||||
variant: 'primary',
|
variant: 'primary',
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
options.push({
|
options.push({
|
||||||
icon: Trash,
|
icon: Trash,
|
||||||
@@ -494,7 +496,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<img
|
<img
|
||||||
src={FolderIcon}
|
src={FolderIcon}
|
||||||
alt={t('settings.documents.parentFolderAlt')}
|
alt={t('settings.sources.parentFolderAlt')}
|
||||||
className="mr-2 h-4 w-4 flex-shrink-0"
|
className="mr-2 h-4 w-4 flex-shrink-0"
|
||||||
/>
|
/>
|
||||||
<span className="text-sm dark:text-[#E0E0E0] truncate">..</span>
|
<span className="text-sm dark:text-[#E0E0E0] truncate">..</span>
|
||||||
@@ -523,7 +525,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
>
|
>
|
||||||
<td className="px-2 lg:px-4 py-2">
|
<td className="px-2 lg:px-4 py-2">
|
||||||
<div className="flex items-center min-w-0">
|
<div className="flex items-center min-w-0">
|
||||||
<img src={FolderIcon} alt={t('settings.documents.folderAlt')} className="mr-2 h-4 w-4 flex-shrink-0" />
|
<img src={FolderIcon} alt={t('settings.sources.folderAlt')} className="mr-2 h-4 w-4 flex-shrink-0" />
|
||||||
<span className="text-sm dark:text-[#E0E0E0] truncate">{name}</span>
|
<span className="text-sm dark:text-[#E0E0E0] truncate">{name}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -544,7 +546,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={ThreeDots}
|
src={ThreeDots}
|
||||||
alt={t('settings.documents.menuAlt')}
|
alt={t('settings.sources.menuAlt')}
|
||||||
className="opacity-60 hover:opacity-100"
|
className="opacity-60 hover:opacity-100"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
@@ -575,7 +577,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
>
|
>
|
||||||
<td className="px-2 lg:px-4 py-2">
|
<td className="px-2 lg:px-4 py-2">
|
||||||
<div className="flex items-center min-w-0">
|
<div className="flex items-center min-w-0">
|
||||||
<img src={FileIcon} alt={t('settings.documents.fileAlt')} className="mr-2 h-4 w-4 flex-shrink-0" />
|
<img src={FileIcon} alt={t('settings.sources.fileAlt')} className="mr-2 h-4 w-4 flex-shrink-0" />
|
||||||
<span className="text-sm dark:text-[#E0E0E0] truncate">{name}</span>
|
<span className="text-sm dark:text-[#E0E0E0] truncate">{name}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -594,7 +596,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={ThreeDots}
|
src={ThreeDots}
|
||||||
alt={t('settings.documents.menuAlt')}
|
alt={t('settings.sources.menuAlt')}
|
||||||
className="opacity-60 hover:opacity-100"
|
className="opacity-60 hover:opacity-100"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
@@ -671,7 +673,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
setSearchResults(searchFiles(e.target.value, directoryStructure));
|
setSearchResults(searchFiles(e.target.value, directoryStructure));
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
placeholder={t('settings.documents.searchFiles')}
|
placeholder={t('settings.sources.searchFiles')}
|
||||||
className={`w-full px-4 py-2 pl-10 border border-[#D1D9E0] dark:border-[#6A6A6A] ${
|
className={`w-full px-4 py-2 pl-10 border border-[#D1D9E0] dark:border-[#6A6A6A] ${
|
||||||
searchQuery ? 'rounded-t-md rounded-b-none border-b-0' : 'rounded-md'
|
searchQuery ? 'rounded-t-md rounded-b-none border-b-0' : 'rounded-md'
|
||||||
} bg-transparent dark:text-[#E0E0E0] focus:outline-none`}
|
} bg-transparent dark:text-[#E0E0E0] focus:outline-none`}
|
||||||
@@ -687,7 +689,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
<div className="absolute z-10 w-full border border-[#D1D9E0] dark:border-[#6A6A6A] rounded-b-md bg-white dark:bg-[#1F2023] shadow-lg max-h-[calc(100vh-200px)] overflow-y-auto">
|
<div className="absolute z-10 w-full border border-[#D1D9E0] dark:border-[#6A6A6A] rounded-b-md bg-white dark:bg-[#1F2023] shadow-lg max-h-[calc(100vh-200px)] overflow-y-auto">
|
||||||
{searchResults.length === 0 ? (
|
{searchResults.length === 0 ? (
|
||||||
<div className="text-sm text-gray-500 dark:text-gray-400 text-center py-2">
|
<div className="text-sm text-gray-500 dark:text-gray-400 text-center py-2">
|
||||||
{t('settings.documents.noResults')}
|
{t('settings.sources.noResults')}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
searchResults.map((result, index) => (
|
searchResults.map((result, index) => (
|
||||||
@@ -701,7 +703,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={result.isFile ? FileIcon : FolderIcon}
|
src={result.isFile ? FileIcon : FolderIcon}
|
||||||
alt={result.isFile ? t('settings.documents.fileAlt') : t('settings.documents.folderAlt')}
|
alt={result.isFile ? t('settings.sources.fileAlt') : t('settings.sources.folderAlt')}
|
||||||
className="flex-shrink-0 w-4 h-4 mr-2"
|
className="flex-shrink-0 w-4 h-4 mr-2"
|
||||||
/>
|
/>
|
||||||
<span className="text-sm dark:text-[#E0E0E0]">
|
<span className="text-sm dark:text-[#E0E0E0]">
|
||||||
@@ -722,7 +724,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
{selectedFile ? (
|
{selectedFile ? (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<DocumentChunks
|
<Chunks
|
||||||
documentId={docId}
|
documentId={docId}
|
||||||
documentName={sourceName}
|
documentName={sourceName}
|
||||||
handleGoBack={() => setSelectedFile(null)}
|
handleGoBack={() => setSelectedFile(null)}
|
||||||
@@ -750,16 +752,16 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
<thead className="bg-gray-100 dark:bg-[#27282D]">
|
<thead className="bg-gray-100 dark:bg-[#27282D]">
|
||||||
<tr className="border-b border-[#D1D9E0] dark:border-[#6A6A6A]">
|
<tr className="border-b border-[#D1D9E0] dark:border-[#6A6A6A]">
|
||||||
<th className="min-w-[200px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
<th className="min-w-[200px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
||||||
{t('settings.documents.fileName')}
|
{t('settings.sources.fileName')}
|
||||||
</th>
|
</th>
|
||||||
<th className="min-w-[80px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
<th className="min-w-[80px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
||||||
{t('settings.documents.tokens')}
|
{t('settings.sources.tokens')}
|
||||||
</th>
|
</th>
|
||||||
<th className="min-w-[80px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
<th className="min-w-[80px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
||||||
{t('settings.documents.size')}
|
{t('settings.sources.size')}
|
||||||
</th>
|
</th>
|
||||||
<th className="w-[60px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
<th className="w-[60px] px-2 lg:px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-[#59636E]">
|
||||||
<span className="sr-only">{t('settings.documents.actions')}</span>
|
<span className="sr-only">{t('settings.sources.actions')}</span>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -775,7 +777,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
|
|||||||
<ConfirmationModal
|
<ConfirmationModal
|
||||||
message={
|
message={
|
||||||
itemToDelete?.isFile
|
itemToDelete?.isFile
|
||||||
? t('settings.documents.confirmDelete')
|
? t('settings.sources.confirmDelete')
|
||||||
: `Are you sure you want to delete the directory "${itemToDelete?.name}" and all its contents? This action cannot be undone.`
|
: `Are you sure you want to delete the directory "${itemToDelete?.name}" and all its contents? This action cannot be undone.`
|
||||||
}
|
}
|
||||||
modalState={deleteModalState}
|
modalState={deleteModalState}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
interface DocumentHeadProps {
|
interface HeadProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
@@ -13,7 +13,7 @@ interface DocumentHeadProps {
|
|||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DocumentHead({
|
export function Head({
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
keywords,
|
keywords,
|
||||||
@@ -24,7 +24,7 @@ export function DocumentHead({
|
|||||||
twitterTitle,
|
twitterTitle,
|
||||||
twitterDescription,
|
twitterDescription,
|
||||||
children,
|
children,
|
||||||
}: DocumentHeadProps) {
|
}: HeadProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{title && <title>{title}</title>}
|
{title && <title>{title}</title>}
|
||||||
@@ -10,7 +10,7 @@ const useTabs = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const tabs = [
|
const tabs = [
|
||||||
t('settings.general.label'),
|
t('settings.general.label'),
|
||||||
t('settings.documents.label'),
|
t('settings.sources.label'),
|
||||||
t('settings.analytics.label'),
|
t('settings.analytics.label'),
|
||||||
t('settings.logs.label'),
|
t('settings.logs.label'),
|
||||||
t('settings.tools.label'),
|
t('settings.tools.label'),
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ function SourceDropdown({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<ConfirmationModal
|
<ConfirmationModal
|
||||||
message={t('settings.documents.deleteWarning', {
|
message={t('settings.sources.deleteWarning', {
|
||||||
name: documentToDelete?.name,
|
name: documentToDelete?.name,
|
||||||
})}
|
})}
|
||||||
modalState={deleteModalState}
|
modalState={deleteModalState}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ export default function SourcesPopup({
|
|||||||
type="text"
|
type="text"
|
||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
onChange={(e) => setSearchTerm(e.target.value)}
|
onChange={(e) => setSearchTerm(e.target.value)}
|
||||||
placeholder={t('settings.documents.searchPlaceholder')}
|
placeholder={t('settings.sources.searchPlaceholder')}
|
||||||
borderVariant="thin"
|
borderVariant="thin"
|
||||||
className="mb-4"
|
className="mb-4"
|
||||||
labelBgClassName="bg-lotion dark:bg-charleston-green-2"
|
labelBgClassName="bg-lotion dark:bg-charleston-green-2"
|
||||||
@@ -203,11 +203,11 @@ export default function SourcesPopup({
|
|||||||
|
|
||||||
<div className="shrink-0 px-4 py-4 opacity-75 transition-opacity duration-200 hover:opacity-100 md:px-6">
|
<div className="shrink-0 px-4 py-4 opacity-75 transition-opacity duration-200 hover:opacity-100 md:px-6">
|
||||||
<a
|
<a
|
||||||
href="/settings/documents"
|
href="/settings/sources"
|
||||||
className="text-violets-are-blue inline-flex items-center gap-2 text-base font-medium"
|
className="text-violets-are-blue inline-flex items-center gap-2 text-base font-medium"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
{t('settings.documents.goToDocuments')}
|
{t('settings.sources.goToSources')}
|
||||||
<img src={RedirectIcon} alt="Redirect" className="h-3 w-3" />
|
<img src={RedirectIcon} alt="Redirect" className="h-3 w-3" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -217,7 +217,7 @@ export default function SourcesPopup({
|
|||||||
onClick={handleUploadClick}
|
onClick={handleUploadClick}
|
||||||
className="border-violets-are-blue text-violets-are-blue hover:bg-violets-are-blue w-auto rounded-full border px-4 py-2 text-[14px] font-medium transition-colors duration-200 hover:text-white"
|
className="border-violets-are-blue text-violets-are-blue hover:bg-violets-are-blue w-auto rounded-full border px-4 py-2 text-[14px] font-medium transition-colors duration-200 hover:text-white"
|
||||||
>
|
>
|
||||||
{t('settings.documents.uploadNew')}
|
{t('settings.sources.uploadNew')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
updateQuery,
|
updateQuery,
|
||||||
} from './sharedConversationSlice';
|
} from './sharedConversationSlice';
|
||||||
import { selectCompletedAttachments } from '../upload/uploadSlice';
|
import { selectCompletedAttachments } from '../upload/uploadSlice';
|
||||||
import { DocumentHead } from '../components/DocumentHead';
|
import { Head as DocumentHead } from '../components/Head';
|
||||||
|
|
||||||
export const SharedConversation = () => {
|
export const SharedConversation = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|||||||
@@ -52,14 +52,14 @@
|
|||||||
"default": "Default",
|
"default": "Default",
|
||||||
"add": "Add"
|
"add": "Add"
|
||||||
},
|
},
|
||||||
"documents": {
|
"sources": {
|
||||||
"title": "This table contains all the documents that are available to you and those you have uploaded",
|
"title": "Here you can manage all of the source file that are available to you and those you have uploaded.",
|
||||||
"label": "Documents",
|
"label": "Sources",
|
||||||
"name": "Document Name",
|
"name": "Source Name",
|
||||||
"date": "Vector Date",
|
"date": "Vector Date",
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
"tokenUsage": "Token Usage",
|
"tokenUsage": "Token Usage",
|
||||||
"noData": "No existing Documents",
|
"noData": "No existing Sources",
|
||||||
"searchPlaceholder": "Search...",
|
"searchPlaceholder": "Search...",
|
||||||
"addNew": "Add New",
|
"addNew": "Add New",
|
||||||
"preLoaded": "Pre-loaded",
|
"preLoaded": "Pre-loaded",
|
||||||
@@ -74,11 +74,12 @@
|
|||||||
"actions": "Actions",
|
"actions": "Actions",
|
||||||
"view": "View",
|
"view": "View",
|
||||||
"deleteWarning": "Are you sure you want to delete \"{{name}}\"?",
|
"deleteWarning": "Are you sure you want to delete \"{{name}}\"?",
|
||||||
"backToAll": "Back to all documents",
|
"confirmDelete": "Are you sure you want to delete this file? This action cannot be undone.",
|
||||||
|
"backToAll": "Back to all sources",
|
||||||
"chunks": "Chunks",
|
"chunks": "Chunks",
|
||||||
"noChunks": "No chunks found",
|
"noChunks": "No chunks found",
|
||||||
"noChunksAlt": "No chunks found",
|
"noChunksAlt": "No chunks found",
|
||||||
"goToDocuments": "Go to Documents",
|
"goToSources": "Go to Sources",
|
||||||
"uploadNew": "Upload new",
|
"uploadNew": "Upload new",
|
||||||
"searchFiles": "Search files...",
|
"searchFiles": "Search files...",
|
||||||
"noResults": "No results found",
|
"noResults": "No results found",
|
||||||
@@ -89,6 +90,7 @@
|
|||||||
"folderAlt": "Folder",
|
"folderAlt": "Folder",
|
||||||
"parentFolderAlt": "Parent folder",
|
"parentFolderAlt": "Parent folder",
|
||||||
"menuAlt": "Menu",
|
"menuAlt": "Menu",
|
||||||
|
"menuAlt": "Menu",
|
||||||
"tokensUnit": "tokens",
|
"tokensUnit": "tokens",
|
||||||
"editAlt": "Edit"
|
"editAlt": "Edit"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,14 +52,14 @@
|
|||||||
"default": "Predeterminado",
|
"default": "Predeterminado",
|
||||||
"addNew": "Añadir Nuevo"
|
"addNew": "Añadir Nuevo"
|
||||||
},
|
},
|
||||||
"documents": {
|
"sources": {
|
||||||
"title": "Esta tabla contiene todos los documentos que están disponibles para ti y los que has subido",
|
"title": "Aquí puedes gestionar todos los archivos fuente que están disponibles para ti y los que has subido.",
|
||||||
"label": "Documentos",
|
"label": "Fuentes",
|
||||||
"name": "Nombre del Documento",
|
"name": "Nombre de la Fuente",
|
||||||
"date": "Fecha de Vector",
|
"date": "Fecha de Vector",
|
||||||
"type": "Tipo",
|
"type": "Tipo",
|
||||||
"tokenUsage": "Uso de Tokens",
|
"tokenUsage": "Uso de Tokens",
|
||||||
"noData": "No hay documentos existentes",
|
"noData": "No hay fuentes existentes",
|
||||||
"searchPlaceholder": "Buscar...",
|
"searchPlaceholder": "Buscar...",
|
||||||
"addNew": "Agregar Nuevo",
|
"addNew": "Agregar Nuevo",
|
||||||
"preLoaded": "Precargado",
|
"preLoaded": "Precargado",
|
||||||
@@ -74,11 +74,12 @@
|
|||||||
"actions": "Acciones",
|
"actions": "Acciones",
|
||||||
"view": "Ver",
|
"view": "Ver",
|
||||||
"deleteWarning": "¿Estás seguro de que deseas eliminar \"{{name}}\"?",
|
"deleteWarning": "¿Estás seguro de que deseas eliminar \"{{name}}\"?",
|
||||||
"backToAll": "Volver a todos los documentos",
|
"confirmDelete": "¿Estás seguro de que deseas eliminar este archivo? Esta acción no se puede deshacer.",
|
||||||
|
"backToAll": "Volver a todas las fuentes",
|
||||||
"chunks": "Fragmentos",
|
"chunks": "Fragmentos",
|
||||||
"noChunks": "No se encontraron fragmentos",
|
"noChunks": "No se encontraron fragmentos",
|
||||||
"noChunksAlt": "No se encontraron fragmentos",
|
"noChunksAlt": "No se encontraron fragmentos",
|
||||||
"goToDocuments": "Ir a Documentos",
|
"goToSources": "Ir a Fuentes",
|
||||||
"uploadNew": "Subir nuevo",
|
"uploadNew": "Subir nuevo",
|
||||||
"searchFiles": "Buscar archivos...",
|
"searchFiles": "Buscar archivos...",
|
||||||
"noResults": "No se encontraron resultados",
|
"noResults": "No se encontraron resultados",
|
||||||
|
|||||||
@@ -52,14 +52,14 @@
|
|||||||
"default": "デフォルト",
|
"default": "デフォルト",
|
||||||
"add": "追加"
|
"add": "追加"
|
||||||
},
|
},
|
||||||
"documents": {
|
"sources": {
|
||||||
"title": "この表には、利用可能なすべてのドキュメントとアップロードしたドキュメントが含まれています",
|
"title": "ここでは、利用可能なすべてのソースファイルとアップロードしたファイルを管理できます。",
|
||||||
"label": "ドキュメント",
|
"label": "ソース",
|
||||||
"name": "ドキュメント名",
|
"name": "ソース名",
|
||||||
"date": "ベクトル日付",
|
"date": "ベクトル日付",
|
||||||
"type": "タイプ",
|
"type": "タイプ",
|
||||||
"tokenUsage": "トークン使用量",
|
"tokenUsage": "トークン使用量",
|
||||||
"noData": "既存のドキュメントがありません",
|
"noData": "既存のソースがありません",
|
||||||
"searchPlaceholder": "検索...",
|
"searchPlaceholder": "検索...",
|
||||||
"addNew": "新規追加",
|
"addNew": "新規追加",
|
||||||
"preLoaded": "プリロード済み",
|
"preLoaded": "プリロード済み",
|
||||||
@@ -74,11 +74,12 @@
|
|||||||
"actions": "アクション",
|
"actions": "アクション",
|
||||||
"view": "表示",
|
"view": "表示",
|
||||||
"deleteWarning": "\"{{name}}\"を削除してもよろしいですか?",
|
"deleteWarning": "\"{{name}}\"を削除してもよろしいですか?",
|
||||||
"backToAll": "すべてのドキュメントに戻る",
|
"confirmDelete": "このファイルを削除してもよろしいですか?この操作は元に戻せません。",
|
||||||
|
"backToAll": "すべてのソースに戻る",
|
||||||
"chunks": "チャンク",
|
"chunks": "チャンク",
|
||||||
"noChunks": "チャンクが見つかりません",
|
"noChunks": "チャンクが見つかりません",
|
||||||
"noChunksAlt": "チャンクが見つかりません",
|
"noChunksAlt": "チャンクが見つかりません",
|
||||||
"goToDocuments": "ドキュメントへ移動",
|
"goToSources": "ソースへ移動",
|
||||||
"uploadNew": "新規アップロード",
|
"uploadNew": "新規アップロード",
|
||||||
"searchFiles": "ファイルを検索...",
|
"searchFiles": "ファイルを検索...",
|
||||||
"noResults": "結果が見つかりません",
|
"noResults": "結果が見つかりません",
|
||||||
|
|||||||
@@ -52,14 +52,14 @@
|
|||||||
"default": "По умолчанию",
|
"default": "По умолчанию",
|
||||||
"add": "Добавить"
|
"add": "Добавить"
|
||||||
},
|
},
|
||||||
"documents": {
|
"sources": {
|
||||||
"title": "Эта таблица содержит все документы, которые доступны вам и те, которые вы загрузили",
|
"title": "Здесь вы можете управлять всеми исходными файлами, которые доступны вам и которые вы загрузили.",
|
||||||
"label": "Документы",
|
"label": "Источники",
|
||||||
"name": "Название документа",
|
"name": "Название источника",
|
||||||
"date": "Дата вектора",
|
"date": "Дата вектора",
|
||||||
"type": "Тип",
|
"type": "Тип",
|
||||||
"tokenUsage": "Использование токена",
|
"tokenUsage": "Использование токена",
|
||||||
"noData": "Нет существующих документов",
|
"noData": "Нет существующих источников",
|
||||||
"searchPlaceholder": "Поиск...",
|
"searchPlaceholder": "Поиск...",
|
||||||
"addNew": "добавить новый",
|
"addNew": "добавить новый",
|
||||||
"preLoaded": "Предзагруженный",
|
"preLoaded": "Предзагруженный",
|
||||||
@@ -74,11 +74,12 @@
|
|||||||
"actions": "Действия",
|
"actions": "Действия",
|
||||||
"view": "Просмотр",
|
"view": "Просмотр",
|
||||||
"deleteWarning": "Вы уверены, что хотите удалить \"{{name}}\"?",
|
"deleteWarning": "Вы уверены, что хотите удалить \"{{name}}\"?",
|
||||||
"backToAll": "Вернуться ко всем документам",
|
"confirmDelete": "Вы уверены, что хотите удалить этот файл? Это действие нельзя отменить.",
|
||||||
|
"backToAll": "Вернуться ко всем источникам",
|
||||||
"chunks": "Фрагменты",
|
"chunks": "Фрагменты",
|
||||||
"noChunks": "Фрагменты не найдены",
|
"noChunks": "Фрагменты не найдены",
|
||||||
"noChunksAlt": "Фрагменты не найдены",
|
"noChunksAlt": "Фрагменты не найдены",
|
||||||
"goToDocuments": "Перейти к документам",
|
"goToSources": "Перейти к источникам",
|
||||||
"uploadNew": "Загрузить новый",
|
"uploadNew": "Загрузить новый",
|
||||||
"searchFiles": "Поиск файлов...",
|
"searchFiles": "Поиск файлов...",
|
||||||
"noResults": "Результаты не найдены",
|
"noResults": "Результаты не найдены",
|
||||||
|
|||||||
@@ -52,14 +52,14 @@
|
|||||||
"default": "預設",
|
"default": "預設",
|
||||||
"add": "添加"
|
"add": "添加"
|
||||||
},
|
},
|
||||||
"documents": {
|
"sources": {
|
||||||
"title": "此表格包含所有可供您使用的文件以及您上傳的文件",
|
"title": "在這裡您可以管理所有可用的來源檔案以及您上傳的檔案。",
|
||||||
"label": "文件",
|
"label": "來源",
|
||||||
"name": "文件名稱",
|
"name": "來源名稱",
|
||||||
"date": "向量日期",
|
"date": "向量日期",
|
||||||
"type": "類型",
|
"type": "類型",
|
||||||
"tokenUsage": "Token 使用量",
|
"tokenUsage": "Token 使用量",
|
||||||
"noData": "沒有現有的文件",
|
"noData": "沒有現有的來源",
|
||||||
"searchPlaceholder": "搜尋...",
|
"searchPlaceholder": "搜尋...",
|
||||||
"addNew": "新增文件",
|
"addNew": "新增文件",
|
||||||
"preLoaded": "預載入",
|
"preLoaded": "預載入",
|
||||||
@@ -74,11 +74,12 @@
|
|||||||
"actions": "操作",
|
"actions": "操作",
|
||||||
"view": "查看",
|
"view": "查看",
|
||||||
"deleteWarning": "您確定要刪除 \"{{name}}\" 嗎?",
|
"deleteWarning": "您確定要刪除 \"{{name}}\" 嗎?",
|
||||||
"backToAll": "返回所有文件",
|
"confirmDelete": "您確定要刪除此檔案嗎?此操作無法復原。",
|
||||||
|
"backToAll": "返回所有來源",
|
||||||
"chunks": "文本塊",
|
"chunks": "文本塊",
|
||||||
"noChunks": "未找到文本塊",
|
"noChunks": "未找到文本塊",
|
||||||
"noChunksAlt": "未找到文本塊",
|
"noChunksAlt": "未找到文本塊",
|
||||||
"goToDocuments": "前往文件",
|
"goToSources": "前往來源",
|
||||||
"uploadNew": "上傳新文件",
|
"uploadNew": "上傳新文件",
|
||||||
"searchFiles": "搜尋檔案...",
|
"searchFiles": "搜尋檔案...",
|
||||||
"noResults": "未找到結果",
|
"noResults": "未找到結果",
|
||||||
|
|||||||
@@ -52,14 +52,14 @@
|
|||||||
"default": "默认",
|
"default": "默认",
|
||||||
"add": "添加"
|
"add": "添加"
|
||||||
},
|
},
|
||||||
"documents": {
|
"sources": {
|
||||||
"title": "此表格包含所有可供您使用的文档以及您上传的文档",
|
"title": "在这里您可以管理所有可用的源文件以及您上传的文件。",
|
||||||
"label": "文档",
|
"label": "来源",
|
||||||
"name": "文件名称",
|
"name": "来源名称",
|
||||||
"date": "向量日期",
|
"date": "向量日期",
|
||||||
"type": "类型",
|
"type": "类型",
|
||||||
"tokenUsage": "令牌使用",
|
"tokenUsage": "令牌使用",
|
||||||
"noData": "没有现有的文档",
|
"noData": "没有现有的来源",
|
||||||
"searchPlaceholder": "搜索...",
|
"searchPlaceholder": "搜索...",
|
||||||
"addNew": "添加新文档",
|
"addNew": "添加新文档",
|
||||||
"preLoaded": "预加载",
|
"preLoaded": "预加载",
|
||||||
@@ -74,11 +74,12 @@
|
|||||||
"actions": "操作",
|
"actions": "操作",
|
||||||
"view": "查看",
|
"view": "查看",
|
||||||
"deleteWarning": "您确定要删除 \"{{name}}\" 吗?",
|
"deleteWarning": "您确定要删除 \"{{name}}\" 吗?",
|
||||||
"backToAll": "返回所有文档",
|
"confirmDelete": "您确定要删除此文件吗?此操作无法撤销。",
|
||||||
|
"backToAll": "返回所有来源",
|
||||||
"chunks": "文本块",
|
"chunks": "文本块",
|
||||||
"noChunks": "未找到文本块",
|
"noChunks": "未找到文本块",
|
||||||
"noChunksAlt": "未找到文本块",
|
"noChunksAlt": "未找到文本块",
|
||||||
"goToDocuments": "前往文档",
|
"goToSources": "前往来源",
|
||||||
"uploadNew": "上传新文档",
|
"uploadNew": "上传新文档",
|
||||||
"searchFiles": "搜索文件...",
|
"searchFiles": "搜索文件...",
|
||||||
"noResults": "未找到结果",
|
"noResults": "未找到结果",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
import Upload from '../upload/Upload';
|
import Upload from '../upload/Upload';
|
||||||
import { formatDate } from '../utils/dateTimeUtils';
|
import { formatDate } from '../utils/dateTimeUtils';
|
||||||
import FileTreeComponent from '../components/FileTreeComponent';
|
import FileTreeComponent from '../components/FileTreeComponent';
|
||||||
import DocumentChunks from '../components/DocumentChunks';
|
import Chunks from '../components/Chunks';
|
||||||
|
|
||||||
const formatTokens = (tokens: number): string => {
|
const formatTokens = (tokens: number): string => {
|
||||||
const roundToTwoDecimals = (num: number): string => {
|
const roundToTwoDecimals = (num: number): string => {
|
||||||
@@ -46,7 +46,7 @@ const formatTokens = (tokens: number): string => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Documents({
|
export default function Sources({
|
||||||
paginatedDocuments,
|
paginatedDocuments,
|
||||||
handleDeleteDocument,
|
handleDeleteDocument,
|
||||||
}: DocumentsProps) {
|
}: DocumentsProps) {
|
||||||
@@ -97,10 +97,10 @@ export default function Documents({
|
|||||||
|
|
||||||
const currentDocuments = paginatedDocuments ?? [];
|
const currentDocuments = paginatedDocuments ?? [];
|
||||||
const syncOptions = [
|
const syncOptions = [
|
||||||
{ label: t('settings.documents.syncFrequency.never'), value: 'never' },
|
{ label: t('settings.sources.syncFrequency.never'), value: 'never' },
|
||||||
{ label: t('settings.documents.syncFrequency.daily'), value: 'daily' },
|
{ label: t('settings.sources.syncFrequency.daily'), value: 'daily' },
|
||||||
{ label: t('settings.documents.syncFrequency.weekly'), value: 'weekly' },
|
{ label: t('settings.sources.syncFrequency.weekly'), value: 'weekly' },
|
||||||
{ label: t('settings.documents.syncFrequency.monthly'), value: 'monthly' },
|
{ label: t('settings.sources.syncFrequency.monthly'), value: 'monthly' },
|
||||||
];
|
];
|
||||||
const [documentToView, setDocumentToView] = useState<Doc>();
|
const [documentToView, setDocumentToView] = useState<Doc>();
|
||||||
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||||
@@ -215,7 +215,7 @@ export default function Documents({
|
|||||||
const actions: MenuOption[] = [
|
const actions: MenuOption[] = [
|
||||||
{
|
{
|
||||||
icon: EyeView,
|
icon: EyeView,
|
||||||
label: t('settings.documents.view'),
|
label: t('settings.sources.view'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setDocumentToView(document);
|
setDocumentToView(document);
|
||||||
},
|
},
|
||||||
@@ -228,7 +228,7 @@ export default function Documents({
|
|||||||
if (document.syncFrequency) {
|
if (document.syncFrequency) {
|
||||||
actions.push({
|
actions.push({
|
||||||
icon: SyncIcon,
|
icon: SyncIcon,
|
||||||
label: t('settings.documents.sync'),
|
label: t('settings.sources.sync'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setSyncMenuState({
|
setSyncMenuState({
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
@@ -268,7 +268,7 @@ export default function Documents({
|
|||||||
onBackToDocuments={() => setDocumentToView(undefined)}
|
onBackToDocuments={() => setDocumentToView(undefined)}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<DocumentChunks
|
<Chunks
|
||||||
documentId={documentToView.id || ''}
|
documentId={documentToView.id || ''}
|
||||||
documentName={documentToView.name}
|
documentName={documentToView.name}
|
||||||
handleGoBack={() => setDocumentToView(undefined)}
|
handleGoBack={() => setDocumentToView(undefined)}
|
||||||
@@ -280,17 +280,17 @@ export default function Documents({
|
|||||||
<div className="relative flex grow flex-col">
|
<div className="relative flex grow flex-col">
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<h2 className="text-sonic-silver text-base font-medium">
|
<h2 className="text-sonic-silver text-base font-medium">
|
||||||
{t('settings.documents.title')}
|
{t('settings.sources.title')}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-6 flex flex-col items-start justify-between gap-3 sm:flex-row sm:items-center">
|
<div className="mb-6 flex flex-col items-start justify-between gap-3 sm:flex-row sm:items-center">
|
||||||
<div className="w-full sm:w-auto">
|
<div className="w-full sm:w-auto">
|
||||||
<label htmlFor="document-search-input" className="sr-only">
|
<label htmlFor="document-search-input" className="sr-only">
|
||||||
{t('settings.documents.searchPlaceholder')}
|
{t('settings.sources.searchPlaceholder')}
|
||||||
</label>
|
</label>
|
||||||
<Input
|
<Input
|
||||||
maxLength={256}
|
maxLength={256}
|
||||||
placeholder={t('settings.documents.searchPlaceholder')}
|
placeholder={t('settings.sources.searchPlaceholder')}
|
||||||
name="Document-search-input"
|
name="Document-search-input"
|
||||||
type="text"
|
type="text"
|
||||||
id="document-search-input"
|
id="document-search-input"
|
||||||
@@ -304,13 +304,13 @@ export default function Documents({
|
|||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
className="bg-purple-30 hover:bg-violets-are-blue flex h-[32px] min-w-[108px] items-center justify-center rounded-full px-4 text-sm whitespace-normal text-white"
|
className="bg-purple-30 hover:bg-violets-are-blue flex h-[32px] min-w-[108px] items-center justify-center rounded-full px-4 text-sm whitespace-normal text-white"
|
||||||
title={t('settings.documents.addNew')}
|
title={t('settings.sources.addNew')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsOnboarding(false);
|
setIsOnboarding(false);
|
||||||
setModalState('ACTIVE');
|
setModalState('ACTIVE');
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('settings.documents.addNew')}
|
{t('settings.sources.addNew')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="relative w-full">
|
<div className="relative w-full">
|
||||||
@@ -322,11 +322,11 @@ export default function Documents({
|
|||||||
<div className="flex flex-col items-center justify-center py-12">
|
<div className="flex flex-col items-center justify-center py-12">
|
||||||
<img
|
<img
|
||||||
src={isDarkTheme ? NoFilesDarkIcon : NoFilesIcon}
|
src={isDarkTheme ? NoFilesDarkIcon : NoFilesIcon}
|
||||||
alt={t('settings.documents.noData')}
|
alt={t('settings.sources.noData')}
|
||||||
className="mx-auto mb-6 h-32 w-32"
|
className="mx-auto mb-6 h-32 w-32"
|
||||||
/>
|
/>
|
||||||
<p className="text-center text-lg text-gray-500 dark:text-gray-400">
|
<p className="text-center text-lg text-gray-500 dark:text-gray-400">
|
||||||
{t('settings.documents.noData')}
|
{t('settings.sources.noData')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -357,7 +357,7 @@ export default function Documents({
|
|||||||
>
|
>
|
||||||
{document.syncFrequency && (
|
{document.syncFrequency && (
|
||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
name={t('settings.documents.sync')}
|
name={t('settings.sources.sync')}
|
||||||
options={syncOptions}
|
options={syncOptions}
|
||||||
onSelect={(value: string) => {
|
onSelect={(value: string) => {
|
||||||
handleManageSync(document, value);
|
handleManageSync(document, value);
|
||||||
@@ -407,7 +407,7 @@ export default function Documents({
|
|||||||
</div>
|
</div>
|
||||||
<div className="font-inter text-[12px] leading-[18px]">
|
<div className="font-inter text-[12px] leading-[18px]">
|
||||||
<span className="dark:text-bright-gray font-[400] text-[#18181B]">
|
<span className="dark:text-bright-gray font-[400] text-[#18181B]">
|
||||||
{t('settings.documents.tokenUsage')}:
|
{t('settings.sources.tokenUsage')}:
|
||||||
</span>
|
</span>
|
||||||
<span className="ml-1 font-[400] text-[#848484] dark:text-[#848484]">
|
<span className="ml-1 font-[400] text-[#848484] dark:text-[#848484]">
|
||||||
{document.tokens
|
{document.tokens
|
||||||
@@ -470,7 +470,7 @@ export default function Documents({
|
|||||||
|
|
||||||
{deleteModalState === 'ACTIVE' && documentToDelete && (
|
{deleteModalState === 'ACTIVE' && documentToDelete && (
|
||||||
<ConfirmationModal
|
<ConfirmationModal
|
||||||
message={t('settings.documents.deleteWarning', {
|
message={t('settings.sources.deleteWarning', {
|
||||||
name: documentToDelete.document.name,
|
name: documentToDelete.document.name,
|
||||||
})}
|
})}
|
||||||
modalState={deleteModalState}
|
modalState={deleteModalState}
|
||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
setSourceDocs,
|
setSourceDocs,
|
||||||
} from '../preferences/preferenceSlice';
|
} from '../preferences/preferenceSlice';
|
||||||
import Analytics from './Analytics';
|
import Analytics from './Analytics';
|
||||||
import Documents from './Documents';
|
import Sources from './Sources';
|
||||||
import General from './General';
|
import General from './General';
|
||||||
import Logs from './Logs';
|
import Logs from './Logs';
|
||||||
import Tools from './Tools';
|
import Tools from './Tools';
|
||||||
@@ -38,8 +38,8 @@ export default function Settings() {
|
|||||||
|
|
||||||
const getActiveTabFromPath = () => {
|
const getActiveTabFromPath = () => {
|
||||||
const path = location.pathname;
|
const path = location.pathname;
|
||||||
if (path.includes('/settings/documents'))
|
if (path.includes('/settings/sources'))
|
||||||
return t('settings.documents.label');
|
return t('settings.sources.label');
|
||||||
if (path.includes('/settings/analytics'))
|
if (path.includes('/settings/analytics'))
|
||||||
return t('settings.analytics.label');
|
return t('settings.analytics.label');
|
||||||
if (path.includes('/settings/logs')) return t('settings.logs.label');
|
if (path.includes('/settings/logs')) return t('settings.logs.label');
|
||||||
@@ -53,8 +53,8 @@ export default function Settings() {
|
|||||||
const handleTabChange = (tab: string) => {
|
const handleTabChange = (tab: string) => {
|
||||||
setActiveTab(tab);
|
setActiveTab(tab);
|
||||||
if (tab === t('settings.general.label')) navigate('/settings');
|
if (tab === t('settings.general.label')) navigate('/settings');
|
||||||
else if (tab === t('settings.documents.label'))
|
else if (tab === t('settings.sources.label'))
|
||||||
navigate('/settings/documents');
|
navigate('/settings/sources');
|
||||||
else if (tab === t('settings.analytics.label'))
|
else if (tab === t('settings.analytics.label'))
|
||||||
navigate('/settings/analytics');
|
navigate('/settings/analytics');
|
||||||
else if (tab === t('settings.logs.label')) navigate('/settings/logs');
|
else if (tab === t('settings.logs.label')) navigate('/settings/logs');
|
||||||
@@ -113,9 +113,9 @@ export default function Settings() {
|
|||||||
<Routes>
|
<Routes>
|
||||||
<Route index element={<General />} />
|
<Route index element={<General />} />
|
||||||
<Route
|
<Route
|
||||||
path="documents"
|
path="sources"
|
||||||
element={
|
element={
|
||||||
<Documents
|
<Sources
|
||||||
paginatedDocuments={paginatedDocuments}
|
paginatedDocuments={paginatedDocuments}
|
||||||
handleDeleteDocument={handleDeleteClick}
|
handleDeleteDocument={handleDeleteClick}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user