diff --git a/src/layout/index.tsx b/src/layout/index.tsx
index f1a331d..6e59c8c 100644
--- a/src/layout/index.tsx
+++ b/src/layout/index.tsx
@@ -23,8 +23,8 @@ export default function ChatLayout() {
if (location.search === '?type=control') {
go('/settings');
}
- if (location.search === '?type=preview') {
- go('/?type=preview');
+ if (location.search === '?type=scripts') {
+ go('/scripts');
}
setMenuKey(location.pathname);
setDashboard(location.pathname === '/');
@@ -88,7 +88,7 @@ export default function ChatLayout() {
theme={appInfo.appTheme === 'dark' ? 'dark' : 'light'}
inlineIndent={12}
items={menuItems}
- // defaultOpenKeys={['/model']}
+ // defaultOpenKeys={['/prompts']}
onClick={(i) => go(i.key)}
/>
diff --git a/src/main.scss b/src/main.scss
index c7c6441..58a48eb 100644
--- a/src/main.scss
+++ b/src/main.scss
@@ -73,6 +73,11 @@ body,
}
}
+.action-btn,
+.file-path {
+ cursor: pointer;
+}
+
.chat-file-path {
font-size: 12px;
font-weight: 500;
@@ -109,3 +114,29 @@ body,
cursor: pointer;
}
}
+
+.editor-task {
+ margin-bottom: 5px;
+ display: flex;
+ justify-content: space-between;
+
+ .ant-breadcrumb-link {
+ padding: 3px 5px;
+ transition: all 300ms ease;
+ border-radius: 4px;
+ &:hover {
+ color: rgba(120, 120, 90, 0.88);
+ background-color: rgba(40, 40, 40, 0.06);
+ cursor: pointer;
+ }
+ }
+
+ .editor-btn {
+ cursor: pointer;
+ margin-left: 5px;
+ }
+}
+
+.ant-message {
+ max-width: 500px;
+}
diff --git a/src/routes.tsx b/src/routes.tsx
index 66910fb..e310f19 100644
--- a/src/routes.tsx
+++ b/src/routes.tsx
@@ -5,24 +5,22 @@ import {
SyncOutlined,
FileSyncOutlined,
UserOutlined,
- DownloadOutlined,
FormOutlined,
- GlobalOutlined,
InfoCircleOutlined,
+ CodeOutlined,
} from '@ant-design/icons';
import type { MenuProps } from 'antd';
import Settings from '@/view/settings';
import About from '@/view/about';
-import Awesome from '@/view/awesome';
-import UserCustom from '@/view/model/UserCustom';
-import SyncPrompts from '@/view/model/SyncPrompts';
-import SyncCustom from '@/view/model/SyncCustom';
-import SyncRecord from '@/view/model/SyncRecord';
-import Download from '@/view/download';
+import Scripts from '@/view/scripts';
+import ScriptsEditor from '@/view/scripts/Editor';
+import UserCustom from '@/view/prompts/UserCustom';
+import SyncPrompts from '@/view/prompts/SyncPrompts';
+import SyncCustom from '@/view/prompts/SyncCustom';
+import SyncRecord from '@/view/prompts/SyncRecord';
import Notes from '@/view/notes';
import Markdown from '@/view/markdown';
-import Dashboard from '@/view/dashboard';
export type ChatRouteMetaObject = {
label: string;
@@ -46,14 +44,6 @@ export const routes: Array
= [
icon: ,
},
},
- {
- path: '/awesome',
- element: ,
- meta: {
- label: 'Awesome',
- icon: ,
- },
- },
{
path: '/notes',
element: ,
@@ -68,9 +58,9 @@ export const routes: Array = [
hideMenu: true,
},
{
- path: '/model',
+ path: '/prompts',
meta: {
- label: 'Language Model',
+ label: 'Prompts',
icon: ,
},
children: [
@@ -107,13 +97,18 @@ export const routes: Array = [
],
},
{
- path: '/download',
- element: ,
+ path: '/scripts',
+ element: ,
meta: {
- label: 'Download',
- icon: ,
+ label: 'Scripts',
+ icon: ,
},
},
+ {
+ path: '/scripts/:id',
+ element: ,
+ hideMenu: true,
+ },
{
path: '/about',
element: ,
@@ -124,8 +119,7 @@ export const routes: Array = [
},
{
path: '/',
- element: ,
- hideMenu: true,
+ element: ,
},
];
diff --git a/src/utils.ts b/src/utils.ts
index f1f62b5..45e5f9c 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -3,8 +3,8 @@ import { homeDir, join, dirname } from '@tauri-apps/api/path';
import dayjs from 'dayjs';
export const APP_CONF_JSON = 'chat.conf.json';
-export const CHAT_MODEL_JSON = 'chat.model.json';
-export const CHAT_MODEL_CMD_JSON = 'chat.model.cmd.json';
+export const CHAT_PROMPT_JSON = 'chat.prompt.json';
+export const CHAT_PROMPT_CMD_JSON = 'chat.prompt.cmd.json';
export const CHAT_DOWNLOAD_JSON = 'chat.download.json';
export const CHAT_AWESOME_JSON = 'chat.awesome.json';
export const CHAT_NOTES_JSON = 'chat.notes.json';
@@ -23,8 +23,12 @@ export const chatRoot = async () => {
return join(await homeDir(), '.chatgpt');
};
-export const chatModelPath = async (): Promise => {
- return join(await chatRoot(), CHAT_MODEL_JSON);
+export const scriptRoot = async () => {
+ return join(await chatRoot(), 'scripts');
+};
+
+export const chatPromptPath = async (): Promise => {
+ return join(await chatRoot(), CHAT_PROMPT_JSON);
};
export const chatPromptsPath = async (): Promise => {
diff --git a/src/view/about/index.tsx b/src/view/about/index.tsx
index 8ec8b34..e8c9680 100644
--- a/src/view/about/index.tsx
+++ b/src/view/about/index.tsx
@@ -69,10 +69,6 @@ const AboutChatGPT = () => {
src="https://user-images.githubusercontent.com/16164244/207228025-117b5f77-c5d2-48c2-a070-774b7a1596f2.png"
/>
-
);
};
diff --git a/src/view/dashboard/index.tsx b/src/view/dashboard/index.tsx
index 0f9b851..40c9c8e 100644
--- a/src/view/dashboard/index.tsx
+++ b/src/view/dashboard/index.tsx
@@ -61,8 +61,11 @@ export default function Dashboard() {
No data