Files
weiyu/deploy/server/admin/p__Debug__index.630abd18.async.js
jack ning 4445905084 update
2025-11-22 13:39:00 +08:00

1 line
4.2 KiB
JavaScript

"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[5481],{77904:function(e,o,r){r.r(o);var l=r(45332),s=r.n(l),t=r(44194),f=r(83001),n=r(59533),a=r(40110),d=r(39487),c=r(13847),i=r(39497),x=r(23753),y=r(23465),h=r(31549),u=f.Z.Title,b=f.Z.Text;o.default=function(){var e=(0,t.useState)("INFO"),o=s()(e,2),r=o[0],l=o[1],f=(0,t.useContext)(y.I).isDarkMode;(0,t.useEffect)((function(){var e=localStorage.getItem(i.aE),o=localStorage.getItem(i.pOC);"DEBUG"===o||"INFO"===o||"WARN"===o||"ERROR"===o?l(o):"false"===e?(l("ERROR"),localStorage.setItem(i.pOC,"ERROR"),localStorage.removeItem(i.aE)):l("INFO")}),[]);return(0,h.jsx)("div",{style:{height:"100vh",backgroundColor:f?"#141414":"#f5f5f5",overflowY:"auto"},children:(0,h.jsxs)("div",{style:{padding:"24px",maxWidth:"800px",margin:"0 auto",color:f?"#fff":"#000"},children:[(0,h.jsx)(u,{level:2,style:{color:f?"#fff":"#000"},children:"调试"}),(0,h.jsx)(a.Z,{title:"日志设置",style:{marginBottom:"16px",backgroundColor:f?"#1f1f1f":"#fff",borderColor:f?"#434343":"#d9d9d9"},styles:{header:{backgroundColor:f?"#1f1f1f":"#fff",color:f?"#fff":"#000",borderBottomColor:f?"#434343":"#d9d9d9"},body:{backgroundColor:f?"#1f1f1f":"#fff",color:f?"#fff":"#000"}},children:(0,h.jsxs)(d.Z,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,h.jsxs)("div",{children:[(0,h.jsx)(b,{strong:!0,style:{color:f?"#fff":"#000"},children:"当前状态"}),(0,h.jsx)("br",{}),(0,h.jsxs)(b,{type:"secondary",style:{color:f?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:["调试模式:","生产环境"]}),(0,h.jsx)("br",{}),(0,h.jsxs)(b,{type:"secondary",style:{color:f?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:["日志级别:",r]})]}),(0,h.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,h.jsxs)("div",{children:[(0,h.jsx)(b,{strong:!0,style:{color:f?"#fff":"#000"},children:"日志级别"}),(0,h.jsx)("br",{}),(0,h.jsx)(b,{type:"secondary",style:{fontSize:"12px",color:f?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:"控制输出的最低日志级别(设置为 ERROR 可最小化输出)"})]}),(0,h.jsx)(c.Z,{value:r,onChange:function(e){l(e),localStorage.setItem(i.pOC,e),n.ZP.success("日志级别已切换为 ".concat(e)),x.Z.info("日志级别已切换为",e)},style:{width:160},options:[{label:"DEBUG",value:"DEBUG"},{label:"INFO",value:"INFO"},{label:"WARN",value:"WARN"},{label:"ERROR",value:"ERROR"}]})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("button",{onClick:function(){x.Z.debug("这是一个调试日志"),x.Z.info("这是一个信息日志"),x.Z.warn("这是一个警告日志"),x.Z.error("这是一个错误日志"),x.Z.log("这是一个普通日志"),x.Z.group("日志分组测试"),x.Z.info("分组内的信息"),x.Z.warn("分组内的警告"),x.Z.groupEnd(),x.Z.table({name:"ByteDesk",version:"1.0.0",type:"Chat System"}),n.ZP.success("日志测试完成,请查看浏览器控制台")},style:{padding:"8px 16px",background:f?"#177ddc":"#1890ff",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"},children:"测试日志功能"}),(0,h.jsx)(b,{type:"secondary",style:{marginLeft:"12px",fontSize:"12px",color:f?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:"点击测试各种日志类型的输出"})]})]})}),(0,h.jsx)(a.Z,{title:"使用说明",style:{backgroundColor:f?"#1f1f1f":"#fff",borderColor:f?"#434343":"#d9d9d9"},styles:{header:{backgroundColor:f?"#1f1f1f":"#fff",color:f?"#fff":"#000",borderBottomColor:f?"#434343":"#d9d9d9"},body:{backgroundColor:f?"#1f1f1f":"#fff",color:f?"#fff":"#000"}},children:(0,h.jsxs)(d.Z,{direction:"vertical",size:"small",children:[(0,h.jsx)(b,{style:{color:f?"#fff":"#000"},children:(0,h.jsx)("strong",{children:"日志级别说明:"})}),(0,h.jsx)(b,{style:{color:f?"#fff":"#000"},children:"• DEBUG: 详细的调试信息"}),(0,h.jsx)(b,{style:{color:f?"#fff":"#000"},children:"• INFO: 一般信息"}),(0,h.jsx)(b,{style:{color:f?"#fff":"#000"},children:"• WARN: 警告信息"}),(0,h.jsx)(b,{style:{color:f?"#fff":"#000"},children:"• ERROR: 错误信息(总是显示)"}),(0,h.jsx)("br",{}),(0,h.jsx)(b,{type:"secondary",style:{fontSize:"12px",color:f?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:"注意:错误日志始终会显示,不受开关控制。在生产环境中建议关闭日志以提高性能。"})]})})]})})}}}]);