| 123 |
- import{i as e}from"./chunk-aKtaBQYM.js";import{C as t,D as n,a as r,w as i,y as a}from"./client-1U8CP3-A.js";import{n as o}from"./QueryClientProvider-DNxj-7q3.js";import{t as s}from"./useQuery-CuYt61na.js";import{t as c}from"./useMutation-Bol60WRP.js";import{t as l}from"./createLucideIcon-Cul4BqgW.js";import{a as u,i as d,n as f,r as p,t as m}from"./info-LY2RC5iR.js";import{t as h}from"./cpu-CuOICTGF.js";import{t as g}from"./hard-drive-DL-_EX8Q.js";import{t as _}from"./loader-circle-D-k3wqK0.js";import{t as v}from"./play-D2hLq8AR.js";import{t as y}from"./search-DAnyCUM_.js";import{t as b}from"./triangle-alert-Dj6qQOvz.js";import{t as x}from"./x-DqK-_AtV.js";import{n as S}from"./AuthContext-BQuxe7K9.js";import{t as C}from"./Card-PxwWH-ub.js";import{a as w}from"./date-G9KUauqz.js";import{$t as T,B as E,En as D,In as O,It as k,Rn as A,Rt as j,Tn as M,Ut as N,Yt as P,_ as F,bn as I,g as L,jn as R,jt as z,kn as B,qt as V,tn as H,yn as ee}from"./index-C6-VhZuX.js";var te=l(`headphones`,[[`path`,{d:`M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3`,key:`1xhozi`}]]),ne=l(`heart-pulse`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]),re=l(`memory-stick`,[[`path`,{d:`M6 19v-3`,key:`1nvgqn`}],[`path`,{d:`M10 19v-3`,key:`iu8nkm`}],[`path`,{d:`M14 19v-3`,key:`kcehxu`}],[`path`,{d:`M18 19v-3`,key:`1vh91z`}],[`path`,{d:`M8 11V9`,key:`63erz4`}],[`path`,{d:`M16 11V9`,key:`fru6f3`}],[`path`,{d:`M12 11V9`,key:`ha00sb`}],[`path`,{d:`M2 15h20`,key:`16ne18`}],[`path`,{d:`M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z`,key:`lhddv3`}]]),U=e(n(),1),W=t(),G=[`DEBUG`,`INFO`,`WARNING`,`ERROR`],K={DEBUG:`text-gray-400`,INFO:`text-blue-400`,WARNING:`text-yellow-400`,ERROR:`text-red-400`},q={DEBUG:O,INFO:m,WARNING:b,ERROR:p};function ie(){let e=o(),[t,n]=(0,U.useState)(!0),[r,i]=(0,U.useState)(new Set),[l,f]=(0,U.useState)(``),[p,h]=(0,U.useState)(`ALL`),[g,_]=(0,U.useState)(!1),[b,S]=(0,U.useState)(!1),C=(0,U.useRef)(null),{data:w,isLoading:T,refetch:E}=s({queryKey:[`application-logs`,p,l],queryFn:()=>a.getLogs({limit:200,level:p===`ALL`?void 0:p,search:l||void 0}),refetchInterval:b?2e3:!1,enabled:g});(0,U.useEffect)(()=>{g||S(!1)},[g]);let D=c({mutationFn:()=>a.clearLogs(),onSuccess:()=>{e.invalidateQueries({queryKey:[`application-logs`]})}});(0,U.useEffect)(()=>{t&&C.current&&w?.entries&&(C.current.scrollTop=C.current.scrollHeight)},[w?.entries,t]);let k=e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},A=e=>{let t=e.split(` `);return t.length>=2?t[1]:e},M=(0,U.useMemo)(()=>w?.entries??[],[w?.entries]),N=(0,U.useMemo)(()=>[...M].reverse(),[M]),P=({level:e})=>(0,W.jsx)(q[e]||m,{className:`w-3.5 h-3.5 ${K[e]||`text-gray-400`}`});return(0,W.jsxs)(`div`,{className:`bg-bambu-dark rounded-lg overflow-hidden`,children:[(0,W.jsxs)(`button`,{onClick:()=>_(!g),className:`w-full flex items-center justify-between p-4 hover:bg-bambu-dark-tertiary/50 transition-colors`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`p-2 rounded-lg ${b?`bg-bambu-green/20 text-bambu-green`:`bg-bambu-dark-tertiary text-bambu-gray`}`,children:(0,W.jsx)(O,{className:`w-5 h-5`})}),(0,W.jsxs)(`div`,{className:`text-left`,children:[(0,W.jsx)(`p`,{className:`font-medium text-white`,children:`Application Logs`}),(0,W.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:b?`Live streaming - ${w?.filtered_count??0} entries`:`View and filter application logs`})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 px-2 py-1 bg-bambu-green/20 rounded text-bambu-green text-xs`,children:[(0,W.jsx)(`span`,{className:`w-1.5 h-1.5 bg-bambu-green rounded-full animate-pulse`}),`Live`]}),g?(0,W.jsx)(d,{className:`w-5 h-5 text-bambu-gray`}):(0,W.jsx)(u,{className:`w-5 h-5 text-bambu-gray`})]})]}),g&&(0,W.jsxs)(`div`,{className:`border-t border-bambu-dark-tertiary`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 p-4 border-b border-bambu-dark-tertiary`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[b?(0,W.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),S(!1)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-500/30 rounded transition-colors`,children:[(0,W.jsx)(j,{className:`w-4 h-4`}),`Stop`]}):(0,W.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),S(!0),E()},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-bambu-green/20 text-bambu-green hover:bg-bambu-green/30 rounded transition-colors`,children:[(0,W.jsx)(v,{className:`w-4 h-4`}),`Start`]}),(0,W.jsxs)(`button`,{onClick:()=>D.mutate(),disabled:D.isPending||M.length===0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-bambu-dark-tertiary text-bambu-gray hover:text-white hover:bg-bambu-dark-secondary rounded transition-colors disabled:opacity-50`,children:[(0,W.jsx)(z,{className:`w-4 h-4`}),`Clear`]}),(0,W.jsx)(`button`,{onClick:()=>E(),disabled:T,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-bambu-dark-tertiary text-bambu-gray hover:text-white hover:bg-bambu-dark-secondary rounded transition-colors disabled:opacity-50`,children:(0,W.jsx)(V,{className:`w-4 h-4 ${T?`animate-spin`:``}`})}),(0,W.jsx)(`div`,{className:`flex-1`}),(0,W.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-bambu-gray cursor-pointer`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked),className:`rounded border-bambu-dark-tertiary bg-bambu-dark-tertiary`}),`Auto-scroll`]}),(0,W.jsxs)(`span`,{className:`text-sm text-bambu-gray`,children:[w?.filtered_count??0,`/`,w?.total_in_file??0]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(`div`,{className:`relative flex-1`,children:[(0,W.jsx)(y,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-bambu-gray`}),(0,W.jsx)(`input`,{type:`text`,placeholder:`Search message or logger name...`,value:l,onChange:e=>f(e.target.value),className:`w-full pl-8 pr-8 py-1.5 text-sm bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded text-white placeholder-bambu-gray focus:border-bambu-green focus:outline-none`}),l&&(0,W.jsx)(`button`,{onClick:()=>f(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-bambu-gray hover:text-white`,children:(0,W.jsx)(x,{className:`w-4 h-4`})})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1 bg-bambu-dark-secondary rounded border border-bambu-dark-tertiary`,children:[(0,W.jsx)(`button`,{onClick:()=>h(`ALL`),className:`px-2 py-1.5 text-xs rounded-l transition-colors ${p===`ALL`?`bg-bambu-green text-white`:`text-bambu-gray hover:text-white`}`,children:`All`}),G.map((e,t)=>(0,W.jsx)(`button`,{onClick:()=>h(e),className:`px-2 py-1.5 text-xs transition-colors flex items-center gap-1 ${t===G.length-1?`rounded-r`:``} ${p===e?`${K[e]} bg-bambu-dark-tertiary`:`text-bambu-gray hover:text-white`}`,children:e},e))]})]})]}),(0,W.jsx)(`div`,{ref:C,className:`overflow-auto font-mono text-xs bg-black min-h-[300px] max-h-[500px]`,children:M.length===0?(0,W.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[300px] text-bambu-gray`,children:[(0,W.jsx)(`p`,{className:`mb-2`,children:`No log entries found`}),(0,W.jsx)(`p`,{className:`text-sm`,children:`Log file may be empty or cleared`})]}):(0,W.jsx)(`div`,{className:`divide-y divide-bambu-dark-tertiary/30`,children:N.map((e,t)=>{let n=r.has(t),i=e.message.includes(`
- `);return(0,W.jsx)(`div`,{className:`p-2 cursor-pointer hover:bg-bambu-dark-secondary/50 transition-colors ${n?`bg-bambu-dark-secondary/30`:``}`,onClick:()=>i&&k(t),children:(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`text-bambu-gray/70 shrink-0 w-20`,children:A(e.timestamp)}),(0,W.jsx)(`span`,{className:`shrink-0`,children:(0,W.jsx)(P,{level:e.level})}),(0,W.jsxs)(`span`,{className:`text-purple-400/80 shrink-0 max-w-[200px] truncate`,title:e.logger_name,children:[`[`,e.logger_name,`]`]}),(0,W.jsx)(`span`,{className:`flex-1 ${K[e.level]||`text-white/80`} ${!n&&i?`truncate`:``}`,children:n?(0,W.jsx)(`pre`,{className:`whitespace-pre-wrap break-all`,children:e.message}):e.message.split(`
- `)[0]}),i&&(0,W.jsx)(`span`,{className:`text-bambu-gray/50 shrink-0`,children:n?(0,W.jsx)(d,{className:`w-3.5 h-3.5`}):(0,W.jsx)(u,{className:`w-3.5 h-3.5`})})]})},t)})})}),(0,W.jsx)(`div`,{className:`flex items-center justify-between p-3 border-t border-bambu-dark-tertiary text-sm text-bambu-gray`,children:b?(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`w-2 h-2 bg-green-500 rounded-full animate-pulse`}),`Auto-refreshing every 2 seconds`]}):(0,W.jsx)(`span`,{children:`Click Start to enable live log streaming`})})]})]})}function ae(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function J({icon:e,label:t,value:n,subValue:r,color:i=`text-bambu-green`}){return(0,W.jsxs)(`div`,{className:`flex items-start gap-3 p-4 bg-bambu-dark rounded-lg`,children:[(0,W.jsx)(`div`,{className:`p-2 rounded-lg bg-bambu-dark-tertiary ${i}`,children:(0,W.jsx)(e,{className:`w-5 h-5`})}),(0,W.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,W.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:t}),(0,W.jsx)(`p`,{className:`text-lg font-semibold text-white truncate`,children:n}),r&&(0,W.jsx)(`p`,{className:`text-xs text-bambu-gray mt-0.5`,children:r})]})]})}function Y({percent:e,color:t=`bg-bambu-green`}){return(0,W.jsx)(`div`,{className:`w-full h-2 bg-bambu-dark rounded-full overflow-hidden`,children:(0,W.jsx)(`div`,{className:`h-full ${t} transition-all duration-300`,style:{width:`${Math.min(100,e)}%`}})})}function X({title:e,icon:t,children:n}){return(0,W.jsxs)(C,{className:`p-6`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,W.jsx)(t,{className:`w-5 h-5 text-bambu-green`}),(0,W.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:e})]}),n]})}function Z(){let{t:e}=i(),{hasPermission:t}=S(),n=t(`settings:update`),c=o(),[l,u]=(0,U.useState)(null),[d,p]=(0,U.useState)(!1),[m,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(null),{data:x,isLoading:C,refetch:j,isFetching:z}=s({queryKey:[`systemInfo`],queryFn:r.getSystemInfo,refetchInterval:3e4}),{data:G}=s({queryKey:[`debugLogging`],queryFn:a.getDebugLoggingState,staleTime:10*1e3,refetchInterval:10*1e3}),{data:K}=E(),{data:q}=s({queryKey:[`library-stats`],queryFn:r.getLibraryStats}),{data:Z}=s({queryKey:[`printers`],queryFn:r.getPrinters}),{data:Q,refetch:oe,isFetching:$}=s({queryKey:[`systemHealth`],queryFn:r.getSystemHealth,staleTime:60*1e3}),se=K?.time_format||`system`,ce=async()=>{v(!0);try{let e=await a.setDebugLogging(!G?.enabled);c.setQueryData([`debugLogging`],e)}catch(e){console.error(`Failed to toggle debug logging:`,e)}finally{v(!1)}},le=async()=>{u(null),p(!0);try{await a.downloadSupportBundle()}catch(e){u(e instanceof Error?e.message:`Failed to download support bundle`)}finally{p(!1)}};if(C)return(0,W.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,W.jsx)(_,{className:`w-8 h-8 text-bambu-green animate-spin`})});if(!x)return(0,W.jsx)(`div`,{className:`p-6 text-center text-bambu-gray`,children:e(`system.failedToLoad`,`Failed to load system information`)});let ue=x.storage.disk_percent_used>90?`bg-red-500`:x.storage.disk_percent_used>75?`bg-yellow-500`:`bg-bambu-green`,de=x.memory.percent_used>90?`bg-red-500`:x.memory.percent_used>75?`bg-yellow-500`:`bg-bambu-green`;return(0,W.jsxs)(`div`,{className:`p-6 space-y-6`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col items-start gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:e(`system.title`,`System Information`)}),(0,W.jsx)(`p`,{className:`text-bambu-gray mt-1`,children:e(`system.subtitle`,`Monitor system resources and database statistics`)})]}),(0,W.jsxs)(`button`,{onClick:()=>j(),disabled:z,className:`flex items-center gap-2 px-4 py-2 bg-bambu-dark-secondary hover:bg-bambu-dark-tertiary rounded-lg transition-colors disabled:opacity-50`,children:[(0,W.jsx)(V,{className:`w-4 h-4 ${z?`animate-spin`:``}`}),e(`common.refresh`,`Refresh`)]})]}),(0,W.jsx)(X,{title:e(`system.application`,`Application`),icon:N,children:(0,W.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[(0,W.jsx)(J,{icon:N,label:e(`system.version`,`Version`),value:`v${x.app.version}`}),(0,W.jsx)(J,{icon:B,label:e(`system.uptime`,`System Uptime`),value:x.system.uptime_formatted}),(0,W.jsx)(J,{icon:N,label:e(`system.hostname`,`Hostname`),value:x.system.hostname})]})}),n&&(0,W.jsx)(X,{title:e(`support.title`,`Support & Troubleshooting`),icon:te,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`support.description`,`Enable debug logging to capture detailed information, then download a support bundle to share when reporting issues.`)}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-bambu-dark rounded-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`p-2 rounded-lg ${G?.enabled?`bg-amber-500/20 text-amber-500`:`bg-bambu-dark-tertiary text-bambu-gray`}`,children:(0,W.jsx)(O,{className:`w-5 h-5`})}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`font-medium text-white`,children:e(`support.debugLogging`,`Debug Logging`)}),(0,W.jsxs)(`p`,{className:`text-sm text-bambu-gray`,children:[G?.enabled?e(`support.debugLoggingEnabled`,`Capturing detailed logs`):e(`support.debugLoggingDisabled`,`Normal logging level`),G?.enabled&&G.duration_seconds!==null&&(0,W.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400 ml-2`,children:[`(`,Math.floor(G.duration_seconds/60),`m `,G.duration_seconds%60,`s)`]})]})]})]}),(0,W.jsxs)(`button`,{onClick:ce,disabled:m,className:`px-4 py-2 rounded-lg font-medium transition-colors flex items-center gap-2 ${G?.enabled?`bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-500/20 dark:text-amber-400 dark:hover:bg-amber-500/30`:`bg-bambu-green/20 text-bambu-green hover:bg-bambu-green/30`} disabled:opacity-50`,children:[m&&(0,W.jsx)(_,{className:`w-4 h-4 animate-spin`}),G?.enabled?e(`support.disableDebug`,`Disable`):e(`support.enableDebug`,`Enable`)]})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-bambu-dark rounded-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`p-2 rounded-lg bg-bambu-dark-tertiary text-bambu-green`,children:(0,W.jsx)(M,{className:`w-5 h-5`})}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`font-medium text-white`,children:e(`support.supportBundle`,`Support Bundle`)}),(0,W.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`support.supportBundleDescription`,`Download system info and logs as a ZIP file`)})]})]}),(0,W.jsxs)(`button`,{onClick:le,disabled:d||!G?.enabled,className:`px-4 py-2 rounded-lg font-medium bg-bambu-green/20 text-bambu-green hover:bg-bambu-green/30 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,title:G?.enabled?void 0:e(`support.enableDebugFirst`,`Enable debug logging first`),children:[d&&(0,W.jsx)(_,{className:`w-4 h-4 animate-spin`}),d?e(`support.bundleGenerating`,`Generating...`):e(`common.download`,`Download`)]})]}),d&&(0,W.jsxs)(`div`,{className:`p-3 bg-bambu-dark-tertiary/40 rounded-lg space-y-1`,children:[(0,W.jsxs)(`p`,{className:`text-sm font-medium text-white flex items-center gap-2`,children:[(0,W.jsx)(_,{className:`w-3.5 h-3.5 animate-spin text-bambu-green`}),e(`support.bundleGenerating`,`Generating...`)]}),(0,W.jsxs)(`ul`,{className:`text-xs text-bambu-gray list-disc list-inside space-y-0.5 pl-1`,children:[(0,W.jsx)(`li`,{children:e(`support.bundleStepConnection`,`Running printer connectivity checks`)}),(0,W.jsx)(`li`,{children:e(`support.bundleStepVirtualPrinters`,`Running virtual-printer setup checks`)}),(0,W.jsx)(`li`,{children:e(`support.bundleStepLogScan`,`Scanning recent logs for known issues`)}),(0,W.jsx)(`li`,{children:e(`support.bundleStepBuild`,`Building the support bundle ZIP`)})]})]}),l&&(0,W.jsx)(`div`,{className:`p-3 bg-red-100 border border-red-300 rounded-lg text-red-700 dark:bg-red-500/20 dark:border-red-500/30 dark:text-red-400 text-sm`,children:l}),!G?.enabled&&(0,W.jsx)(`div`,{className:`p-4 bg-bambu-dark-tertiary/50 rounded-lg`,children:(0,W.jsxs)(`p`,{className:`text-sm text-bambu-gray`,children:[(0,W.jsx)(`span`,{className:`text-amber-700 dark:text-amber-400 font-medium`,children:e(`support.instructions`,`To report an issue:`)}),(0,W.jsx)(`br`,{}),`1. `,e(`support.step1`,`Enable debug logging`),(0,W.jsx)(`br`,{}),`2. `,e(`support.step2`,`Reproduce the issue`),(0,W.jsx)(`br`,{}),`3. `,e(`support.step3`,`Download the support bundle`),(0,W.jsx)(`br`,{}),`4. `,e(`support.step4`,`Attach the ZIP file to your issue report`)]})}),(0,W.jsxs)(`div`,{className:`p-4 bg-bambu-dark rounded-lg space-y-3`,children:[(0,W.jsx)(`p`,{className:`text-sm font-medium text-white`,children:e(`support.privacyTitle`,`What's in the support bundle?`)}),(0,W.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 text-sm`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-bambu-green font-medium mb-1`,children:e(`support.collected`,`Collected:`)}),(0,W.jsxs)(`ul`,{className:`text-bambu-gray space-y-0.5`,children:[(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem1`,`App version and debug mode`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem2`,`OS, architecture, Python version`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem3`,`Database statistics (counts only)`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem4`,`Printer models and nozzle counts`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem5`,`Non-sensitive settings (themes, formats)`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem6`,`Debug logs (sanitized)`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem7`,`Printer connectivity and firmware versions`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem8`,`Integration status (Spoolman, MQTT, HA)`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem9`,`Network interfaces (subnets only)`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem10`,`Python package versions`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem11`,`Database health checks`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.collectItem12`,`Docker environment details`)]})]})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-red-700 dark:text-red-400 font-medium mb-1`,children:e(`support.notCollected`,`NOT collected:`)}),(0,W.jsxs)(`ul`,{className:`text-bambu-gray space-y-0.5`,children:[(0,W.jsxs)(`li`,{children:[`• `,e(`support.notItem1`,`Printer names and serial numbers`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.notItem2`,`Access codes and passwords`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.notItem3`,`Email addresses`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.notItem4`,`API keys and tokens`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.notItem5`,`Webhook URLs`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.notItem6`,`Your hostname or username`)]}),(0,W.jsxs)(`li`,{children:[`• `,e(`support.notItem7`,`IP addresses`)]})]})]})]}),(0,W.jsx)(`p`,{className:`text-xs text-bambu-gray/70`,children:e(`support.privacyNote`,`Email addresses in logs are replaced with [EMAIL], printer names with [PRINTER], serial numbers with [SERIAL], and IP addresses with [IP].`)})]}),(0,W.jsx)(ie,{})]})}),(0,W.jsxs)(X,{title:e(`diagnostic.sectionTitle`,`Connection Diagnostic`),icon:k,children:[(0,W.jsx)(`p`,{className:`text-sm text-bambu-gray mb-4`,children:e(`diagnostic.sectionDescription`,`Check why a printer won't connect or won't print — port reachability, LAN developer mode, Docker network mode, and credentials.`)}),Z&&Z.length>0?(0,W.jsx)(`div`,{className:`space-y-2`,children:Z.map(t=>(0,W.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-bambu-dark rounded-lg`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{className:`font-medium text-white`,children:t.name}),(0,W.jsx)(`span`,{className:`text-sm text-bambu-gray ml-2`,children:t.ip_address})]}),(0,W.jsxs)(`button`,{onClick:()=>b(t),className:`flex items-center gap-2 px-3 py-1.5 text-sm bg-bambu-dark-secondary hover:bg-bambu-dark-tertiary text-white rounded-lg transition-colors flex-shrink-0`,children:[(0,W.jsx)(k,{className:`w-4 h-4`}),e(`diagnostic.runButton`,`Run diagnostic`)]})]},t.id))}):(0,W.jsx)(`p`,{className:`text-bambu-gray`,children:e(`diagnostic.noPrinters`,`No printers configured.`)})]}),(0,W.jsxs)(X,{title:e(`systemHealth.sectionTitle`),icon:ne,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`systemHealth.sectionDescription`)}),(0,W.jsxs)(`button`,{onClick:()=>oe(),disabled:$,className:`flex items-center gap-2 px-3 py-1.5 text-sm bg-bambu-dark-secondary hover:bg-bambu-dark-tertiary text-white rounded-lg transition-colors flex-shrink-0 disabled:opacity-50`,children:[(0,W.jsx)(V,{className:`w-4 h-4 ${$?`animate-spin`:``}`}),e(`systemHealth.rescan`)]})]}),Q?(0,W.jsx)(L,{result:Q}):(0,W.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`common.loading`)})]}),(0,W.jsxs)(X,{title:e(`system.database`,`Database`),icon:D,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 mb-4`,children:[(0,W.jsx)(J,{icon:D,label:e(`system.dbEngine`,`Database Engine`),value:x.database.engine||`SQLite`}),(0,W.jsx)(J,{icon:D,label:e(`system.dbVersion`,`Version`),value:x.database.version||`unknown`})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 mb-4`,children:[(0,W.jsx)(J,{icon:A,label:e(`system.totalArchives`,`Total Archives`),value:x.database.archives}),(0,W.jsx)(J,{icon:R,label:e(`system.completed`,`Completed`),value:x.database.archives_completed,color:`text-green-500`}),(0,W.jsx)(J,{icon:f,label:e(`system.failed`,`Failed`),value:x.database.archives_failed,color:`text-red-500`}),(0,W.jsx)(J,{icon:_,label:e(`system.printing`,`Printing`),value:x.database.archives_printing,color:`text-yellow-500`})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,W.jsx)(J,{icon:P,label:e(`system.printers`,`Printers`),value:x.database.printers}),(0,W.jsx)(J,{icon:H,label:e(`system.filaments`,`Filaments`),value:x.database.filaments}),(0,W.jsx)(J,{icon:I,label:e(`system.projects`,`Projects`),value:x.database.projects}),(0,W.jsx)(J,{icon:T,label:e(`system.smartPlugs`,`Smart Plugs`),value:x.database.smart_plugs})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 mt-4`,children:[(0,W.jsx)(J,{icon:B,label:e(`system.totalPrintTime`,`Total Print Time`),value:x.database.total_print_time_formatted}),(0,W.jsx)(J,{icon:A,label:e(`system.totalFilament`,`Total Filament Used`),value:`${x.database.total_filament_kg} kg`,subValue:`${x.database.total_filament_grams.toLocaleString()} g`})]})]}),(0,W.jsxs)(X,{title:e(`system.connectedPrinters`,`Connected Printers`),icon:P,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-4 mb-4`,children:[(0,W.jsx)(`div`,{className:`text-3xl font-bold text-bambu-green`,children:x.printers.connected}),(0,W.jsx)(`div`,{className:`text-bambu-gray`,children:e(`system.ofTotal`,`of {{total}} printers connected`,{total:x.printers.total})})]}),x.printers.connected_list.length>0?(0,W.jsx)(`div`,{className:`space-y-2`,children:x.printers.connected_list.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-bambu-dark rounded-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-bambu-green`}),(0,W.jsx)(`span`,{className:`font-medium text-white`,children:e.name})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-4 text-sm text-bambu-gray`,children:[(0,W.jsx)(`span`,{children:e.model}),(0,W.jsx)(`span`,{className:`px-2 py-0.5 rounded ${e.state===`RUNNING`?`bg-bambu-green/20 text-bambu-green`:e.state===`IDLE`?`bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400`:`bg-bambu-dark-tertiary`}`,children:e.state})]})]},e.id))}):(0,W.jsx)(`p`,{className:`text-bambu-gray`,children:e(`system.noPrintersConnected`,`No printers connected`)})]}),(0,W.jsx)(X,{title:e(`system.storage`,`Storage`),icon:g,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex justify-between text-sm mb-1`,children:[(0,W.jsx)(`span`,{className:`text-bambu-gray`,children:e(`system.diskUsage`,`Disk Usage`)}),(0,W.jsxs)(`span`,{className:`text-white`,children:[x.storage.disk_used_formatted,` / `,x.storage.disk_total_formatted]})]}),(0,W.jsx)(Y,{percent:x.storage.disk_percent_used,color:ue}),(0,W.jsxs)(`p`,{className:`text-xs text-bambu-gray mt-1`,children:[x.storage.disk_free_formatted,` `,e(`system.free`,`free`),` (`,(100-x.storage.disk_percent_used).toFixed(1),`%)`]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[(0,W.jsx)(J,{icon:A,label:e(`system.archiveStorage`,`Archive Storage`),value:x.storage.archive_size_formatted}),(0,W.jsx)(J,{icon:D,label:e(`system.databaseSize`,`Database Size`),value:x.storage.database_size_formatted}),q&&(0,W.jsx)(J,{icon:ee,label:e(`system.fileManagerStorage`,`File Manager`),value:ae(q.total_size_bytes),subValue:`${q.total_files} files, ${q.total_folders} folders`})]})]})}),(0,W.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,W.jsx)(X,{title:e(`system.memory`,`Memory`),icon:re,children:(0,W.jsx)(`div`,{className:`space-y-4`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex justify-between text-sm mb-1`,children:[(0,W.jsx)(`span`,{className:`text-bambu-gray`,children:e(`system.memoryUsage`,`Memory Usage`)}),(0,W.jsxs)(`span`,{className:`text-white`,children:[x.memory.used_formatted,` / `,x.memory.total_formatted]})]}),(0,W.jsx)(Y,{percent:x.memory.percent_used,color:de}),(0,W.jsxs)(`p`,{className:`text-xs text-bambu-gray mt-1`,children:[x.memory.available_formatted,` `,e(`system.available`,`available`)]})]})})}),(0,W.jsx)(X,{title:e(`system.cpu`,`CPU`),icon:h,children:(0,W.jsx)(`div`,{className:`space-y-4`,children:(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,W.jsx)(J,{icon:h,label:e(`system.cores`,`Cores`),value:x.cpu.count,subValue:`${x.cpu.count_logical} logical`}),(0,W.jsx)(J,{icon:h,label:e(`system.usage`,`Usage`),value:`${x.cpu.percent}%`})]})})})]}),(0,W.jsx)(X,{title:e(`system.systemDetails`,`System Details`),icon:N,children:(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,W.jsx)(J,{icon:N,label:e(`system.os`,`Operating System`),value:x.system.platform,subValue:x.system.platform_release}),(0,W.jsx)(J,{icon:h,label:e(`system.architecture`,`Architecture`),value:x.system.architecture}),(0,W.jsx)(J,{icon:N,label:e(`system.python`,`Python`),value:x.system.python_version}),(0,W.jsx)(J,{icon:B,label:e(`system.bootTime`,`Boot Time`),value:w(x.system.boot_time,se)})]})}),y&&(0,W.jsx)(F,{printerId:y.id,printerName:y.name,onClose:()=>b(null)})]})}export{Z as SystemInfoPage};
|