chatgpt-plugin/server/static/assets/guoba.0a045bba.js
HalcyonAlcedo c68a50e8bc
继续适配Trss (#583)
* fix: 修复星火api上下文

* 将无星火ck的情况降低为warn

* feat: 添加星火设定自定义代码功能

* 修复星火api模式的一些问题

* 修复导出配置问题

* feat:添加工具箱快捷登录接口

* 添加工具箱快捷登录指令

* 阻止群聊使用快捷登录

* 添加Azure配置支持,修复重复的配置项冲突

* 移除旧版本渲染和新版本帮助

* 添加工具箱

* 更新工具箱替换原有后台

* 更新工具箱适配代码

* 后台适配Trss

* 修复trss不支持sendPrivateMsg的问题

* 优化路由

* 修复路由

* 适配其他uin

* 添加bing第三方绘图

* 修复bing绘图第三方调用错误

* 添加bing第三方绘图采样配置

* 修复错误

* 添加bing第三方绘图图片大小配置

* 修复视图错误

* 使用ap替换第三方绘图

* 适配trss

* server 适配trss

* 修复错误的后台版本更新

* 添加锅巴用户数据

* 修复server初始化消息错误

* 添加锅巴插件适配

* 更新后台页面

* 添加锅巴代理接口

* 优化锅巴接口代理

* 修复锅巴代理参数

* 删除调试信息

* 修复headers

* 更新后台锅巴插件支持
2023-10-16 21:49:00 +08:00

1 line
5.7 KiB
JavaScript

import{_ as T}from"./AutoSettings.a106e074.js";import{K as C,O as m,o as _,aR as R,as as y,Q as c,a1 as k,ar as A,R as D,S as p,a2 as $,a3 as x,T as B,D as h,W as N,aD as S,aN as K,U as Q,_ as O,P as n,aP as u}from"./index.a457a291.js";import"./VCheckbox.650ef329.js";import"./VCheckboxBtn.ae1aff4b.js";import"./VTextarea.74351862.js";import"./VSelect.5c080fb6.js";const E={__name:"guoba",setup(V){const t=C(),l=m({bot:{},redis:{},other:{}}),b=m([{id:"bot",title:"\u673A\u5668\u4EBA\u914D\u7F6E",view:[{type:"select",label:"\u65E5\u5FD7\u7B49\u7EA7",model:"bot",data:"log_level",items:[{label:"Trace",value:"trace"},{label:"Debug",value:"debug"},{label:"Inof",value:"info"},{label:"Warn",value:"warn"},{label:"Fatal",value:"fatal"},{label:"Mark",value:"mark"},{label:"Error",value:"error"},{label:"Off",value:"off"}]},{type:"check",label:"\u8FC7\u6EE4\u81EA\u5DF1",model:"bot",data:"ignore_self"},{type:"check",label:"\u5206\u7247\u53D1\u9001",model:"bot",data:"resend"},{type:"text",label:"ffmpeg\u8DEF\u5F84",model:"bot",data:"ffmpeg_path"},{type:"text",label:"ffprobe\u8DEF\u5F84",model:"bot",data:"ffprobe_path"},{type:"text",label:"chromium\u8DEF\u5F84",model:"bot",data:"chromium_path"},{type:"text",label:"\u4EE3\u7406\u5730\u5740",model:"bot",data:"proxyAddress"},{type:"check",label:"\u63A8\u9001\u5E2E\u52A9",model:"bot",data:"online_msg"},{type:"number",label:"\u63A8\u9001\u5E2E\u52A9\u51B7\u5374",model:"bot",data:"online_msg_exp"}]},{id:"redis",title:"\u673A\u5668\u4EBA\u914D\u7F6E",view:[{type:"text",label:"Redis\u5730\u5740",model:"redis",data:"host"},{type:"number",label:"Redis\u7AEF\u53E3",model:"redis",data:"port"},{type:"password",label:"Redis\u5BC6\u7801",model:"redis",data:"password"},{type:"number",label:"Redis\u6570\u636E\u5E93",model:"redis",data:"db"}]},{id:"other",title:"\u5176\u4ED6\u914D\u7F6E",view:[{type:"check",label:"\u6DFB\u52A0\u597D\u53CB",model:"other",data:"autoFriend"},{type:"number",label:"\u9000\u7FA4\u4EBA\u6570",model:"other",data:"autoQuit"},{type:"select",label:"\u4E3B\u4EBAQQ",model:"other",data:"masterQQ",multiple:!0},{type:"check",label:"\u7981\u7528\u79C1\u804A",model:"other",data:"disablePrivate"},{type:"text",label:"\u7981\u79C1\u804A\u63D0\u793A",model:"other",data:"disableMsg"},{type:"select",label:"\u79C1\u804A\u901A\u884C\u5B57\u7B26\u4E32",model:"other",data:"disableAdopt",multiple:!0},{type:"select",label:"\u767D\u540D\u5355\u7FA4",model:"other",data:"whiteGroup",multiple:!0},{type:"select",label:"\u9ED1\u540D\u5355\u7FA4",model:"other",data:"blackGroup",multiple:!0},{type:"select",label:"\u9ED1\u540D\u5355QQ",model:"other",data:"blackQQ",multiple:!0}]}]);_(()=>{let e=[];for(const a of b.value){e.push({name:a.title,path:a.id});for(const o of a.view)if(o.type.toLowerCase()==="tabs")for(const s of o.tabs)for(const r of s.view){let i={name:r.label,path:`${a.id}/${r.id||r.data}`};i.group=a.title,i.tab=s.tab,i.tabId=`${a.id}_${o.id}`,e.push(i)}else{let s={name:o.label,path:`${a.id}/${o.id||o.data}`};s.group=a.title,e.push(s)}}return e});const d=m(!1),g=()=>{d.value=!1,n.post(`${t.getters.serverApi}guobaApi`,{token:t.getters.userToken,guobaToken:t.getters.guobaToken,path:"api/config/data",data:{key:"system.bot"}}).then(e=>{e.data&&(e.data.ok?l.value=Object.assign({},u(l.value),{bot:Object.assign({},u(l.value).bot,e.data.result)}):t.commit("app/ADD_SNACKBAR",{message:e.data.message,color:"error"}))}).catch(e=>{d.value=!0,t.commit("app/ADD_SNACKBAR",{message:e.message,color:"error"}),console.log(e)}),n.post(`${t.getters.serverApi}guobaApi`,{token:t.getters.userToken,guobaToken:t.getters.guobaToken,path:"api/config/data",data:{key:"system.redis"}}).then(e=>{e.data&&(e.data.ok?l.value=Object.assign({},u(l.value),{redis:Object.assign({},u(l.value).redis,e.data.result)}):t.commit("app/ADD_SNACKBAR",{message:e.data.message,color:"error"}))}).catch(e=>{d.value=!0,t.commit("app/ADD_SNACKBAR",{message:e.message,color:"error"}),console.log(e)}),n.post(`${t.getters.serverApi}guobaApi`,{token:t.getters.userToken,guobaToken:t.getters.guobaToken,path:"api/config/data",data:{key:"system.other"}}).then(e=>{e.data&&(e.data.ok?l.value=Object.assign({},u(l.value),{other:Object.assign({},u(l.value).other,e.data.result)}):t.commit("app/ADD_SNACKBAR",{message:e.data.message,color:"error"}))}).catch(e=>{d.value=!0,t.commit("app/ADD_SNACKBAR",{message:e.message,color:"error"}),console.log(e)})},w=e=>{for(let a in e)n.post(`${t.getters.serverApi}guobaApi`,{token:t.getters.userToken,guobaToken:t.getters.guobaToken,path:"api/config/data",post:!0,data:{key:`system.${a}`,data:u(l.value)[a]}}).then(o=>{var s;(s=o.data)!=null&&s.ok?t.commit("app/ADD_SNACKBAR",{message:"\u4FDD\u5B58\u6210\u529F",color:"success"}):t.commit("app/ADD_SNACKBAR",{message:o.data.message,color:"error"}),g()}).catch(o=>{g(),t.commit("app/ADD_SNACKBAR",{message:o.message,color:"error"}),console.log(o)})},f=_({get(){return l.value},set(e){l.value[e.mode][e.data]=e.value;let a={};a[e.mode]={},a[e.mode][e.data]=e.value,w(a)}}),v=m({});R([l],([e],[a])=>{e!=a&&e&&d.value==!1&&(d.value=!0)});for(const e of b.value){const a=e.view.filter(o=>o.type.toLowerCase()==="tabs");for(const o of a)v.value[`${e.id}_${o.id}`]=o.tabs[0].tab}return g(),(e,a)=>{const o=y("masonry-tile"),s=y("masonry");return c(),k("div",null,[A((c(),D(O,null,{default:p(()=>[(c(!0),k($,null,x(b.value,r=>A((c(),D(B,{key:r.id,cols:"12",md:"6"},{default:p(()=>[h(Q,{title:r.title},{default:p(()=>[h(N,null,{default:p(()=>[h(T,{initData:d.value,viewId:r.id,viewData:r.view,configData:S(f),"onUpdate:configData":a[0]||(a[0]=i=>K(f)?f.value=i:null),activeTab:v.value,"onUpdate:activeTab":a[1]||(a[1]=i=>v.value=i)},null,8,["initData","viewId","viewData","configData","activeTab"])]),_:2},1024)]),_:2},1032,["title"])]),_:2},1024)),[[o]])),128))]),_:1})),[[s]])])}}};export{E as default};