1
0
mirror of https://github.com/lencx/ChatGPT.git synced 2024-10-01 01:06:13 -04:00

chore: style

This commit is contained in:
lencx 2023-05-25 13:04:59 +08:00
parent 55eb719e5c
commit f50dd4fc6a
5 changed files with 16 additions and 14 deletions

2
scripts/chat.js vendored
View File

@ -114,6 +114,8 @@ function chatInit() {
currentIndex = -1;
};
}
init();
}
if (document.readyState === 'complete' || document.readyState === 'interactive') {

View File

@ -7,7 +7,7 @@
},
"package": {
"productName": "ChatGPT",
"version": "1.0.0"
"version": "0.12.0"
},
"tauri": {
"allowlist": {

4
src/main.scss vendored
View File

@ -136,3 +136,7 @@ body,
margin-left: 5px;
}
}
.ant-message {
max-width: 500px;
}

View File

@ -48,23 +48,12 @@ export const scriptColumns = ({ scriptsMap }: any) => [
return <a onClick={() => shell.open(uri)}>{uri}</a>;
},
},
{
title: 'Created',
dataIndex: 'created',
key: 'created',
width: 150,
render: fmtDate,
},
{
title: 'Action',
fixed: 'right',
width: 100,
render: (_: any, row: any, actions: any) => {
const isExternal = row.name === 'main.js';
const next = scriptsMap?.[row.name]?.next_version;
const curr = scriptsMap?.[row.name]?.curr_version;
return (
<Space>
<Link
@ -74,7 +63,7 @@ export const scriptColumns = ({ scriptsMap }: any) => [
>
Edit
</Link>
{!isExternal && next && next !== curr && (
{!isExternal && (
<Popconfirm
placement="topLeft"
title="Are you sure you want to synchronize? It will overwrite all previous modifications made to this file."

View File

@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { Table } from 'antd';
import { Table, message } from 'antd';
import { path, fs, invoke } from '@tauri-apps/api';
import useInit from '@/hooks/useInit';
@ -53,6 +53,13 @@ export default function Scripts() {
if (isOk) {
await handleInit();
opInfo.resetRecord();
message.success(
`The ${opInfo?.opRecord?.name} script has been synchronized successfully`,
);
} else {
message.error(
`The ${opInfo?.opRecord?.name} script synchronization failed. You can try editing the script and click the Remote File link to copy the source code.`,
);
}
}
})();