@backtest-kit/ui 7.0.0 → 7.2.0

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.
Files changed (37) hide show
  1. package/build/modules/frontend/build/assets/{Article-CUKUVtNn.js → Article-673O2GAo.js} +1 -1
  2. package/build/modules/frontend/build/assets/{Background-Cm7NWjYf.js → Background-GZVl6Dd-.js} +1 -1
  3. package/build/modules/frontend/build/assets/{IconPhoto-VQJtz-we.js → IconPhoto-Dol-gfi5.js} +1 -1
  4. package/build/modules/frontend/build/assets/{KeyboardArrowLeft-Bx3w5JlP.js → KeyboardArrowLeft-B96q9-RN.js} +1 -1
  5. package/build/modules/frontend/build/assets/{Refresh-BkaYn01m.js → Refresh-DKJv3mpD.js} +1 -1
  6. package/build/modules/frontend/build/assets/emitters-8Ddy6nda.js +1 -0
  7. package/build/modules/frontend/build/assets/{hasRouteMatch-F5OIUGjU.js → hasRouteMatch-cVt-5faK.js} +1 -1
  8. package/build/modules/frontend/build/assets/html2canvas-B_SfkTNO.js +1 -0
  9. package/build/modules/frontend/build/assets/{index-BTuorlT_.js → index-B1bEyjto.js} +1 -1
  10. package/build/modules/frontend/build/assets/index-BB1KfPr2.js +1 -0
  11. package/build/modules/frontend/build/assets/index-BY91NQhQ.js +1 -0
  12. package/build/modules/frontend/build/assets/index-Bfrag62a.js +1 -0
  13. package/build/modules/frontend/build/assets/index-CnzKZiFP.js +1 -0
  14. package/build/modules/frontend/build/assets/index-CpO55Vw3.js +1 -0
  15. package/build/modules/frontend/build/assets/index-DDUY7roZ.js +1578 -0
  16. package/build/modules/frontend/build/assets/{index-BdOvXECv.js → index-De1PN9nY.js} +1 -1
  17. package/build/modules/frontend/build/assets/index-DhUPeC3A.js +1 -0
  18. package/build/modules/frontend/build/assets/index-G-Rr8i6Z.js +1 -0
  19. package/build/modules/frontend/build/assets/{index-C6MJd2e7.js → index-tA6ppP-9.js} +1 -1
  20. package/build/modules/frontend/build/assets/index-vcDgTyUw.js +1 -0
  21. package/build/modules/frontend/build/assets/{index.es-Dy9r9ja5.js → index.es-CAJnvyqV.js} +1 -1
  22. package/build/modules/frontend/build/assets/markdownit-DjH6sN97.js +1 -0
  23. package/build/modules/frontend/build/index.html +1 -1
  24. package/package.json +4 -4
  25. package/types.d.ts +14 -5
  26. package/build/modules/frontend/build/assets/emitters-DFr8bMD1.js +0 -1
  27. package/build/modules/frontend/build/assets/html2canvas-D9EezEc_.js +0 -1
  28. package/build/modules/frontend/build/assets/index-ApVR6Ifc.js +0 -1
  29. package/build/modules/frontend/build/assets/index-Bo9eE7UW.js +0 -1
  30. package/build/modules/frontend/build/assets/index-CROpLyTo.js +0 -1
  31. package/build/modules/frontend/build/assets/index-ChbT-tDv.js +0 -17
  32. package/build/modules/frontend/build/assets/index-Cx2iXzXi.js +0 -1
  33. package/build/modules/frontend/build/assets/index-D4lcxG8i.js +0 -1
  34. package/build/modules/frontend/build/assets/index-D5q-xBp8.js +0 -1
  35. package/build/modules/frontend/build/assets/index-Mr3SEWze.js +0 -1560
  36. package/build/modules/frontend/build/assets/index-XWTSQlQH.js +0 -1
  37. package/build/modules/frontend/build/assets/markdownit-CaCiS1m5.js +0 -1
@@ -1 +0,0 @@
1
- import{b as e,f as a,r as t,b6 as i,b7 as o,Z as r,i as s,b8 as n,b9 as c,ba as l,I as d,au as p,aQ as h,bb as u,t as m,a8 as b,bc as f,H as y,T as g,aS as x,a2 as v,R as w,bd as S,a3 as L,be as k,aM as A,z as j,a0 as C,X as z,w as N,x as H,aX as R,B as E,A as M,aW as T}from"./index-Mr3SEWze.js";import{h as I}from"./hasRouteMatch-F5OIUGjU.js";import{B as V}from"./Background-Cm7NWjYf.js";import{A as B}from"./Article-CUKUVtNn.js";import{C as D,R as F}from"./Refresh-BkaYn01m.js";import{K}from"./KeyboardArrowLeft-Bx3w5JlP.js";const W=e(a("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}),"Image"),X=e(a("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"}),"InsertDriveFile"),P="65px",O=e=>e.mimeType.startsWith("image/")?a(W,{sx:{color:"#f57c00",fontSize:20}}):"application/json"===e.mimeType?a(j,{sx:{color:"#7b1fa2",fontSize:20}}):e.mimeType.startsWith("text/")?a(B,{sx:{color:"#1976d2",fontSize:20}}):a(X,{sx:{color:"#546e7a",fontSize:20}}),Q=m()(e=>({root:{position:"relative",height:"100%",width:"100%",background:"#eee",overflow:"clip"},header:{position:"absolute",top:0,left:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"8px",paddingRight:"4px",height:P},input:{height:P,paddingRight:e.spacing(2),paddingLeft:e.spacing(1),width:"100%"},container:{position:"absolute",top:P,left:0,right:0,bottom:0,height:`calc(100% - ${P})`,width:"100%",background:"white",overflow:"clip",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{display:"flex",flex:1},loader:{height:"100%",width:"100%"},accent:{background:b("#00c3ff",.05)}})),Z=({outlinePaper:e,className:m,style:b,sx:j,nodes:C,initialSearch:z=""})=>{const{classes:N,cx:H}=Q(),[R,E]=t.useState(z),M=i(R),[T,{flush:I}]=o(R,2500),[V,{loading:B}]=r(async()=>await(async(e,a)=>{const t=e.trim().toLowerCase(),i=[];let o=0;for(const r of s.explorerHelperService.deepFlat(a))if("file"!==r.type||t&&!r.path.toLowerCase().includes(t)||i.push(r),++o%1e4==0&&await f(0),i.length>25e3)break;return i})(T,C),{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1),deps:[T,C]}),{execute:D}=n(async e=>{await s.layoutService.pickDumpContent(e)},{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1)});return a(u,{outlinePaper:e,className:H(N.root,m),style:b,sx:j,children:[a("div",{className:N.header,children:a(c,{disabled:B,className:N.input,endAdornment:a(l,{position:"end",children:a(d,{disabled:B||!R,onClick:()=>{M.once(async()=>{await f(500),I()}),E("")},edge:"end",children:a(R?p:h,{})})}),placeholder:"Search",value:R,onBlur:()=>I(),onChange:({target:e})=>E(e.value),onKeyDown:({key:e,currentTarget:a})=>"Enter"===e&&a.blur()})}),a("div",{className:N.container,children:a("div",{className:N.content,children:V?V.length?a(A,{withScrollbar:!0,children:V.map((e,t)=>a(v,{className:H({[N.accent]:t%2==1}),component:w,onClick:()=>(async e=>{await D(e)})(e.id),children:[a(S,{children:O(e)}),a(L,{primary:e.label,secondary:e.path}),a(k,{content:e.path,label:"Copy path"})]},e.id))}):a(x,{sx:{height:"100%",width:"100%"},children:a(g,{variant:"h6",sx:{opacity:.5},children:"Not found"})}):a(y,{className:N.loader})})})]})},$=[{type:H.Link,action:"back-action",label:a(K,{sx:{display:"block"}})},{type:H.Link,action:"back-action",label:"Main"},{type:H.Link,action:"back-action",label:"Dump Explorer"}],q=[{action:"update-now",label:"Refresh",icon:()=>a(M,{icon:F,color:"#4caf50"})}],G=new z,J=({params:e})=>{const[t,{loading:i,execute:o}]=r(async()=>await s.explorerViewService.getFolderTree(),{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1)});C(()=>G.subscribe(o));return a(D,{children:[a(N,{items:$,actions:q,onAction:e=>{"back-action"===e&&s.routerService.push("/"),"update-now"===e&&(s.explorerViewService.clear(),G.next())}}),a(R,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"calc(100vh - 150px)"},children:a(E,{pr:2,pl:2,children:i||!t?a(x,{children:a(g,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):a(Z,{nodes:t,initialSearch:e.search})})}),a(V,{})]})},U=[{id:"search",element:J,isActive:e=>I(["/dump/:search"],e)},{id:"main",element:J,isActive:e=>I(["/dump"],e)}],Y=({search:e=""})=>a(T,{history:s.routerService,onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1),routes:U,params:{search:e}});export{Y as DumpPage,Y as default};
@@ -1 +0,0 @@
1
- import{r as e,f as a,P as i,B as n,O as r,az as t,T as o,ae as l,L as s,am as c,F as d,aA as p,M as m,aB as u,aC as b,aD as v,aE as g,au as y,aF as h,aG as k,aH as $,aI as f,aJ as x,aK as S,aL as _,i as C,ap as P,X as w,aq as L,w as A,x as z,aM as O,aN as E,A as F}from"./index-Mr3SEWze.js";import{C as j,R as B}from"./Refresh-BkaYn01m.js";import{K as T}from"./KeyboardArrowLeft-Bx3w5JlP.js";const R=e=>{const i={color:"white",fontSize:28};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return a(S,{sx:i});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return a(y,{sx:i});case"signal.scheduled":return a(_,{sx:i});case"signal.cancelled":case"cancel_scheduled.commit":return a(h,{sx:i});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return a(f,{sx:i});case"breakeven.available":case"breakeven.commit":return a(x,{sx:i});case"activate_scheduled.commit":case"signal_sync.open":return a(k,{sx:i});case"trailing_stop.commit":case"trailing_take.commit":return a($,{sx:i});case"risk.rejection":return a(g,{sx:i});case"error.info":case"error.validation":case"signal.info":return a(b,{sx:i});case"error.critical":return a(v,{sx:i});default:return a(u,{sx:i})}},I=e=>{switch(e.type){case"signal.opened":return`${c("Opened")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.closed":return`${c("Closed")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"signal.scheduled":return`${c("Scheduled")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.cancelled":return`${c("Cancelled")} ${e.symbol}`;case"partial_profit.available":return`${c("Partial profit")} ${e.level}% ${e.symbol}`;case"partial_profit.commit":return`${c("Profit fixed")} ${e.percentToClose}% ${e.symbol}`;case"partial_loss.available":return`${c("Partial loss")} ${e.level}% ${e.symbol}`;case"partial_loss.commit":return`${c("Loss fixed")} ${e.percentToClose}% ${e.symbol}`;case"breakeven.available":return`${c("Breakeven available")} ${e.symbol}`;case"breakeven.commit":return`${c("Breakeven set")} ${e.symbol}`;case"activate_scheduled.commit":return`${c("Activated")} ${e.position.toUpperCase()} ${e.symbol}`;case"average_buy.commit":return`${c("Average Buy")} ${e.symbol}`;case"trailing_stop.commit":return`${c("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${c("Trailing take")} ${e.symbol}`;case"signal_sync.open":return`${c("Sync Open")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal_sync.close":return`${c("Sync Close")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;case"cancel_scheduled.commit":return`${c("Cancel Scheduled")} ${e.symbol}`;case"close_pending.commit":return`${c("Close Pending")} ${e.symbol}`;case"risk.rejection":return`${c("Rejected")} ${e.position.toUpperCase()} ${e.symbol}`;case"error.info":return`${c("Error")}: ${e.message}`;case"error.validation":return`${c("Validation")}: ${e.message}`;case"error.critical":return`${c("Critical")}: ${e.message}`;case"signal.info":return`${c("Signal Info")} ${e.symbol} (${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%)`;default:return c("Unknown")}},D=e=>{switch(e.type){case"signal.opened":return c("Signal Opened");case"signal.closed":return c("Signal Closed");case"signal.scheduled":return c("Signal Scheduled");case"signal.cancelled":return c("Signal Cancelled");case"partial_profit.available":return c("Partial Profit Available");case"partial_profit.commit":return c("Partial Profit Commit");case"partial_loss.available":return c("Partial Loss Available");case"partial_loss.commit":return c("Partial Loss Commit");case"breakeven.available":return c("Breakeven Available");case"breakeven.commit":return c("Breakeven Commit");case"activate_scheduled.commit":return c("Activated Scheduled");case"average_buy.commit":return c("Average Buy");case"trailing_stop.commit":return c("Trailing Stop");case"trailing_take.commit":return c("Trailing Take");case"signal_sync.open":return c("Signal Sync Open");case"signal_sync.close":return c("Signal Sync Close");case"cancel_scheduled.commit":return c("Cancel Scheduled");case"close_pending.commit":return c("Close Pending");case"risk.rejection":return c("Risk Rejection");case"error.info":return c("Info Error");case"error.validation":return c("Validation Error");case"error.critical":return c("Critical Error");case"signal.info":return c("Signal Info");default:return c("Unknown")}},U=e=>"symbol"in e,M=e=>"position"in e,N=e=>"priceOpen"in e&&"priceTakeProfit"in e&&"priceStopLoss"in e,W=e=>"pnlPercentage"in e,H=e=>"level"in e,Y=e=>"percentToClose"in e,K=e=>"currentPrice"in e,V=e=>"duration"in e,q=e=>"closeReason"in e,G=e=>"cancelReason"in e,J=e=>"priceClose"in e,X=e=>"percentShift"in e,Q=e=>"signal.opened"===e.type?"note"in e&&!!e.note:"signal.info"===e.type?"note"in e&&!!e.note&&!!e.notificationId:"activate_scheduled.commit"===e.type?"note"in e&&!!e.note&&!!e.activateId:"close_pending.commit"===e.type?"note"in e&&!!e.note&&!!e.closeId:"cancel_scheduled.commit"===e.type&&("note"in e&&!!e.note&&!!e.cancelId),Z=e=>"message"in e,ee=e=>"rejectionNote"in e,ae=e=>"activePositionCount"in e,ie=e=>"effectivePriceOpen"in e,ne=e=>"totalEntries"in e&&e.totalEntries>1,re=e=>"originalPriceOpen"in e&&"priceOpen"in e&&e.originalPriceOpen!==e.priceOpen,te=e=>"totalPartials"in e&&e.totalPartials>0,oe=e=>"cost"in e,le=e=>"pnlPriceOpen"in e&&"pnlPriceClose"in e&&"pnlCost"in e&&"pnlEntries"in e,se=e.forwardRef(({item:e,className:u,style:b,sx:v},g)=>{const y=(e=>{switch(e.type){case"signal.opened":case"activate_scheduled.commit":case"signal_sync.open":return"#4CAF50";case"signal.closed":case"signal_sync.close":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":case"cancel_scheduled.commit":default:return"#9E9E9E";case"partial_profit.available":case"partial_profit.commit":return"#8BC34A";case"partial_loss.available":case"partial_loss.commit":return"#FF5722";case"breakeven.available":case"breakeven.commit":return"#00BCD4";case"trailing_stop.commit":case"trailing_take.commit":return"#673AB7";case"close_pending.commit":return"#607D8B";case"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";case"signal.info":return"#9C27B0"}})(e),h=(e=>"timestamp"in e)(e)?e.timestamp:Date.now();return a("div",{className:u,style:b,ref:g,children:a(i,{variant:"outlined",onClick:()=>(e=>{switch(e.type){case"risk.rejection":C.layoutService.pickRisk(e.id);break;case"signal.opened":C.layoutService.pickSignalOpened(e.id);break;case"signal.closed":C.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":C.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":C.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":C.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":C.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":C.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":C.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":C.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":C.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":C.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":C.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":C.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":C.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":C.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":C.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":C.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":C.layoutService.pickClosePending(e.id);break;case"signal.info":C.layoutService.pickSignalNotify(e.id)}})(e),sx:{transition:"box-shadow 0.2s ease",cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{boxShadow:4},...v},children:a(n,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[a(r,{direction:"row",spacing:2,sx:{p:2},children:[a(t,{sx:{width:56,height:56,background:y},children:R(e)}),a(r,{flex:1,spacing:1,children:[a(r,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[a(o,{variant:"h6",sx:{fontWeight:600},children:I(e)}),a(o,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:l(h).format("HH:mm DD/MM/YYYY")})]}),a(r,{direction:"row",spacing:1,flexWrap:"wrap",children:[a(s,{size:"small",label:D(e),sx:{background:y,color:"white",fontWeight:500}}),U(e)&&a(s,{size:"small",label:e.symbol,variant:"outlined"}),M(e)&&a(s,{size:"small",label:e.position.toUpperCase(),variant:"outlined",color:"long"===e.position?"success":"error"}),W(e)&&a(s,{size:"small",label:`PnL: ${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`,color:e.pnlPercentage>=0?"success":"error",variant:"outlined"}),H(e)&&a(s,{size:"small",label:`${c("Level")}: ${e.level}%`,variant:"outlined"}),Y(e)&&a(s,{size:"small",label:`${c("Close")}: ${e.percentToClose}%`,variant:"outlined"}),V(e)&&a(s,{size:"small",label:`${c("Duration")}: ${e.duration} ${c("min")}`,variant:"outlined"}),q(e)&&a(s,{size:"small",label:e.closeReason,variant:"outlined",color:"info"}),G(e)&&a(s,{size:"small",label:e.cancelReason,variant:"outlined",color:"info"}),X(e)&&a(s,{size:"small",label:`${c("Shift")}: ${e.percentShift>0?"+":""}${e.percentShift}%`,variant:"outlined"}),ae(e)&&a(s,{size:"small",label:`${c("Active")}: ${e.activePositionCount}`,variant:"outlined"}),ne(e)&&a(s,{size:"small",label:`${c("Entries")}: ${e.totalEntries}`,variant:"outlined"}),te(e)&&a(s,{size:"small",label:`${c("Partials")}: ${e.totalPartials}`,variant:"outlined"}),oe(e)&&a(s,{size:"small",label:`${c("Cost")}: ${e.cost.toFixed(2)}$`,variant:"outlined"}),ie(e)&&a(s,{size:"small",label:`${c("Avg entry")}: ${e.effectivePriceOpen}`,variant:"outlined",color:"warning"}),re(e)&&a(s,{size:"small",label:`${c("Orig entry")}: ${e.originalPriceOpen}`,variant:"outlined"})]}),N(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(r,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Entry"),":"," "]}),e.priceOpen]}),J(e)&&a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Close"),":"," "]}),e.priceClose]}),K(e)&&a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Current"),":"," "]}),e.currentPrice]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Take Profit"),":"," "]}),e.priceTakeProfit]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Stop Loss"),":"," "]}),e.priceStopLoss]})]})]}),le(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(r,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("PnL Entry"),":"," "]}),e.pnlPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("PnL Exit"),":"," "]}),e.pnlPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("PnL"),":"," "]}),a(o,{component:"span",color:e.pnlCost>=0?"success.main":"error.main",children:[e.pnlCost>=0?"+":"",e.pnlCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Invested"),":"," "]}),e.pnlEntries.toFixed(2),"$"]})]})]})]})]}),Q(e)&&a(n,{onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(n,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordWrap:"break-word"},children:a(m,{content:e.note})})]}),ee(e)&&a(n,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"error",children:e.rejectionNote})]}),Z(e)&&!Q(e)&&a(n,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"text.secondary",children:e.message})]}),a(n,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:y}})]})})})}),ce=[{action:"update-now",label:"Refresh manually",icon:()=>a(F,{icon:B,color:"#4caf50"})}],de=[{type:z.Link,action:"back-action",label:a(T,{sx:{display:"block"}})},{type:z.Link,action:"back-action",label:"Main"},{type:z.Link,action:"back-action",label:"Notifications"}],pe=new w,me=()=>{const{data:e,hasMore:i,loading:n,onSkip:r}=P({handler:async(e,a)=>{const i=await C.notificationViewService.getList(),n=L(e,a);for(const r of i)if(n([r]).done)break;return n().rows},onLoadStart:()=>C.layoutService.setAppbarLoader(!0),onLoadEnd:()=>C.layoutService.setAppbarLoader(!1),reloadSubject:pe});return a(j,{children:[a(A,{items:de,actions:ce,onAction:async e=>{"back-action"===e&&C.routerService.push("/"),"update-now"===e&&await pe.next()}}),a(O,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:n,onDataRequest:r,bufferSize:E,hasMore:i,children:e.map(e=>a(se,{item:e,sx:{mb:1}},e.id))})]})};export{me as NotificationPage,me as default};
@@ -1 +0,0 @@
1
- import{b as a,f as e,aM as t,B as o,O as r,az as n,T as i,ae as s,L as c,F as l,aA as d,P as h,aB as p,aO as u,aP as w,ap as b,X as f,i as x,aq as g,$ as y,aw as v,w as m,x as S,aQ as L,aN as k,D as A,A as j}from"./index-Mr3SEWze.js";import{A as z}from"./Article-CUKUVtNn.js";import{C as R,R as H}from"./Refresh-BkaYn01m.js";import{K as B}from"./KeyboardArrowLeft-Bx3w5JlP.js";const C=a(e("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"}),"BugReport"),M=a=>{const t={color:"white",fontSize:28};switch(a.type){case"debug":return e(C,{sx:t});case"info":return e(u,{sx:t});case"warn":return e(p,{sx:t});default:return e(z,{sx:t})}},D=t.virtualize(({data:a,sx:t})=>{const p=(a=>{switch(a.type){case"debug":default:return"#9E9E9E";case"info":return"#2196F3";case"warn":return"#FF9800";case"log":return"#4CAF50"}})(a);return e(h,{variant:"outlined",sx:{display:"flex",alignItems:"stretch",justifyContent:"stretch",...t},children:e(o,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[e(r,{direction:"row",spacing:2,sx:{p:2},children:[e(n,{sx:{width:56,height:56,background:p},children:M(a)}),e(r,{flex:1,spacing:1,children:[e(r,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e(i,{variant:"h6",sx:{fontWeight:600,wordBreak:"break-all"},children:a.topic}),e(i,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:s(a.createdAt).format("HH:mm DD/MM/YYYY")})]}),e(r,{direction:"row",spacing:1,flexWrap:"wrap",children:e(c,{size:"small",label:a.type.toUpperCase(),sx:{background:p,color:"white",fontWeight:500}})}),a.args.length>0&&e(l,{children:[e(d,{sx:{my:1}}),e(o,{component:"pre",sx:{m:0,fontSize:"0.75rem",whiteSpace:"pre-wrap",wordBreak:"break-all",color:"text.secondary"},children:JSON.stringify(1===a.args.length?a.args[0]:a.args,null,2)})]})]})]}),e(o,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:p}})]})})}),E=[{action:"download-action",label:"Download",icon:()=>e(j,{icon:A,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh manually",icon:()=>e(j,{icon:H,color:"#4caf50"})}],F=[{type:S.Link,action:"back-action",label:e(B,{sx:{display:"block"}})},{type:S.Link,action:"back-action",label:"Main"},{type:S.Link,action:"back-action",label:"Logs"},{type:S.Button,icon:L,action:"search-action",label:"Search"}],O=new f,Y=()=>{const[a,o]=w(""),{data:r,hasMore:n,loading:i,onSkip:s}=b({handler:async(e,t)=>{const o=await x.logViewService.getList(),r=g(e,t);for(const n of o)if(new RegExp(a.current,"i").test(n.topic)&&r([n]).done)break;return r().rows},onLoadStart:()=>x.layoutService.setAppbarLoader(!0),onLoadEnd:()=>x.layoutService.setAppbarLoader(!1),reloadSubject:O}),c=y(r),{execute:l}=v(async()=>{const a=new Blob([JSON.stringify(c.current,null,2)],{type:"application/json"}),e=URL.createObjectURL(a);x.layoutService.downloadFile(e,`logs_${Date.now()}.json`)},{onLoadStart:()=>x.layoutService.setAppbarLoader(!0),onLoadEnd:()=>x.layoutService.setAppbarLoader(!1)});return e(R,{children:[e(m,{items:F,actions:E,onAction:async a=>{"back-action"===a&&x.routerService.push("/"),"download-action"===a&&l(),"update-now"===a&&(o(""),await O.next()),"search-action"===a&&(async()=>{const a=await x.layoutService.prompt("Search keyword");if(a)return o(a),void O.next();o(""),O.next()})()}}),e(t,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:i,onDataRequest:s,bufferSize:k,hasMore:n,children:r.map(a=>e(D,{data:a,sx:{mb:1}},a.id))})]})};export{Y as LogPage,Y as default};