-
+
{selectedItems.length > 0 && (
<>
-
+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/view/download/config.tsx b/src/view/download/config.tsx
index 274c208..4f42bb9 100644
--- a/src/view/download/config.tsx
+++ b/src/view/download/config.tsx
@@ -10,7 +10,7 @@ import { fmtDate, chatRoot } from '@/utils';
const colorMap: any = {
pdf: 'blue',
png: 'orange',
-}
+};
export const downloadColumns = () => [
{
@@ -61,20 +61,22 @@ export const downloadColumns = () => [
Delete
- )
- }
- }
+ );
+ },
+ },
];
const RenderPath = ({ row }: any) => {
const [filePath, setFilePath] = useState('');
useInit(async () => {
- setFilePath(await getPath(row));
- })
+ setFilePath(await getPath(row));
+ });
return
shell.open(filePath)}>{filePath};
};
export const getPath = async (row: any) => {
const isImg = ['png'].includes(row?.ext);
- return await path.join(await chatRoot(), 'download', isImg ? 'img' : row.ext, row.id) + `.${row.ext}`;
-}
+ return (
+ (await path.join(await chatRoot(), 'download', isImg ? 'img' : row.ext, row.id)) + `.${row.ext}`
+ );
+};
diff --git a/src/view/download/index.tsx b/src/view/download/index.tsx
index 4192651..5684993 100644
--- a/src/view/download/index.tsx
+++ b/src/view/download/index.tsx
@@ -37,7 +37,12 @@ export default function Download() {
(async () => {
const record = opInfo?.opRecord;
const isImg = ['png'].includes(record?.ext);
- const file = await path.join(await chatRoot(), 'download', isImg ? 'img' : record?.ext, `${record?.id}.${record?.ext}`);
+ const file = await path.join(
+ await chatRoot(),
+ 'download',
+ isImg ? 'img' : record?.ext,
+ `${record?.id}.${record?.ext}`,
+ );
if (opInfo.opType === 'preview') {
const data = await fs.readBinaryFile(file);
const sourceData = renderFile(data, record?.ext);
@@ -55,8 +60,8 @@ export default function Download() {
message.success('Name has been changed!');
}
opInfo.resetRecord();
- })()
- }, [opInfo.opType])
+ })();
+ }, [opInfo.opType]);
const handleDelete = async () => {
if (opData?.length === selectedRows.length) {
@@ -69,10 +74,15 @@ export default function Download() {
const rows = selectedRows.map(async (i) => {
const isImg = ['png'].includes(i?.ext);
- const file = await path.join(await chatRoot(), 'download', isImg ? 'img' : i?.ext, `${i?.id}.${i?.ext}`);
+ const file = await path.join(
+ await chatRoot(),
+ 'download',
+ isImg ? 'img' : i?.ext,
+ `${i?.id}.${i?.ext}`,
+ );
await fs.removeFile(file);
return file;
- })
+ });
Promise.all(rows).then(async () => {
await handleRefresh();
message.success('All files selected are cleared!');
@@ -131,5 +141,5 @@ export default function Download() {
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/view/markdown/index.scss b/src/view/markdown/index.scss
index 71f7cc5..964eb74 100644
--- a/src/view/markdown/index.scss
+++ b/src/view/markdown/index.scss
@@ -1,4 +1,3 @@
-
.md-task {
margin-bottom: 5px;
display: flex;
@@ -14,4 +13,4 @@
cursor: pointer;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/view/markdown/index.tsx b/src/view/markdown/index.tsx
index 088dd9b..292c7e2 100644
--- a/src/view/markdown/index.tsx
+++ b/src/view/markdown/index.tsx
@@ -14,7 +14,7 @@ const modeMap: any = {
0: 'split',
1: 'md',
2: 'doc',
-}
+};
export default function Markdown() {
const [filePath, setFilePath] = useState('');
@@ -26,8 +26,8 @@ export default function Markdown() {
useInit(async () => {
const file = await getPath(state);
setFilePath(file);
- setSource(await fs.readTextFile(file))
- })
+ setSource(await fs.readTextFile(file));
+ });
const handleChange = async (v: string) => {
await fs.writeTextFile(filePath, v);
@@ -46,9 +46,7 @@ export default function Markdown() {
history.go(-1)}>
-
shell.open(filePath)}>
- {filePath}
-
+
shell.open(filePath)}>{filePath}
@@ -57,4 +55,4 @@ export default function Markdown() {
>
);
-}
\ No newline at end of file
+}
diff --git a/src/view/model/SyncCustom/Form.tsx b/src/view/model/SyncCustom/Form.tsx
index fbf3e3a..9166643 100644
--- a/src/view/model/SyncCustom/Form.tsx
+++ b/src/view/model/SyncCustom/Form.tsx
@@ -1,4 +1,10 @@
-import { useEffect, useState, ForwardRefRenderFunction, useImperativeHandle, forwardRef } from 'react';
+import {
+ useEffect,
+ useState,
+ ForwardRefRenderFunction,
+ useImperativeHandle,
+ forwardRef,
+} from 'react';
import { Form, Input, Select, Tooltip } from 'antd';
import { v4 } from 'uuid';
import type { FormProps } from 'antd';
@@ -7,7 +13,7 @@ import { DISABLE_AUTO_COMPLETE, chatRoot } from '@/utils';
import useInit from '@/hooks/useInit';
interface SyncFormProps {
- record?: Record
| null;
+ record?: Record | null;
type: string;
}
@@ -54,10 +60,18 @@ const SyncForm: ForwardRefRenderFunction = ({ record,
const jsonTip = (
{JSON.stringify([
- { cmd: '', act: '', prompt: '' },
- { cmd: '', act: '', prompt: '' },
- ], null, 2)}}
+ title={
+
+ {JSON.stringify(
+ [
+ { cmd: '', act: '', prompt: '' },
+ { cmd: '', act: '', prompt: '' },
+ ],
+ null,
+ 2,
+ )}
+
+ }
>
JSON
@@ -65,10 +79,12 @@ const SyncForm: ForwardRefRenderFunction = ({ record,
const csvTip = (
{`"cmd","act","prompt"
+ title={
+ {`"cmd","act","prompt"
"cmd","act","prompt"
"cmd","act","prompt"
-"cmd","act","prompt"`}
}
+"cmd","act","prompt"`}
+ }
>
CSV
@@ -76,11 +92,7 @@ const SyncForm: ForwardRefRenderFunction = ({ record,
return (
<>
- = ({ record,
label="PATH"
name="path"
rules={[{ required: true, message: 'Please enter the path!' }]}
- >
+ >
= ({ record,
{...DISABLE_AUTO_COMPLETE}
/>
-
+
+
+
-
The file supports only {csvTip} and {jsonTip} formats.
+
+ The file supports only {csvTip} and {jsonTip} formats.
+
>
- )
-}
+ );
+};
export default forwardRef(SyncForm);
diff --git a/src/view/model/SyncCustom/config.tsx b/src/view/model/SyncCustom/config.tsx
index d491cfc..bb3721c 100644
--- a/src/view/model/SyncCustom/config.tsx
+++ b/src/view/model/SyncCustom/config.tsx
@@ -26,7 +26,7 @@ export const syncColumns = () => [
dataIndex: 'path',
key: 'path',
width: 180,
- render: (_: string, row: any) =>
+ render: (_: string, row: any) => ,
},
{
title: 'Last updated',
@@ -36,7 +36,7 @@ export const syncColumns = () => [
render: (v: number) => (
- { v ? fmtDate(v) : ''}
+ {v ? fmtDate(v) : ''}
),
},
@@ -56,7 +56,11 @@ export const syncColumns = () => [
>
Sync
- {row.last_updated && View}
+ {row.last_updated && (
+
+ View
+
+ )}
actions.setRecord(row, 'edit')}>Edit
[
Delete
- )
- }
- }
+ );
+ },
+ },
];
const RenderPath = ({ row }: any) => {
const [filePath, setFilePath] = useState('');
useInit(async () => {
- setFilePath(await getPath(row));
- })
- return shell.open(filePath)}>{filePath}
+ setFilePath(await getPath(row));
+ });
+ return shell.open(filePath)}>{filePath};
};
export const getPath = async (row: any) => {
if (!/^http/.test(row.protocol)) {
- return await path.join(await chatRoot(), row.path) + `.${row.ext}`;
+ return (await path.join(await chatRoot(), row.path)) + `.${row.ext}`;
} else {
return `${row.protocol}://${row.path}.${row.ext}`;
}
-}
\ No newline at end of file
+};
diff --git a/src/view/model/SyncCustom/index.tsx b/src/view/model/SyncCustom/index.tsx
index 0ee3767..fec29cb 100644
--- a/src/view/model/SyncCustom/index.tsx
+++ b/src/view/model/SyncCustom/index.tsx
@@ -10,7 +10,13 @@ import { CHAT_MODEL_JSON, chatRoot, readJSON, genCmd } from '@/utils';
import { syncColumns, getPath } from './config';
import SyncForm from './Form';
-const fmtData = (data: Record[] = []) => (Array.isArray(data) ? data : []).map((i) => ({ ...i, cmd: i.cmd ? i.cmd : genCmd(i.act), tags: ['user-sync'], enable: true }));
+const fmtData = (data: Record[] = []) =>
+ (Array.isArray(data) ? data : []).map((i) => ({
+ ...i,
+ cmd: i.cmd ? i.cmd : genCmd(i.act),
+ tags: ['user-sync'],
+ enable: true,
+ }));
export default function SyncCustom() {
const [isVisible, setVisible] = useState(false);
@@ -37,7 +43,10 @@ export default function SyncCustom() {
handleSync(filename).then((isOk: boolean) => {
opInfo.resetRecord();
if (!isOk) return;
- const data = opReplace(opInfo?.opRecord?.[opSafeKey], { ...opInfo?.opRecord, last_updated: Date.now() });
+ const data = opReplace(opInfo?.opRecord?.[opSafeKey], {
+ ...opInfo?.opRecord,
+ last_updated: Date.now(),
+ });
modelSet(data);
opInfo.resetRecord();
});
@@ -48,9 +57,13 @@ export default function SyncCustom() {
if (['delete'].includes(opInfo.opType)) {
(async () => {
try {
- const file = await path.join(await chatRoot(), 'cache_model', `${opInfo?.opRecord?.id}.json`);
+ const file = await path.join(
+ await chatRoot(),
+ 'cache_model',
+ `${opInfo?.opRecord?.id}.json`,
+ );
await fs.removeFile(file);
- } catch(e) {}
+ } catch (e) {}
const data = opRemove(opInfo?.opRecord?.[opSafeKey]);
modelSet(data);
opInfo.resetRecord();
@@ -94,29 +107,24 @@ export default function SyncCustom() {
};
const handleOk = () => {
- formRef.current?.form?.validateFields()
- .then((vals: Record) => {
- if (opInfo.opType === 'new') {
- const data = opAdd(vals);
- modelSet(data);
- message.success('Data added successfully');
- }
- if (opInfo.opType === 'edit') {
- const data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);
- modelSet(data);
- message.success('Data updated successfully');
- }
- hide();
- })
+ formRef.current?.form?.validateFields().then((vals: Record) => {
+ if (opInfo.opType === 'new') {
+ const data = opAdd(vals);
+ modelSet(data);
+ message.success('Data added successfully');
+ }
+ if (opInfo.opType === 'edit') {
+ const data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);
+ modelSet(data);
+ message.success('Data updated successfully');
+ }
+ hide();
+ });
};
return (
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/view/model/SyncPrompts/config.tsx b/src/view/model/SyncPrompts/config.tsx
index b8b4ade..b6381de 100644
--- a/src/view/model/SyncPrompts/config.tsx
+++ b/src/view/model/SyncPrompts/config.tsx
@@ -41,8 +41,6 @@ export const syncColumns = () => [
dataIndex: 'prompt',
key: 'prompt',
// width: 300,
- render: (v: string) => (
- {v}
- ),
+ render: (v: string) => {v},
},
];
diff --git a/src/view/model/SyncPrompts/index.scss b/src/view/model/SyncPrompts/index.scss
index 4e3ba63..0c7fb60 100644
--- a/src/view/model/SyncPrompts/index.scss
+++ b/src/view/model/SyncPrompts/index.scss
@@ -1,4 +1,5 @@
-.chat-table-tip, .chat-table-btns {
+.chat-table-tip,
+.chat-table-btns {
display: flex;
justify-content: space-between;
}
diff --git a/src/view/model/SyncPrompts/index.tsx b/src/view/model/SyncPrompts/index.tsx
index 8a26a84..e983d37 100644
--- a/src/view/model/SyncPrompts/index.tsx
+++ b/src/view/model/SyncPrompts/index.tsx
@@ -52,7 +52,7 @@ export default function SyncPrompts() {
}, [opInfo.opTime]);
const handleEnable = (isEnable: boolean) => {
- const data = opReplaceItems(selectedRowIDs, { enable: isEnable })
+ const data = opReplaceItems(selectedRowIDs, { enable: isEnable });
modelCacheSet(data);
};
@@ -72,7 +72,9 @@ export default function SyncPrompts() {
{selectedItems.length > 0 && (
<>
-
+
Selected {selectedItems.length} items
>
@@ -84,7 +86,11 @@ export default function SyncPrompts() {
- {lastUpdated && Last updated on {fmtDate(lastUpdated)}}
+ {lastUpdated && (
+
+ Last updated on {fmtDate(lastUpdated)}
+
+ )}
{record.prompt}
}}
+ expandable={{
+ expandedRowRender: (record) => {record.prompt}
,
+ }}
/>
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/view/model/SyncRecord/config.tsx b/src/view/model/SyncRecord/config.tsx
index 71321ca..66ffd23 100644
--- a/src/view/model/SyncRecord/config.tsx
+++ b/src/view/model/SyncRecord/config.tsx
@@ -25,7 +25,11 @@ export const syncColumns = () => [
key: 'tags',
// width: 150,
render: (v: string[]) => (
- {v?.map(i => {i})}
+
+ {v?.map((i) => (
+ {i}
+ ))}
+
),
},
{
@@ -43,8 +47,6 @@ export const syncColumns = () => [
dataIndex: 'prompt',
key: 'prompt',
// width: 300,
- render: (v: string) => (
- {v}
- ),
+ render: (v: string) => {v},
},
];
diff --git a/src/view/model/SyncRecord/index.tsx b/src/view/model/SyncRecord/index.tsx
index b74344a..d8b60ca 100644
--- a/src/view/model/SyncRecord/index.tsx
+++ b/src/view/model/SyncRecord/index.tsx
@@ -30,7 +30,7 @@ export default function SyncRecord() {
useInit(async () => {
setFilePath(await getPath(state));
setJsonPath(await path.join(await chatRoot(), 'cache_model', `${state?.id}.json`));
- })
+ });
useEffect(() => {
if (modelCacheJson.length <= 0) return;
@@ -45,7 +45,7 @@ export default function SyncRecord() {
}, [opInfo.opTime]);
const handleEnable = (isEnable: boolean) => {
- const data = opReplaceItems(selectedRowIDs, { enable: isEnable })
+ const data = opReplaceItems(selectedRowIDs, { enable: isEnable });
modelCacheSet(data);
};
@@ -58,7 +58,9 @@ export default function SyncRecord() {
{selectedItems.length > 0 && (
<>
-
+
Selected {selectedItems.length} items
>
@@ -70,7 +72,11 @@ export default function SyncRecord() {
- {state?.last_updated && Last updated on {fmtDate(state?.last_updated)}}
+ {state?.last_updated && (
+
+ Last updated on {fmtDate(state?.last_updated)}
+
+ )}
{record.prompt}
}}
+ expandable={{
+ expandedRowRender: (record) => {record.prompt}
,
+ }}
/>
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/view/model/UserCustom/Form.tsx b/src/view/model/UserCustom/Form.tsx
index c810a77..9d4e306 100644
--- a/src/view/model/UserCustom/Form.tsx
+++ b/src/view/model/UserCustom/Form.tsx
@@ -6,7 +6,7 @@ import Tags from '@comps/Tags';
import { DISABLE_AUTO_COMPLETE } from '@/utils';
interface UserCustomFormProps {
- record?: Record | null;
+ record?: Record | null;
}
const initFormValue = {
@@ -16,7 +16,10 @@ const initFormValue = {
prompt: '',
};
-const UserCustomForm: ForwardRefRenderFunction = ({ record }, ref) => {
+const UserCustomForm: ForwardRefRenderFunction = (
+ { record },
+ ref,
+) => {
const [form] = Form.useForm();
useImperativeHandle(ref, () => ({ form }));
@@ -27,11 +30,7 @@ const UserCustomForm: ForwardRefRenderFunction =
}, [record]);
return (
- =
- )
-}
+ );
+};
export default forwardRef(UserCustomForm);
diff --git a/src/view/model/UserCustom/config.tsx b/src/view/model/UserCustom/config.tsx
index 0450043..162dc66 100644
--- a/src/view/model/UserCustom/config.tsx
+++ b/src/view/model/UserCustom/config.tsx
@@ -7,7 +7,7 @@ export const modelColumns = () => [
fixed: 'left',
width: 120,
key: 'cmd',
- render: (v: string) => /{v}
+ render: (v: string) => /{v},
},
{
title: 'Act',
@@ -21,7 +21,11 @@ export const modelColumns = () => [
key: 'tags',
width: 150,
render: (v: string[]) => (
- {v?.map(i => {i})}
+
+ {v?.map((i) => (
+ {i}
+ ))}
+
),
},
{
@@ -39,9 +43,7 @@ export const modelColumns = () => [
dataIndex: 'prompt',
key: 'prompt',
width: 300,
- render: (v: string) => (
- {v}
- ),
+ render: (v: string) => {v},
},
{
title: 'Action',
@@ -61,5 +63,5 @@ export const modelColumns = () => [
),
- }
+ },
];
diff --git a/src/view/model/UserCustom/index.tsx b/src/view/model/UserCustom/index.tsx
index a98615a..591d35f 100644
--- a/src/view/model/UserCustom/index.tsx
+++ b/src/view/model/UserCustom/index.tsx
@@ -50,10 +50,10 @@ export default function LanguageModel() {
const data = opReplace(opInfo?.opRecord?.[opSafeKey], opInfo?.opRecord);
modelCacheSet(data);
}
- }, [opInfo.opTime])
+ }, [opInfo.opTime]);
const handleEnable = (isEnable: boolean) => {
- const data = opReplaceItems(selectedRowIDs, { enable: isEnable })
+ const data = opReplaceItems(selectedRowIDs, { enable: isEnable });
modelCacheSet(data);
};
@@ -63,38 +63,51 @@ export default function LanguageModel() {
};
const handleOk = () => {
- formRef.current?.form?.validateFields()
- .then(async (vals: Record) => {
- if (modelCacheJson.map((i: any) => i.cmd).includes(vals.cmd) && opInfo?.opRecord?.cmd !== vals.cmd) {
- message.warning(`"cmd: /${vals.cmd}" already exists, please change the "${vals.cmd}" name and resubmit.`);
- return;
- }
- let data = [];
- switch (opInfo.opType) {
- case 'new': data = opAdd(vals); break;
- case 'edit': data = opReplace(opInfo?.opRecord?.[opSafeKey], vals); break;
- default: break;
- }
- await modelCacheSet(data);
- opInit(data);
- modelSet({
- id: 'user_custom',
- last_updated: Date.now(),
- });
- hide();
- })
+ formRef.current?.form?.validateFields().then(async (vals: Record) => {
+ if (
+ modelCacheJson.map((i: any) => i.cmd).includes(vals.cmd) &&
+ opInfo?.opRecord?.cmd !== vals.cmd
+ ) {
+ message.warning(
+ `"cmd: /${vals.cmd}" already exists, please change the "${vals.cmd}" name and resubmit.`,
+ );
+ return;
+ }
+ let data = [];
+ switch (opInfo.opType) {
+ case 'new':
+ data = opAdd(vals);
+ break;
+ case 'edit':
+ data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);
+ break;
+ default:
+ break;
+ }
+ await modelCacheSet(data);
+ opInit(data);
+ modelSet({
+ id: 'user_custom',
+ last_updated: Date.now(),
+ });
+ hide();
+ });
};
- const modalTitle = `${({ new: 'Create', edit: 'Edit' })[opInfo.opType]} Model`;
+ const modalTitle = `${{ new: 'Create', edit: 'Edit' }[opInfo.opType]} Model`;
return (
-
+
{selectedItems.length > 0 && (
<>
-
+
Selected {selectedItems.length} items
>
@@ -103,7 +116,11 @@ export default function LanguageModel() {
- {lastUpdated && Last updated on {fmtDate(lastUpdated)}}
+ {lastUpdated && (
+
+ Last updated on {fmtDate(lastUpdated)}
+
+ )}
{record.prompt}
}}
+ expandable={{
+ expandedRowRender: (record) => {record.prompt}
,
+ }}
/>
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/view/notes/config.tsx b/src/view/notes/config.tsx
index 224aea9..53ed522 100644
--- a/src/view/notes/config.tsx
+++ b/src/view/notes/config.tsx
@@ -41,7 +41,9 @@ export const notesColumns = () => [
return (
actions.setRecord(row, 'preview')}>Preview
- Edit
+
+ Edit
+
actions.setRecord(row, 'delete')}
@@ -51,20 +53,20 @@ export const notesColumns = () => [
Delete
- )
- }
- }
+ );
+ },
+ },
];
const RenderPath = ({ row }: any) => {
const [filePath, setFilePath] = useState('');
useInit(async () => {
- setFilePath(await getPath(row));
- })
+ setFilePath(await getPath(row));
+ });
return shell.open(filePath)}>{filePath};
};
export const getPath = async (row: any) => {
const isImg = ['png'].includes(row?.ext);
- return await path.join(await chatRoot(), 'notes', row.id) + `.${row.ext}`;
-}
+ return (await path.join(await chatRoot(), 'notes', row.id)) + `.${row.ext}`;
+};
diff --git a/src/view/notes/index.tsx b/src/view/notes/index.tsx
index c007ea1..9bbc626 100644
--- a/src/view/notes/index.tsx
+++ b/src/view/notes/index.tsx
@@ -46,8 +46,8 @@ export default function Notes() {
message.success('Name has been changed!');
}
opInfo.resetRecord();
- })()
- }, [opInfo.opType])
+ })();
+ }, [opInfo.opType]);
const handleDelete = async () => {
if (opData?.length === selectedRows.length) {
@@ -62,7 +62,7 @@ export default function Notes() {
const file = await path.join(await chatRoot(), 'notes', `${i?.id}.${i?.ext}`);
await fs.removeFile(file);
return file;
- })
+ });
Promise.all(rows).then(async () => {
await handleRefresh();
message.success('All files selected are cleared!');
@@ -122,5 +122,5 @@ export default function Notes() {
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/view/settings/General.tsx b/src/view/settings/General.tsx
index 9b2189d..88207b1 100644
--- a/src/view/settings/General.tsx
+++ b/src/view/settings/General.tsx
@@ -9,37 +9,47 @@ import { DISABLE_AUTO_COMPLETE } from '@/utils';
const AutoUpdateLabel = () => {
return (
- Auto Update
- {' '}
-
- Auto Update Policy
- Prompt: prompt to install
- Silent: install silently
- {/* Disable: disable auto update
*/}
-
- )}>
+ Auto Update{' '}
+
+ Auto Update Policy
+
+ Prompt: prompt to install
+
+
+ Silent: install silently
+
+ {/* Disable: disable auto update
*/}
+
+ }
+ >
+
+
- )
-}
+ );
+};
const GlobalShortcutLabel = () => {
return (
- )}>
+ Global Shortcut{' '}
+
+ Shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q
+ If empty, the shortcut is disabled.
+
+ https://tauri.app/v1/api/js/globalshortcut
+
+
+ }
+ >
- )
-}
+ );
+};
export default function General() {
const [platformInfo, setPlatform] = useState('');
@@ -62,9 +72,7 @@ export default function General() {
Light
Dark
- {["darwin", "windows"].includes(platformInfo) && (
- System
- )}
+ {['darwin', 'windows'].includes(platformInfo) && System}
} name="auto_update">
@@ -78,5 +86,5 @@ export default function General() {
>
- )
+ );
}
diff --git a/src/view/settings/MainWindow.tsx b/src/view/settings/MainWindow.tsx
index d5e511e..99a7378 100644
--- a/src/view/settings/MainWindow.tsx
+++ b/src/view/settings/MainWindow.tsx
@@ -9,25 +9,39 @@ import { DISABLE_AUTO_COMPLETE } from '@/utils';
const OriginLabel = ({ url }: { url: string }) => {
return (
- Switch Origin
+ Switch Origin{' '}
+
+
+
- )
-}
+ );
+};
const PopupSearchLabel = () => {
return (
- Pop-up Search
- {' '}
-
- Generate images according to the content: Select the ChatGPT content with the mouse, no more than 400 characters. the DALL·E 2 button appears, and click to jump (Note: because the search content filled by the script cannot trigger the event directly, you need to enter a space in the input box to make the button clickable).
- The application is built using Tauri, and due to its security restrictions, some of the action buttons will not work, so we recommend going to your browser.
-
- )}>
+ Pop-up Search{' '}
+
+
+ Generate images according to the content: Select the ChatGPT content with the mouse,
+ no more than 400 characters. the DALL·E 2 button appears, and click to jump
+ (Note: because the search content filled by the script cannot trigger the event
+ directly, you need to enter a space in the input box to make the button clickable).
+
+
+ The application is built using Tauri, and due to its security restrictions, some of
+ the action buttons will not work, so we recommend going to your browser.
+
+
+ }
+ >
+
+
- )
-}
+ );
+};
export default function General() {
const [chatConf, setChatConf] = useState(null);
@@ -46,8 +60,12 @@ export default function General() {
-
+
>
- )
+ );
}
diff --git a/src/view/settings/TrayWindow.tsx b/src/view/settings/TrayWindow.tsx
index 7ee94f1..8fcab50 100644
--- a/src/view/settings/TrayWindow.tsx
+++ b/src/view/settings/TrayWindow.tsx
@@ -9,8 +9,12 @@ export default function General() {
-
+
>
- )
+ );
}
diff --git a/src/view/settings/index.tsx b/src/view/settings/index.tsx
index a6a442a..96f87f8 100644
--- a/src/view/settings/index.tsx
+++ b/src/view/settings/index.tsx
@@ -21,7 +21,7 @@ export default function Settings() {
useEffect(() => {
form.setFieldsValue(clone(chatConf));
- }, [chatConf])
+ }, [chatConf]);
const onCancel = () => {
form.setFieldsValue(chatConf);
@@ -31,7 +31,7 @@ export default function Settings() {
const chatData = await invoke('reset_chat_conf');
setChatConf(chatData);
const isOk = await dialog.ask(`Configuration reset successfully, whether to restart?`, {
- title: 'ChatGPT Preferences'
+ title: 'ChatGPT Preferences',
});
if (isOk) {
process.relaunch();
@@ -44,7 +44,7 @@ export default function Settings() {
if (!isEqual(omit(chatConf, ['default_origin']), values)) {
await invoke('form_confirm', { data: values, label: 'main' });
const isOk = await dialog.ask(`Configuration saved successfully, whether to restart?`, {
- title: 'ChatGPT Preferences'
+ title: 'ChatGPT Preferences',
});
if (isOk) {
process.relaunch();
@@ -75,11 +75,15 @@ export default function Settings() {
-
-
+
+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/tsconfig.json b/tsconfig.json
index 474aa73..9505215 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -20,7 +20,7 @@
"@/*": ["src/*"],
"@view/*": ["src/view/*"],
"@comps/*": ["src/components/*"],
- "@layout/*": ["src/layout/*"],
+ "@layout/*": ["src/layout/*"]
}
},
"include": ["src"],
diff --git a/vite.config.ts b/vite.config.ts
index debf8b2..c69da5d 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,6 +1,6 @@
-import { defineConfig } from "vite";
-import react from "@vitejs/plugin-react";
-import tsconfigPaths from "vite-tsconfig-paths";
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+import tsconfigPaths from 'vite-tsconfig-paths';
// https://vitejs.dev/config/
export default defineConfig({
@@ -16,12 +16,12 @@ export default defineConfig({
},
// to make use of `TAURI_DEBUG` and other env variables
// https://tauri.studio/v1/api/config#buildconfig.beforedevcommand
- envPrefix: ["VITE_", "TAURI_"],
+ envPrefix: ['VITE_', 'TAURI_'],
build: {
// Tauri supports es2021
- target: ["es2021", "chrome100", "safari13"],
+ target: ['es2021', 'chrome100', 'safari13'],
// don't minify for debug builds
- minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
+ minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
// produce sourcemaps for debug builds
sourcemap: !!process.env.TAURI_DEBUG,
},