chore(version): 0.8.23
This commit is contained in:
parent
ae1960f5c6
commit
e5c1791135
@ -66,4 +66,3 @@ releaseInfo:
|
|||||||
修复快捷键设置错误导致的无法启动问题
|
修复快捷键设置错误导致的无法启动问题
|
||||||
修复翻译按钮无法正常输出内容问题
|
修复翻译按钮无法正常输出内容问题
|
||||||
修复检测更新按钮逻辑错误
|
修复检测更新按钮逻辑错误
|
||||||
没有语言标识的代码块支持复制
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "CherryStudio",
|
"name": "CherryStudio",
|
||||||
"version": "0.8.22",
|
"version": "0.8.23",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "A powerful AI assistant for producer.",
|
"description": "A powerful AI assistant for producer.",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
|
|||||||
@ -6,7 +6,8 @@ export default class AppUpdater {
|
|||||||
autoUpdater: _AppUpdater = autoUpdater
|
autoUpdater: _AppUpdater = autoUpdater
|
||||||
|
|
||||||
constructor(mainWindow: BrowserWindow) {
|
constructor(mainWindow: BrowserWindow) {
|
||||||
logger.transports.file.level = 'debug'
|
logger.transports.file.level = 'info'
|
||||||
|
|
||||||
autoUpdater.logger = logger
|
autoUpdater.logger = logger
|
||||||
autoUpdater.forceDevUpdateConfig = !app.isPackaged
|
autoUpdater.forceDevUpdateConfig = !app.isPackaged
|
||||||
autoUpdater.autoDownload = true
|
autoUpdater.autoDownload = true
|
||||||
@ -18,15 +19,8 @@ export default class AppUpdater {
|
|||||||
})
|
})
|
||||||
|
|
||||||
autoUpdater.on('update-available', (releaseInfo: UpdateInfo) => {
|
autoUpdater.on('update-available', (releaseInfo: UpdateInfo) => {
|
||||||
autoUpdater.logger?.info('检测到新版本,开始自动下载')
|
logger.info('检测到新版本', releaseInfo)
|
||||||
mainWindow.webContents.send('update-available', releaseInfo)
|
mainWindow.webContents.send('update-available', releaseInfo)
|
||||||
|
|
||||||
dialog.showMessageBox({
|
|
||||||
type: 'info',
|
|
||||||
title: '正在下载新版本',
|
|
||||||
message: `新版本 ${releaseInfo.version}`,
|
|
||||||
detail: this.formatReleaseNotes(releaseInfo.releaseNotes)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 检测到不需要更新时
|
// 检测到不需要更新时
|
||||||
|
|||||||
@ -174,7 +174,6 @@ body[os='mac'] {
|
|||||||
border-top-left-radius: 10px;
|
border-top-left-radius: 10px;
|
||||||
border-bottom-left-radius: 10px;
|
border-bottom-left-radius: 10px;
|
||||||
border-left: 0.5px solid var(--color-border);
|
border-left: 0.5px solid var(--color-border);
|
||||||
box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,11 +88,11 @@
|
|||||||
"settings.context_count": "Context",
|
"settings.context_count": "Context",
|
||||||
"settings.context_count.tip": "The number of previous messages to keep in the context.",
|
"settings.context_count.tip": "The number of previous messages to keep in the context.",
|
||||||
"settings.max": "Max",
|
"settings.max": "Max",
|
||||||
"settings.max_tokens": "Enable Max Tokens Limit",
|
"settings.max_tokens": "Enable max tokens limit",
|
||||||
"settings.max_tokens.tip": "The maximum number of tokens the model can generate. Normal chat suggests 500-800. Short text generation suggests 800-2000. Code generation suggests 2000-3600. Long text generation suggests above 4000.",
|
"settings.max_tokens.tip": "The maximum number of tokens the model can generate. Normal chat suggests 500-800. Short text generation suggests 800-2000. Code generation suggests 2000-3600. Long text generation suggests above 4000.",
|
||||||
"settings.reset": "Reset",
|
"settings.reset": "Reset",
|
||||||
"settings.set_as_default": "Apply to default assistant",
|
"settings.set_as_default": "Apply to default assistant",
|
||||||
"settings.show_line_numbers": "Show Line Numbers in Code",
|
"settings.show_line_numbers": "Show line numbers in code",
|
||||||
"settings.temperature": "Temperature",
|
"settings.temperature": "Temperature",
|
||||||
"settings.temperature.tip": "Lower values make the model more creative and unpredictable, while higher values make it more deterministic and precise.",
|
"settings.temperature.tip": "Lower values make the model more creative and unpredictable, while higher values make it more deterministic and precise.",
|
||||||
"suggestions.title": "Suggested Questions",
|
"suggestions.title": "Suggested Questions",
|
||||||
@ -228,7 +228,7 @@
|
|||||||
"message.code_style": "Code style",
|
"message.code_style": "Code style",
|
||||||
"message.delete.content": "Are you sure you want to delete this message?",
|
"message.delete.content": "Are you sure you want to delete this message?",
|
||||||
"message.delete.title": "Delete Message",
|
"message.delete.title": "Delete Message",
|
||||||
"message.style": "Message Style",
|
"message.style": "Message style",
|
||||||
"message.style.bubble": "Bubble",
|
"message.style.bubble": "Bubble",
|
||||||
"message.style.plain": "Plain",
|
"message.style.plain": "Plain",
|
||||||
"reset.confirm.content": "Are you sure you want to clear all data?",
|
"reset.confirm.content": "Are you sure you want to clear all data?",
|
||||||
@ -249,7 +249,7 @@
|
|||||||
"model": {
|
"model": {
|
||||||
"pinned": "Pinned",
|
"pinned": "Pinned",
|
||||||
"search": "Search models...",
|
"search": "Search models...",
|
||||||
"stream_output": "Stream Output",
|
"stream_output": "Stream output",
|
||||||
"type": {
|
"type": {
|
||||||
"select": "Select Model Types",
|
"select": "Select Model Types",
|
||||||
"text": "Text",
|
"text": "Text",
|
||||||
@ -328,6 +328,7 @@
|
|||||||
"about.releases.button": "Releases",
|
"about.releases.button": "Releases",
|
||||||
"about.releases.title": "Release Notes",
|
"about.releases.title": "Release Notes",
|
||||||
"about.title": "About",
|
"about.title": "About",
|
||||||
|
"about.updateAvailable": "Found new version {{version}}",
|
||||||
"about.updateError": "Update error",
|
"about.updateError": "Update error",
|
||||||
"about.updateNotAvailable": "You are using the latest version",
|
"about.updateNotAvailable": "You are using the latest version",
|
||||||
"about.website.button": "Website",
|
"about.website.button": "Website",
|
||||||
@ -360,7 +361,7 @@
|
|||||||
"webdav.user": "WebDAV User"
|
"webdav.user": "WebDAV User"
|
||||||
},
|
},
|
||||||
"display.title": "Display Settings",
|
"display.title": "Display Settings",
|
||||||
"font_size.title": "Message Font Size",
|
"font_size.title": "Message font size",
|
||||||
"general": "General Settings",
|
"general": "General Settings",
|
||||||
"general.backup.button": "Backup",
|
"general.backup.button": "Backup",
|
||||||
"general.backup.title": "Data Backup and Recovery",
|
"general.backup.title": "Data Backup and Recovery",
|
||||||
@ -477,10 +478,10 @@
|
|||||||
"theme.window.style.title": "Window Style",
|
"theme.window.style.title": "Window Style",
|
||||||
"theme.window.style.transparent": "Transparent Window",
|
"theme.window.style.transparent": "Transparent Window",
|
||||||
"title": "Settings",
|
"title": "Settings",
|
||||||
"topic.position": "Topic Position",
|
"topic.position": "Topic position",
|
||||||
"topic.position.left": "Left",
|
"topic.position.left": "Left",
|
||||||
"topic.position.right": "Right",
|
"topic.position.right": "Right",
|
||||||
"topic.show.time": "Show Topic Time",
|
"topic.show.time": "Show topic time",
|
||||||
"tray.title": "Enable System Tray Icon"
|
"tray.title": "Enable System Tray Icon"
|
||||||
},
|
},
|
||||||
"translate": {
|
"translate": {
|
||||||
|
|||||||
@ -328,6 +328,7 @@
|
|||||||
"about.releases.button": "Релизы",
|
"about.releases.button": "Релизы",
|
||||||
"about.releases.title": "Заметки о релизах",
|
"about.releases.title": "Заметки о релизах",
|
||||||
"about.title": "О программе",
|
"about.title": "О программе",
|
||||||
|
"about.updateAvailable": "Найдено новое обновление {{version}}",
|
||||||
"about.updateError": "Ошибка обновления",
|
"about.updateError": "Ошибка обновления",
|
||||||
"about.updateNotAvailable": "Вы используете последнюю версию",
|
"about.updateNotAvailable": "Вы используете последнюю версию",
|
||||||
"about.website.button": "Сайт",
|
"about.website.button": "Сайт",
|
||||||
|
|||||||
@ -328,6 +328,7 @@
|
|||||||
"about.releases.button": "查看",
|
"about.releases.button": "查看",
|
||||||
"about.releases.title": "更新日志",
|
"about.releases.title": "更新日志",
|
||||||
"about.title": "关于我们",
|
"about.title": "关于我们",
|
||||||
|
"about.updateAvailable": "发现新版本 {{version}}",
|
||||||
"about.updateError": "更新出错",
|
"about.updateError": "更新出错",
|
||||||
"about.updateNotAvailable": "你的软件已是最新版本",
|
"about.updateNotAvailable": "你的软件已是最新版本",
|
||||||
"about.website.button": "查看",
|
"about.website.button": "查看",
|
||||||
@ -445,7 +446,7 @@
|
|||||||
"action": "操作",
|
"action": "操作",
|
||||||
"key": "按键",
|
"key": "按键",
|
||||||
"new_topic": "新建话题",
|
"new_topic": "新建话题",
|
||||||
"title": "快捷键",
|
"title": "快捷方式",
|
||||||
"zoom_in": "放大界面",
|
"zoom_in": "放大界面",
|
||||||
"zoom_out": "缩小界面",
|
"zoom_out": "缩小界面",
|
||||||
"zoom_reset": "重置缩放",
|
"zoom_reset": "重置缩放",
|
||||||
|
|||||||
@ -328,6 +328,7 @@
|
|||||||
"about.releases.button": "查看",
|
"about.releases.button": "查看",
|
||||||
"about.releases.title": "更新日誌",
|
"about.releases.title": "更新日誌",
|
||||||
"about.title": "關於我們",
|
"about.title": "關於我們",
|
||||||
|
"about.updateAvailable": "發現新版本 {{version}}",
|
||||||
"about.updateError": "更新錯誤",
|
"about.updateError": "更新錯誤",
|
||||||
"about.updateNotAvailable": "您正在使用最新版本",
|
"about.updateNotAvailable": "您正在使用最新版本",
|
||||||
"about.website.button": "網站",
|
"about.website.button": "網站",
|
||||||
|
|||||||
@ -194,7 +194,7 @@ const AgentsPage: FC = () => {
|
|||||||
{Object.values(filteredAgentGroups)
|
{Object.values(filteredAgentGroups)
|
||||||
.flat()
|
.flat()
|
||||||
.map((agent, index, array) => (
|
.map((agent, index, array) => (
|
||||||
<Col span={array.length === 1 ? 8 : 6} key={index}>
|
<Col span={array.length === 1 ? 12 : 6} key={index}>
|
||||||
<AgentCard
|
<AgentCard
|
||||||
onClick={() => onAddAgentConfirm(getAgentFromSystemAgent(agent as any))}
|
onClick={() => onAddAgentConfirm(getAgentFromSystemAgent(agent as any))}
|
||||||
agent={agent as any}
|
agent={agent as any}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import 'katex/dist/katex.min.css'
|
|||||||
|
|
||||||
import { useSettings } from '@renderer/hooks/useSettings'
|
import { useSettings } from '@renderer/hooks/useSettings'
|
||||||
import { Message } from '@renderer/types'
|
import { Message } from '@renderer/types'
|
||||||
import { addPlaintextToCodeBlock, escapeBrackets } from '@renderer/utils/formula'
|
import { escapeBrackets } from '@renderer/utils/formula'
|
||||||
import { isEmpty } from 'lodash'
|
import { isEmpty } from 'lodash'
|
||||||
import { FC, useMemo } from 'react'
|
import { FC, useMemo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -35,7 +35,7 @@ const Markdown: FC<Props> = ({ message }) => {
|
|||||||
const empty = isEmpty(message.content)
|
const empty = isEmpty(message.content)
|
||||||
const paused = message.status === 'paused'
|
const paused = message.status === 'paused'
|
||||||
const content = empty && paused ? t('message.chat.completion.paused') : message.content
|
const content = empty && paused ? t('message.chat.completion.paused') : message.content
|
||||||
return escapeBrackets(addPlaintextToCodeBlock(content))
|
return escapeBrackets(content)
|
||||||
}, [message.content, message.status, t])
|
}, [message.content, message.status, t])
|
||||||
|
|
||||||
const rehypePlugins = useMemo(() => {
|
const rehypePlugins = useMemo(() => {
|
||||||
|
|||||||
@ -169,8 +169,8 @@ const Segmented = styled(AntSegmented)`
|
|||||||
.ant-segmented-item {
|
.ant-segmented-item {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: none !important;
|
transition: none !important;
|
||||||
height: 30px;
|
height: 34px;
|
||||||
line-height: 30px;
|
line-height: 34px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
.ant-segmented-item-selected {
|
.ant-segmented-item-selected {
|
||||||
|
|||||||
@ -9,10 +9,11 @@ import { useAppDispatch } from '@renderer/store'
|
|||||||
import { setManualUpdateCheck } from '@renderer/store/settings'
|
import { setManualUpdateCheck } from '@renderer/store/settings'
|
||||||
import { runAsyncFunction } from '@renderer/utils'
|
import { runAsyncFunction } from '@renderer/utils'
|
||||||
import { Avatar, Button, Progress, Row, Switch, Tag } from 'antd'
|
import { Avatar, Button, Progress, Row, Switch, Tag } from 'antd'
|
||||||
import { ProgressInfo } from 'electron-updater'
|
import { ProgressInfo, UpdateInfo } from 'electron-updater'
|
||||||
import { debounce } from 'lodash'
|
import { debounce } from 'lodash'
|
||||||
import { FC, useEffect, useState } from 'react'
|
import { FC, useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import Markdown from 'react-markdown'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
|
|
||||||
@ -81,9 +82,19 @@ const AboutSettings: FC = () => {
|
|||||||
setCheckUpdateLoading(false)
|
setCheckUpdateLoading(false)
|
||||||
window.message.success(t('settings.about.updateNotAvailable'))
|
window.message.success(t('settings.about.updateNotAvailable'))
|
||||||
}),
|
}),
|
||||||
ipcRenderer.on('update-available', () => {
|
ipcRenderer.on('update-available', (_, releaseInfo: UpdateInfo) => {
|
||||||
setCheckUpdateLoading(false)
|
setCheckUpdateLoading(false)
|
||||||
setDownloading(true)
|
setDownloading(true)
|
||||||
|
window.modal.info({
|
||||||
|
title: t('settings.about.updateAvailable', { version: releaseInfo.version }),
|
||||||
|
content: (
|
||||||
|
<Markdown>
|
||||||
|
{typeof releaseInfo.releaseNotes === 'string'
|
||||||
|
? releaseInfo.releaseNotes
|
||||||
|
: releaseInfo.releaseNotes?.map((note) => note.note).join('\n')}
|
||||||
|
</Markdown>
|
||||||
|
)
|
||||||
|
})
|
||||||
}),
|
}),
|
||||||
ipcRenderer.on('download-update', () => {
|
ipcRenderer.on('download-update', () => {
|
||||||
setCheckUpdateLoading(false)
|
setCheckUpdateLoading(false)
|
||||||
|
|||||||
@ -43,17 +43,3 @@ export function extractTitle(html: string): string | null {
|
|||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addPlaintextToCodeBlock(markdown: string): string {
|
|
||||||
// 修改正则表达式以匹配代码块的开始和结束,包括前后的换行符
|
|
||||||
const codeBlockRegex = /(^|\n)```([\w]*)\n([\s\S]*?)\n```/g
|
|
||||||
|
|
||||||
return markdown.replace(codeBlockRegex, (match, newline, language, code) => {
|
|
||||||
// 如果没有指定语言,使用 text
|
|
||||||
if (!language) {
|
|
||||||
return `${newline}\`\`\`text\n${code}\n\`\`\``
|
|
||||||
}
|
|
||||||
// 如果指定了语言,保持原样
|
|
||||||
return match
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user