feat: added file management functionality and API operations
- Improved functionality for file management has been added. - Added file system management functionality through IPC. - Added functionality to interact with files including selection, upload, deletion, and batch operations. - Added new file operations to the custom API, including file select, upload, delete, batch upload, and batch delete functions. - Implemented feature to select and upload files via API.
This commit is contained in:
@@ -7,13 +7,23 @@ import styled from 'styled-components'
|
||||
const FilesPage: FC = () => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const handleSelectFile = async () => {
|
||||
const files = await window.api.fileSelect({
|
||||
properties: ['openFile', 'multiSelections']
|
||||
})
|
||||
for (const file of files || []) {
|
||||
const result = await window.api.fileUpload(file.path)
|
||||
console.log('Selected file:', file, result)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<Navbar>
|
||||
<NavbarCenter style={{ borderRight: 'none' }}>{t('files.title')}</NavbarCenter>
|
||||
</Navbar>
|
||||
<ContentContainer>
|
||||
<Button>添加文件</Button>
|
||||
<Button onClick={handleSelectFile}>添加文件</Button>
|
||||
</ContentContainer>
|
||||
</Container>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user