Skip to content

Commit c8d3290

Browse files
committed
feat(gpt-runner-core): add chat page
1 parent 75af0d8 commit c8d3290

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

packages/gpt-runner-core/client/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<head>
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
7-
<meta http-equiv="Content-Security-Policy"
8-
content="default-src 'none'; font-src ${webview.cspSource}; style-src ${webview.cspSource} 'unsafe-inline' ; script-src 'nonce-${nonce}';">
97
<title>GPT Runner</title>
108
<link href="/codicon/codicon.css" rel="stylesheet" />
119
</head>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { FC } from 'react'
2+
3+
const Chat: FC = () => {
4+
return <>chat</>
5+
}
6+
7+
Chat.displayName = 'Chat'
8+
9+
export default Chat

packages/gpt-runner-core/client/src/router.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { VSCodeProgressRing } from '@vscode/webview-ui-toolkit/react'
55
import Home from './pages/home/index'
66
import Error404 from './pages/error/404'
77
import { useLoading } from './hooks/use-loading.hook'
8+
import Chat from './pages/chat'
89

910
export const AppRouter: FC = () => {
1011
const { loading } = useLoading()
@@ -16,10 +17,7 @@ export const AppRouter: FC = () => {
1617
<Router>
1718
<Routes>
1819
<Route index element={<Home />} />
19-
20-
{/* Using path="*"" means "match anything", so this route
21-
acts like a catch-all for URLs that we don't have explicit
22-
routes for. */}
20+
<Route path="chat" element={<Chat />} />
2321
<Route path="*" element={<Error404 />} />
2422
</Routes>
2523
</Router>

packages/gpt-runner-core/client/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const resolvePath = (...paths: string[]) => path.resolve(__dirname, ...paths)
77
// https://vitejs.dev/config/
88
export default defineConfig({
99
root: resolvePath('./'),
10+
publicDir: resolvePath('./public'),
1011
plugins: [
1112
React(),
1213
],
14+
server: {
15+
port: 3006,
16+
host: true,
17+
},
1318
})

0 commit comments

Comments
 (0)