diff --git a/README.md b/README.md index ca08c2c61..a0d4e68a0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ One-Click to deploy your own ChatGPT web UI. -[演示 Demo](https://chat-gpt-next-web.vercel.app/) / [反馈 Issues](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [加入 Discord](https://discord.gg/zrhvHCr79N) / [微信群](https://user-images.githubusercontent.com/16968934/227772522-b3ba3713-9206-4c8d-a81f-22300b7c313a.jpg) / [打赏开发者](https://user-images.githubusercontent.com/16968934/227772541-5bcd52d8-61b7-488c-a203-0330d8006e2b.jpg) +[演示 Demo](https://chat-gpt-next-web.vercel.app/) / [反馈 Issues](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [加入 Discord](https://discord.gg/zrhvHCr79N) / [QQ 群](https://user-images.githubusercontent.com/16968934/228190818-7dd00845-e9b9-4363-97e5-44c507ac76da.jpeg) / [打赏开发者](https://user-images.githubusercontent.com/16968934/227772541-5bcd52d8-61b7-488c-a203-0330d8006e2b.jpg) [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FYidadaa%2FChatGPT-Next-Web&env=OPENAI_API_KEY&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web) @@ -116,18 +116,10 @@ OPENAI_API_KEY= 2. 执行 `yarn install && yarn dev` 即可。 ### 本地部署 Local Deployment - -请直接询问 ChatGPT,使用下列 Prompt: - -``` -如何使用 pm2 和 yarn 部署 nextjs 项目到 ubuntu 服务器上,项目编译命令为 yarn build,启动命令为 yarn start,启动时需要设置环境变量为 OPENAI_API_KEY,端口为 3000,使用 ngnix 做反向代理 +```shell +bash <(curl -s https://raw.githubusercontent.com/Yidadaa/ChatGPT-Next-Web/main/scripts/setup.sh) ``` -Please ask ChatGPT with prompt: - -``` -how to deploy nextjs project with pm2 and yarn on my ubuntu server, the build command is `yarn build`, the start command is `yarn start`, the project must start with env var named `OPENAI_API_KEY`, the port is 3000, use ngnix -``` ### 容器部署 Docker Deployment @@ -159,12 +151,14 @@ If you would like to contribute your API key, you can email it to the author and [@mushan0x0](https://github.com/mushan0x0) [@ClarenceDan](https://github.com/ClarenceDan) +[@zhangjia](https://github.com/zhangjia) ### 贡献者 Contributor [@AprilNEA](https://github.com/AprilNEA) [@iSource](https://github.com/iSource) [@iFwu](https://github.com/iFwu) +[@xiaotianxt](https://github.com/xiaotianxt) ## LICENSE diff --git a/app/api/access.ts b/app/api/access.ts index 13ada2140..d3e4c9cf9 100644 --- a/app/api/access.ts +++ b/app/api/access.ts @@ -14,3 +14,4 @@ export function getAccessCodes(): Set { } export const ACCESS_CODES = getAccessCodes(); +export const IS_IN_DOCKER = process.env.DOCKER; diff --git a/app/components/home.tsx b/app/components/home.tsx index 2526f2325..850c51774 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -131,10 +131,12 @@ function useSubmitHandler() { (config.submitKey === SubmitKey.AltEnter && e.altKey) || (config.submitKey === SubmitKey.CtrlEnter && e.ctrlKey) || (config.submitKey === SubmitKey.ShiftEnter && e.shiftKey) || + (config.submitKey === SubmitKey.MetaEnter && e.metaKey) || (config.submitKey === SubmitKey.Enter && !e.altKey && !e.ctrlKey && - !e.shiftKey) + !e.shiftKey && + !e.metaKey) ); }; @@ -163,6 +165,7 @@ export function Chat(props: { showSideBar?: () => void }) { setIsLoading(true); onUserInput(userInput).then(() => setIsLoading(false)); setUserInput(""); + inputRef.current?.focus(); }; // stop response @@ -203,6 +206,7 @@ export function Chat(props: { showSideBar?: () => void }) { // for auto-scroll const latestMessageRef = useRef(null); + const inputRef = useRef(null); // wont scroll while hovering messages const [autoScroll, setAutoScroll] = useState(false); @@ -371,6 +375,7 @@ export function Chat(props: { showSideBar?: () => void }) {