Skip to content

Commit

Permalink
chore: version 2.8.0 (#140)
Browse files Browse the repository at this point in the history
* fix: 用户输入换行符号被忽略的问题[#137]

* feat: 输入框添加换行提示,移动端`Enter` 判定换行而不是提交[#135]

* feat: 调整标签

* chore: version 2.8.0
  • Loading branch information
Chanzhaoyu authored Feb 27, 2023
1 parent 3e9db49 commit 89712aa
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 9 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## v2.8.0

`2023-02-27`

- 感谢 [puppywang](https://github.com/Chanzhaoyu/chatgpt-web/commit/628187f5c3348bda0d0518f90699a86525d19018) 修复了 `2.7.0` 版本中关于流输出数据的问题(使用 `nginx` 需要自行配置 `octet-stream` 相关内容)

- 关于为什么使用 `octet-stream` 而不是 `sse`,是因为更好的兼容之前的模式。

- 建议更新到此版本获得比较完整的体验

### Enhancement
- 优化了部份代码和类型提示
- 输入框添加换行提示
- 移动端输入框现在回车为换行,而不是直接提交
- 移动端双击标题返回顶部,箭头返回底部

### BugFix
- 流输出数据下的问题[#122]
- 修复了 `API Key` 下部份代码不换行的问题
- 修复移动端深色模式部份样式问题[#123][#126]
- 修复主题模式图标不一致的问题[#126]

## v2.7.3

`2023-02-25`
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

> 使用 `express``vue3` 搭建的支持 `ChatGPT` 双模型演示网页
![cover](./docs/c1.png)
![cover2](./docs/c2.png)
![cover](./docs/c1-2.8.0.png)
![cover2](./docs/c2-2.8.0.png)

- [ChatGPT Web](#chatgpt-web)
- [介绍](#介绍)
Expand All @@ -30,6 +30,7 @@
- [前端网页](#前端网页-1)
- [常见问题](#常见问题)
- [参与贡献](#参与贡献)
- [赞助](#赞助)
- [License](#license)
## 介绍

Expand All @@ -44,6 +45,8 @@
1. `ChatGPTAPI` 使用 `text-davinci-003` 通过官方`OpenAI`补全`API`模拟`ChatGPT`(最稳健的方法,但它不是免费的,并且没有使用针对聊天进行微调的模型)
2. `ChatGPTUnofficialProxyAPI` 使用非官方代理服务器访问 `ChatGPT` 的后端`API`,绕过`Cloudflare`(使用真实的的`ChatGPT`,非常轻量级,但依赖于第三方服务器,并且有速率限制)

[查看详情](https://github.com/Chanzhaoyu/chatgpt-web/issues/138)

切换方式:
1. 进入 `service/.env` 文件
2. 使用 `OpenAI API Key` 请填写 `OPENAI_API_KEY` 字段 [(获取 apiKey)](https://platform.openai.com/overview)
Expand Down Expand Up @@ -255,5 +258,20 @@ A: `vscode` 请安装项目推荐插件,或手动安装 `Eslint` 插件。
<img src="https://contrib.rocks/image?repo=Chanzhaoyu/chatgpt-web" />
</a>

## 赞助

如果你觉得这个项目对你有帮助,并且情况允许的话,可以给我一点点支持,总之非常感谢支持~

<div style="display: flex; gap: 20px;">
<div style="text-align: center">
<img style="max-width: 100%" src="./docs/wechat.png" alt="微信" />
<p>WeChat Pay</p>
</div>
<div style="text-align: center">
<img style="max-width: 100%" src="./docs/alipay.png" alt="支付宝" />
<p>Alipay</p>
</div>
</div>

## License
MIT © [ChenZhaoYu](./license)
Binary file added docs/alipay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/c1-2.8.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/c2-2.8.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wechat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chatgpt-web",
"version": "2.7.3",
"version": "2.8.0",
"private": false,
"description": "ChatGPT Web",
"author": "ChenZhaoYu <chenzhaoyu1994@gmail.com>",
Expand Down
4 changes: 2 additions & 2 deletions src/views/chat/components/Message/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const text = computed(() => {
</template>
<template v-else>
<div class="leading-relaxed break-all">
<div v-if="!inversion" class="markdown-body" v-html="text" />
<div v-else v-text="text" />
<pre v-if="!inversion" class="markdown-body" v-html="text" />
<div v-else class="whitespace-pre-wrap" v-text="text" />
</div>
</template>
</div>
Expand Down
16 changes: 12 additions & 4 deletions src/views/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ function handleClear() {
}
function handleEnter(event: KeyboardEvent) {
if (event.key === 'Enter' && !event.shiftKey) {
event.preventDefault()
handleSubmit()
if (!isMobile.value) {
if (event.key === 'Enter' && !event.shiftKey) {
event.preventDefault()
handleSubmit()
}
}
}
Expand All @@ -279,6 +281,12 @@ function handleStop() {
}
}
const placeholder = computed(() => {
if (isMobile.value)
return 'Ask me anything...'
return 'Ask me anything... (Shift + Enter = line break)'
})
const buttonDisabled = computed(() => {
return loading.value || !prompt.value || prompt.value.trim() === ''
})
Expand Down Expand Up @@ -358,7 +366,7 @@ onUnmounted(() => {
v-model:value="prompt"
type="textarea"
:autosize="{ minRows: 1, maxRows: 2 }"
placeholder="Ask me anything..."
:placeholder="placeholder"
@keypress="handleEnter"
/>
<NButton type="primary" :disabled="buttonDisabled" @click="handleSubmit">
Expand Down

0 comments on commit 89712aa

Please sign in to comment.