Files
weiyu/deploy/server/admin/p__Debug__index.2a61aff1.async.js
2025-12-17 17:03:07 +08:00

1 line
4.1 KiB
JavaScript

"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[5481],{58272:function(e,o,r){r.r(o);var l=r(45332),s=r.n(l),f=r(44194),t=r(37351),n=r(14999),d=r(22060),c=r(76185),a=r(15384),i=r(36265),x=r(42539),y=r(61376),h=r(31549),u=t.Z.Title,b=t.Z.Text;o.default=function(){var e=(0,f.useState)("INFO"),o=s()(e,2),r=o[0],l=o[1],t=(0,f.useContext)(y.I).isDarkMode;(0,f.useEffect)((function(){var e=localStorage.getItem(i.pOC);l("DEBUG"===e||"INFO"===e||"WARN"===e||"ERROR"===e?e:"INFO")}),[]);return(0,h.jsx)("div",{style:{height:"100vh",backgroundColor:t?"#141414":"#f5f5f5",overflowY:"auto"},children:(0,h.jsxs)("div",{style:{padding:"24px",maxWidth:"800px",margin:"0 auto",color:t?"#fff":"#000"},children:[(0,h.jsx)(u,{level:2,style:{color:t?"#fff":"#000"},children:"调试"}),(0,h.jsx)(d.Z,{title:"日志设置",style:{marginBottom:"16px",backgroundColor:t?"#1f1f1f":"#fff",borderColor:t?"#434343":"#d9d9d9"},styles:{header:{backgroundColor:t?"#1f1f1f":"#fff",color:t?"#fff":"#000",borderBottomColor:t?"#434343":"#d9d9d9"},body:{backgroundColor:t?"#1f1f1f":"#fff",color:t?"#fff":"#000"}},children:(0,h.jsxs)(c.Z,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,h.jsxs)("div",{children:[(0,h.jsx)(b,{strong:!0,style:{color:t?"#fff":"#000"},children:"当前状态"}),(0,h.jsx)("br",{}),(0,h.jsxs)(b,{type:"secondary",style:{color:t?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:["调试模式:","生产环境"]}),(0,h.jsx)("br",{}),(0,h.jsxs)(b,{type:"secondary",style:{color:t?"#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:t?"#fff":"#000"},children:"日志级别"}),(0,h.jsx)("br",{}),(0,h.jsx)(b,{type:"secondary",style:{fontSize:"12px",color:t?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:"控制输出的最低日志级别(设置为 ERROR 可最小化输出)"})]}),(0,h.jsx)(a.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:t?"#177ddc":"#1890ff",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"},children:"测试日志功能"}),(0,h.jsx)(b,{type:"secondary",style:{marginLeft:"12px",fontSize:"12px",color:t?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:"点击测试各种日志类型的输出"})]})]})}),(0,h.jsx)(d.Z,{title:"使用说明",style:{backgroundColor:t?"#1f1f1f":"#fff",borderColor:t?"#434343":"#d9d9d9"},styles:{header:{backgroundColor:t?"#1f1f1f":"#fff",color:t?"#fff":"#000",borderBottomColor:t?"#434343":"#d9d9d9"},body:{backgroundColor:t?"#1f1f1f":"#fff",color:t?"#fff":"#000"}},children:(0,h.jsxs)(c.Z,{direction:"vertical",size:"small",children:[(0,h.jsx)(b,{style:{color:t?"#fff":"#000"},children:(0,h.jsx)("strong",{children:"日志级别说明:"})}),(0,h.jsx)(b,{style:{color:t?"#fff":"#000"},children:"• DEBUG: 详细的调试信息"}),(0,h.jsx)(b,{style:{color:t?"#fff":"#000"},children:"• INFO: 一般信息"}),(0,h.jsx)(b,{style:{color:t?"#fff":"#000"},children:"• WARN: 警告信息"}),(0,h.jsx)(b,{style:{color:t?"#fff":"#000"},children:"• ERROR: 错误信息(总是显示)"}),(0,h.jsx)("br",{}),(0,h.jsx)(b,{type:"secondary",style:{fontSize:"12px",color:t?"#a6a6a6":"rgba(0, 0, 0, 0.45)"},children:"注意:错误日志始终会显示,不受开关控制。在生产环境中建议关闭日志以提高性能。"})]})})]})})}}}]);