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",
|
||||
"version": "0.8.22",
|
||||
"version": "0.8.23",
|
||||
"private": true,
|
||||
"description": "A powerful AI assistant for producer.",
|
||||
"main": "./out/main/index.js",
|
||||
|
||||
@ -6,7 +6,8 @@ export default class AppUpdater {
|
||||
autoUpdater: _AppUpdater = autoUpdater
|
||||
|
||||
constructor(mainWindow: BrowserWindow) {
|
||||
logger.transports.file.level = 'debug'
|
||||
logger.transports.file.level = 'info'
|
||||
|
||||
autoUpdater.logger = logger
|
||||
autoUpdater.forceDevUpdateConfig = !app.isPackaged
|
||||
autoUpdater.autoDownload = true
|
||||
@ -18,15 +19,8 @@ export default class AppUpdater {
|
||||
})
|
||||
|
||||
autoUpdater.on('update-available', (releaseInfo: UpdateInfo) => {
|
||||
autoUpdater.logger?.info('检测到新版本,开始自动下载')
|
||||
logger.info('检测到新版本', 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-bottom-left-radius: 10px;
|
||||
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.tip": "The number of previous messages to keep in the context.",
|
||||
"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.reset": "Reset",
|
||||
"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.tip": "Lower values make the model more creative and unpredictable, while higher values make it more deterministic and precise.",
|
||||
"suggestions.title": "Suggested Questions",
|
||||
@ -228,7 +228,7 @@
|
||||
"message.code_style": "Code style",
|
||||
"message.delete.content": "Are you sure you want to delete this message?",
|
||||
"message.delete.title": "Delete Message",
|
||||
"message.style": "Message Style",
|
||||
"message.style": "Message style",
|
||||
"message.style.bubble": "Bubble",
|
||||
"message.style.plain": "Plain",
|
||||
"reset.confirm.content": "Are you sure you want to clear all data?",
|
||||
@ -249,7 +249,7 @@
|
||||
"model": {
|
||||
"pinned": "Pinned",
|
||||
"search": "Search models...",
|
||||
"stream_output": "Stream Output",
|
||||
"stream_output": "Stream output",
|
||||
"type": {
|
||||
"select": "Select Model Types",
|
||||
"text": "Text",
|
||||
@ -328,6 +328,7 @@
|
||||
"about.releases.button": "Releases",
|
||||
"about.releases.title": "Release Notes",
|
||||
"about.title": "About",
|
||||
"about.updateAvailable": "Found new version {{version}}",
|
||||
"about.updateError": "Update error",
|
||||
"about.updateNotAvailable": "You are using the latest version",
|
||||
"about.website.button": "Website",
|
||||
@ -360,7 +361,7 @@
|
||||
"webdav.user": "WebDAV User"
|
||||
},
|
||||
"display.title": "Display Settings",
|
||||
"font_size.title": "Message Font Size",
|
||||
"font_size.title": "Message font size",
|
||||
"general": "General Settings",
|
||||
"general.backup.button": "Backup",
|
||||
"general.backup.title": "Data Backup and Recovery",
|
||||
@ -477,10 +478,10 @@
|
||||
"theme.window.style.title": "Window Style",
|
||||
"theme.window.style.transparent": "Transparent Window",
|
||||
"title": "Settings",
|
||||
"topic.position": "Topic Position",
|
||||
"topic.position": "Topic position",
|
||||
"topic.position.left": "Left",
|
||||
"topic.position.right": "Right",
|
||||
"topic.show.time": "Show Topic Time",
|
||||
"topic.show.time": "Show topic time",
|
||||
"tray.title": "Enable System Tray Icon"
|
||||
},
|
||||
"translate": {
|
||||
|
||||
@ -328,6 +328,7 @@
|
||||
"about.releases.button": "Релизы",
|
||||
"about.releases.title": "Заметки о релизах",
|
||||
"about.title": "О программе",
|
||||
"about.updateAvailable": "Найдено новое обновление {{version}}",
|
||||
"about.updateError": "Ошибка обновления",
|
||||
"about.updateNotAvailable": "Вы используете последнюю версию",
|
||||
"about.website.button": "Сайт",
|
||||
|
||||
@ -328,6 +328,7 @@
|
||||
"about.releases.button": "查看",
|
||||
"about.releases.title": "更新日志",
|
||||
"about.title": "关于我们",
|
||||
"about.updateAvailable": "发现新版本 {{version}}",
|
||||
"about.updateError": "更新出错",
|
||||
"about.updateNotAvailable": "你的软件已是最新版本",
|
||||
"about.website.button": "查看",
|
||||
@ -445,7 +446,7 @@
|
||||
"action": "操作",
|
||||
"key": "按键",
|
||||
"new_topic": "新建话题",
|
||||
"title": "快捷键",
|
||||
"title": "快捷方式",
|
||||
"zoom_in": "放大界面",
|
||||
"zoom_out": "缩小界面",
|
||||
"zoom_reset": "重置缩放",
|
||||
|
||||
@ -328,6 +328,7 @@
|
||||
"about.releases.button": "查看",
|
||||
"about.releases.title": "更新日誌",
|
||||
"about.title": "關於我們",
|
||||
"about.updateAvailable": "發現新版本 {{version}}",
|
||||
"about.updateError": "更新錯誤",
|
||||
"about.updateNotAvailable": "您正在使用最新版本",
|
||||
"about.website.button": "網站",
|
||||
|
||||
@ -194,7 +194,7 @@ const AgentsPage: FC = () => {
|
||||
{Object.values(filteredAgentGroups)
|
||||
.flat()
|
||||
.map((agent, index, array) => (
|
||||
<Col span={array.length === 1 ? 8 : 6} key={index}>
|
||||
<Col span={array.length === 1 ? 12 : 6} key={index}>
|
||||
<AgentCard
|
||||
onClick={() => onAddAgentConfirm(getAgentFromSystemAgent(agent as any))}
|
||||
agent={agent as any}
|
||||
|
||||
@ -2,7 +2,7 @@ import 'katex/dist/katex.min.css'
|
||||
|
||||
import { useSettings } from '@renderer/hooks/useSettings'
|
||||
import { Message } from '@renderer/types'
|
||||
import { addPlaintextToCodeBlock, escapeBrackets } from '@renderer/utils/formula'
|
||||
import { escapeBrackets } from '@renderer/utils/formula'
|
||||
import { isEmpty } from 'lodash'
|
||||
import { FC, useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -35,7 +35,7 @@ const Markdown: FC<Props> = ({ message }) => {
|
||||
const empty = isEmpty(message.content)
|
||||
const paused = message.status === 'paused'
|
||||
const content = empty && paused ? t('message.chat.completion.paused') : message.content
|
||||
return escapeBrackets(addPlaintextToCodeBlock(content))
|
||||
return escapeBrackets(content)
|
||||
}, [message.content, message.status, t])
|
||||
|
||||
const rehypePlugins = useMemo(() => {
|
||||
|
||||
@ -169,8 +169,8 @@ const Segmented = styled(AntSegmented)`
|
||||
.ant-segmented-item {
|
||||
overflow: hidden;
|
||||
transition: none !important;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
background-color: transparent;
|
||||
}
|
||||
.ant-segmented-item-selected {
|
||||
|
||||
@ -9,10 +9,11 @@ import { useAppDispatch } from '@renderer/store'
|
||||
import { setManualUpdateCheck } from '@renderer/store/settings'
|
||||
import { runAsyncFunction } from '@renderer/utils'
|
||||
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 { FC, useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Markdown from 'react-markdown'
|
||||
import { Link } from 'react-router-dom'
|
||||
import styled from 'styled-components'
|
||||
|
||||
@ -81,9 +82,19 @@ const AboutSettings: FC = () => {
|
||||
setCheckUpdateLoading(false)
|
||||
window.message.success(t('settings.about.updateNotAvailable'))
|
||||
}),
|
||||
ipcRenderer.on('update-available', () => {
|
||||
ipcRenderer.on('update-available', (_, releaseInfo: UpdateInfo) => {
|
||||
setCheckUpdateLoading(false)
|
||||
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', () => {
|
||||
setCheckUpdateLoading(false)
|
||||
|
||||
@ -43,17 +43,3 @@ export function extractTitle(html: string): string | 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