mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: export
This commit is contained in:
38
src/view/download/config.tsx
vendored
Normal file
38
src/view/download/config.tsx
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Switch, Tag, Tooltip, Space, Popconfirm } from 'antd';
|
||||
|
||||
export const syncColumns = () => [
|
||||
{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
fixed: 'left',
|
||||
// width: 120,
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: 'Type',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
render: () => {
|
||||
return <Tag>{}</Tag>;
|
||||
}
|
||||
// width: 200,
|
||||
},
|
||||
{
|
||||
title: 'Action',
|
||||
render: (_: any, row: any, actions: any) => {
|
||||
return (
|
||||
<Space>
|
||||
<a>View</a>
|
||||
<Popconfirm
|
||||
title="Are you sure to delete this file?"
|
||||
onConfirm={() => actions.setRecord(row, 'delete')}
|
||||
okText="Yes"
|
||||
cancelText="No"
|
||||
>
|
||||
<a>Delete</a>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
}
|
||||
];
|
||||
12
src/view/download/index.scss
vendored
Normal file
12
src/view/download/index.scss
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
.chat-table-tip, .chat-table-btns {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.chat-table-btns {
|
||||
margin-bottom: 5px;
|
||||
|
||||
.num {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
38
src/view/download/index.tsx
vendored
Normal file
38
src/view/download/index.tsx
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { useState } from 'react';
|
||||
import { Table } from 'antd';
|
||||
import { path, shell } from '@tauri-apps/api';
|
||||
|
||||
import useInit from '@/hooks/useInit';
|
||||
import useColumns from '@/hooks/useColumns';
|
||||
import useTable, { TABLE_PAGINATION } from '@/hooks/useTable';
|
||||
import { chatRoot } from '@/utils';
|
||||
import { syncColumns } from './config';
|
||||
import './index.scss';
|
||||
|
||||
export default function SyncPrompts() {
|
||||
const { rowSelection, selectedRowIDs } = useTable();
|
||||
const [downloadPath, setDownloadPath] = useState('');
|
||||
const { columns, ...opInfo } = useColumns(syncColumns());
|
||||
|
||||
useInit(async () => {
|
||||
setDownloadPath(await path.join(await chatRoot(), 'download'));
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="chat-table-tip">
|
||||
<div className="chat-file-path">
|
||||
<div>PATH: <a onClick={() => shell.open(downloadPath)} title={downloadPath}>{downloadPath}</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<Table
|
||||
rowKey="name"
|
||||
columns={columns}
|
||||
scroll={{ x: 'auto' }}
|
||||
dataSource={[]}
|
||||
rowSelection={rowSelection}
|
||||
pagination={TABLE_PAGINATION}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user