mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
feat: 后台新增Azure语音配置项 (#383)
* 修复后台API反代地址未能正确显示的问题 * 更新渲染页面配置 * 添加个人聊天模式配置 * 将用户数据获取改到common中 * 修复错误的渲染页面参数 * 修复bug * 添加Live2D * 修复渲染页面错误 * 修复渲染传入值 * 更新渲染 * 修复图表渲染bug * 调整live2d模型大小 * 修复live2d无法关闭问题 * 修复错误的传值 * 修复ai命名 * 更新渲染 * 添加用户独立设定 * 更新渲染配置适配个人设置 * 修复合并导致的渲染文件异常删除 * 修复用户数据缺失问题 * 修复旧版本数据缺失问题 * 修复bing参数不存在问题,兼容miao的截图 * 修复受限token重试时不被排除的问题 * 修复个人模式下结束对话的模式错误 * 更新渲染页面,将预览版转为正式版 * 修复传统渲染无法调用截图功能的问题 * 文字模式也进行一次缓存 * 更新README * Update README.md * 更新渲染 * 更新渲染页面 * 添加版本信息 * 遗漏参数 * 丢失引用 * 补充路由 * 添加云转码功能 * 判断node-silk是否正常合成 * 云转码提示 * 修复图片渲染出错 * 云转码支持发送Buffer * 添加云转码模式支持 * 更新描述 * 更新后台渲染页面 * 更新配置 * 更新渲染页面 * 添加云渲染 * 修复错误的接口调用 * 修复遗漏的数据转换 * 修复获取的图片数据异常问题 * 更新后台配置 * 更新渲染页面 * 修复云渲染访问地址错误 --------- Co-authored-by: ikechan8370 <geyinchibuaa@gmail.com>
This commit is contained in:
parent
eb6c25d75d
commit
5099ae9d87
23 changed files with 126 additions and 128 deletions
|
|
@ -681,6 +681,12 @@ export function supportGuoba () {
|
|||
bottomHelpMessage: '聊天页面渲染窗口的宽度',
|
||||
component: 'InputNumber'
|
||||
},
|
||||
{
|
||||
field: 'cloudRender',
|
||||
label: '云渲染',
|
||||
bottomHelpMessage: '是否使用云资源进行图片渲染,需要开放服务器端口后才能使用,不支持旧版本渲染',
|
||||
component: 'Switch'
|
||||
},
|
||||
{
|
||||
field: 'chatViewBotName',
|
||||
label: 'Bot命名',
|
||||
|
|
|
|||
22
server/static/css/app.13fc2dfe.css
Normal file
22
server/static/css/app.13fc2dfe.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -17,5 +17,4 @@
|
|||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
-->
|
||||
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="76x76" href="/apple-icon.png"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"/><script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.6.3/mermaid.min.js"></script><title>ChatGPT-Plugin</title><script defer="defer" type="module" src="/js/chunk-vendors.f0ab5903.js"></script><script defer="defer" type="module" src="/js/app.5fabf316.js"></script><link href="/css/chunk-vendors.0ede84b4.css" rel="stylesheet"><link href="/css/app.db850df4.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.f38f83ce.js" nomodule></script><script defer="defer" src="/js/app-legacy.2b7469b6.js" nomodule></script></head><body class="text-blueGray-700 antialiased"><noscript><strong>We're sorry but vue-notus doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="76x76" href="/apple-icon.png"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"/><script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.6.3/mermaid.min.js"></script><title>ChatGPT-Plugin</title><script defer="defer" type="module" src="/js/chunk-vendors.94518e59.js"></script><script defer="defer" type="module" src="/js/app.dac4caf6.js"></script><link href="/css/chunk-vendors.0ede84b4.css" rel="stylesheet"><link href="/css/app.13fc2dfe.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.ad38f327.js" nomodule></script><script defer="defer" src="/js/app-legacy.7e5f8de2.js" nomodule></script></head><body class="text-blueGray-700 antialiased"><noscript><strong>We're sorry but vue-notus doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
server/static/js/app-legacy.7e5f8de2.js
Normal file
21
server/static/js/app-legacy.7e5f8de2.js
Normal file
File diff suppressed because one or more lines are too long
1
server/static/js/app-legacy.7e5f8de2.js.map
Normal file
1
server/static/js/app-legacy.7e5f8de2.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
server/static/js/app.dac4caf6.js
Normal file
21
server/static/js/app.dac4caf6.js
Normal file
File diff suppressed because one or more lines are too long
1
server/static/js/app.dac4caf6.js.map
Normal file
1
server/static/js/app.dac4caf6.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
server/static/js/chunk-vendors-legacy.ad38f327.js.map
Normal file
1
server/static/js/chunk-vendors-legacy.ad38f327.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -326,6 +326,42 @@ export async function render (e, pluginKey, htmlPath, data = {}, renderCfg = {})
|
|||
}
|
||||
|
||||
export async function renderUrl (e, url, renderCfg = {}) {
|
||||
// 云渲染
|
||||
if (Config.cloudRender) {
|
||||
url = url.replace(`127.0.0.1:${Config.serverPort || 3321}`, Config.serverHost || `${await getPublicIP()}:${Config.serverPort || 3321}`)
|
||||
const resultres = await fetch(`${Config.cloudTranscode}/screenshot`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
url: url,
|
||||
option: {
|
||||
width: renderCfg.Viewport.width || 1280,
|
||||
height: renderCfg.Viewport.height || 720,
|
||||
timeout: 120000,
|
||||
selector: Config.live2d ? "#live2d-widget" : "body",
|
||||
wait: renderCfg.wait || 1000
|
||||
},
|
||||
type: 'image'
|
||||
})
|
||||
})
|
||||
if (resultres.ok) {
|
||||
const buff = Buffer.from(await resultres.arrayBuffer())
|
||||
if(buff) {
|
||||
const base64 = segment.image(buff)
|
||||
if (renderCfg.retType === 'base64') {
|
||||
return base64
|
||||
}
|
||||
let ret = true
|
||||
if (base64) {
|
||||
ret = await e.reply(base64)
|
||||
}
|
||||
return renderCfg.retType === 'msgId' ? ret : true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await _puppeteer.browserInit()
|
||||
const page = await _puppeteer.browser.newPage()
|
||||
let base64
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ const defaultConfig = {
|
|||
slackClaudeGlobalPreset: '',
|
||||
slackClaudeSpecifiedChannel: '',
|
||||
cloudTranscode: 'https://silk.201666.xyz',
|
||||
cloudRender: false,
|
||||
cloudMode: 'url',
|
||||
ttsMode: 'vits-uma-genshin-honkai', // or azure
|
||||
azureTTSKey: '',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue