Unverified Commit df26f825 authored by crazywoola's avatar crazywoola Committed by GitHub

Feature/support xlsx (#311)

parent dbe0c435
<svg width="24" height="26" viewBox="0 0 24 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_5938_919)">
<path d="M3 5.8C3 4.11984 3 3.27976 3.32698 2.63803C3.6146 2.07354 4.07354 1.6146 4.63803 1.32698C5.27976 1 6.11984 1 7.8 1H14L21 8V18.2C21 19.8802 21 20.7202 20.673 21.362C20.3854 21.9265 19.9265 22.3854 19.362 22.673C18.7202 23 17.8802 23 16.2 23H7.8C6.11984 23 5.27976 23 4.63803 22.673C4.07354 22.3854 3.6146 21.9265 3.32698 21.362C3 20.7202 3 19.8802 3 18.2V5.8Z" fill="#169951"/>
</g>
<g opacity="0.96">
<path d="M9.81332 16.4181C9.63132 17.5171 8.86832 18.0421 7.92332 18.0421C7.34232 18.0421 6.90132 17.8461 6.53732 17.4821C6.01232 16.9571 6.03332 16.2571 6.03332 15.5081C6.03332 14.7591 6.01232 14.0591 6.53732 13.5341C6.90132 13.1701 7.34232 12.9741 7.92332 12.9741C8.86832 12.9741 9.63132 13.4991 9.81332 14.5981H8.56732C8.49032 14.3181 8.33632 14.0661 7.93032 14.0661C7.70632 14.0661 7.53832 14.1571 7.44732 14.2761C7.33532 14.4231 7.25832 14.5981 7.25832 15.5081C7.25832 16.4181 7.33532 16.5931 7.44732 16.7401C7.53832 16.8591 7.70632 16.9501 7.93032 16.9501C8.33632 16.9501 8.49032 16.6981 8.56732 16.4181H9.81332Z" fill="white"/>
<path d="M13.8059 16.4741C13.8059 17.4891 12.9309 18.0421 11.8809 18.0421C11.1179 18.0421 10.4949 17.9021 9.99094 17.3841L10.7749 16.6001C11.0339 16.8591 11.4889 16.9501 11.8879 16.9501C12.3709 16.9501 12.6019 16.7891 12.6019 16.5021C12.6019 16.3831 12.5739 16.2851 12.5039 16.2081C12.4409 16.1451 12.3359 16.0961 12.1749 16.0751L11.5729 15.9911C11.1319 15.9281 10.7959 15.7811 10.5719 15.5501C10.3409 15.3121 10.2289 14.9761 10.2289 14.5491C10.2289 13.6391 10.9149 12.9741 12.0489 12.9741C12.7629 12.9741 13.3019 13.1421 13.7289 13.5691L12.9589 14.3391C12.6439 14.0241 12.2309 14.0451 12.0139 14.0451C11.5869 14.0451 11.4119 14.2901 11.4119 14.5071C11.4119 14.5701 11.4329 14.6611 11.5099 14.7381C11.5729 14.8011 11.6779 14.8641 11.8529 14.8851L12.4549 14.9691C12.9029 15.0321 13.2249 15.1721 13.4349 15.3821C13.7009 15.6411 13.8059 16.0121 13.8059 16.4741Z" fill="white"/>
<path d="M18.3124 13.0161L16.6604 18.0001H15.7504L14.1054 13.0161H15.3724L16.2124 15.8021L17.0384 13.0161H18.3124Z" fill="white"/>
</g>
<path opacity="0.5" d="M14 1L21 8H16C14.8954 8 14 7.10457 14 6V1Z" fill="white"/>
<defs>
<filter id="filter0_d_5938_919" x="1" y="0" width="22" height="26" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5938_919"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5938_919" result="shape"/>
</filter>
</defs>
</svg>
<svg width="24" height="26" viewBox="0 0 24 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_5938_927)">
<path d="M3 5.8C3 4.11984 3 3.27976 3.32698 2.63803C3.6146 2.07354 4.07354 1.6146 4.63803 1.32698C5.27976 1 6.11984 1 7.8 1H14L21 8V18.2C21 19.8802 21 20.7202 20.673 21.362C20.3854 21.9265 19.9265 22.3854 19.362 22.673C18.7202 23 17.8802 23 16.2 23H7.8C6.11984 23 5.27976 23 4.63803 22.673C4.07354 22.3854 3.6146 21.9265 3.32698 21.362C3 20.7202 3 19.8802 3 18.2V5.8Z" fill="#169951"/>
</g>
<path opacity="0.5" d="M14 1L21 8H16C14.8954 8 14 7.10457 14 6V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 12C17.5523 12 18 12.4477 18 13V18C18 18.5523 17.5523 19 17 19H7C6.44772 19 6 18.5523 6 18V13C6 12.4477 6.44772 12 7 12H17ZM11.5 13H7L7 15H11.5V13ZM12.5 18H17V16H12.5V18ZM11.5 16V18H7L7 16H11.5ZM12.5 15H17V13H12.5V15Z" fill="white" fill-opacity="0.96"/>
<defs>
<filter id="filter0_d_5938_927" x="1" y="0" width="22" height="26" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5938_927"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5938_927" result="shape"/>
</filter>
</defs>
</svg>
...@@ -100,6 +100,14 @@ ...@@ -100,6 +100,14 @@
background-image: url(../assets/unknow.svg); background-image: url(../assets/unknow.svg);
background-size: 32px; background-size: 32px;
} }
.fileIcon.csv {
background-image: url(../assets/csv.svg);
}
.fileIcon.xlsx,
.fileIcon.xls {
background-image: url(../assets/xlsx.svg);
}
.fileIcon.pdf { .fileIcon.pdf {
background-image: url(../assets/pdf.svg); background-image: url(../assets/pdf.svg);
} }
...@@ -168,4 +176,4 @@ ...@@ -168,4 +176,4 @@
.actionWrapper .buttonWrapper { .actionWrapper .buttonWrapper {
@apply flex items-center; @apply flex items-center;
display: none; display: none;
} }
\ No newline at end of file
'use client' 'use client'
import React, { useState, useRef, useEffect, useCallback } from 'react' import React, { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import type { File as FileEntity } from '@/models/datasets'
import { useContext } from 'use-context-selector' import { useContext } from 'use-context-selector'
import cn from 'classnames'
import s from './index.module.css'
import type { File as FileEntity } from '@/models/datasets'
import { ToastContext } from '@/app/components/base/toast' import { ToastContext } from '@/app/components/base/toast'
import Button from '@/app/components/base/button' import Button from '@/app/components/base/button'
import { upload } from '@/service/base' import { upload } from '@/service/base'
import cn from 'classnames'
import s from './index.module.css'
type IFileUploaderProps = { type IFileUploaderProps = {
file?: FileEntity; file?: FileEntity
onFileUpdate: (file?: FileEntity) => void; onFileUpdate: (file?: FileEntity) => void
} }
const ACCEPTS = [ const ACCEPTS = [
...@@ -23,9 +22,12 @@ const ACCEPTS = [ ...@@ -23,9 +22,12 @@ const ACCEPTS = [
'.md', '.md',
'.markdown', '.markdown',
'.txt', '.txt',
'.xls',
'.xlsx',
'.csv',
] ]
const MAX_SIZE = 15 * 1024 *1024 const MAX_SIZE = 15 * 1024 * 1024
const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => { const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => {
const { t } = useTranslation() const { t } = useTranslation()
...@@ -39,60 +41,55 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => { ...@@ -39,60 +41,55 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => {
const [uploading, setUploading] = useState(false) const [uploading, setUploading] = useState(false)
const [percent, setPercent] = useState(0) const [percent, setPercent] = useState(0)
const handleDragEnter = (e: DragEvent) => { // utils
e.preventDefault() const getFileType = (currentFile: File) => {
e.stopPropagation() if (!currentFile)
e.target !== dragRef.current && setDragging(true) return ''
}
const handleDragOver = (e: DragEvent) => { const arr = currentFile.name.split('.')
e.preventDefault() return arr[arr.length - 1]
e.stopPropagation()
} }
const handleDragLeave = (e: DragEvent) => { const getFileName = (name: string) => {
e.preventDefault() const arr = name.split('.')
e.stopPropagation() return arr.slice(0, -1).join()
e.target === dragRef.current && setDragging(false)
} }
const handleDrop = (e: DragEvent) => { const getFileSize = (size: number) => {
e.preventDefault() if (size / 1024 < 10)
e.stopPropagation() return `${(size / 1024).toFixed(2)}KB`
setDragging(false)
if (!e.dataTransfer) { return `${(size / 1024 / 1024).toFixed(2)}MB`
return
}
const files = [...e.dataTransfer.files]
if (files.length > 1) {
notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.validation.count') })
return;
}
onFileUpdate()
fileUpload(files[0])
} }
const selectHandle = () => { const isValid = (file: File) => {
if (fileUploader.current) { const { size } = file
fileUploader.current.click(); const ext = `.${getFileType(file)}`
} const isValidType = ACCEPTS.includes(ext)
if (!isValidType)
notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.validation.typeError') })
const isValidSize = size <= MAX_SIZE
if (!isValidSize)
notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.validation.size') })
return isValidType && isValidSize
} }
const removeFile = () => { const onProgress = useCallback((e: ProgressEvent) => {
if (fileUploader.current) { if (e.lengthComputable) {
fileUploader.current.value = '' const percent = Math.floor(e.loaded / e.total * 100)
setPercent(percent)
} }
setCurrentFile(undefined) }, [setPercent])
onFileUpdate() const abort = () => {
} const currentXHR = uploadPromise.current
const fileChangeHandle = (e: React.ChangeEvent<HTMLInputElement>) => { currentXHR.abort()
const currentFile = e.target.files?.[0]
onFileUpdate()
fileUpload(currentFile)
} }
const fileUpload = async (file?: File) => { const fileUpload = async (file?: File) => {
if (!file) { if (!file)
return return
}
if (!isValid(file)) { if (!isValid(file))
return return
}
setCurrentFile(file) setCurrentFile(file)
setUploading(true) setUploading(true)
const formData = new FormData() const formData = new FormData()
...@@ -105,7 +102,7 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => { ...@@ -105,7 +102,7 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => {
xhr: currentXHR, xhr: currentXHR,
data: formData, data: formData,
onprogress: onProgress, onprogress: onProgress,
}) as FileEntity; }) as FileEntity
onFileUpdate(result) onFileUpdate(result)
setUploading(false) setUploading(false)
} }
...@@ -113,69 +110,72 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => { ...@@ -113,69 +110,72 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => {
setUploading(false) setUploading(false)
// abort handle // abort handle
if (xhr.readyState === 0 && xhr.status === 0) { if (xhr.readyState === 0 && xhr.status === 0) {
if (fileUploader.current) { if (fileUploader.current)
fileUploader.current.value = '' fileUploader.current.value = ''
}
setCurrentFile(undefined) setCurrentFile(undefined)
return return
} }
notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.failed') }) notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.failed') })
return
} }
} }
const onProgress = useCallback((e: ProgressEvent) => { const handleDragEnter = (e: DragEvent) => {
if (e.lengthComputable) { e.preventDefault()
const percent = Math.floor(e.loaded / e.total * 100) e.stopPropagation()
setPercent(percent) e.target !== dragRef.current && setDragging(true)
} }
}, [setPercent]) const handleDragOver = (e: DragEvent) => {
const abort = () => { e.preventDefault()
const currentXHR = uploadPromise.current e.stopPropagation()
currentXHR.abort();
} }
const handleDragLeave = (e: DragEvent) => {
e.preventDefault()
e.stopPropagation()
e.target === dragRef.current && setDragging(false)
}
const handleDrop = (e: DragEvent) => {
e.preventDefault()
e.stopPropagation()
setDragging(false)
if (!e.dataTransfer)
return
// utils const files = [...e.dataTransfer.files]
const getFileType = (currentFile: File) => { if (files.length > 1) {
if (!currentFile) { notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.validation.count') })
return '' return
} }
const arr = currentFile.name.split('.') onFileUpdate()
return arr[arr.length-1] fileUpload(files[0])
} }
const getFileName = (name: string) => {
const arr = name.split('.') const selectHandle = () => {
return arr.slice(0, -1).join() if (fileUploader.current)
fileUploader.current.click()
} }
const getFileSize = (size: number) => { const removeFile = () => {
if (size / 1024 < 10) { if (fileUploader.current)
return `${(size / 1024).toFixed(2)}KB` fileUploader.current.value = ''
}
return `${(size / 1024 / 1024).toFixed(2)}MB` setCurrentFile(undefined)
onFileUpdate()
} }
const isValid = (file: File) => { const fileChangeHandle = (e: React.ChangeEvent<HTMLInputElement>) => {
const { size } = file const currentFile = e.target.files?.[0]
const ext = `.${getFileType(file)}` onFileUpdate()
const isValidType = ACCEPTS.includes(ext) fileUpload(currentFile)
if (!isValidType) {
notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.validation.typeError') })
}
const isValidSize = size <= MAX_SIZE;
if (!isValidSize) {
notify({ type: 'error', message: t('datasetCreation.stepOne.uploader.validation.size') })
}
return isValidType && isValidSize;
} }
useEffect(() => { useEffect(() => {
dropRef.current?.addEventListener('dragenter', handleDragEnter); dropRef.current?.addEventListener('dragenter', handleDragEnter)
dropRef.current?.addEventListener('dragover', handleDragOver); dropRef.current?.addEventListener('dragover', handleDragOver)
dropRef.current?.addEventListener('dragleave', handleDragLeave); dropRef.current?.addEventListener('dragleave', handleDragLeave)
dropRef.current?.addEventListener('drop', handleDrop); dropRef.current?.addEventListener('drop', handleDrop)
return () => { return () => {
dropRef.current?.removeEventListener('dragenter', handleDragEnter); dropRef.current?.removeEventListener('dragenter', handleDragEnter)
dropRef.current?.removeEventListener('dragover', handleDragOver); dropRef.current?.removeEventListener('dragover', handleDragOver)
dropRef.current?.removeEventListener('dragleave', handleDragLeave); dropRef.current?.removeEventListener('dragleave', handleDragLeave)
dropRef.current?.removeEventListener('drop', handleDrop); dropRef.current?.removeEventListener('drop', handleDrop)
} }
}, []) }, [])
...@@ -202,7 +202,7 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => { ...@@ -202,7 +202,7 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => {
{currentFile && ( {currentFile && (
<div className={cn(s.file, uploading && s.uploading)}> <div className={cn(s.file, uploading && s.uploading)}>
{uploading && ( {uploading && (
<div className={s.progressbar} style={{ width: `${percent}%`}}/> <div className={s.progressbar} style={{ width: `${percent}%` }}/>
)} )}
<div className={cn(s.fileIcon, s[getFileType(currentFile)])}/> <div className={cn(s.fileIcon, s[getFileType(currentFile)])}/>
<div className={s.fileInfo}> <div className={s.fileInfo}>
...@@ -264,4 +264,4 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => { ...@@ -264,4 +264,4 @@ const FileUploader = ({ file, onFileUpdate }: IFileUploaderProps) => {
) )
} }
export default FileUploader; export default FileUploader
...@@ -292,6 +292,15 @@ ...@@ -292,6 +292,15 @@
background-image: url(../assets/pdf.svg); background-image: url(../assets/pdf.svg);
} }
.fileIcon.csv {
background-image: url(../assets/csv.svg);
}
.fileIcon.xlsx,
.fileIcon.xls {
background-image: url(../assets/xlsx.svg);
}
.fileIcon.html, .fileIcon.html,
.fileIcon.htm { .fileIcon.htm {
background-image: url(../assets/html.svg); background-image: url(../assets/html.svg);
...@@ -379,4 +388,4 @@ ...@@ -379,4 +388,4 @@
line-height: 28px; line-height: 28px;
color: #101828; color: #101828;
z-index: 10; z-index: 10;
} }
\ No newline at end of file
<svg width="24" height="26" viewBox="0 0 24 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_5938_919)">
<path d="M3 5.8C3 4.11984 3 3.27976 3.32698 2.63803C3.6146 2.07354 4.07354 1.6146 4.63803 1.32698C5.27976 1 6.11984 1 7.8 1H14L21 8V18.2C21 19.8802 21 20.7202 20.673 21.362C20.3854 21.9265 19.9265 22.3854 19.362 22.673C18.7202 23 17.8802 23 16.2 23H7.8C6.11984 23 5.27976 23 4.63803 22.673C4.07354 22.3854 3.6146 21.9265 3.32698 21.362C3 20.7202 3 19.8802 3 18.2V5.8Z" fill="#169951"/>
</g>
<g opacity="0.96">
<path d="M9.81332 16.4181C9.63132 17.5171 8.86832 18.0421 7.92332 18.0421C7.34232 18.0421 6.90132 17.8461 6.53732 17.4821C6.01232 16.9571 6.03332 16.2571 6.03332 15.5081C6.03332 14.7591 6.01232 14.0591 6.53732 13.5341C6.90132 13.1701 7.34232 12.9741 7.92332 12.9741C8.86832 12.9741 9.63132 13.4991 9.81332 14.5981H8.56732C8.49032 14.3181 8.33632 14.0661 7.93032 14.0661C7.70632 14.0661 7.53832 14.1571 7.44732 14.2761C7.33532 14.4231 7.25832 14.5981 7.25832 15.5081C7.25832 16.4181 7.33532 16.5931 7.44732 16.7401C7.53832 16.8591 7.70632 16.9501 7.93032 16.9501C8.33632 16.9501 8.49032 16.6981 8.56732 16.4181H9.81332Z" fill="white"/>
<path d="M13.8059 16.4741C13.8059 17.4891 12.9309 18.0421 11.8809 18.0421C11.1179 18.0421 10.4949 17.9021 9.99094 17.3841L10.7749 16.6001C11.0339 16.8591 11.4889 16.9501 11.8879 16.9501C12.3709 16.9501 12.6019 16.7891 12.6019 16.5021C12.6019 16.3831 12.5739 16.2851 12.5039 16.2081C12.4409 16.1451 12.3359 16.0961 12.1749 16.0751L11.5729 15.9911C11.1319 15.9281 10.7959 15.7811 10.5719 15.5501C10.3409 15.3121 10.2289 14.9761 10.2289 14.5491C10.2289 13.6391 10.9149 12.9741 12.0489 12.9741C12.7629 12.9741 13.3019 13.1421 13.7289 13.5691L12.9589 14.3391C12.6439 14.0241 12.2309 14.0451 12.0139 14.0451C11.5869 14.0451 11.4119 14.2901 11.4119 14.5071C11.4119 14.5701 11.4329 14.6611 11.5099 14.7381C11.5729 14.8011 11.6779 14.8641 11.8529 14.8851L12.4549 14.9691C12.9029 15.0321 13.2249 15.1721 13.4349 15.3821C13.7009 15.6411 13.8059 16.0121 13.8059 16.4741Z" fill="white"/>
<path d="M18.3124 13.0161L16.6604 18.0001H15.7504L14.1054 13.0161H15.3724L16.2124 15.8021L17.0384 13.0161H18.3124Z" fill="white"/>
</g>
<path opacity="0.5" d="M14 1L21 8H16C14.8954 8 14 7.10457 14 6V1Z" fill="white"/>
<defs>
<filter id="filter0_d_5938_919" x="1" y="0" width="22" height="26" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5938_919"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5938_919" result="shape"/>
</filter>
</defs>
</svg>
<svg width="24" height="26" viewBox="0 0 24 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_5938_927)">
<path d="M3 5.8C3 4.11984 3 3.27976 3.32698 2.63803C3.6146 2.07354 4.07354 1.6146 4.63803 1.32698C5.27976 1 6.11984 1 7.8 1H14L21 8V18.2C21 19.8802 21 20.7202 20.673 21.362C20.3854 21.9265 19.9265 22.3854 19.362 22.673C18.7202 23 17.8802 23 16.2 23H7.8C6.11984 23 5.27976 23 4.63803 22.673C4.07354 22.3854 3.6146 21.9265 3.32698 21.362C3 20.7202 3 19.8802 3 18.2V5.8Z" fill="#169951"/>
</g>
<path opacity="0.5" d="M14 1L21 8H16C14.8954 8 14 7.10457 14 6V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 12C17.5523 12 18 12.4477 18 13V18C18 18.5523 17.5523 19 17 19H7C6.44772 19 6 18.5523 6 18V13C6 12.4477 6.44772 12 7 12H17ZM11.5 13H7L7 15H11.5V13ZM12.5 18H17V16H12.5V18ZM11.5 16V18H7L7 16H11.5ZM12.5 15H17V13H12.5V15Z" fill="white" fill-opacity="0.96"/>
<defs>
<filter id="filter0_d_5938_927" x="1" y="0" width="22" height="26" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5938_927"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5938_927" result="shape"/>
</filter>
</defs>
</svg>
...@@ -75,6 +75,15 @@ ...@@ -75,6 +75,15 @@
.markdownIcon { .markdownIcon {
background-image: url(./assets/md.svg); background-image: url(./assets/md.svg);
} }
.xlsIcon {
background-image: url(./assets/xlsx.svg);
}
.xlsxIcon {
background-image: url(./assets/xlsx.svg);
}
.csvIcon {
background-image: url(./assets/csv.svg);
}
.statusItemDetail { .statusItemDetail {
@apply h-8 font-medium border border-gray-200 inline-flex items-center rounded-lg pl-3 pr-4 mr-2; @apply h-8 font-medium border border-gray-200 inline-flex items-center rounded-lg pl-3 pr-4 mr-2;
} }
......
...@@ -22,7 +22,7 @@ const translation = { ...@@ -22,7 +22,7 @@ const translation = {
title: 'Upload text file', title: 'Upload text file',
button: 'Drag and drop file, or', button: 'Drag and drop file, or',
browse: 'Browse', browse: 'Browse',
tip: 'Supports txt, html, markdown, and pdf.', tip: 'Supports txt, html, markdown, xlsx, xls, and pdf.',
validation: { validation: {
typeError: 'File type not supported', typeError: 'File type not supported',
size: 'File too large. Maximum is 15MB', size: 'File too large. Maximum is 15MB',
......
...@@ -22,7 +22,7 @@ const translation = { ...@@ -22,7 +22,7 @@ const translation = {
title: '上传文本文件', title: '上传文本文件',
button: '拖拽文件至此,或者', button: '拖拽文件至此,或者',
browse: '选择文件', browse: '选择文件',
tip: '已支持 TXT, HTML, Markdown, PDF', tip: '已支持 TXT, HTML, Markdown, PDF, XLSX, XLS',
validation: { validation: {
typeError: '文件类型不支持', typeError: '文件类型不支持',
size: '文件太大了,不能超过 15MB', size: '文件太大了,不能超过 15MB',
......
const translation = { const translation = {
list: { list: {
title: "Documents", title: 'Documents',
desc: "All files of the dataset are shown here, and the entire dataset can be linked to Dify citations or indexed via the Chat plugin.", desc: 'All files of the dataset are shown here, and the entire dataset can be linked to Dify citations or indexed via the Chat plugin.',
addFile: "add file", addFile: 'add file',
table: { table: {
header: { header: {
fileName: "FILE NAME", fileName: 'FILE NAME',
words: "WORDS", words: 'WORDS',
hitCount: "HIT COUNT", hitCount: 'HIT COUNT',
uploadTime: "UPLOAD TIME", uploadTime: 'UPLOAD TIME',
status: "STATUS", status: 'STATUS',
action: "ACTION", action: 'ACTION',
}, },
}, },
action: { action: {
uploadFile: 'Upload new file', uploadFile: 'Upload new file',
settings: 'Segment settings', settings: 'Segment settings',
archive: 'Archive', archive: 'Archive',
delete: "Delete", delete: 'Delete',
enableWarning: 'Archived file cannot be enabled', enableWarning: 'Archived file cannot be enabled',
}, },
index: { index: {
...@@ -38,48 +38,48 @@ const translation = { ...@@ -38,48 +38,48 @@ const translation = {
archived: 'Archived', archived: 'Archived',
}, },
empty: { empty: {
title: "There is no documentation yet", title: 'There is no documentation yet',
upload: { upload: {
tip: "You can upload files, sync from the website, or from webb apps like Notion, GitHub, etc.", tip: 'You can upload files, sync from the website, or from webb apps like Notion, GitHub, etc.',
}, },
sync: { sync: {
tip: "Dify will periodically download files from your Notion and complete processing.", tip: 'Dify will periodically download files from your Notion and complete processing.',
}, },
}, },
delete: { delete: {
title: 'Are you sure Delete?', title: 'Are you sure Delete?',
content: 'If you need to resume processing later, you will continue from where you left off' content: 'If you need to resume processing later, you will continue from where you left off',
} },
}, },
metadata: { metadata: {
title: "Metadata", title: 'Metadata',
desc: "Labeling metadata for documents allows AI to access them in a timely manner and exposes the source of references for users.", desc: 'Labeling metadata for documents allows AI to access them in a timely manner and exposes the source of references for users.',
dateTimeFormat: 'MMMM D, YYYY hh:mm A', dateTimeFormat: 'MMMM D, YYYY hh:mm A',
docTypeSelectTitle: "Please select a document type", docTypeSelectTitle: 'Please select a document type',
docTypeChangeTitle: "Change document type", docTypeChangeTitle: 'Change document type',
docTypeSelectWarning: docTypeSelectWarning:
"If the document type is changed, the now filled metadata will no longer be preserved", 'If the document type is changed, the now filled metadata will no longer be preserved',
firstMetaAction: "Let's go", firstMetaAction: 'Let\'s go',
placeholder: { placeholder: {
add: 'Add ', add: 'Add ',
select: 'Select ', select: 'Select ',
}, },
source: { source: {
upload_file: 'Upload File', upload_file: 'Upload File',
notion: "Sync form Notion", notion: 'Sync form Notion',
github: "Sync form Github", github: 'Sync form Github',
}, },
type: { type: {
book: "Book", book: 'Book',
webPage: "Web Page", webPage: 'Web Page',
paper: "Paper", paper: 'Paper',
socialMediaPost: "Social Media Post", socialMediaPost: 'Social Media Post',
personalDocument: "Personal Document", personalDocument: 'Personal Document',
businessDocument: "Business Document", businessDocument: 'Business Document',
IMChat: "IM Chat", IMChat: 'IM Chat',
wikipediaEntry: "Wikipedia Entry", wikipediaEntry: 'Wikipedia Entry',
notion: "Sync form Notion", notion: 'Sync form Notion',
github: "Sync form Github", github: 'Sync form Github',
technicalParameters: 'Technical Parameters', technicalParameters: 'Technical Parameters',
}, },
field: { field: {
...@@ -90,102 +90,102 @@ const translation = { ...@@ -90,102 +90,102 @@ const translation = {
processClean: 'Text Process Clean', processClean: 'Text Process Clean',
}, },
book: { book: {
title: "Title", title: 'Title',
language: "Language", language: 'Language',
author: "Author", author: 'Author',
publisher: "Publisher", publisher: 'Publisher',
publicationDate: "Publication Date", publicationDate: 'Publication Date',
ISBN: "ISBN", ISBN: 'ISBN',
category: "Category", category: 'Category',
}, },
webPage: { webPage: {
title: "Title", title: 'Title',
url: "URL", url: 'URL',
language: "Language", language: 'Language',
authorPublisher: "Author/Publisher", authorPublisher: 'Author/Publisher',
publishDate: "Publish Date", publishDate: 'Publish Date',
topicsKeywords: "Topics/Keywords", topicsKeywords: 'Topics/Keywords',
description: "Description", description: 'Description',
}, },
paper: { paper: {
title: "Title", title: 'Title',
language: "Language", language: 'Language',
author: "Author", author: 'Author',
publishDate: "Publish Date", publishDate: 'Publish Date',
journalConferenceName: "Journal/Conference Name", journalConferenceName: 'Journal/Conference Name',
volumeIssuePage: "Volume/Issue/Page", volumeIssuePage: 'Volume/Issue/Page',
DOI: "DOI", DOI: 'DOI',
topicsKeywords: "Topics/Keywords", topicsKeywords: 'Topics/Keywords',
abstract: "Abstract", abstract: 'Abstract',
}, },
socialMediaPost: { socialMediaPost: {
platform: "Platform", platform: 'Platform',
authorUsername: "Author/Username", authorUsername: 'Author/Username',
publishDate: "Publish Date", publishDate: 'Publish Date',
postURL: "Post URL", postURL: 'Post URL',
topicsTags: "Topics/Tags", topicsTags: 'Topics/Tags',
}, },
personalDocument: { personalDocument: {
title: "Title", title: 'Title',
author: "Author", author: 'Author',
creationDate: "Creation Date", creationDate: 'Creation Date',
lastModifiedDate: "Last Modified Date", lastModifiedDate: 'Last Modified Date',
documentType: "Document Type", documentType: 'Document Type',
tagsCategory: "Tags/Category", tagsCategory: 'Tags/Category',
}, },
businessDocument: { businessDocument: {
title: "Title", title: 'Title',
author: "Author", author: 'Author',
creationDate: "Creation Date", creationDate: 'Creation Date',
lastModifiedDate: "Last Modified Date", lastModifiedDate: 'Last Modified Date',
documentType: "Document Type", documentType: 'Document Type',
departmentTeam: "Department/Team", departmentTeam: 'Department/Team',
}, },
IMChat: { IMChat: {
chatPlatform: "Chat Platform", chatPlatform: 'Chat Platform',
chatPartiesGroupName: "Chat Parties/Group Name", chatPartiesGroupName: 'Chat Parties/Group Name',
participants: "Participants", participants: 'Participants',
startDate: "Start Date", startDate: 'Start Date',
endDate: "End Date", endDate: 'End Date',
topicsKeywords: "Topics/Keywords", topicsKeywords: 'Topics/Keywords',
fileType: "File Type", fileType: 'File Type',
}, },
wikipediaEntry: { wikipediaEntry: {
title: "Title", title: 'Title',
language: "Language", language: 'Language',
webpageURL: "Webpage URL", webpageURL: 'Webpage URL',
editorContributor: "Editor/Contributor", editorContributor: 'Editor/Contributor',
lastEditDate: "Last Edit Date", lastEditDate: 'Last Edit Date',
summaryIntroduction: "Summary/Introduction", summaryIntroduction: 'Summary/Introduction',
}, },
notion: { notion: {
title: "Title", title: 'Title',
language: "Language", language: 'Language',
author: "Author", author: 'Author',
createdTime: "Created Time", createdTime: 'Created Time',
lastModifiedTime: "Last Modified Time", lastModifiedTime: 'Last Modified Time',
url: "URL", url: 'URL',
tag: "Tag", tag: 'Tag',
description: "Description", description: 'Description',
}, },
github: { github: {
repoName: "Repo Name", repoName: 'Repo Name',
repoDesc: "Repo Description", repoDesc: 'Repo Description',
repoOwner: "Repo Owner", repoOwner: 'Repo Owner',
fileName: "File Name", fileName: 'File Name',
filePath: "File Path", filePath: 'File Path',
programmingLang: "Programming Language", programmingLang: 'Programming Language',
url: "URL", url: 'URL',
license: "License", license: 'License',
lastCommitTime: "Last Commit Time", lastCommitTime: 'Last Commit Time',
lastCommitAuthor: "Last Commit Author", lastCommitAuthor: 'Last Commit Author',
}, },
originInfo: { originInfo: {
originalFilename: "Original filename", originalFilename: 'Original filename',
originalFileSize: "Original file size", originalFileSize: 'Original file size',
uploadDate: "Upload date", uploadDate: 'Upload date',
lastUpdateDate: "Last update date", lastUpdateDate: 'Last update date',
source: "Source", source: 'Source',
}, },
technicalParameters: { technicalParameters: {
segmentSpecification: 'Segment specification', segmentSpecification: 'Segment specification',
...@@ -194,92 +194,92 @@ const translation = { ...@@ -194,92 +194,92 @@ const translation = {
paragraphs: 'Paragraphs', paragraphs: 'Paragraphs',
hitCount: 'Hit count', hitCount: 'Hit count',
embeddingTime: 'Embedding time', embeddingTime: 'Embedding time',
embeddedSpend: 'Embedded spend' embeddedSpend: 'Embedded spend',
} },
}, },
languageMap: { languageMap: {
zh: "Chinese", zh: 'Chinese',
en: "English", en: 'English',
es: "Spanish", es: 'Spanish',
fr: "French", fr: 'French',
de: "German", de: 'German',
ja: "Japanese", ja: 'Japanese',
ko: "Korean", ko: 'Korean',
ru: "Russian", ru: 'Russian',
ar: "Arabic", ar: 'Arabic',
pt: "Portuguese", pt: 'Portuguese',
it: "Italian", it: 'Italian',
nl: "Dutch", nl: 'Dutch',
pl: "Polish", pl: 'Polish',
sv: "Swedish", sv: 'Swedish',
tr: "Turkish", tr: 'Turkish',
he: "Hebrew", he: 'Hebrew',
hi: "Hindi", hi: 'Hindi',
da: "Danish", da: 'Danish',
fi: "Finnish", fi: 'Finnish',
no: "Norwegian", no: 'Norwegian',
hu: "Hungarian", hu: 'Hungarian',
el: "Greek", el: 'Greek',
cs: "Czech", cs: 'Czech',
th: "Thai", th: 'Thai',
id: "Indonesian", id: 'Indonesian',
}, },
categoryMap: { categoryMap: {
book: { book: {
fiction: "Fiction", fiction: 'Fiction',
biography: "Biography", biography: 'Biography',
history: "History", history: 'History',
science: "Science", science: 'Science',
technology: "Technology", technology: 'Technology',
education: "Education", education: 'Education',
philosophy: "Philosophy", philosophy: 'Philosophy',
religion: "Religion", religion: 'Religion',
socialSciences: "SocialSciences", socialSciences: 'SocialSciences',
art: "Art", art: 'Art',
travel: "Travel", travel: 'Travel',
health: "Health", health: 'Health',
selfHelp: "SelfHelp", selfHelp: 'SelfHelp',
businessEconomics: "BusinessEconomics", businessEconomics: 'BusinessEconomics',
cooking: "Cooking", cooking: 'Cooking',
childrenYoungAdults: "ChildrenYoungAdults", childrenYoungAdults: 'ChildrenYoungAdults',
comicsGraphicNovels: "ComicsGraphicNovels", comicsGraphicNovels: 'ComicsGraphicNovels',
poetry: "Poetry", poetry: 'Poetry',
drama: "Drama", drama: 'Drama',
other: "Other", other: 'Other',
}, },
personalDoc: { personalDoc: {
notes: "Notes", notes: 'Notes',
blogDraft: "Blog Draft", blogDraft: 'Blog Draft',
diary: "Diary", diary: 'Diary',
researchReport: "Research Report", researchReport: 'Research Report',
bookExcerpt: "Book Excerpt", bookExcerpt: 'Book Excerpt',
schedule: "Schedule", schedule: 'Schedule',
list: "List", list: 'List',
projectOverview: "Project Overview", projectOverview: 'Project Overview',
photoCollection: "Photo Collection", photoCollection: 'Photo Collection',
creativeWriting: "Creative Writing", creativeWriting: 'Creative Writing',
codeSnippet: "Code Snippet", codeSnippet: 'Code Snippet',
designDraft: "Design Draft", designDraft: 'Design Draft',
personalResume: "Personal Resume", personalResume: 'Personal Resume',
other: "Other", other: 'Other',
}, },
businessDoc: { businessDoc: {
meetingMinutes: "Meeting Minutes", meetingMinutes: 'Meeting Minutes',
researchReport: "Research Report", researchReport: 'Research Report',
proposal: "Proposal", proposal: 'Proposal',
employeeHandbook: "Employee Handbook", employeeHandbook: 'Employee Handbook',
trainingMaterials: "Training Materials", trainingMaterials: 'Training Materials',
requirementsDocument: "Requirements Document", requirementsDocument: 'Requirements Document',
designDocument: "Design Document", designDocument: 'Design Document',
productSpecification: "Product Specification", productSpecification: 'Product Specification',
financialReport: "Financial Report", financialReport: 'Financial Report',
marketAnalysis: "Market Analysis", marketAnalysis: 'Market Analysis',
projectPlan: "Project Plan", projectPlan: 'Project Plan',
teamStructure: "Team Structure", teamStructure: 'Team Structure',
policiesProcedures: "Policies & Procedures", policiesProcedures: 'Policies & Procedures',
contractsAgreements: "Contracts & Agreements", contractsAgreements: 'Contracts & Agreements',
emailCorrespondence: "Email Correspondence", emailCorrespondence: 'Email Correspondence',
other: "Other", other: 'Other',
}, },
}, },
}, },
...@@ -300,7 +300,7 @@ const translation = { ...@@ -300,7 +300,7 @@ const translation = {
resume: 'Resume processing', resume: 'Resume processing',
automatic: 'Automatic', automatic: 'Automatic',
custom: 'Custom', custom: 'Custom',
previewTip: 'Paragraph preview will be available after embedding is complete' previewTip: 'Paragraph preview will be available after embedding is complete',
}, },
segment: { segment: {
paragraphs: 'Paragraphs', paragraphs: 'Paragraphs',
...@@ -308,7 +308,7 @@ const translation = { ...@@ -308,7 +308,7 @@ const translation = {
characters: 'characters', characters: 'characters',
hitCount: 'hit count', hitCount: 'hit count',
vectorHash: 'Vector hash: ', vectorHash: 'Vector hash: ',
} },
}; }
export default translation; export default translation
const translation = { const translation = {
list: { list: {
title: "文档", title: '文档',
desc: "数据集的所有文件都在这里显示,整个数据集都可以链接到 Dify 引用或通过 Chat 插件进行索引。", desc: '数据集的所有文件都在这里显示,整个数据集都可以链接到 Dify 引用或通过 Chat 插件进行索引。',
addFile: "添加文件", addFile: '添加文件',
table: { table: {
header: { header: {
fileName: "文件名", fileName: '文件名',
words: "字符数", words: '字符数',
hitCount: "命中次数", hitCount: '命中次数',
uploadTime: "上传时间", uploadTime: '上传时间',
status: "状态", status: '状态',
action: "操作", action: '操作',
}, },
}, },
action: { action: {
uploadFile: '上传新文件', uploadFile: '上传新文件',
settings: '分段设置', settings: '分段设置',
archive: '归档', archive: '归档',
delete: "删除", delete: '删除',
enableWarning: '归档的文件无法启用', enableWarning: '归档的文件无法启用',
}, },
index: { index: {
...@@ -38,47 +38,47 @@ const translation = { ...@@ -38,47 +38,47 @@ const translation = {
archived: '已归档', archived: '已归档',
}, },
empty: { empty: {
title: "还没有文档", title: '还没有文档',
upload: { upload: {
tip: "您可以上传文件,从网站同步,或者从网络应用程序(如概念、GitHub 等)同步。", tip: '您可以上传文件,从网站同步,或者从网络应用程序(如概念、GitHub 等)同步。',
}, },
sync: { sync: {
tip: "Dify 会定期从您的 Notion 中下载文件并完成处理。", tip: 'Dify 会定期从您的 Notion 中下载文件并完成处理。',
}, },
}, },
delete: { delete: {
title: '确定删除吗?', title: '确定删除吗?',
content: '如果您需要稍后恢复处理,您将从您离开的地方继续' content: '如果您需要稍后恢复处理,您将从您离开的地方继续',
} },
}, },
metadata: { metadata: {
title: "元数据", title: '元数据',
desc: "标记文档的元数据允许 AI 及时访问它们并为用户公开参考来源。", desc: '标记文档的元数据允许 AI 及时访问它们并为用户公开参考来源。',
dateTimeFormat: 'YYYY-MM-DD HH:mm', dateTimeFormat: 'YYYY-MM-DD HH:mm',
docTypeSelectTitle: "请选择一种文档类型", docTypeSelectTitle: '请选择一种文档类型',
docTypeChangeTitle: "更换文档类型", docTypeChangeTitle: '更换文档类型',
docTypeSelectWarning: "如果更改文档类型,将不再保留现在填充的元数据", docTypeSelectWarning: '如果更改文档类型,将不再保留现在填充的元数据',
firstMetaAction: "开始", firstMetaAction: '开始',
placeholder: { placeholder: {
add: '输入', add: '输入',
select: '选择', select: '选择',
}, },
source: { source: {
upload_file: '文件上传', upload_file: '文件上传',
notion: "从 Notion 同步的文档", notion: '从 Notion 同步的文档',
github: "从 Github 同步的代码", github: '从 Github 同步的代码',
}, },
type: { type: {
book: "书籍", book: '书籍',
webPage: "网页", webPage: '网页',
paper: "论文", paper: '论文',
socialMediaPost: "社交媒体帖子", socialMediaPost: '社交媒体帖子',
personalDocument: "个人文档", personalDocument: '个人文档',
businessDocument: "商务文档", businessDocument: '商务文档',
IMChat: "IM 聊天记录", IMChat: 'IM 聊天记录',
wikipediaEntry: "维基百科条目", wikipediaEntry: '维基百科条目',
notion: "从 Notion 同步的文档", notion: '从 Notion 同步的文档',
github: "从 Github 同步的代码", github: '从 Github 同步的代码',
technicalParameters: '技术参数', technicalParameters: '技术参数',
}, },
field: { field: {
...@@ -89,102 +89,102 @@ const translation = { ...@@ -89,102 +89,102 @@ const translation = {
processClean: '文本预处理与清洗', processClean: '文本预处理与清洗',
}, },
book: { book: {
title: "标题", title: '标题',
language: "语言", language: '语言',
author: "作者", author: '作者',
publisher: "出版商", publisher: '出版商',
publicationDate: "出版日期", publicationDate: '出版日期',
ISBN: "ISBN", ISBN: 'ISBN',
category: "类别", category: '类别',
}, },
webPage: { webPage: {
title: "标题", title: '标题',
url: "网址", url: '网址',
language: "语言", language: '语言',
authorPublisher: "作者/出版商", authorPublisher: '作者/出版商',
publishDate: "发布日期", publishDate: '发布日期',
topicsKeywords: "主题/关键词", topicsKeywords: '主题/关键词',
description: "描述", description: '描述',
}, },
paper: { paper: {
title: "标题", title: '标题',
language: "语言", language: '语言',
author: "作者", author: '作者',
publishDate: "发布日期", publishDate: '发布日期',
journalConferenceName: "期刊/会议名称", journalConferenceName: '期刊/会议名称',
volumeIssuePage: "卷/期/页码", volumeIssuePage: '卷/期/页码',
DOI: "DOI", DOI: 'DOI',
topicsKeywords: "主题/关键词", topicsKeywords: '主题/关键词',
abstract: "摘要", abstract: '摘要',
}, },
socialMediaPost: { socialMediaPost: {
platform: "平台", platform: '平台',
authorUsername: "作者/用户名", authorUsername: '作者/用户名',
publishDate: "发布日期", publishDate: '发布日期',
postURL: "帖子网址", postURL: '帖子网址',
topicsTags: "主题/标签", topicsTags: '主题/标签',
}, },
personalDocument: { personalDocument: {
title: "标题", title: '标题',
author: "作者", author: '作者',
creationDate: "创建日期", creationDate: '创建日期',
lastModifiedDate: "最后修改日期", lastModifiedDate: '最后修改日期',
documentType: "文档类型", documentType: '文档类型',
tagsCategory: "标签/类别", tagsCategory: '标签/类别',
}, },
businessDocument: { businessDocument: {
title: "标题", title: '标题',
author: "作者", author: '作者',
creationDate: "创建日期", creationDate: '创建日期',
lastModifiedDate: "最后修改日期", lastModifiedDate: '最后修改日期',
documentType: "文档类型", documentType: '文档类型',
departmentTeam: "部门/团队", departmentTeam: '部门/团队',
}, },
IMChat: { IMChat: {
chatPlatform: "聊天平台", chatPlatform: '聊天平台',
chatPartiesGroupName: "聊天参与方/群组名称", chatPartiesGroupName: '聊天参与方/群组名称',
participants: "参与者", participants: '参与者',
startDate: "开始日期", startDate: '开始日期',
endDate: "结束日期", endDate: '结束日期',
topicsKeywords: "主题/关键词", topicsKeywords: '主题/关键词',
fileType: "文件类型", fileType: '文件类型',
}, },
wikipediaEntry: { wikipediaEntry: {
title: "标题", title: '标题',
language: "语言", language: '语言',
webpageURL: "网页网址", webpageURL: '网页网址',
editorContributor: "编辑/贡献者", editorContributor: '编辑/贡献者',
lastEditDate: "最后编辑日期", lastEditDate: '最后编辑日期',
summaryIntroduction: "摘要/介绍", summaryIntroduction: '摘要/介绍',
}, },
notion: { notion: {
title: "标题", title: '标题',
language: "语言", language: '语言',
author: "作者", author: '作者',
createdTime: "创建时间", createdTime: '创建时间',
lastModifiedTime: "最后修改时间", lastModifiedTime: '最后修改时间',
url: "网址", url: '网址',
tag: "标签", tag: '标签',
description: "描述", description: '描述',
}, },
github: { github: {
repoName: "仓库名", repoName: '仓库名',
repoDesc: "仓库描述", repoDesc: '仓库描述',
repoOwner: "仓库所有者", repoOwner: '仓库所有者',
fileName: "文件名", fileName: '文件名',
filePath: "文件路径", filePath: '文件路径',
programmingLang: "编程语言", programmingLang: '编程语言',
url: "网址", url: '网址',
license: "许可证", license: '许可证',
lastCommitTime: "最后提交时间", lastCommitTime: '最后提交时间',
lastCommitAuthor: "最后提交者", lastCommitAuthor: '最后提交者',
}, },
originInfo: { originInfo: {
originalFilename: "原始文件名称", originalFilename: '原始文件名称',
originalFileSize: "原始文件大小", originalFileSize: '原始文件大小',
uploadDate: "上传日期", uploadDate: '上传日期',
lastUpdateDate: "最后更新日期", lastUpdateDate: '最后更新日期',
source: "来源", source: '来源',
}, },
technicalParameters: { technicalParameters: {
segmentSpecification: '分段规则', segmentSpecification: '分段规则',
...@@ -194,91 +194,91 @@ const translation = { ...@@ -194,91 +194,91 @@ const translation = {
hitCount: '命中次数', hitCount: '命中次数',
embeddingTime: '嵌入时间', embeddingTime: '嵌入时间',
embeddedSpend: '嵌入花费', embeddedSpend: '嵌入花费',
} },
}, },
languageMap: { languageMap: {
zh: "中文", zh: '中文',
en: "英文", en: '英文',
es: "西班牙语", es: '西班牙语',
fr: "法语", fr: '法语',
de: "德语", de: '德语',
ja: "日语", ja: '日语',
ko: "韩语", ko: '韩语',
ru: "俄语", ru: '俄语',
ar: "阿拉伯语", ar: '阿拉伯语',
pt: "葡萄牙语", pt: '葡萄牙语',
it: "意大利语", it: '意大利语',
nl: "荷兰语", nl: '荷兰语',
pl: "波兰语", pl: '波兰语',
sv: "瑞典语", sv: '瑞典语',
tr: "土耳其语", tr: '土耳其语',
he: "希伯来语", he: '希伯来语',
hi: "印地语", hi: '印地语',
da: "丹麦语", da: '丹麦语',
fi: "芬兰语", fi: '芬兰语',
no: "挪威语", no: '挪威语',
hu: "匈牙利语", hu: '匈牙利语',
el: "希腊语", el: '希腊语',
cs: "捷克语", cs: '捷克语',
th: "泰语", th: '泰语',
id: "印度尼西亚语", id: '印度尼西亚语',
}, },
categoryMap: { categoryMap: {
book: { book: {
fiction: "小说", fiction: '小说',
biography: "传记", biography: '传记',
history: "历史", history: '历史',
science: "科学", science: '科学',
technology: "技术", technology: '技术',
education: "教育", education: '教育',
philosophy: "哲学", philosophy: '哲学',
religion: "宗教", religion: '宗教',
socialSciences: "社会科学", socialSciences: '社会科学',
art: "艺术", art: '艺术',
travel: "旅行", travel: '旅行',
health: "健康", health: '健康',
selfHelp: "自助", selfHelp: '自助',
businessEconomics: "商业/经济", businessEconomics: '商业/经济',
cooking: "烹饪", cooking: '烹饪',
childrenYoungAdults: "儿童/青少年", childrenYoungAdults: '儿童/青少年',
comicsGraphicNovels: "漫画/图形小说", comicsGraphicNovels: '漫画/图形小说',
poetry: "诗歌", poetry: '诗歌',
drama: "戏剧", drama: '戏剧',
other: "其他", other: '其他',
}, },
personalDoc: { personalDoc: {
notes: "笔记", notes: '笔记',
blogDraft: "博客草稿", blogDraft: '博客草稿',
diary: "日记", diary: '日记',
researchReport: "研究报告", researchReport: '研究报告',
bookExcerpt: "书籍摘录", bookExcerpt: '书籍摘录',
schedule: "日程安排", schedule: '日程安排',
list: "列表", list: '列表',
projectOverview: "项目概述", projectOverview: '项目概述',
photoCollection: "照片集", photoCollection: '照片集',
creativeWriting: "创意写作", creativeWriting: '创意写作',
codeSnippet: "代码片段", codeSnippet: '代码片段',
designDraft: "设计草稿", designDraft: '设计草稿',
personalResume: "个人简历", personalResume: '个人简历',
other: "其他", other: '其他',
}, },
businessDoc: { businessDoc: {
meetingMinutes: "会议纪要", meetingMinutes: '会议纪要',
researchReport: "研究报告", researchReport: '研究报告',
proposal: "提案", proposal: '提案',
employeeHandbook: "员工手册", employeeHandbook: '员工手册',
trainingMaterials: "培训材料", trainingMaterials: '培训材料',
requirementsDocument: "需求文档", requirementsDocument: '需求文档',
designDocument: "设计文档", designDocument: '设计文档',
productSpecification: "产品规格", productSpecification: '产品规格',
financialReport: "财务报告", financialReport: '财务报告',
marketAnalysis: "市场分析", marketAnalysis: '市场分析',
projectPlan: "项目计划", projectPlan: '项目计划',
teamStructure: "团队结构", teamStructure: '团队结构',
policiesProcedures: "政策和流程", policiesProcedures: '政策和流程',
contractsAgreements: "合同和协议", contractsAgreements: '合同和协议',
emailCorrespondence: "邮件往来", emailCorrespondence: '邮件往来',
other: "其他", other: '其他',
}, },
}, },
}, },
...@@ -299,7 +299,7 @@ const translation = { ...@@ -299,7 +299,7 @@ const translation = {
resume: '恢复处理', resume: '恢复处理',
automatic: '自动', automatic: '自动',
custom: '自定义', custom: '自定义',
previewTip: '段落预览将在嵌入完成后可用' previewTip: '段落预览将在嵌入完成后可用',
}, },
segment: { segment: {
paragraphs: '段落', paragraphs: '段落',
...@@ -307,7 +307,7 @@ const translation = { ...@@ -307,7 +307,7 @@ const translation = {
characters: '字符', characters: '字符',
hitCount: '命中次数', hitCount: '命中次数',
vectorHash: '向量哈希:', vectorHash: '向量哈希:',
} },
}; }
export default translation; export default translation
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment