feat(gpt-runner-core): add chat page

This commit is contained in:
JinmingYang
2023-05-15 23:17:57 +08:00
parent 75af0d850a
commit c8d3290b15
4 changed files with 16 additions and 6 deletions

View File

@@ -4,8 +4,6 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta http-equiv="Content-Security-Policy"
content="default-src 'none'; font-src ${webview.cspSource}; style-src ${webview.cspSource} 'unsafe-inline' ; script-src 'nonce-${nonce}';">
<title>GPT Runner</title>
<link href="/codicon/codicon.css" rel="stylesheet" />
</head>

View File

@@ -0,0 +1,9 @@
import type { FC } from 'react'
const Chat: FC = () => {
return <>chat</>
}
Chat.displayName = 'Chat'
export default Chat

View File

@@ -5,6 +5,7 @@ import { VSCodeProgressRing } from '@vscode/webview-ui-toolkit/react'
import Home from './pages/home/index'
import Error404 from './pages/error/404'
import { useLoading } from './hooks/use-loading.hook'
import Chat from './pages/chat'
export const AppRouter: FC = () => {
const { loading } = useLoading()
@@ -16,10 +17,7 @@ export const AppRouter: FC = () => {
<Router>
<Routes>
<Route index element={<Home />} />
{/* Using path="*"" means "match anything", so this route
acts like a catch-all for URLs that we don't have explicit
routes for. */}
<Route path="chat" element={<Chat />} />
<Route path="*" element={<Error404 />} />
</Routes>
</Router>

View File

@@ -7,7 +7,12 @@ const resolvePath = (...paths: string[]) => path.resolve(__dirname, ...paths)
// https://vitejs.dev/config/
export default defineConfig({
root: resolvePath('./'),
publicDir: resolvePath('./public'),
plugins: [
React(),
],
server: {
port: 3006,
host: true,
},
})