llonebot-dist 7.12.10 → 7.12.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"llonebot-dist","version":"7.12.
|
|
1
|
+
{"name":"llonebot-dist","version":"7.12.13","type":"module","description":"","main":"llbot.js","author":"linyuchen","repository":{"type":"git","url":"https://github.com/LLOneBot/LuckyLilliaBot"}}
|
|
@@ -34,4 +34,4 @@ Error generating stack: `+e.message+`
|
|
|
34
34
|
`,children:(0,I.jsx)(ii,{activeTab:f,onTabChange:g,friendCategories:s,groups:c,recentChats:w,unreadCounts:M,selectedPeerId:d?.peerId,onSelectFriend:le,onSelectGroup:ue,onSelectRecent:j})}),(0,I.jsx)(`div`,{className:`
|
|
35
35
|
flex-1 flex flex-col min-w-0
|
|
36
36
|
${k?`block`:`hidden md:flex`}
|
|
37
|
-
`,children:(0,I.jsx)(Ua,{session:d,onShowMembers:()=>_(!m),onNewMessageCallback:re,onEmojiReactionCallback:ie,onMessageRecalledCallback:ae,appendInputMention:D,onAppendInputMentionConsumed:te,onBack:ce,showBackButton:k})}),m&&d?.chatType===2&&(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 bg-white/85 dark:bg-neutral-900/85 backdrop-blur-xl md:static md:inset-auto md:z-auto md:bg-transparent md:backdrop-blur-none md:w-64 md:border-l md:border-theme-divider md:flex-shrink-0`,children:(0,I.jsx)(Ga,{groupCode:d.peerId,onClose:()=>_(!1),onAtMember:ee})})]}),!e&&o&&(0,I.jsx)(`button`,{onClick:()=>window.open(`#webqq-fullscreen`,`_blank`),className:`fixed top-4 right-4 md:top-auto md:bottom-6 md:right-6 z-50 p-3 bg-pink-500/70 hover:bg-pink-500/90 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-200 group backdrop-blur-sm`,title:`在新窗口中全屏打开`,children:(0,I.jsx)(Ne,{size:20,className:`group-hover:scale-110 transition-transform`})})]})},Ja=()=>(0,I.jsx)(`div`,{className:`h-screen bg-theme p-4 md:p-8`,children:(0,I.jsx)(qa,{isFullscreen:!0})}),Ya={webui:{enable:!0,host:`127.0.0.1`,port:3080},milky:{enable:!1,reportSelfMessage:!1,http:{host:`127.0.0.1`,port:3010,prefix:``,accessToken:``},webhook:{urls:[],accessToken:``}},satori:{enable:!1,host:`127.0.0.1`,port:5600,token:``},ob11:{enable:!0,connect:[]},enableLocalFile2Url:!1,log:!0,autoDeleteFile:!1,autoDeleteFileSecond:60,musicSignUrl:`https://ss.xingzhige.com/music_card/card`,msgCacheExpire:120,ffmpeg:``,rawMsgPB:!1};function Xa(){let[e,t]=(0,C.useState)(()=>{let e=window.location.hash.slice(1);return[`dashboard`,`onebot`,`satori`,`milky`,`logs`,`other`,`webqq`,`webqq-fullscreen`,`about`].includes(e)?e:`dashboard`}),[n,r]=(0,C.useState)(Ya),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!0),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)(!1),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(null),[b,x]=(0,C.useState)(!1),[S,w]=(0,C.useState)(!1),[T,E]=(0,C.useState)(!1),[D,O]=(0,C.useState)(!1),[ee,te]=(0,C.useState)(``),[ne,re]=(0,C.useState)(!1),[ie,ae]=(0,C.useState)(!1),[oe,k]=(0,C.useState)(!1),{autoHideSidebarInWebQQ:A}=Kt();(0,C.useEffect)(()=>{rn(async e=>new Promise(t=>{_(e||``),h(!0),y(()=>t)}))},[]),(0,C.useEffect)(()=>{window.location.hash=e},[e]),(0,C.useEffect)(()=>{A&&e===`webqq`&&ae(!0)},[e,A]),(0,C.useEffect)(()=>{let e=()=>{let e=window.location.hash.slice(1);[`dashboard`,`onebot`,`satori`,`milky`,`logs`,`other`,`webqq`,`webqq-fullscreen`,`about`].includes(e)&&t(e)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let se=(0,C.useCallback)(e=>{e.trim()?(h(!1),_(``),v&&(v(e),y(null))):_(`密码不能为空`)},[v]);(0,C.useEffect)(()=>{(async()=>{try{let e=await R(`/api/config`);if(e.success&&e.data.selfInfo.online){l(!0),p({nick:e.data.selfInfo.nick||``,uin:e.data.selfInfo.uin}),r(e.data.config);try{let e=await R(`/api/email/config`);e.success&&e.data&&a(e.data)}catch(e){console.error(`Failed to fetch email config:`,e)}try{let e=await R(`/api/device-info`);e.success&&e.data?.buildVer&&te(e.data.buildVer)}catch(e){console.error(`Failed to fetch device info:`,e)}}else l(!1)}catch(e){console.error(`Failed to check login status:`,e),l(!1)}finally{d(!1)}})()},[]);let ce=(0,C.useCallback)(async(e,t)=>{try{s(!0);let r=e||n,a=t===void 0?i:t,o=await R(`/api/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({config:r})});if(!o.success){L(o.message||`保存失败`,`error`);return}if(a)try{let e=await R(`/api/email/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});if(!e.success){L(`主配置已保存,但邮件配置保存失败:${e.message}`,`warning`);return}}catch(e){L(`主配置已保存,但邮件配置保存失败:${String(e)}`,`warning`);return}L(`配置保存成功`,`success`)}catch(e){L(e instanceof Error?e.message:`保存失败`,`error`)}finally{s(!1)}},[n,i]),le=(0,C.useCallback)(()=>{window.location.reload()},[]);return u?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(`div`,{className:`relative flex items-center justify-center min-h-screen z-10`,children:(0,I.jsx)(N,{size:48,className:`animate-spin text-pink-500`})}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g})]}):c?e===`webqq-fullscreen`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(Ja,{}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g}),(0,I.jsx)(kt,{})]}):(0,I.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(dn,{activeTab:e,onTabChange:t,accountInfo:f||void 0,isOpen:ne,onClose:()=>re(!1),collapsed:ie,onToggleCollapse:()=>ae(!ie),onOpenSettings:()=>k(!0)}),(0,I.jsxs)(`main`,{className:`flex-1 overflow-auto z-10 transition-all duration-300 ${ie?``:`md:ml-64`}`,children:[(0,I.jsxs)(`div`,{className:`md:hidden sticky top-0 z-30 bg-theme-card/95 backdrop-blur-xl border-b border-theme-divider px-4 py-3 flex items-center gap-3`,children:[(0,I.jsx)(`button`,{onClick:()=>re(!0),className:`p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors`,children:(0,I.jsx)(Pe,{size:24})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`img`,{src:`/logo.jpg`,alt:`Logo`,className:`w-8 h-8 rounded-lg`}),(0,I.jsx)(`span`,{className:`font-semibold text-theme`,children:`LLBot`})]})]}),(0,I.jsxs)(`div`,{className:`p-4 md:p-8 max-w-6xl mx-auto`,children:[(0,I.jsxs)(`div`,{className:`mb-8 hidden md:block`,children:[(0,I.jsx)(`h2`,{className:`text-3xl font-bold text-white mb-2`,children:e===`dashboard`&&`Dashboard`}),(0,I.jsx)(`p`,{className:`text-white/80`,children:e===`dashboard`&&`欢迎使用 Lucky Lillia Bot`})]}),e===`dashboard`&&(0,I.jsx)(vn,{llbotVersion:`7.12.10`,qqVersion:ee}),e===`webqq`&&(0,I.jsx)(qa,{}),e===`logs`&&(0,I.jsx)(Sn,{}),e===`onebot`&&(0,I.jsx)(kn,{config:n.ob11,onChange:e=>{r({...n,ob11:e})},onSave:e=>{e?ce({...n,ob11:e}):ce()}}),e===`satori`&&(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-6`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center`,children:(0,I.jsx)(he,{size:24,className:`text-white`})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`Satori 协议`}),(0,I.jsx)(`p`,{className:`text-sm text-theme-secondary`,children:`配置 Satori 协议相关设置`})]}),(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.jsxs)(`a`,{href:`https://www.luckylillia.com/guide/develop#satori-%E5%8D%8F%E8%AE%AE`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors`,children:[(0,I.jsx)(_e,{size:16}),`文档`]})]}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`启用 Satori 协议`}),(0,I.jsx)(`div`,{className:`text-xs text-theme-muted mt-0.5`,children:`开启后将支持 Satori 协议连接`})]}),(0,I.jsx)(`input`,{type:`checkbox`,checked:n.satori.enable,onChange:e=>r({...n,satori:{...n.satori,enable:e.target.checked}}),className:`switch-toggle`})]}),n.satori.enable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`监听地址`}),(0,I.jsx)(ln,{value:n.satori.host,onChange:e=>r({...n,satori:{...n.satori,host:e}})}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`选择服务监听的网络地址`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Satori 端口`}),(0,I.jsx)(`input`,{type:`number`,value:n.satori.port,onChange:e=>r({...n,satori:{...n.satori,port:parseInt(e.target.value)}}),min:`1`,max:`65535`,placeholder:`5500`,className:`input-field`}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`Satori 服务监听端口(1-65535)`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Satori Token`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`input`,{type:b?`text`:`password`,value:n.satori.token,onChange:e=>r({...n,satori:{...n.satori,token:e.target.value}}),placeholder:`请输入 Satori Token`,className:`input-field pr-12`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>x(!b),className:`absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1`,children:b?(0,I.jsx)(ve,{size:20}):(0,I.jsx)(ye,{size:20})})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`用于 Satori 连接验证的 Token`})]})]})]}),(0,I.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,I.jsx)(`button`,{onClick:()=>{if(n.satori.host===``&&n.satori.enable&&!n.satori.token?.trim()){L(`当监听所有地址时,必须设置 Satori Token!`,`error`);return}ce()},disabled:o,className:`btn-primary flex items-center gap-2`,children:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{size:20,className:`animate-spin`}),`保存中...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ye,{size:20}),`保存配置`]})})})]}),e===`milky`&&(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-6`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center`,children:(0,I.jsx)(Le,{size:24,className:`text-white`})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`Milky 协议`}),(0,I.jsx)(`p`,{className:`text-sm text-theme-secondary`,children:`配置 Milky 协议相关设置`})]}),(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.jsxs)(`a`,{href:`https://www.luckylillia.com/guide/develop#milky-%E5%8D%8F%E8%AE%AE`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors`,children:[(0,I.jsx)(_e,{size:16}),`文档`]})]}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`启用 Milky 协议`}),(0,I.jsx)(`div`,{className:`text-xs text-theme-muted mt-0.5`,children:`开启后将支持 Milky 协议连接`})]}),(0,I.jsx)(`input`,{type:`checkbox`,checked:n.milky.enable,onChange:e=>r({...n,milky:{...n.milky,enable:e.target.checked}}),className:`switch-toggle`})]}),n.milky.enable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`上报自己发送的消息`}),(0,I.jsx)(`div`,{className:`text-xs text-theme-muted mt-0.5`,children:`启用后将上报自己发送的消息`})]}),(0,I.jsx)(`input`,{type:`checkbox`,checked:n.milky.reportSelfMessage,onChange:e=>r({...n,milky:{...n.milky,reportSelfMessage:e.target.checked}}),className:`switch-toggle`})]}),(0,I.jsxs)(`div`,{className:`border-t border-theme-divider pt-4 mt-4`,children:[(0,I.jsx)(`h4`,{className:`text-md font-semibold text-theme mb-4`,children:`HTTP 配置`}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`监听地址`}),(0,I.jsx)(ln,{value:n.milky.http.host,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,host:e}}})}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`选择服务监听的网络地址`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`HTTP 端口`}),(0,I.jsx)(`input`,{type:`number`,value:n.milky.http.port,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,port:parseInt(e.target.value)}}}),min:`1`,max:`65535`,placeholder:`3010`,className:`input-field`}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`Milky HTTP 服务监听端口(1-65535)`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`路径前缀`}),(0,I.jsx)(`input`,{type:`text`,value:n.milky.http.prefix,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,prefix:e.target.value}}}),placeholder:`/api`,className:`input-field`}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`HTTP API 路径前缀(可选)`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Access Token`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`input`,{type:S?`text`:`password`,value:n.milky.http.accessToken,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,accessToken:e.target.value}}}),placeholder:`请输入 Access Token`,className:`input-field pr-12`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(!S),className:`absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1`,children:S?(0,I.jsx)(ve,{size:20}):(0,I.jsx)(ye,{size:20})})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`用于 Milky HTTP 连接验证的 Token`})]})]})]}),(0,I.jsxs)(`div`,{className:`border-t border-theme-divider pt-4 mt-4`,children:[(0,I.jsx)(`h4`,{className:`text-md font-semibold text-theme mb-4`,children:`Webhook 配置`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Webhook URLs`}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[n.milky.webhook.urls.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`input`,{type:`text`,value:e,onChange:e=>{let i=[...n.milky.webhook.urls];i[t]=e.target.value,r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:i}}})},placeholder:`http:// 或 https://`,className:`input-field flex-1 ${e&&!e.match(/^https?:\/\//)?`border-red-300 focus:ring-red-500`:``}`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let e=n.milky.webhook.urls.filter((e,n)=>n!==t);r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:e}}})},className:`p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded-lg transition-colors`,title:`删除`,children:(0,I.jsx)(F,{size:18})})]},t)),n.milky.webhook.urls.some(e=>e&&!e.match(/^https?:\/\//))&&(0,I.jsx)(`p`,{className:`text-xs text-red-500`,children:`URL 必须以 http:// 或 https:// 开头`}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:[...n.milky.webhook.urls,``]}}})},className:`flex items-center gap-2 px-4 py-2 text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors text-sm font-medium`,children:[(0,I.jsx)(Ge,{size:18}),`添加 Webhook URL`]})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-2`,children:`事件上报的 Webhook 地址`})]}),(0,I.jsxs)(`div`,{className:`mt-4`,children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Access Token`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`input`,{type:T?`text`:`password`,value:n.milky.webhook.accessToken,onChange:e=>r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,accessToken:e.target.value}}}),placeholder:`请输入 Access Token`,className:`input-field pr-12`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>E(!T),className:`absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1`,children:T?(0,I.jsx)(ve,{size:20}):(0,I.jsx)(ye,{size:20})})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`用于 Webhook 请求验证的 Token`})]})]})]})]}),(0,I.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,I.jsx)(`button`,{onClick:()=>{if(n.milky.http.host===``&&n.milky.enable&&!n.milky.http.accessToken?.trim()){L(`当监听所有地址时,必须设置 Milky Access Token!`,`error`);return}if(n.milky.webhook.urls.filter(e=>e.trim()&&!e.match(/^https?:\/\//)).length>0){L(`Webhook URL 必须以 http:// 或 https:// 开头`,`error`);return}let e={...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:n.milky.webhook.urls.filter(e=>e.trim())}}};r(e),ce(e)},disabled:o,className:`btn-primary flex items-center gap-2`,children:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{size:20,className:`animate-spin`}),`保存中...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ye,{size:20}),`保存配置`]})})})]}),e===`other`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`pb-24`,children:(0,I.jsx)(Mn,{config:n,emailConfig:i,onChange:r,onEmailChange:a,onOpenChangePassword:()=>O(!0)})}),(0,I.jsx)(`div`,{className:`fixed bottom-8 right-8 z-40`,children:(0,I.jsx)(`button`,{onClick:()=>ce(),disabled:o,className:`btn-primary flex items-center gap-2 shadow-2xl hover:shadow-3xl`,children:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{size:20,className:`animate-spin`}),`保存中...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ye,{size:20}),`保存配置`]})})})]}),e===`about`&&(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`card p-8 text-center`,children:[(0,I.jsx)(`div`,{className:`w-20 h-20 rounded-3xl overflow-hidden mx-auto mb-6 shadow-lg`,children:(0,I.jsx)(`img`,{src:`/logo.jpg`,alt:`Logo`,className:`w-full h-full object-cover`})}),(0,I.jsx)(`h1`,{className:`text-3xl font-bold text-theme mb-2`,children:`Lucky Lillia Bot`}),(0,I.jsx)(`p`,{className:`text-theme-secondary mb-6`,children:`使你的 QQNT 支持 OneBot 11 协议、Satori 协议、Milky 协议进行 QQ 机器人开发`}),(0,I.jsxs)(`div`,{className:`flex items-center justify-center gap-4`,children:[(0,I.jsxs)(`a`,{href:`https://github.com/LLOneBot/LuckyLilliaBot`,target:`_blank`,rel:`noopener noreferrer`,className:`px-6 py-2.5 bg-gray-800 dark:bg-neutral-700 text-white rounded-xl hover:bg-gray-900 dark:hover:bg-neutral-600 transition-colors flex items-center gap-2`,children:[(0,I.jsx)(`svg`,{className:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{fillRule:`evenodd`,d:`M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z`,clipRule:`evenodd`})}),`GitHub`]}),(0,I.jsxs)(`a`,{href:`https://luckylillia.com`,target:`_blank`,rel:`noopener noreferrer`,className:`px-6 py-2.5 gradient-primary text-white rounded-xl hover:shadow-lg transition-all flex items-center gap-2`,children:[(0,I.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253`})}),`文档`]})]})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center`,children:(0,I.jsx)(`svg`,{className:`w-6 h-6 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{d:`M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z`})})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`Telegram 群`}),(0,I.jsx)(`p`,{className:`text-sm text-theme-secondary`})]})]}),(0,I.jsx)(`a`,{href:`https://t.me/+nLZEnpne-pQ1OWFl`,target:`_blank`,rel:`noopener noreferrer`,className:`text-pink-500 hover:text-pink-600 hover:underline text-sm break-all`,children:`https://t.me/+nLZEnpne-pQ1OWFl`})]}),(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-green-500 to-emerald-600 flex items-center justify-center`,children:(0,I.jsx)(`svg`,{className:`w-6 h-6 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{d:`M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z`})})}),(0,I.jsx)(`div`,{children:(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`QQ 群`})})]}),(0,I.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,I.jsx)(`a`,{href:`https://qm.qq.com/q/EZndy3xntQ`,target:`_blank`,rel:`noopener noreferrer`,className:` text-pink-500 hover:text-pink-600 hover:underline`,children:`545402644`})})]})]}),(0,I.jsx)(`div`,{className:`card p-6`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center`,children:(0,I.jsx)(`svg`,{className:`w-5 h-5 text-white`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`版本信息`}),(0,I.jsxs)(`div`,{className:`text-xs text-theme-muted`,children:[`Lucky Lillia Bot `,`7.12.10`]}),ee&&(0,I.jsxs)(`div`,{className:`text-xs text-theme-muted`,children:[`QQ `,ee]})]})]}),(0,I.jsxs)(`div`,{className:`text-sm text-theme-secondary`,children:[`WebUI Powered by `,(0,I.jsx)(`span`,{className:`font-semibold text-pink-500`,children:`React + Tailwind`})]})]})})]})]})]}),o&&(0,I.jsx)(`div`,{className:`fixed inset-0 bg-black/20 dark:bg-black/40 flex items-center justify-center`,style:{zIndex:9e3},children:(0,I.jsxs)(`div`,{className:`bg-theme-card backdrop-blur-xl rounded-2xl p-6 shadow-2xl`,children:[(0,I.jsx)(N,{size:48,className:`animate-spin text-pink-500 mx-auto`}),(0,I.jsx)(`p`,{className:`mt-4 text-theme`,children:`加载中...`})]})}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g}),(0,I.jsx)(Pn,{visible:D,onClose:()=>O(!1),onSuccess:()=>{window.location.reload()}}),(0,I.jsx)(kt,{}),(0,I.jsx)(qt,{visible:oe,onClose:()=>k(!1),onLogout:()=>{$t(`webui_token`),window.location.reload()}})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(In,{onLoginSuccess:le}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g}),(0,I.jsx)(kt,{})]})}var Za=localStorage.getItem(`llbot-theme`);if(Za)try{let{state:e}=JSON.parse(Za);e?.isDark&&document.documentElement.classList.add(`dark`)}catch{}St.createRoot(document.getElementById(`root`)).render((0,I.jsx)(C.StrictMode,{children:(0,I.jsx)(Xa,{})}));
|
|
37
|
+
`,children:(0,I.jsx)(Ua,{session:d,onShowMembers:()=>_(!m),onNewMessageCallback:re,onEmojiReactionCallback:ie,onMessageRecalledCallback:ae,appendInputMention:D,onAppendInputMentionConsumed:te,onBack:ce,showBackButton:k})}),m&&d?.chatType===2&&(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 bg-white/85 dark:bg-neutral-900/85 backdrop-blur-xl md:static md:inset-auto md:z-auto md:bg-transparent md:backdrop-blur-none md:w-64 md:border-l md:border-theme-divider md:flex-shrink-0`,children:(0,I.jsx)(Ga,{groupCode:d.peerId,onClose:()=>_(!1),onAtMember:ee})})]}),!e&&o&&(0,I.jsx)(`button`,{onClick:()=>window.open(`#webqq-fullscreen`,`_blank`),className:`fixed top-4 right-4 md:top-auto md:bottom-6 md:right-6 z-50 p-3 bg-pink-500/70 hover:bg-pink-500/90 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-200 group backdrop-blur-sm`,title:`在新窗口中全屏打开`,children:(0,I.jsx)(Ne,{size:20,className:`group-hover:scale-110 transition-transform`})})]})},Ja=()=>(0,I.jsx)(`div`,{className:`h-screen bg-theme p-4 md:p-8`,children:(0,I.jsx)(qa,{isFullscreen:!0})}),Ya={webui:{enable:!0,host:`127.0.0.1`,port:3080},milky:{enable:!1,reportSelfMessage:!1,http:{host:`127.0.0.1`,port:3010,prefix:``,accessToken:``},webhook:{urls:[],accessToken:``}},satori:{enable:!1,host:`127.0.0.1`,port:5600,token:``},ob11:{enable:!0,connect:[]},enableLocalFile2Url:!1,log:!0,autoDeleteFile:!1,autoDeleteFileSecond:60,musicSignUrl:`https://ss.xingzhige.com/music_card/card`,msgCacheExpire:120,ffmpeg:``,rawMsgPB:!1};function Xa(){let[e,t]=(0,C.useState)(()=>{let e=window.location.hash.slice(1);return[`dashboard`,`onebot`,`satori`,`milky`,`logs`,`other`,`webqq`,`webqq-fullscreen`,`about`].includes(e)?e:`dashboard`}),[n,r]=(0,C.useState)(Ya),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!0),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)(!1),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(null),[b,x]=(0,C.useState)(!1),[S,w]=(0,C.useState)(!1),[T,E]=(0,C.useState)(!1),[D,O]=(0,C.useState)(!1),[ee,te]=(0,C.useState)(``),[ne,re]=(0,C.useState)(!1),[ie,ae]=(0,C.useState)(!1),[oe,k]=(0,C.useState)(!1),{autoHideSidebarInWebQQ:A}=Kt();(0,C.useEffect)(()=>{rn(async e=>new Promise(t=>{_(e||``),h(!0),y(()=>t)}))},[]),(0,C.useEffect)(()=>{window.location.hash=e},[e]),(0,C.useEffect)(()=>{A&&e===`webqq`&&ae(!0)},[e,A]),(0,C.useEffect)(()=>{let e=()=>{let e=window.location.hash.slice(1);[`dashboard`,`onebot`,`satori`,`milky`,`logs`,`other`,`webqq`,`webqq-fullscreen`,`about`].includes(e)&&t(e)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let se=(0,C.useCallback)(e=>{e.trim()?(h(!1),_(``),v&&(v(e),y(null))):_(`密码不能为空`)},[v]);(0,C.useEffect)(()=>{(async()=>{try{let e=await R(`/api/config`);if(e.success&&e.data.selfInfo.online){l(!0),p({nick:e.data.selfInfo.nick||``,uin:e.data.selfInfo.uin}),r(e.data.config);try{let e=await R(`/api/email/config`);e.success&&e.data&&a(e.data)}catch(e){console.error(`Failed to fetch email config:`,e)}try{let e=await R(`/api/device-info`);e.success&&e.data?.buildVer&&te(e.data.buildVer)}catch(e){console.error(`Failed to fetch device info:`,e)}}else l(!1)}catch(e){console.error(`Failed to check login status:`,e),l(!1)}finally{d(!1)}})()},[]);let ce=(0,C.useCallback)(async(e,t)=>{try{s(!0);let r=e||n,a=t===void 0?i:t,o=await R(`/api/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({config:r})});if(!o.success){L(o.message||`保存失败`,`error`);return}if(a)try{let e=await R(`/api/email/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)});if(!e.success){L(`主配置已保存,但邮件配置保存失败:${e.message}`,`warning`);return}}catch(e){L(`主配置已保存,但邮件配置保存失败:${String(e)}`,`warning`);return}L(`配置保存成功`,`success`)}catch(e){L(e instanceof Error?e.message:`保存失败`,`error`)}finally{s(!1)}},[n,i]),le=(0,C.useCallback)(()=>{window.location.reload()},[]);return u?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(`div`,{className:`relative flex items-center justify-center min-h-screen z-10`,children:(0,I.jsx)(N,{size:48,className:`animate-spin text-pink-500`})}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g})]}):c?e===`webqq-fullscreen`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(Ja,{}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g}),(0,I.jsx)(kt,{})]}):(0,I.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(dn,{activeTab:e,onTabChange:t,accountInfo:f||void 0,isOpen:ne,onClose:()=>re(!1),collapsed:ie,onToggleCollapse:()=>ae(!ie),onOpenSettings:()=>k(!0)}),(0,I.jsxs)(`main`,{className:`flex-1 overflow-auto z-10 transition-all duration-300 ${ie?``:`md:ml-64`}`,children:[(0,I.jsxs)(`div`,{className:`md:hidden sticky top-0 z-30 bg-theme-card/95 backdrop-blur-xl border-b border-theme-divider px-4 py-3 flex items-center gap-3`,children:[(0,I.jsx)(`button`,{onClick:()=>re(!0),className:`p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors`,children:(0,I.jsx)(Pe,{size:24})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`img`,{src:`/logo.jpg`,alt:`Logo`,className:`w-8 h-8 rounded-lg`}),(0,I.jsx)(`span`,{className:`font-semibold text-theme`,children:`LLBot`})]})]}),(0,I.jsxs)(`div`,{className:`p-4 md:p-8 max-w-6xl mx-auto`,children:[(0,I.jsxs)(`div`,{className:`mb-8 hidden md:block`,children:[(0,I.jsx)(`h2`,{className:`text-3xl font-bold text-white mb-2`,children:e===`dashboard`&&`Dashboard`}),(0,I.jsx)(`p`,{className:`text-white/80`,children:e===`dashboard`&&`欢迎使用 Lucky Lillia Bot`})]}),e===`dashboard`&&(0,I.jsx)(vn,{llbotVersion:`7.12.13`,qqVersion:ee}),e===`webqq`&&(0,I.jsx)(qa,{}),e===`logs`&&(0,I.jsx)(Sn,{}),e===`onebot`&&(0,I.jsx)(kn,{config:n.ob11,onChange:e=>{r({...n,ob11:e})},onSave:e=>{e?ce({...n,ob11:e}):ce()}}),e===`satori`&&(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-6`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center`,children:(0,I.jsx)(he,{size:24,className:`text-white`})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`Satori 协议`}),(0,I.jsx)(`p`,{className:`text-sm text-theme-secondary`,children:`配置 Satori 协议相关设置`})]}),(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.jsxs)(`a`,{href:`https://www.luckylillia.com/guide/develop#satori-%E5%8D%8F%E8%AE%AE`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors`,children:[(0,I.jsx)(_e,{size:16}),`文档`]})]}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`启用 Satori 协议`}),(0,I.jsx)(`div`,{className:`text-xs text-theme-muted mt-0.5`,children:`开启后将支持 Satori 协议连接`})]}),(0,I.jsx)(`input`,{type:`checkbox`,checked:n.satori.enable,onChange:e=>r({...n,satori:{...n.satori,enable:e.target.checked}}),className:`switch-toggle`})]}),n.satori.enable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`监听地址`}),(0,I.jsx)(ln,{value:n.satori.host,onChange:e=>r({...n,satori:{...n.satori,host:e}})}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`选择服务监听的网络地址`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Satori 端口`}),(0,I.jsx)(`input`,{type:`number`,value:n.satori.port,onChange:e=>r({...n,satori:{...n.satori,port:parseInt(e.target.value)}}),min:`1`,max:`65535`,placeholder:`5500`,className:`input-field`}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`Satori 服务监听端口(1-65535)`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Satori Token`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`input`,{type:b?`text`:`password`,value:n.satori.token,onChange:e=>r({...n,satori:{...n.satori,token:e.target.value}}),placeholder:`请输入 Satori Token`,className:`input-field pr-12`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>x(!b),className:`absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1`,children:b?(0,I.jsx)(ve,{size:20}):(0,I.jsx)(ye,{size:20})})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`用于 Satori 连接验证的 Token`})]})]})]}),(0,I.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,I.jsx)(`button`,{onClick:()=>{if(n.satori.host===``&&n.satori.enable&&!n.satori.token?.trim()){L(`当监听所有地址时,必须设置 Satori Token!`,`error`);return}ce()},disabled:o,className:`btn-primary flex items-center gap-2`,children:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{size:20,className:`animate-spin`}),`保存中...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ye,{size:20}),`保存配置`]})})})]}),e===`milky`&&(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-6`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center`,children:(0,I.jsx)(Le,{size:24,className:`text-white`})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`Milky 协议`}),(0,I.jsx)(`p`,{className:`text-sm text-theme-secondary`,children:`配置 Milky 协议相关设置`})]}),(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.jsxs)(`a`,{href:`https://www.luckylillia.com/guide/develop#milky-%E5%8D%8F%E8%AE%AE`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors`,children:[(0,I.jsx)(_e,{size:16}),`文档`]})]}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`启用 Milky 协议`}),(0,I.jsx)(`div`,{className:`text-xs text-theme-muted mt-0.5`,children:`开启后将支持 Milky 协议连接`})]}),(0,I.jsx)(`input`,{type:`checkbox`,checked:n.milky.enable,onChange:e=>r({...n,milky:{...n.milky,enable:e.target.checked}}),className:`switch-toggle`})]}),n.milky.enable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-theme-item rounded-xl hover:bg-theme-item-hover transition-colors`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`上报自己发送的消息`}),(0,I.jsx)(`div`,{className:`text-xs text-theme-muted mt-0.5`,children:`启用后将上报自己发送的消息`})]}),(0,I.jsx)(`input`,{type:`checkbox`,checked:n.milky.reportSelfMessage,onChange:e=>r({...n,milky:{...n.milky,reportSelfMessage:e.target.checked}}),className:`switch-toggle`})]}),(0,I.jsxs)(`div`,{className:`border-t border-theme-divider pt-4 mt-4`,children:[(0,I.jsx)(`h4`,{className:`text-md font-semibold text-theme mb-4`,children:`HTTP 配置`}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`监听地址`}),(0,I.jsx)(ln,{value:n.milky.http.host,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,host:e}}})}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`选择服务监听的网络地址`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`HTTP 端口`}),(0,I.jsx)(`input`,{type:`number`,value:n.milky.http.port,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,port:parseInt(e.target.value)}}}),min:`1`,max:`65535`,placeholder:`3010`,className:`input-field`}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`Milky HTTP 服务监听端口(1-65535)`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`路径前缀`}),(0,I.jsx)(`input`,{type:`text`,value:n.milky.http.prefix,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,prefix:e.target.value}}}),placeholder:`/api`,className:`input-field`}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`HTTP API 路径前缀(可选)`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Access Token`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`input`,{type:S?`text`:`password`,value:n.milky.http.accessToken,onChange:e=>r({...n,milky:{...n.milky,http:{...n.milky.http,accessToken:e.target.value}}}),placeholder:`请输入 Access Token`,className:`input-field pr-12`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(!S),className:`absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1`,children:S?(0,I.jsx)(ve,{size:20}):(0,I.jsx)(ye,{size:20})})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`用于 Milky HTTP 连接验证的 Token`})]})]})]}),(0,I.jsxs)(`div`,{className:`border-t border-theme-divider pt-4 mt-4`,children:[(0,I.jsx)(`h4`,{className:`text-md font-semibold text-theme mb-4`,children:`Webhook 配置`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Webhook URLs`}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[n.milky.webhook.urls.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`input`,{type:`text`,value:e,onChange:e=>{let i=[...n.milky.webhook.urls];i[t]=e.target.value,r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:i}}})},placeholder:`http:// 或 https://`,className:`input-field flex-1 ${e&&!e.match(/^https?:\/\//)?`border-red-300 focus:ring-red-500`:``}`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let e=n.milky.webhook.urls.filter((e,n)=>n!==t);r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:e}}})},className:`p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 rounded-lg transition-colors`,title:`删除`,children:(0,I.jsx)(F,{size:18})})]},t)),n.milky.webhook.urls.some(e=>e&&!e.match(/^https?:\/\//))&&(0,I.jsx)(`p`,{className:`text-xs text-red-500`,children:`URL 必须以 http:// 或 https:// 开头`}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:[...n.milky.webhook.urls,``]}}})},className:`flex items-center gap-2 px-4 py-2 text-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/30 rounded-lg transition-colors text-sm font-medium`,children:[(0,I.jsx)(Ge,{size:18}),`添加 Webhook URL`]})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-2`,children:`事件上报的 Webhook 地址`})]}),(0,I.jsxs)(`div`,{className:`mt-4`,children:[(0,I.jsx)(`label`,{className:`block text-sm font-medium text-theme-secondary mb-2`,children:`Access Token`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`input`,{type:T?`text`:`password`,value:n.milky.webhook.accessToken,onChange:e=>r({...n,milky:{...n.milky,webhook:{...n.milky.webhook,accessToken:e.target.value}}}),placeholder:`请输入 Access Token`,className:`input-field pr-12`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>E(!T),className:`absolute right-3 top-1/2 -translate-y-1/2 text-theme-hint hover:text-theme transition-colors p-1`,children:T?(0,I.jsx)(ve,{size:20}):(0,I.jsx)(ye,{size:20})})]}),(0,I.jsx)(`p`,{className:`text-xs text-theme-muted mt-1`,children:`用于 Webhook 请求验证的 Token`})]})]})]})]}),(0,I.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,I.jsx)(`button`,{onClick:()=>{if(n.milky.http.host===``&&n.milky.enable&&!n.milky.http.accessToken?.trim()){L(`当监听所有地址时,必须设置 Milky Access Token!`,`error`);return}if(n.milky.webhook.urls.filter(e=>e.trim()&&!e.match(/^https?:\/\//)).length>0){L(`Webhook URL 必须以 http:// 或 https:// 开头`,`error`);return}let e={...n,milky:{...n.milky,webhook:{...n.milky.webhook,urls:n.milky.webhook.urls.filter(e=>e.trim())}}};r(e),ce(e)},disabled:o,className:`btn-primary flex items-center gap-2`,children:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{size:20,className:`animate-spin`}),`保存中...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ye,{size:20}),`保存配置`]})})})]}),e===`other`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`pb-24`,children:(0,I.jsx)(Mn,{config:n,emailConfig:i,onChange:r,onEmailChange:a,onOpenChangePassword:()=>O(!0)})}),(0,I.jsx)(`div`,{className:`fixed bottom-8 right-8 z-40`,children:(0,I.jsx)(`button`,{onClick:()=>ce(),disabled:o,className:`btn-primary flex items-center gap-2 shadow-2xl hover:shadow-3xl`,children:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{size:20,className:`animate-spin`}),`保存中...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ye,{size:20}),`保存配置`]})})})]}),e===`about`&&(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`card p-8 text-center`,children:[(0,I.jsx)(`div`,{className:`w-20 h-20 rounded-3xl overflow-hidden mx-auto mb-6 shadow-lg`,children:(0,I.jsx)(`img`,{src:`/logo.jpg`,alt:`Logo`,className:`w-full h-full object-cover`})}),(0,I.jsx)(`h1`,{className:`text-3xl font-bold text-theme mb-2`,children:`Lucky Lillia Bot`}),(0,I.jsx)(`p`,{className:`text-theme-secondary mb-6`,children:`使你的 QQNT 支持 OneBot 11 协议、Satori 协议、Milky 协议进行 QQ 机器人开发`}),(0,I.jsxs)(`div`,{className:`flex items-center justify-center gap-4`,children:[(0,I.jsxs)(`a`,{href:`https://github.com/LLOneBot/LuckyLilliaBot`,target:`_blank`,rel:`noopener noreferrer`,className:`px-6 py-2.5 bg-gray-800 dark:bg-neutral-700 text-white rounded-xl hover:bg-gray-900 dark:hover:bg-neutral-600 transition-colors flex items-center gap-2`,children:[(0,I.jsx)(`svg`,{className:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{fillRule:`evenodd`,d:`M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z`,clipRule:`evenodd`})}),`GitHub`]}),(0,I.jsxs)(`a`,{href:`https://luckylillia.com`,target:`_blank`,rel:`noopener noreferrer`,className:`px-6 py-2.5 gradient-primary text-white rounded-xl hover:shadow-lg transition-all flex items-center gap-2`,children:[(0,I.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253`})}),`文档`]})]})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl gradient-primary-br flex items-center justify-center`,children:(0,I.jsx)(`svg`,{className:`w-6 h-6 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{d:`M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z`})})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`Telegram 群`}),(0,I.jsx)(`p`,{className:`text-sm text-theme-secondary`})]})]}),(0,I.jsx)(`a`,{href:`https://t.me/+nLZEnpne-pQ1OWFl`,target:`_blank`,rel:`noopener noreferrer`,className:`text-pink-500 hover:text-pink-600 hover:underline text-sm break-all`,children:`https://t.me/+nLZEnpne-pQ1OWFl`})]}),(0,I.jsxs)(`div`,{className:`card p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,I.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-green-500 to-emerald-600 flex items-center justify-center`,children:(0,I.jsx)(`svg`,{className:`w-6 h-6 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{d:`M16.5 3c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 4.171 4.912 8.213 6.281 9.49a2.94 2.94 0 0 0 2.438.94 2.94 2.94 0 0 0 2.438-.94C14.588 16.713 19.5 12.671 19.5 8.5 19.5 5.462 17.038 3 16.5 3z`})})}),(0,I.jsx)(`div`,{children:(0,I.jsx)(`h3`,{className:`text-lg font-semibold text-theme`,children:`QQ 群`})})]}),(0,I.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,I.jsx)(`a`,{href:`https://qm.qq.com/q/EZndy3xntQ`,target:`_blank`,rel:`noopener noreferrer`,className:` text-pink-500 hover:text-pink-600 hover:underline`,children:`545402644`})})]})]}),(0,I.jsx)(`div`,{className:`card p-6`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`w-10 h-10 rounded-xl gradient-primary-br flex items-center justify-center`,children:(0,I.jsx)(`svg`,{className:`w-5 h-5 text-white`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,I.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-theme`,children:`版本信息`}),(0,I.jsxs)(`div`,{className:`text-xs text-theme-muted`,children:[`Lucky Lillia Bot `,`7.12.13`]}),ee&&(0,I.jsxs)(`div`,{className:`text-xs text-theme-muted`,children:[`QQ `,ee]})]})]}),(0,I.jsxs)(`div`,{className:`text-sm text-theme-secondary`,children:[`WebUI Powered by `,(0,I.jsx)(`span`,{className:`font-semibold text-pink-500`,children:`React + Tailwind`})]})]})})]})]})]}),o&&(0,I.jsx)(`div`,{className:`fixed inset-0 bg-black/20 dark:bg-black/40 flex items-center justify-center`,style:{zIndex:9e3},children:(0,I.jsxs)(`div`,{className:`bg-theme-card backdrop-blur-xl rounded-2xl p-6 shadow-2xl`,children:[(0,I.jsx)(N,{size:48,className:`animate-spin text-pink-500 mx-auto`}),(0,I.jsx)(`p`,{className:`mt-4 text-theme`,children:`加载中...`})]})}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g}),(0,I.jsx)(Pn,{visible:D,onClose:()=>O(!1),onSuccess:()=>{window.location.reload()}}),(0,I.jsx)(kt,{}),(0,I.jsx)(qt,{visible:oe,onClose:()=>k(!1),onLogout:()=>{$t(`webui_token`),window.location.reload()}})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Gt,{}),(0,I.jsx)(In,{onLoginSuccess:le}),(0,I.jsx)(Fn,{visible:m,onConfirm:se,error:g}),(0,I.jsx)(kt,{})]})}var Za=localStorage.getItem(`llbot-theme`);if(Za)try{let{state:e}=JSON.parse(Za);e?.isDark&&document.documentElement.classList.add(`dark`)}catch{}St.createRoot(document.getElementById(`root`)).render((0,I.jsx)(C.StrictMode,{children:(0,I.jsx)(Xa,{})}));
|
package/webui/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>WebUI</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-nQk7kGKN.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-D-XIyK1s.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
V7.12.13
|
|
2
|
+
更新时间 2026-05-05
|
|
3
|
+
|
|
4
|
+
* OneBot 修复 get_forward_msg API 获取包含视频的聊天记录时报错
|
|
5
|
+
* OneBot 修复设置事件过滤器后导致反向 WS 频繁断线重连
|
|
6
|
+
|
|
7
|
+
=================
|
|
8
|
+
V7.12.11
|
|
9
|
+
更新时间 2026-05-03
|
|
10
|
+
|
|
11
|
+
* OneBot 修复 send_group_ai_record API 返回无效的 message_id
|
|
12
|
+
|
|
13
|
+
=================
|
|
1
14
|
V7.12.10
|
|
2
15
|
更新时间 2026-04-30
|
|
3
16
|
|