@backtest-kit/ui 5.10.0 → 5.11.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.
- package/build/index.cjs +4 -0
- package/build/index.mjs +4 -0
- package/build/modules/frontend/build/assets/{Article-D0PUfsyZ.js → Article-CV5Q8o6x.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-Bp0-zX1I.js → Background-as5_tKS_.js} +1 -1
- package/build/modules/frontend/build/assets/{Container-BVnjAw0L.js → Container-bTKJUsqX.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-vJVt5Ncr.js → IconPhoto-iHdj_K8W.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-C6uma9wN.js → KeyboardArrowLeft-sfHB1IYi.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-BY0j0EcE.js → Refresh-CH0eiGLB.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-CmNFQZWA.js +1 -0
- package/build/modules/frontend/build/assets/{hasRouteMatch-DohEILWY.js → hasRouteMatch-DzWVcZWi.js} +1 -1
- package/build/modules/frontend/build/assets/{html2canvas-D2jUEpzH.js → html2canvas-DkIH2Xet.js} +1 -1
- package/build/modules/frontend/build/assets/{index-jlDU8JcV.js → index-BneZFtKI.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CjPBJAjp.js → index-Bw-ZorFV.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Bcb8nGYX.js → index-C3UjHQ42.js} +1 -1
- package/build/modules/frontend/build/assets/{index-RtiSuyWs.js → index-CFZzoSq1.js} +1 -1
- package/build/modules/frontend/build/assets/{index-yQQoZEqI.js → index-CHbdbxq4.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Cg1Md-6T.js → index-CMCkXfjC.js} +1 -1
- package/build/modules/frontend/build/assets/{index--twYSr4E.js → index-CkLkivGW.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DAgM7WkM.js → index-CpAgfFDW.js} +6 -6
- package/build/modules/frontend/build/assets/{index-DNrZ-NLx.js → index-DBOjHCyk.js} +1 -1
- package/build/modules/frontend/build/assets/{index-D8XGIcxD.js → index-DOoEVh8-.js} +1 -1
- package/build/modules/frontend/build/assets/{index-BTNj0TPL.js → index-DfJxzRHU.js} +1 -1
- package/build/modules/frontend/build/assets/{index.es-BdwPG30D.js → index.es-BKZV0i2c.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-CJIyDibX.js → markdownit-Bu-L1Tz5.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +3 -3
- package/build/modules/frontend/build/assets/emitters-D7EMED_Y.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,f as a,P as i,B as r,S as n,ay as t,T as s,ac as l,H as o,al as c,F as d,az as p,aA as m,aB as u,aC as b,aD as v,aE as y,aF as g,at as h,aG as k,aH as $,aI as f,aJ as x,aK as S,aL as _,aM as C,v as P,ao as w,U as L,ap as A,t as z,Z as O,aN as E,aO as j,y as F}from"./index-DAgM7WkM.js";import{C as T}from"./Container-BVnjAw0L.js";import{R as B}from"./Refresh-BY0j0EcE.js";import{K as R}from"./KeyboardArrowLeft-C6uma9wN.js";const D=e=>{const i={color:"white",fontSize:28};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return a(_,{sx:i});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return a(h,{sx:i});case"signal.scheduled":return a(C,{sx:i});case"signal.cancelled":case"cancel_scheduled.commit":return a(k,{sx:i});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return a(x,{sx:i});case"breakeven.available":case"breakeven.commit":return a(S,{sx:i});case"activate_scheduled.commit":case"signal_sync.open":return a($,{sx:i});case"trailing_stop.commit":case"trailing_take.commit":return a(f,{sx:i});case"risk.rejection":return a(g,{sx:i});case"error.info":case"error.validation":return a(y,{sx:i});case"error.critical":return a(v,{sx:i});default:return a(b,{sx:i})}},U=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}`;default:return c("Unknown")}},W=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");default:return c("Unknown")}},I=e=>"symbol"in e,M=e=>"position"in e,N=e=>"priceOpen"in e&&"priceTakeProfit"in e&&"priceStopLoss"in e,H=e=>"pnlPercentage"in e,Y=e=>"level"in e,K=e=>"percentToClose"in e,V=e=>"currentPrice"in e,q=e=>"duration"in e,G=e=>"closeReason"in e,J=e=>"cancelReason"in e,Z=e=>"priceClose"in e,Q=e=>"percentShift"in e,X=e=>"note"in e&&!!e.note,ee=e=>"message"in e,ae=e=>"rejectionNote"in e,ie=e=>"activePositionCount"in e,re=e=>"effectivePriceOpen"in e,ne=e=>"totalEntries"in e&&e.totalEntries>1,te=e=>"originalPriceOpen"in e&&"priceOpen"in e&&e.originalPriceOpen!==e.priceOpen,se=e=>"totalPartials"in e&&e.totalPartials>0,le=e=>"cost"in e,oe=e=>"pnlPriceOpen"in e&&"pnlPriceClose"in e&&"pnlCost"in e&&"pnlEntries"in e,ce=e.forwardRef(({item:e,className:b,style:v,sx:y},g)=>{const h=(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"}})(e),k=(e=>"timestamp"in e)(e)?e.timestamp:Date.now();return a("div",{className:b,style:v,ref:g,children:a(i,{variant:"outlined",onClick:()=>(e=>{switch(e.type){case"risk.rejection":P.layoutService.pickRisk(e.id);break;case"signal.opened":P.layoutService.pickSignalOpened(e.id);break;case"signal.closed":P.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":P.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":P.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":P.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":P.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":P.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":P.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":P.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":P.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":P.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":P.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":P.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":P.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":P.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":P.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":P.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":P.layoutService.pickClosePending(e.id)}})(e),sx:{transition:"box-shadow 0.2s ease",cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{boxShadow:4},...y},children:a(r,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[a(n,{direction:"row",spacing:2,sx:{p:2},children:[a(t,{sx:{width:56,height:56,background:h},children:D(e)}),a(n,{flex:1,spacing:1,children:[a(n,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[a(s,{variant:"h6",sx:{fontWeight:600},children:U(e)}),a(s,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:l(k).format("HH:mm DD/MM/YYYY")})]}),a(n,{direction:"row",spacing:1,flexWrap:"wrap",children:[a(o,{size:"small",label:W(e),sx:{background:h,color:"white",fontWeight:500}}),I(e)&&a(o,{size:"small",label:e.symbol,variant:"outlined"}),M(e)&&a(o,{size:"small",label:e.position.toUpperCase(),variant:"outlined",color:"long"===e.position?"success":"error"}),H(e)&&a(o,{size:"small",label:`PnL: ${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`,color:e.pnlPercentage>=0?"success":"error",variant:"outlined"}),Y(e)&&a(o,{size:"small",label:`${c("Level")}: ${e.level}%`,variant:"outlined"}),K(e)&&a(o,{size:"small",label:`${c("Close")}: ${e.percentToClose}%`,variant:"outlined"}),q(e)&&a(o,{size:"small",label:`${c("Duration")}: ${e.duration} ${c("min")}`,variant:"outlined"}),G(e)&&a(o,{size:"small",label:e.closeReason,variant:"outlined",color:"info"}),J(e)&&a(o,{size:"small",label:e.cancelReason,variant:"outlined",color:"info"}),Q(e)&&a(o,{size:"small",label:`${c("Shift")}: ${e.percentShift>0?"+":""}${e.percentShift}%`,variant:"outlined"}),ie(e)&&a(o,{size:"small",label:`${c("Active")}: ${e.activePositionCount}`,variant:"outlined"}),ne(e)&&a(o,{size:"small",label:`${c("Entries")}: ${e.totalEntries}`,variant:"outlined"}),se(e)&&a(o,{size:"small",label:`${c("Partials")}: ${e.totalPartials}`,variant:"outlined"}),le(e)&&a(o,{size:"small",label:`${c("Cost")}: ${e.cost.toFixed(2)}$`,variant:"outlined"}),re(e)&&a(o,{size:"small",label:`${c("Avg entry")}: ${e.effectivePriceOpen}`,variant:"outlined",color:"warning"}),te(e)&&a(o,{size:"small",label:`${c("Orig entry")}: ${e.originalPriceOpen}`,variant:"outlined"})]}),N(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Entry"),":"," "]}),e.priceOpen]}),Z(e)&&a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Close"),":"," "]}),e.priceClose]}),V(e)&&a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Current"),":"," "]}),e.currentPrice]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Take Profit"),":"," "]}),e.priceTakeProfit]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Stop Loss"),":"," "]}),e.priceStopLoss]})]})]}),oe(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("PnL Entry"),":"," "]}),e.pnlPriceOpen]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("PnL Exit"),":"," "]}),e.pnlPriceClose]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("PnL"),":"," "]}),a(s,{component:"span",color:e.pnlCost>=0?"success.main":"error.main",children:[e.pnlCost>=0?"+":"",e.pnlCost.toFixed(2),"$"]})]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Invested"),":"," "]}),e.pnlEntries.toFixed(2),"$"]})]})]})]})]}),X(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(r,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordWrap:"break-word"},children:a(m,{style:{textWrap:"wrap"},config:u,handler:()=>e.note})})]}),ae(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(s,{variant:"body2",color:"error",children:e.rejectionNote})]}),ee(e)&&!X(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(s,{variant:"body2",color:"text.secondary",children:e.message})]}),a(r,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:h}})]})})})}),de=[{action:"update-now",label:"Refresh manually",icon:()=>a(F,{icon:B,color:"#4caf50"})}],pe=[{type:O.Link,action:"back-action",label:a(R,{sx:{display:"block"}})},{type:O.Link,action:"back-action",label:"Main"},{type:O.Link,action:"back-action",label:"Notifications"}],me=new L,ue=()=>{const{data:e,hasMore:i,loading:r,onSkip:n}=w({handler:async(e,a)=>{const i=await P.notificationViewService.getList(),r=A(e,a);for(const n of i)if(r([n]).done)break;return r().rows},onLoadStart:()=>P.layoutService.setAppbarLoader(!0),onLoadEnd:()=>P.layoutService.setAppbarLoader(!1),reloadSubject:me});return a(T,{children:[a(z,{items:pe,actions:de,onAction:async e=>{"back-action"===e&&P.routerService.push("/"),"update-now"===e&&await me.next()}}),a(E,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:r,onDataRequest:n,bufferSize:j,hasMore:i,children:e.map(e=>a(ce,{item:e,sx:{mb:1}},e.id))})]})};export{ue as NotificationPage,ue as default};
|
|
1
|
+
import{r as e,f as a,P as i,B as r,S as n,ay as t,T as s,ac as l,H as o,al as c,F as d,az as p,aA as m,aB as u,aC as b,aD as v,aE as y,aF as g,at as h,aG as k,aH as $,aI as f,aJ as x,aK as S,aL as _,aM as C,v as P,ao as w,U as L,ap as A,t as z,Z as O,aN as E,aO as j,y as F}from"./index-CpAgfFDW.js";import{C as T}from"./Container-bTKJUsqX.js";import{R as B}from"./Refresh-CH0eiGLB.js";import{K as R}from"./KeyboardArrowLeft-sfHB1IYi.js";const D=e=>{const i={color:"white",fontSize:28};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return a(_,{sx:i});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return a(h,{sx:i});case"signal.scheduled":return a(C,{sx:i});case"signal.cancelled":case"cancel_scheduled.commit":return a(k,{sx:i});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return a(x,{sx:i});case"breakeven.available":case"breakeven.commit":return a(S,{sx:i});case"activate_scheduled.commit":case"signal_sync.open":return a($,{sx:i});case"trailing_stop.commit":case"trailing_take.commit":return a(f,{sx:i});case"risk.rejection":return a(g,{sx:i});case"error.info":case"error.validation":return a(y,{sx:i});case"error.critical":return a(v,{sx:i});default:return a(b,{sx:i})}},U=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}`;default:return c("Unknown")}},W=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");default:return c("Unknown")}},I=e=>"symbol"in e,M=e=>"position"in e,N=e=>"priceOpen"in e&&"priceTakeProfit"in e&&"priceStopLoss"in e,H=e=>"pnlPercentage"in e,Y=e=>"level"in e,K=e=>"percentToClose"in e,V=e=>"currentPrice"in e,q=e=>"duration"in e,G=e=>"closeReason"in e,J=e=>"cancelReason"in e,Z=e=>"priceClose"in e,Q=e=>"percentShift"in e,X=e=>"note"in e&&!!e.note,ee=e=>"message"in e,ae=e=>"rejectionNote"in e,ie=e=>"activePositionCount"in e,re=e=>"effectivePriceOpen"in e,ne=e=>"totalEntries"in e&&e.totalEntries>1,te=e=>"originalPriceOpen"in e&&"priceOpen"in e&&e.originalPriceOpen!==e.priceOpen,se=e=>"totalPartials"in e&&e.totalPartials>0,le=e=>"cost"in e,oe=e=>"pnlPriceOpen"in e&&"pnlPriceClose"in e&&"pnlCost"in e&&"pnlEntries"in e,ce=e.forwardRef(({item:e,className:b,style:v,sx:y},g)=>{const h=(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"}})(e),k=(e=>"timestamp"in e)(e)?e.timestamp:Date.now();return a("div",{className:b,style:v,ref:g,children:a(i,{variant:"outlined",onClick:()=>(e=>{switch(e.type){case"risk.rejection":P.layoutService.pickRisk(e.id);break;case"signal.opened":P.layoutService.pickSignalOpened(e.id);break;case"signal.closed":P.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":P.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":P.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":P.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":P.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":P.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":P.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":P.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":P.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":P.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":P.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":P.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":P.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":P.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":P.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":P.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":P.layoutService.pickClosePending(e.id)}})(e),sx:{transition:"box-shadow 0.2s ease",cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{boxShadow:4},...y},children:a(r,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[a(n,{direction:"row",spacing:2,sx:{p:2},children:[a(t,{sx:{width:56,height:56,background:h},children:D(e)}),a(n,{flex:1,spacing:1,children:[a(n,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[a(s,{variant:"h6",sx:{fontWeight:600},children:U(e)}),a(s,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:l(k).format("HH:mm DD/MM/YYYY")})]}),a(n,{direction:"row",spacing:1,flexWrap:"wrap",children:[a(o,{size:"small",label:W(e),sx:{background:h,color:"white",fontWeight:500}}),I(e)&&a(o,{size:"small",label:e.symbol,variant:"outlined"}),M(e)&&a(o,{size:"small",label:e.position.toUpperCase(),variant:"outlined",color:"long"===e.position?"success":"error"}),H(e)&&a(o,{size:"small",label:`PnL: ${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`,color:e.pnlPercentage>=0?"success":"error",variant:"outlined"}),Y(e)&&a(o,{size:"small",label:`${c("Level")}: ${e.level}%`,variant:"outlined"}),K(e)&&a(o,{size:"small",label:`${c("Close")}: ${e.percentToClose}%`,variant:"outlined"}),q(e)&&a(o,{size:"small",label:`${c("Duration")}: ${e.duration} ${c("min")}`,variant:"outlined"}),G(e)&&a(o,{size:"small",label:e.closeReason,variant:"outlined",color:"info"}),J(e)&&a(o,{size:"small",label:e.cancelReason,variant:"outlined",color:"info"}),Q(e)&&a(o,{size:"small",label:`${c("Shift")}: ${e.percentShift>0?"+":""}${e.percentShift}%`,variant:"outlined"}),ie(e)&&a(o,{size:"small",label:`${c("Active")}: ${e.activePositionCount}`,variant:"outlined"}),ne(e)&&a(o,{size:"small",label:`${c("Entries")}: ${e.totalEntries}`,variant:"outlined"}),se(e)&&a(o,{size:"small",label:`${c("Partials")}: ${e.totalPartials}`,variant:"outlined"}),le(e)&&a(o,{size:"small",label:`${c("Cost")}: ${e.cost.toFixed(2)}$`,variant:"outlined"}),re(e)&&a(o,{size:"small",label:`${c("Avg entry")}: ${e.effectivePriceOpen}`,variant:"outlined",color:"warning"}),te(e)&&a(o,{size:"small",label:`${c("Orig entry")}: ${e.originalPriceOpen}`,variant:"outlined"})]}),N(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Entry"),":"," "]}),e.priceOpen]}),Z(e)&&a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Close"),":"," "]}),e.priceClose]}),V(e)&&a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Current"),":"," "]}),e.currentPrice]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Take Profit"),":"," "]}),e.priceTakeProfit]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Stop Loss"),":"," "]}),e.priceStopLoss]})]})]}),oe(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("PnL Entry"),":"," "]}),e.pnlPriceOpen]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("PnL Exit"),":"," "]}),e.pnlPriceClose]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("PnL"),":"," "]}),a(s,{component:"span",color:e.pnlCost>=0?"success.main":"error.main",children:[e.pnlCost>=0?"+":"",e.pnlCost.toFixed(2),"$"]})]}),a(s,{variant:"body2",children:[a(s,{component:"span",color:"text.secondary",children:[c("Invested"),":"," "]}),e.pnlEntries.toFixed(2),"$"]})]})]})]})]}),X(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(r,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordWrap:"break-word"},children:a(m,{style:{textWrap:"wrap"},config:u,handler:()=>e.note})})]}),ae(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(s,{variant:"body2",color:"error",children:e.rejectionNote})]}),ee(e)&&!X(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(s,{variant:"body2",color:"text.secondary",children:e.message})]}),a(r,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:h}})]})})})}),de=[{action:"update-now",label:"Refresh manually",icon:()=>a(F,{icon:B,color:"#4caf50"})}],pe=[{type:O.Link,action:"back-action",label:a(R,{sx:{display:"block"}})},{type:O.Link,action:"back-action",label:"Main"},{type:O.Link,action:"back-action",label:"Notifications"}],me=new L,ue=()=>{const{data:e,hasMore:i,loading:r,onSkip:n}=w({handler:async(e,a)=>{const i=await P.notificationViewService.getList(),r=A(e,a);for(const n of i)if(r([n]).done)break;return r().rows},onLoadStart:()=>P.layoutService.setAppbarLoader(!0),onLoadEnd:()=>P.layoutService.setAppbarLoader(!1),reloadSubject:me});return a(T,{children:[a(z,{items:pe,actions:de,onAction:async e=>{"back-action"===e&&P.routerService.push("/"),"update-now"===e&&await me.next()}}),a(E,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:r,onDataRequest:n,bufferSize:j,hasMore:i,children:e.map(e=>a(ce,{item:e,sx:{mb:1}},e.id))})]})};export{ue as NotificationPage,ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,f as a,aQ as t,W as r,v as i,Y as o,U as n,X as c,t as s,Z as l,aY as p,B as d,F as h,y as m,T as u,aT as f,P as x,N as y,as as b,S as v,b7 as S,x as g,aX as L}from"./index-
|
|
1
|
+
import{c as e,f as a,aQ as t,W as r,v as i,Y as o,U as n,X as c,t as s,Z as l,aY as p,B as d,F as h,y as m,T as u,aT as f,P as x,N as y,as as b,S as v,b7 as S,x as g,aX as L}from"./index-CpAgfFDW.js";import{h as k}from"./hasRouteMatch-DzWVcZWi.js";import{B as w}from"./Background-as5_tKS_.js";import{R as A}from"./Refresh-CH0eiGLB.js";import{K as j}from"./KeyboardArrowLeft-sfHB1IYi.js";import{A as z}from"./Article-CV5Q8o6x.js";const H=e(a("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}),"Folder"),I=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"),T=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"),C=[{type:l.Link,action:"back-action",label:a(j,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Dump Explorer"}],E=[{action:"update-now",label:"Refresh",icon:()=>a(m,{icon:A,color:"#4caf50"})}],M=e=>e.mimeType.startsWith("image/")?a(I,{sx:{color:"#f57c00",fontSize:20}}):"application/json"===e.mimeType?a(g,{sx:{color:"#7b1fa2",fontSize:20}}):e.mimeType.startsWith("text/")?a(z,{sx:{color:"#1976d2",fontSize:20}}):a(T,{sx:{color:"#546e7a",fontSize:20}}),V=new n,D=({params:e})=>{const[n,l]=t(e.search),[m,{loading:g,execute:L}]=r(async()=>await i.explorerViewService.getFolderTree(),{onLoadStart:()=>i.layoutService.setAppbarLoader(!0),onLoadEnd:()=>i.layoutService.setAppbarLoader(!1)});o(()=>V.subscribe(L));const k=c(m);return a(h,{children:[a(s,{items:C,actions:E,onAction:e=>{"back-action"===e&&i.routerService.push("/"),"update-now"===e&&(i.explorerViewService.clear(),V.next())}}),a(p,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"calc(100vh - 150px)"},children:a(d,{pr:2,pl:2,children:g||!m?a(f,{children:a(u,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):a(S,{component:x,withExpandRoot:!0,search:n.current,onSearchChanged:e=>l(e),sx:{background:e=>e.palette.background.default,minHeight:"calc(100vh - 160px)",p:1},formatSearch:e=>{const a=k.current.map[e];return a?`${a.label}`:""},formatKey:e=>{const t=k.current.map[e];return t?a(v,{direction:"row",alignItems:"center",gap:1,children:["directory"===t.type&&a(H,{sx:{color:"#1976d2",fontSize:20}}),a(u,{children:t?t.label:e}),a(d,{sx:{flex:1}})]}):null},EmptyItem:()=>a("span",{children:"No files"}),CustomItem:({itemKey:e,index:t,withDarkParent:r})=>{const o=k.current.map[e];return o?"file"!==o.type?null:a(y,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"stretch",direction:"row",background:t%2==0?"transparent":r?"#fff6":"#ccc6",gap:1,p:1,mt:0===t?1:0},onClick:()=>{return a=e,void i.layoutService.pickDumpContent(a);var a},children:[M(o),a(d,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch","& > *":{width:"100%",textAlign:"start"}},children:[a(u,{variant:"body2",children:o.label}),a(u,{variant:"caption",sx:{opacity:.5},children:o.mimeType})]}),a(d,{sx:{flex:1}}),a(b,{sx:{mr:2,pointerEvents:"none"},variant:"text",children:"Open"})]}):null},data:m.record,keyWidth:3,valueWidth:9})})}),a(w,{})]})},R=[{id:"search",element:D,isActive:e=>k(["/dump/:search"],e)},{id:"main",element:D,isActive:e=>k(["/dump"],e)}],W=({search:e=""})=>a(L,{history:i.routerService,onLoadStart:()=>i.layoutService.setAppbarLoader(!0),onLoadEnd:()=>i.layoutService.setAppbarLoader(!1),routes:R,params:{search:e}});export{W as DumpPage,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,f as o,aS as t,W as i,v as a,t as n,Z as l,o as s,y as r,T as c,aT as p,w as d,B as m,F as u,G as h,H as b,K as y,S as f,N as g,i as k,l as v,L as S,Q as C,r as L,ak as x,ba as w,bb as P,bc as T,bd as V,be as $,bf as M,ac as z,a6 as H,X as N,Y as A,a$ as O,aP as _,az as F,P as I,E,ag as R,bg as j,U as W,aq as D,ar as G,aV as U,as as B,I as Y,at as K,D as X,aX as q}from"./index-DAgM7WkM.js";import{h as J}from"./hasRouteMatch-DohEILWY.js";import{I as Q}from"./IconPhoto-vJVt5Ncr.js";import{C as Z}from"./Container-BVnjAw0L.js";import{R as ee}from"./Refresh-BY0j0EcE.js";import{K as oe}from"./KeyboardArrowLeft-C6uma9wN.js";const te=e([o("path",{d:"M5 19h14V5H5v14zm4-4h4v-2h-2v-2h2V9H9V7h4c1.1 0 2 .89 2 2v1.5c0 .83-.67 1.5-1.5 1.5.83 0 1.5.67 1.5 1.5V15c0 1.11-.9 2-2 2H9v-2z",opacity:".3"}),o("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-4-4v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V9c0-1.11-.9-2-2-2H9v2h4v2h-2v2h2v2H9v2h4c1.1 0 2-.89 2-2z"})],"Looks3TwoTone"),ie=e([o("path",{d:"M19 5H5v14h14V5zm-5 12h-2V9h-2V7h4v10z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm5 4h2v8h2V7h-4z"})],"LooksOneTwoTone"),ae=e([o("path",{d:"M19 5H5v14h14V5zm-4 6c0 1.11-.9 2-2 2h-2v2h4v2H9v-4c0-1.11.9-2 2-2h2V9H9V7h4c1.1 0 2 .89 2 2v2z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm8 2H9v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2h-4v-2h2c1.1 0 2-.89 2-2V9c0-1.11-.9-2-2-2z"})],"LooksTwoTwoTone"),ne="backtest-kit__groupHeader",le="backtest-kit__groupRoot",se="backtest-kit__symbolImage",re=s()({root:{[`& .${le}:hover .${ne}`]:{opacity:"1 !important"}}});function ce(e){return C(e,"#000000")>C(e,"#FFFFFF")}const pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"}],de=[{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],me=e=>({type:h.Group,className:le,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:h.Component,className:ne,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"small",color:"info",label:`${y.bullet} Symbols`,sx:{mb:1,pr:.5,fontSize:"14px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:e.map(({symbol:e,label:t,color:i})=>((e,t,i)=>({type:h.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(`/price_chart/${e.toLowerCase()}`)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${se}`]:{transition:"filter 500ms"},"&:hover":{background:()=>ce(i)?k(i,.33):v(i,.33),[`& .${se}`]:{transition:"filter 500ms",filter:ce(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(Q,{className:se,symbol:e}),children:t})}))(e,t,i))}]}),ue="backtest-kit__groupHeader",he="backtest-kit__groupRoot",be="backtest-kit__symbolImage",ye=s()({root:{[`& .${he}:hover .${ue}`]:{opacity:"1 !important"}}});function fe(e){return C(e,"#000000")>C(e,"#FFFFFF")}const ge=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:e=>String(e).toUpperCase()}],ke=(e,t)=>({type:h.Group,className:he,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:h.Component,className:ue,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"medium",color:"info",label:`${y.bullet} ${e}`,sx:{mb:1,pr:.5,fontSize:"16px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:t.map(({label:e,to:t,color:i,icon:n})=>((e,t,i,n)=>({type:h.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(e)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px",[`& .${be}`]:{transition:"filter 500ms"},"&:hover":{background:()=>fe(i)?k(i,.33):v(i,.33),[`& .${be}`]:{transition:"filter 500ms",filter:fe(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(n,{className:be}),children:t})}))(t,e,i,n))}]}),ve=s()({root:{position:"relative"},tooltip:{position:"absolute",margin:0,left:5,top:5,backgroundColor:"#343434",zIndex:999,color:"white",fontWeight:"bold",padding:"5px 10px",borderRadius:3,fontSize:"12px",pointerEvents:"none",touchAction:"none"}}),Se={layout:{textColor:"#d4d4d8",backgroundColor:"#ffffff"},rightPriceScale:{scaleMargins:{top:.3,bottom:.25}},crosshair:{vertLine:{width:4,color:"#ebe0e301",style:0},horzLine:{visible:!1,labelVisible:!1}},grid:{vertLines:{color:"#f8b3"},horzLines:{color:"#f8b3"}},handleScroll:{vertTouchDrag:!1}},Ce=({height:e,width:t,items:i,position:a,priceOpen:n,priceStopLoss:l,priceTakeProfit:s})=>{const{classes:r}=ve(),c=L.useRef(void 0),[p,d]=L.useState(null);return L.useLayoutEffect(()=>{const{current:o}=c,r=x(o,{...Se,width:t,height:e,crosshair:{mode:w.Normal,vertLine:{labelVisible:!1},horzLine:{visible:!1,labelVisible:!0}},timeScale:{timeVisible:!0,secondsVisible:!0,tickMarkFormatter:e=>{const o=i.find(o=>o.timestamp===Number(e))||i[0];if(!o||!o.timestamp)return"Invalid date";const t=z(o.timestamp);return t.isValid()?t.format("HH:mm:ss"):"Invalid date"}}}),p=r.addLineSeries({lastValueVisible:!1,color:P[400]}),m=i.map(e=>({time:Math.floor(e.timestamp),value:parseFloat(e.close)}));if(p.setData(m),a&&n){const e="long"===a?P[700]:V[700];p.createPriceLine({price:n,color:e,lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"long"===a?"LONG Entry":"SHORT Entry"})}return l&&p.createPriceLine({price:l,color:$[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"SL"}),s&&p.createPriceLine({price:s,color:M[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"TP"}),r.subscribeCrosshairMove(e=>{if(e.time){const o=i.find(o=>o.timestamp===Number(e.time));if(o){const e=z(o.timestamp).format("DD/MM/YYYY HH:mm:ss"),t=H(o.close.toFixed(6));d(`${e}: ${t}`)}else d(null)}else d(null)}),r.timeScale().fitContent(),()=>{r.remove()}},[e,t,i]),o("div",{ref:c,className:r.root,children:p&&o("div",{className:r.tooltip,children:p})})},Le={"1m":"#2979ff","15m":"#f3a43a","1h":"#d500f9"},xe={"1m":"1 minute","15m":"15 minutes","1h":"1 hour"};const we=({symbol:e,interval:t,reloadSubject:n,downloadSubject:l,onInfoClick:s,disableInfo:r,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h,sx:y})=>{const[f,{loading:g,execute:k}]=i(async()=>await a.exchangeViewService.getLastCandles(e,t),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e,t]}),v=N(f);A(()=>n.subscribe(k)),A(()=>l.subscribe(()=>{const{current:o}=v;!function(e,o="data.json"){const t=new Blob([e],{type:"application/json"}),i=window.URL.createObjectURL(t);a.layoutService.downloadFile(i,o)}(JSON.stringify(o,null,2),`${e}-${t}.json`)}));return o(I,{sx:{...y,display:"flex",flexDirection:"column",alignItems:"stretch",overflow:"clip"},children:[o(m,{sx:{background:Le[t]||"#607d8b",minHeight:"48px",display:"flex",alignItems:"center",pl:2,pr:1},children:[o(c,{variant:"h6",sx:{color:"white",fontWeight:"bold",mr:1},children:xe[t]||t}),!!p&&o(b,{variant:"filled",sx:{color:"white"},color:"short"===p?"warning":"success",label:String(p).toUpperCase()}),o(m,{sx:{flex:1}}),o(O,{disabled:r,onClick:s,children:o(_,{style:{color:"white",opacity:r?.5:1}})})]}),o(F,{}),!f||g?o(E,{sx:{height:"100%",width:"100%"}}):o(m,{sx:{position:"relative",flex:1},children:o(R,{style:{position:"absolute"},children:({height:e,width:t})=>o(Ce,{items:f,height:e,width:t,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h})})})]})},Pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:({symbol:e})=>String(e).toUpperCase()},{type:l.Link,action:"back-action",compute:({interval:e})=>String(e).toUpperCase()}],Te=[{action:"download-now",label:"Download",icon:()=>o(r,{icon:X,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],Ve=new W,$e=new W,Me=[{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"symbol",title:"Symbol",readonly:!0,compute:e=>e.symbol||"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"position",title:"Position",readonly:!0,compute:e=>"long"===e.position?"🔵 LONG (profit on rise)":"🟠 SHORT (profit on fall)"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceOpen",title:"Entry",readonly:!0,compute:e=>e.priceOpen?`${H(e.priceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceOpen",title:"Original Entry",readonly:!0,isVisible:e=>null!=e.originalPriceOpen&&e.originalPriceOpen!==e.priceOpen,compute:e=>e.originalPriceOpen?`${H(e.originalPriceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceTakeProfit",title:"Take Profit",readonly:!0,compute:e=>e.priceTakeProfit?`${H(e.priceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceTakeProfit",title:"Original Take Profit",readonly:!0,isVisible:e=>null!=e.originalPriceTakeProfit&&e.originalPriceTakeProfit!==e.priceTakeProfit,compute:e=>e.originalPriceTakeProfit?`${H(e.originalPriceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceStopLoss",title:"Stop Loss",readonly:!0,compute:e=>e.priceStopLoss?`${H(e.priceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceStopLoss",title:"Original Stop Loss",readonly:!0,isVisible:e=>null!=e.originalPriceStopLoss&&e.originalPriceStopLoss!==e.priceStopLoss,compute:e=>e.originalPriceStopLoss?`${H(e.originalPriceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalEntries",title:"Total Entries",readonly:!0,isVisible:e=>null!=e.totalEntries&&e.totalEntries>1,compute:e=>String(e.totalEntries)},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalPartials",title:"Total Closes",readonly:!0,isVisible:e=>null!=e.totalPartials&&e.totalPartials>0,compute:e=>String(e.totalPartials)},{type:h.Component,sx:{mt:2},element:({payload:e})=>o(S,{variant:"outlined",onClick:e.handleClose,children:"Back"})}],ze=[{id:"chart",element:({params:e})=>{const t=j(()=>({symbol:String(e.symbol).toUpperCase(),interval:e.interval})),[l,{loading:s,execute:r}]=i(async()=>{const o=String(e.symbol).toUpperCase();return await a.signalViewService.getPendingSignal(o)},{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e.symbol]});A(()=>Ve.subscribe(r));const c=L.useMemo(()=>l?l.priceTakeProfit:0,[l]),p=L.useMemo(()=>l?l.priceStopLoss:0,[l]),d=L.useMemo(()=>l?l.priceOpen:0,[l]),m=L.useMemo(()=>l?l.position:null,[l]),[u,h]=D(null),{pickData:b,setOpen:y,render:g}=G({title:"Info",AfterTitle:({onClose:e})=>o(f,{direction:"row",gap:2,children:[o(B,{onClick:()=>a.layoutService.pickSignal(u.current.id),variant:"outlined",children:"Show Details"}),o(Y,{size:"small",onClick:e,children:o(K,{})})]}),payload:()=>({handleClose(){y(!1)}}),fields:Me,handler:()=>u.current,withActionButton:!1}),k=U(async()=>{l&&(h(l),b(l.id))});return o(Z,{children:[o(n,{items:Pe,actions:Te,payload:t,onAction:async o=>{"back-action"===o&&a.routerService.push(`/price_chart/${e.symbol}`),"update-now"===o&&await Ve.next(),"download-now"===o&&await $e.next()}}),s?null:o(we,{symbol:t.symbol,interval:t.interval,disableInfo:!l,reloadSubject:Ve,downloadSubject:$e,onInfoClick:k,position:m,priceOpen:d,priceStopLoss:p,priceTakeProfit:c,sx:{height:"calc(100dvh - 165px)"}}),g()]})},isActive:e=>J(["/price_chart/:symbol/:interval"],e)},{id:"coin",element:({params:e})=>{const{classes:t}=ye(),i=e.symbol,l=L.useMemo(()=>[{label:"1 minute",to:`/price_chart/${i}/1m`,color:"#2979ff",icon:ie},{label:"15 minutes",to:`/price_chart/${i}/15m`,color:"#f3a43a",icon:ae},{label:"1 hour",to:`/price_chart/${i}/1h`,color:"#d500f9",icon:te}],[i]),s=L.useMemo(()=>[ke("Chart",l)],[l]);return o(Z,{children:[o(n,{items:ge,payload:i,onAction:e=>{"back-action"===e&&a.routerService.push("/price_chart")}}),o(d,{className:t.root,fields:s}),o(m,{paddingBottom:"24px"})]})},isActive:e=>J(["/price_chart/:symbol"],e)},{id:"main",element:()=>{const{classes:e}=re(),{reloadTrigger:l,doReload:s}=t(),[r,{loading:h}]=i(async()=>await(async()=>{const[e,o]=await Promise.all([a.symbolGlobalService.getSymbolList(),a.symbolGlobalService.getSymbolMap()]),t=e.map(e=>{const t=o[e];return{symbol:e,label:(null==t?void 0:t.displayName)||e,color:(null==t?void 0:t.color)||"#ccc"}});return t.length?[me(t)]:[]})(),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[l]});return o(Z,{children:[o(n,{items:pe,actions:de,onAction:e=>{"back-action"===e&&a.routerService.push("/"),"update-now"===e&&s()}}),h||!r?o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):r.length?o(u,{children:[o(d,{className:e.root,fields:r},l),o(m,{paddingBottom:"24px"})]}):o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"No symbols found"})})]})},isActive:e=>J(["/price_chart"],e)}],He=({symbol:e,interval:t})=>o(q,{history:a.routerService,onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),routes:ze,params:{symbol:e,interval:t}});export{He as PriceChartPage,He as default};
|
|
1
|
+
import{c as e,f as o,aS as t,W as i,v as a,t as n,Z as l,o as s,y as r,T as c,aT as p,w as d,B as m,F as u,G as h,H as b,K as y,S as f,N as g,i as k,l as v,L as S,Q as C,r as L,ak as x,ba as w,bb as P,bc as T,bd as V,be as $,bf as M,ac as z,a6 as H,X as N,Y as A,a$ as O,aP as _,az as F,P as I,E,ag as R,bg as j,U as W,aq as D,ar as G,aV as U,as as B,I as Y,at as K,D as X,aX as q}from"./index-CpAgfFDW.js";import{h as J}from"./hasRouteMatch-DzWVcZWi.js";import{I as Q}from"./IconPhoto-iHdj_K8W.js";import{C as Z}from"./Container-bTKJUsqX.js";import{R as ee}from"./Refresh-CH0eiGLB.js";import{K as oe}from"./KeyboardArrowLeft-sfHB1IYi.js";const te=e([o("path",{d:"M5 19h14V5H5v14zm4-4h4v-2h-2v-2h2V9H9V7h4c1.1 0 2 .89 2 2v1.5c0 .83-.67 1.5-1.5 1.5.83 0 1.5.67 1.5 1.5V15c0 1.11-.9 2-2 2H9v-2z",opacity:".3"}),o("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-4-4v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V9c0-1.11-.9-2-2-2H9v2h4v2h-2v2h2v2H9v2h4c1.1 0 2-.89 2-2z"})],"Looks3TwoTone"),ie=e([o("path",{d:"M19 5H5v14h14V5zm-5 12h-2V9h-2V7h4v10z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm5 4h2v8h2V7h-4z"})],"LooksOneTwoTone"),ae=e([o("path",{d:"M19 5H5v14h14V5zm-4 6c0 1.11-.9 2-2 2h-2v2h4v2H9v-4c0-1.11.9-2 2-2h2V9H9V7h4c1.1 0 2 .89 2 2v2z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm8 2H9v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2h-4v-2h2c1.1 0 2-.89 2-2V9c0-1.11-.9-2-2-2z"})],"LooksTwoTwoTone"),ne="backtest-kit__groupHeader",le="backtest-kit__groupRoot",se="backtest-kit__symbolImage",re=s()({root:{[`& .${le}:hover .${ne}`]:{opacity:"1 !important"}}});function ce(e){return C(e,"#000000")>C(e,"#FFFFFF")}const pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"}],de=[{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],me=e=>({type:h.Group,className:le,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:h.Component,className:ne,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"small",color:"info",label:`${y.bullet} Symbols`,sx:{mb:1,pr:.5,fontSize:"14px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:e.map(({symbol:e,label:t,color:i})=>((e,t,i)=>({type:h.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(`/price_chart/${e.toLowerCase()}`)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${se}`]:{transition:"filter 500ms"},"&:hover":{background:()=>ce(i)?k(i,.33):v(i,.33),[`& .${se}`]:{transition:"filter 500ms",filter:ce(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(Q,{className:se,symbol:e}),children:t})}))(e,t,i))}]}),ue="backtest-kit__groupHeader",he="backtest-kit__groupRoot",be="backtest-kit__symbolImage",ye=s()({root:{[`& .${he}:hover .${ue}`]:{opacity:"1 !important"}}});function fe(e){return C(e,"#000000")>C(e,"#FFFFFF")}const ge=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:e=>String(e).toUpperCase()}],ke=(e,t)=>({type:h.Group,className:he,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:h.Component,className:ue,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"medium",color:"info",label:`${y.bullet} ${e}`,sx:{mb:1,pr:.5,fontSize:"16px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:t.map(({label:e,to:t,color:i,icon:n})=>((e,t,i,n)=>({type:h.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(e)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px",[`& .${be}`]:{transition:"filter 500ms"},"&:hover":{background:()=>fe(i)?k(i,.33):v(i,.33),[`& .${be}`]:{transition:"filter 500ms",filter:fe(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(n,{className:be}),children:t})}))(t,e,i,n))}]}),ve=s()({root:{position:"relative"},tooltip:{position:"absolute",margin:0,left:5,top:5,backgroundColor:"#343434",zIndex:999,color:"white",fontWeight:"bold",padding:"5px 10px",borderRadius:3,fontSize:"12px",pointerEvents:"none",touchAction:"none"}}),Se={layout:{textColor:"#d4d4d8",backgroundColor:"#ffffff"},rightPriceScale:{scaleMargins:{top:.3,bottom:.25}},crosshair:{vertLine:{width:4,color:"#ebe0e301",style:0},horzLine:{visible:!1,labelVisible:!1}},grid:{vertLines:{color:"#f8b3"},horzLines:{color:"#f8b3"}},handleScroll:{vertTouchDrag:!1}},Ce=({height:e,width:t,items:i,position:a,priceOpen:n,priceStopLoss:l,priceTakeProfit:s})=>{const{classes:r}=ve(),c=L.useRef(void 0),[p,d]=L.useState(null);return L.useLayoutEffect(()=>{const{current:o}=c,r=x(o,{...Se,width:t,height:e,crosshair:{mode:w.Normal,vertLine:{labelVisible:!1},horzLine:{visible:!1,labelVisible:!0}},timeScale:{timeVisible:!0,secondsVisible:!0,tickMarkFormatter:e=>{const o=i.find(o=>o.timestamp===Number(e))||i[0];if(!o||!o.timestamp)return"Invalid date";const t=z(o.timestamp);return t.isValid()?t.format("HH:mm:ss"):"Invalid date"}}}),p=r.addLineSeries({lastValueVisible:!1,color:P[400]}),m=i.map(e=>({time:Math.floor(e.timestamp),value:parseFloat(e.close)}));if(p.setData(m),a&&n){const e="long"===a?P[700]:V[700];p.createPriceLine({price:n,color:e,lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"long"===a?"LONG Entry":"SHORT Entry"})}return l&&p.createPriceLine({price:l,color:$[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"SL"}),s&&p.createPriceLine({price:s,color:M[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"TP"}),r.subscribeCrosshairMove(e=>{if(e.time){const o=i.find(o=>o.timestamp===Number(e.time));if(o){const e=z(o.timestamp).format("DD/MM/YYYY HH:mm:ss"),t=H(o.close.toFixed(6));d(`${e}: ${t}`)}else d(null)}else d(null)}),r.timeScale().fitContent(),()=>{r.remove()}},[e,t,i]),o("div",{ref:c,className:r.root,children:p&&o("div",{className:r.tooltip,children:p})})},Le={"1m":"#2979ff","15m":"#f3a43a","1h":"#d500f9"},xe={"1m":"1 minute","15m":"15 minutes","1h":"1 hour"};const we=({symbol:e,interval:t,reloadSubject:n,downloadSubject:l,onInfoClick:s,disableInfo:r,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h,sx:y})=>{const[f,{loading:g,execute:k}]=i(async()=>await a.exchangeViewService.getLastCandles(e,t),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e,t]}),v=N(f);A(()=>n.subscribe(k)),A(()=>l.subscribe(()=>{const{current:o}=v;!function(e,o="data.json"){const t=new Blob([e],{type:"application/json"}),i=window.URL.createObjectURL(t);a.layoutService.downloadFile(i,o)}(JSON.stringify(o,null,2),`${e}-${t}.json`)}));return o(I,{sx:{...y,display:"flex",flexDirection:"column",alignItems:"stretch",overflow:"clip"},children:[o(m,{sx:{background:Le[t]||"#607d8b",minHeight:"48px",display:"flex",alignItems:"center",pl:2,pr:1},children:[o(c,{variant:"h6",sx:{color:"white",fontWeight:"bold",mr:1},children:xe[t]||t}),!!p&&o(b,{variant:"filled",sx:{color:"white"},color:"short"===p?"warning":"success",label:String(p).toUpperCase()}),o(m,{sx:{flex:1}}),o(O,{disabled:r,onClick:s,children:o(_,{style:{color:"white",opacity:r?.5:1}})})]}),o(F,{}),!f||g?o(E,{sx:{height:"100%",width:"100%"}}):o(m,{sx:{position:"relative",flex:1},children:o(R,{style:{position:"absolute"},children:({height:e,width:t})=>o(Ce,{items:f,height:e,width:t,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h})})})]})},Pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:({symbol:e})=>String(e).toUpperCase()},{type:l.Link,action:"back-action",compute:({interval:e})=>String(e).toUpperCase()}],Te=[{action:"download-now",label:"Download",icon:()=>o(r,{icon:X,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],Ve=new W,$e=new W,Me=[{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"symbol",title:"Symbol",readonly:!0,compute:e=>e.symbol||"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"position",title:"Position",readonly:!0,compute:e=>"long"===e.position?"🔵 LONG (profit on rise)":"🟠 SHORT (profit on fall)"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceOpen",title:"Entry",readonly:!0,compute:e=>e.priceOpen?`${H(e.priceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceOpen",title:"Original Entry",readonly:!0,isVisible:e=>null!=e.originalPriceOpen&&e.originalPriceOpen!==e.priceOpen,compute:e=>e.originalPriceOpen?`${H(e.originalPriceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceTakeProfit",title:"Take Profit",readonly:!0,compute:e=>e.priceTakeProfit?`${H(e.priceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceTakeProfit",title:"Original Take Profit",readonly:!0,isVisible:e=>null!=e.originalPriceTakeProfit&&e.originalPriceTakeProfit!==e.priceTakeProfit,compute:e=>e.originalPriceTakeProfit?`${H(e.originalPriceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceStopLoss",title:"Stop Loss",readonly:!0,compute:e=>e.priceStopLoss?`${H(e.priceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceStopLoss",title:"Original Stop Loss",readonly:!0,isVisible:e=>null!=e.originalPriceStopLoss&&e.originalPriceStopLoss!==e.priceStopLoss,compute:e=>e.originalPriceStopLoss?`${H(e.originalPriceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalEntries",title:"Total Entries",readonly:!0,isVisible:e=>null!=e.totalEntries&&e.totalEntries>1,compute:e=>String(e.totalEntries)},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalPartials",title:"Total Closes",readonly:!0,isVisible:e=>null!=e.totalPartials&&e.totalPartials>0,compute:e=>String(e.totalPartials)},{type:h.Component,sx:{mt:2},element:({payload:e})=>o(S,{variant:"outlined",onClick:e.handleClose,children:"Back"})}],ze=[{id:"chart",element:({params:e})=>{const t=j(()=>({symbol:String(e.symbol).toUpperCase(),interval:e.interval})),[l,{loading:s,execute:r}]=i(async()=>{const o=String(e.symbol).toUpperCase();return await a.signalViewService.getPendingSignal(o)},{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e.symbol]});A(()=>Ve.subscribe(r));const c=L.useMemo(()=>l?l.priceTakeProfit:0,[l]),p=L.useMemo(()=>l?l.priceStopLoss:0,[l]),d=L.useMemo(()=>l?l.priceOpen:0,[l]),m=L.useMemo(()=>l?l.position:null,[l]),[u,h]=D(null),{pickData:b,setOpen:y,render:g}=G({title:"Info",AfterTitle:({onClose:e})=>o(f,{direction:"row",gap:2,children:[o(B,{onClick:()=>a.layoutService.pickSignal(u.current.id),variant:"outlined",children:"Show Details"}),o(Y,{size:"small",onClick:e,children:o(K,{})})]}),payload:()=>({handleClose(){y(!1)}}),fields:Me,handler:()=>u.current,withActionButton:!1}),k=U(async()=>{l&&(h(l),b(l.id))});return o(Z,{children:[o(n,{items:Pe,actions:Te,payload:t,onAction:async o=>{"back-action"===o&&a.routerService.push(`/price_chart/${e.symbol}`),"update-now"===o&&await Ve.next(),"download-now"===o&&await $e.next()}}),s?null:o(we,{symbol:t.symbol,interval:t.interval,disableInfo:!l,reloadSubject:Ve,downloadSubject:$e,onInfoClick:k,position:m,priceOpen:d,priceStopLoss:p,priceTakeProfit:c,sx:{height:"calc(100dvh - 165px)"}}),g()]})},isActive:e=>J(["/price_chart/:symbol/:interval"],e)},{id:"coin",element:({params:e})=>{const{classes:t}=ye(),i=e.symbol,l=L.useMemo(()=>[{label:"1 minute",to:`/price_chart/${i}/1m`,color:"#2979ff",icon:ie},{label:"15 minutes",to:`/price_chart/${i}/15m`,color:"#f3a43a",icon:ae},{label:"1 hour",to:`/price_chart/${i}/1h`,color:"#d500f9",icon:te}],[i]),s=L.useMemo(()=>[ke("Chart",l)],[l]);return o(Z,{children:[o(n,{items:ge,payload:i,onAction:e=>{"back-action"===e&&a.routerService.push("/price_chart")}}),o(d,{className:t.root,fields:s}),o(m,{paddingBottom:"24px"})]})},isActive:e=>J(["/price_chart/:symbol"],e)},{id:"main",element:()=>{const{classes:e}=re(),{reloadTrigger:l,doReload:s}=t(),[r,{loading:h}]=i(async()=>await(async()=>{const[e,o]=await Promise.all([a.symbolGlobalService.getSymbolList(),a.symbolGlobalService.getSymbolMap()]),t=e.map(e=>{const t=o[e];return{symbol:e,label:(null==t?void 0:t.displayName)||e,color:(null==t?void 0:t.color)||"#ccc"}});return t.length?[me(t)]:[]})(),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[l]});return o(Z,{children:[o(n,{items:pe,actions:de,onAction:e=>{"back-action"===e&&a.routerService.push("/"),"update-now"===e&&s()}}),h||!r?o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):r.length?o(u,{children:[o(d,{className:e.root,fields:r},l),o(m,{paddingBottom:"24px"})]}):o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"No symbols found"})})]})},isActive:e=>J(["/price_chart"],e)}],He=({symbol:e,interval:t})=>o(q,{history:a.routerService,onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),routes:ze,params:{symbol:e,interval:t}});export{He as PriceChartPage,He as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aS as t,W as a,v as e,f as o,t as s,Z as i,o as n,G as r,y as c,T as l,aT as d,w as p,B as u,F as m,H as b,K as y,S as h,N as g,i as S,l as f,L,Q as v,aU as k,aV as w,Y as x,U as A,D as C,aW as N,aX as j}from"./index-
|
|
1
|
+
import{aS as t,W as a,v as e,f as o,t as s,Z as i,o as n,G as r,y as c,T as l,aT as d,w as p,B as u,F as m,H as b,K as y,S as h,N as g,i as S,l as f,L,Q as v,aU as k,aV as w,Y as x,U as A,D as C,aW as N,aX as j}from"./index-CpAgfFDW.js";import{h as R}from"./hasRouteMatch-DzWVcZWi.js";import{I as $}from"./IconPhoto-iHdj_K8W.js";import{C as F}from"./Container-bTKJUsqX.js";import{R as H}from"./Refresh-CH0eiGLB.js";import{K as B}from"./KeyboardArrowLeft-sfHB1IYi.js";import{B as E}from"./Background-as5_tKS_.js";const G="backtest-kit__groupHeader",M="backtest-kit__groupRoot",V="backtest-kit__symbolImage",_=n()({root:{[`& .${M}:hover .${G}`]:{opacity:"1 !important"}}});function U(t){return v(t,"#000000")>v(t,"#FFFFFF")}const I=[{type:i.Link,action:"back-action",label:o(B,{sx:{display:"block"}})},{type:i.Link,action:"back-action",label:"Main"},{type:i.Link,action:"back-action",label:"Status"}],O=[{action:"update-now",label:"Refresh",icon:()=>o(c,{icon:H,color:"#4caf50"})}],T=(t,a)=>({type:r.Group,className:M,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:r.Component,className:G,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(h,{direction:"row",children:[o(b,{variant:"outlined",size:"small",color:"info",label:`${y.bullet} ${t}`,sx:{mb:1,pr:.5,fontSize:"14px",background:"white",cursor:"not-allowed"}}),o(u,{flex:1})]})},{type:r.Group,fields:a.map(({symbol:t,label:a,to:s,color:i})=>((t,a,s,i)=>({type:r.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(L,{component:g,onClick:()=>{e.routerService.push(`/status/${a}`)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${V}`]:{transition:"filter 500ms"},"&:hover":{background:()=>U(i)?S(i,.33):f(i,.33),[`& .${V}`]:{transition:"filter 500ms",filter:U(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o($,{className:V,symbol:t}),children:s})}))(t,s,a,i))}]}),W=[{type:i.Link,action:"back-action",label:o(B,{sx:{display:"block"}})},{type:i.Link,action:"back-action",label:"Main"},{type:i.Link,action:"back-action",label:"Status"},{type:i.Link,action:"back-action",compute:t=>t?`${String(t.symbol).toUpperCase()} (${t.strategyName})`:"Live"}],z=[{action:"download-action",label:"Download",icon:()=>o(c,{icon:C,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(c,{icon:H,color:"#4caf50"})}],D=new A,K=[{id:"status",element:({params:t})=>{const[i]=a(async()=>{const a=await e.statusViewService.getStatusMap();return k.get(a,t.id,null)},{onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),deps:[t.id]}),[n,{loading:r,execute:c}]=a(async()=>await e.statusViewService.getStatusOne(t.id),{onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),deps:[t.id]}),b=w(async()=>{if(!n)return;const t=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),a=URL.createObjectURL(t);e.layoutService.downloadFile(a,`status_${Date.now()}.json`)});x(()=>D.subscribe(c));return o(F,{children:[o(s,{items:W,actions:z,payload:i,onAction:async t=>{"back-action"===t&&((async()=>{1!==(await e.statusViewService.getStatusList()).length?e.routerService.push("/status"):e.routerService.push("/")})(),e.routerService.push("/")),"update-now"===t&&await D.next(),"download-action"===t&&await b()}}),r?o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):n?o(m,{children:[o(p,{handler:n,fields:N}),o(u,{paddingBottom:"24px"})]}):o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"No pending signal"})}),o(E,{})]})},isActive:t=>R(["/status/:id"],t)},{id:"main",element:()=>{const{classes:i}=_(),{reloadTrigger:n,doReload:c}=t();a(async()=>{const t=await e.statusViewService.getStatusList();if(1===t.length){const[{id:a}]=t;e.routerService.push(`/status/${a}`)}},{onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),deps:[n]});const[b,{loading:y}]=a(async()=>await(async()=>{const[t,a]=await Promise.all([e.symbolGlobalService.getSymbolMap(),e.statusViewService.getStatusList()]);if(!a||0===a.length)return[{type:r.Typography,typoVariant:"h6",placeholder:"Listening for a pending signal...",sx:{textAlign:"center",opacity:.5,mt:4}}];const o={};a.forEach(a=>{const e=t[a.symbol],s=a.strategyName;o[s]||(o[s]=[]),o[s].push({symbol:a.symbol,label:(null==e?void 0:e.displayName)||a.symbol,color:(null==e?void 0:e.color)||"#ccc",to:a.id})});const s=Object.entries(o).sort(([,t],[,a])=>a.length-t.length),i=[],n=[],c=[];return s.forEach(([t,a],e)=>{const o=T(t,a);e%2==0?i.push(o):n.push(o),c.push(o)}),[{type:r.Group,columns:"6",className:"tabletLeftColumn",phoneHidden:!0,desktopHidden:!0,fields:i},{type:r.Group,columns:"6",className:"tabletRightColumn",phoneHidden:!0,desktopHidden:!0,fields:n},{type:r.Group,columns:"12",className:"wideColumn",tabletHidden:!0,fields:c}]})(),{onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),deps:[n]});return o(F,{children:[o(s,{items:I,actions:O,onAction:t=>{"back-action"===t&&e.routerService.push("/"),"update-now"===t&&c()}}),y||!b?o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):b.length?o(m,{children:[o(p,{className:i.root,fields:b},n),o(u,{paddingBottom:"24px"})]}):o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"No pending signals"})})]})},isActive:t=>R(["/status"],t)}],P=({id:t})=>o(j,{history:e.routerService,onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),routes:K,params:{id:t}});export{P as StatusPage,P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,aY as t,M as a,B as i,aZ as r,a_ as o,v as n,a$ as s,b0 as l,aV as c,b1 as d,x as p,y as h,z as w,A as m,aQ as k,b2 as g,aq as b,b3 as v,aa as y,b4 as u,b5 as f,at as S,S as x,b6 as _,ad as V,q as D,aS as N,W as O,t as L,Z as R,o as B,G as A,T as P,aT as C,w as $,F as j,H as J,K as G,N as M,i as F,l as X,L as H,Q as I,aX as E}from"./index-DAgM7WkM.js";import{h as z}from"./hasRouteMatch-DohEILWY.js";import{I as T}from"./IconPhoto-vJVt5Ncr.js";import{C as U}from"./Container-BVnjAw0L.js";import{R as q}from"./Refresh-BY0j0EcE.js";import{K}from"./KeyboardArrowLeft-C6uma9wN.js";const W=[{id:"backtest",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/backtest")},{id:"live",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/live")},{id:"breakeven",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/breakeven")},{id:"risk",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/risk")},{id:"partial",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/partial")},{id:"highest_profit",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/highest_profit")},{id:"schedule",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/schedule")},{id:"performance",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/performance")},{id:"sync",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/sync")},{id:"heat",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/heat")},{id:"strategy",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/strategy")}],Q=[{id:"backtest",label:"Backtest",isVisible:({type:e})=>"backtest"===e},{id:"live",label:"Live",isVisible:({type:e})=>"live"===e},{id:"strategy",label:"Strategy"},{id:"breakeven",label:"Breakeven"},{id:"risk",label:"Risk"},{id:"partial",label:"Partial"},{id:"highest_profit",label:"Highest Profit"},{id:"schedule",label:"Schedule"},{id:"performance",label:"Performance"},{id:"sync",label:"Sync"},{id:"heat",label:"Heat"}],Z=({disabled:t,className:a,style:i,sx:c,onClick:d,color:p})=>e(s,{className:a,style:i,sx:c,disabled:t,color:p,size:36,onClick:async e=>{const[t,{resolve:a}]=o();e.preventDefault(),e.stopPropagation(),await d(e,e=>a(e));const i=await t;await(async e=>{let t=!1;t=t||"string"==typeof e,t=t||"number"==typeof e,t=t||"boolean"==typeof e,t=t||void 0===e,t=t||null===e,t&&await l(String(e))})(i),n.alertService.notify("Copied!")},children:e(r,{})}),Y=[{action:"json",label:"Download JSON",icon:()=>e(h,{icon:p,color:"#4caf50"})},{action:"markdown",label:"Download Markdown",icon:()=>e(h,{icon:w,color:"#4caf50"})},{action:"pdf",label:"Download PDF",icon:()=>e(h,{icon:m,color:"#4caf50"})}],ee=({disabled:t,className:a,style:i,sx:r,onDownloadJson:o,onDownloadMarkdown:n,onDownloadPdf:s})=>{const l=c(async e=>{"json"===e?await o():"markdown"===e?await n():"pdf"===e&&await s()});return e(d,{transparent:!0,keepMounted:!0,className:a,style:i,sx:r,disabled:t,options:Y,onAction:l})},te=y(),ae=V(async(e,t)=>{const a=("backtest"===t?await n.backtestGlobalService.list():await n.liveGlobalService.list()).find(t=>t.id===e);if(!a)throw new Error(`Item not found: ${e}`);const{symbol:i,strategyName:r,exchangeName:o,frameName:s}=a,[l,c,d,p,h,w,m,k,g,b,v]=await Promise.all(["backtest"===t?n.markdownViewService.getBacktestReport(i,r,o,s):Promise.resolve(""),"live"===t?n.markdownViewService.getLiveReport(i,r,o):Promise.resolve(""),n.markdownViewService.getBreakevenReport(i,r,o,s,"backtest"===t),n.markdownViewService.getRiskReport(i,r,o,s,"backtest"===t),n.markdownViewService.getPartialReport(i,r,o,s,"backtest"===t),n.markdownViewService.getHighestProfitReport(i,r,o,s,"backtest"===t),n.markdownViewService.getScheduleReport(i,r,o,s,"backtest"===t),n.markdownViewService.getPerformanceReport(i,r,o,s,"backtest"===t),n.markdownViewService.getSyncReport(i,r,o,s,"backtest"===t),n.markdownViewService.getHeatReport(r,o,s,"backtest"===t),n.markdownViewService.getStrategyReport(i,r,o,s,"backtest"===t)]);return{type:t,backtest:l,live:c,breakeven:d,risk:p,partial:h,highest_profit:w,schedule:m,performance:k,sync:g,heat:b,strategy:v}},{timeout:45e3,key:([e,t])=>`${e}_${t}`}),ie=()=>{const[t,a]=k(""),[r,o]=k("backtest"),l=g(),{push:c,pop:d}=l,[p,h]=b(te.location.pathname),w=async()=>{const e=(await ae(t.current,r.current))[p.current.replace("/markdown_report/","")];"string"==typeof e&&await D(e)},m=async()=>{const e=await ae(t.current,r.current),a=p.current.replace("/markdown_report/",""),i=e[a];if("string"==typeof i){const e=new Blob([i],{type:"text/plain"}),t=URL.createObjectURL(e);n.layoutService.downloadFile(t,`${a}_${r.current}_${Date.now()}.md`)}},y=async()=>{const e=("backtest"===r.current?await n.backtestGlobalService.list():await n.liveGlobalService.list()).find(e=>e.id===t.current);if(!e)throw new Error(`Item not found: ${t.current}`);const{symbol:a,strategyName:i,exchangeName:o,frameName:s}=e,l=p.current.replace("/markdown_report/",""),c="backtest"===r.current;let d;if("backtest"===l?d=await n.markdownViewService.getBacktestData(a,i,o,s):"live"===l?d=await n.markdownViewService.getLiveData(a,i,o):"breakeven"===l?d=await n.markdownViewService.getBreakevenData(a,i,o,s,c):"risk"===l?d=await n.markdownViewService.getRiskData(a,i,o,s,c):"partial"===l?d=await n.markdownViewService.getPartialData(a,i,o,s,c):"highest_profit"===l?d=await n.markdownViewService.getHighestProfitData(a,i,o,s,c):"schedule"===l?d=await n.markdownViewService.getScheduleData(a,i,o,s,c):"performance"===l?d=await n.markdownViewService.getPerformanceData(a,i,o,s,c):"sync"===l?d=await n.markdownViewService.getSyncData(a,i,o,s,c):"heat"===l?d=await n.markdownViewService.getHeatData(i,o,s,c):"strategy"===l&&(d=await n.markdownViewService.getStrategyData(a,i,o,s,c)),void 0!==d){const e=new Blob([JSON.stringify(d,null,2)],{type:"application/json"}),t=URL.createObjectURL(e);n.layoutService.downloadFile(t,`${l}_${r.current}_${Date.now()}.json`)}},{pickData:V,render:N}=v({tabs:Q,withStaticAction:!0,onTabChange:(e,t)=>{const a=`/markdown_report/${e}`;t.replace(a),h(a)},animation:"none",title:"Markdown Report",sizeRequest:u,history:te,routes:W,BeforeTitle:({onClose:t})=>{const{total:a}=g();return e(i,{sx:{mr:1,display:1===a?"none":"flex"},children:e(s,{onClick:t,children:e(_,{})})})},AfterTitle:({onClose:a})=>e(x,{direction:"row",gap:1,children:[e(s,{sx:{mr:"10px"},onClick:()=>w(),children:e(f,{})}),e(Z,{onClick:async(e,a)=>{await(async(e,t,a,i)=>{const r=("backtest"===a?await n.backtestGlobalService.list():await n.liveGlobalService.list()).find(e=>e.id===t);if(!r)throw new Error(`Item not found: ${t}`);const{symbol:o,strategyName:s,exchangeName:l,frameName:c}=r,d="backtest"===a;e.includes("/markdown_report/backtest")?i(JSON.stringify(await n.markdownViewService.getBacktestData(o,s,l,c),null,2)):e.includes("/markdown_report/live")?i(JSON.stringify(await n.markdownViewService.getLiveData(o,s,l),null,2)):e.includes("/markdown_report/breakeven")?i(JSON.stringify(await n.markdownViewService.getBreakevenData(o,s,l,c,d),null,2)):e.includes("/markdown_report/risk")?i(JSON.stringify(await n.markdownViewService.getRiskData(o,s,l,c,d),null,2)):e.includes("/markdown_report/partial")?i(JSON.stringify(await n.markdownViewService.getPartialData(o,s,l,c,d),null,2)):e.includes("/markdown_report/highest_profit")?i(JSON.stringify(await n.markdownViewService.getHighestProfitData(o,s,l,c,d),null,2)):e.includes("/markdown_report/schedule")?i(JSON.stringify(await n.markdownViewService.getScheduleData(o,s,l,c,d),null,2)):e.includes("/markdown_report/performance")?i(JSON.stringify(await n.markdownViewService.getPerformanceData(o,s,l,c,d),null,2)):e.includes("/markdown_report/sync")?i(JSON.stringify(await n.markdownViewService.getSyncData(o,s,l,c,d),null,2)):e.includes("/markdown_report/heat")?i(JSON.stringify(await n.markdownViewService.getHeatData(s,l,c,d),null,2)):e.includes("/markdown_report/strategy")&&i(JSON.stringify(await n.markdownViewService.getStrategyData(o,s,l,c,d),null,2))})(p.current,t.current,r.current,a)},sx:{mr:"10px",mt:"2.5px"}}),e(ee,{sx:{mr:"10px",mt:"0.5px"},onDownloadJson:y,onDownloadMarkdown:m,onDownloadPdf:w}),e(s,{onClick:a,children:e(S,{})})]}),fetchState:async()=>await ae(t.current,r.current),mapInitialData:([{type:e,backtest:t,live:a,breakeven:i,risk:r,partial:o,highest_profit:n,schedule:s,performance:l,sync:c,heat:d,strategy:p}])=>({backtest:t,live:a,breakeven:i,risk:r,partial:o,highest_profit:n,schedule:s,performance:l,sync:c,heat:d,strategy:p,type:e}),mapPayload:([{type:e}])=>({type:e}),onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),onClose:()=>{d()}});return(e,t)=>{c({id:"markdown_report_modal",render:N,onInit:()=>{const e="live"===t?"/markdown_report/live":"/markdown_report/backtest";te.push(e),h(e)},onMount:()=>{a(e),o(t),V()}})}},re="backtest-kit__groupHeader",oe="backtest-kit__groupRoot",ne="backtest-kit__symbolImage",se=B()({root:{[`& .${oe}:hover .${re}`]:{opacity:"1 !important"}}});function le(e){return I(e,"#000000")>I(e,"#FFFFFF")}const ce=[{type:R.Link,action:"back-action",label:e(K,{sx:{display:"block"}})},{type:R.Link,action:"back-action",label:"Main"},{type:R.Link,action:"back-action",label:"Markdown Report"}],de=[{action:"update-now",label:"Refresh",icon:()=>e(h,{icon:q,color:"#4caf50"})}],pe=(t,a)=>({type:A.Group,className:oe,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:A.Component,className:re,style:{transition:"opacity 500ms",opacity:.5},element:()=>e(x,{direction:"row",children:[e(J,{variant:"outlined",size:"small",color:"info",label:`${G.bullet} ${t}`,sx:{mb:1,pr:.5,fontSize:"14px",background:"white",cursor:"not-allowed"}}),e(i,{flex:1})]})},{type:A.Group,fields:a.map(({symbol:t,label:a,id:i,type:r,color:o})=>((t,a,i,r,o)=>({type:A.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:({payload:n})=>e(H,{component:M,onClick:()=>{n.handleOpen(t,a)},sx:{width:"100%",background:o,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${ne}`]:{transition:"filter 500ms"},"&:hover":{background:()=>le(o)?F(o,.33):X(o,.33),[`& .${ne}`]:{transition:"filter 500ms",filter:le(o)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:e(T,{className:ne,symbol:i}),children:r})}))(i,r,t,a,o))}]}),he=[{id:"main",element:()=>{const{classes:t}=se(),{reloadTrigger:a,doReload:r}=N(),[o,{loading:s}]=O(async()=>await(async()=>{const[e,t,a]=await Promise.all([n.symbolGlobalService.getSymbolMap(),n.backtestGlobalService.list(),n.liveGlobalService.list()]),i={},r={};t.forEach(t=>{const a=e[t.symbol],r=t.strategyName;i[r]||(i[r]=[]),i[r].push({symbol:t.symbol,label:(null==a?void 0:a.displayName)||t.symbol,color:(null==a?void 0:a.color)||"#ccc",type:"backtest",id:t.id})}),a.forEach(t=>{const a=e[t.symbol],i=t.strategyName;r[i]||(r[i]=[]),r[i].push({symbol:t.symbol,label:(null==a?void 0:a.displayName)||t.symbol,color:(null==a?void 0:a.color)||"#ccc",id:t.id,type:"live"})});const o=Object.entries(i).sort(([,e],[,t])=>t.length-e.length).map(([e,t])=>pe(e,t)),s=Object.entries(r).sort(([,e],[,t])=>t.length-e.length).map(([e,t])=>pe(e,t));return s.length||o.length?[{type:A.Fragment,isVisible:()=>!!o.length,fields:[{type:A.Line,title:"Backtest"},{type:A.Group,columns:"12",fields:o}]},{type:A.Fragment,isVisible:()=>!!s.length,fields:[{type:A.Line,title:"Live"},{type:A.Group,columns:"12",fields:s}]}]:[]})(),{onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),deps:[a]}),l=ie(),c=(e,t)=>{l(e,t)};return e(U,{children:[e(L,{items:ce,actions:de,onAction:e=>{"back-action"===e&&n.routerService.push("/"),"update-now"===e&&r()}}),s||!o?e(C,{children:e(P,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):o.length?e(j,{children:[e($,{className:t.root,fields:o,payload:()=>({handleOpen:c})},a),e(i,{paddingBottom:"24px"})]}):e(C,{children:e(P,{variant:"h6",sx:{opacity:.5},children:"No pending signals"})})]})},isActive:e=>z(["/report"],e)}],we=({id:t})=>e(E,{history:n.routerService,onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),routes:he,params:{id:t}});export{we as StatusPage,we as default};
|
|
1
|
+
import{f as e,aY as t,M as a,B as i,aZ as r,a_ as o,v as n,a$ as s,b0 as l,aV as c,b1 as d,x as p,y as h,z as w,A as m,aQ as k,b2 as g,aq as b,b3 as v,aa as y,b4 as u,b5 as f,at as S,S as x,b6 as _,ad as V,q as D,aS as N,W as O,t as L,Z as R,o as B,G as A,T as P,aT as C,w as $,F as j,H as J,K as G,N as M,i as F,l as X,L as H,Q as I,aX as E}from"./index-CpAgfFDW.js";import{h as z}from"./hasRouteMatch-DzWVcZWi.js";import{I as T}from"./IconPhoto-iHdj_K8W.js";import{C as U}from"./Container-bTKJUsqX.js";import{R as q}from"./Refresh-CH0eiGLB.js";import{K}from"./KeyboardArrowLeft-sfHB1IYi.js";const W=[{id:"backtest",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/backtest")},{id:"live",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/live")},{id:"breakeven",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/breakeven")},{id:"risk",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/risk")},{id:"partial",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/partial")},{id:"highest_profit",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/highest_profit")},{id:"schedule",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/schedule")},{id:"performance",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/performance")},{id:"sync",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/sync")},{id:"heat",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/heat")},{id:"strategy",element:({data:r})=>e(i,{sx:{height:"100%",width:"100%",pt:1},children:e(t,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"100%"},children:e("div",{children:[e(a,{content:r||"# Нет данных"}),e(i,{sx:{paddingBottom:"65px"}})]})})}),isActive:e=>e.includes("/markdown_report/strategy")}],Q=[{id:"backtest",label:"Backtest",isVisible:({type:e})=>"backtest"===e},{id:"live",label:"Live",isVisible:({type:e})=>"live"===e},{id:"strategy",label:"Strategy"},{id:"breakeven",label:"Breakeven"},{id:"risk",label:"Risk"},{id:"partial",label:"Partial"},{id:"highest_profit",label:"Highest Profit"},{id:"schedule",label:"Schedule"},{id:"performance",label:"Performance"},{id:"sync",label:"Sync"},{id:"heat",label:"Heat"}],Z=({disabled:t,className:a,style:i,sx:c,onClick:d,color:p})=>e(s,{className:a,style:i,sx:c,disabled:t,color:p,size:36,onClick:async e=>{const[t,{resolve:a}]=o();e.preventDefault(),e.stopPropagation(),await d(e,e=>a(e));const i=await t;await(async e=>{let t=!1;t=t||"string"==typeof e,t=t||"number"==typeof e,t=t||"boolean"==typeof e,t=t||void 0===e,t=t||null===e,t&&await l(String(e))})(i),n.alertService.notify("Copied!")},children:e(r,{})}),Y=[{action:"json",label:"Download JSON",icon:()=>e(h,{icon:p,color:"#4caf50"})},{action:"markdown",label:"Download Markdown",icon:()=>e(h,{icon:w,color:"#4caf50"})},{action:"pdf",label:"Download PDF",icon:()=>e(h,{icon:m,color:"#4caf50"})}],ee=({disabled:t,className:a,style:i,sx:r,onDownloadJson:o,onDownloadMarkdown:n,onDownloadPdf:s})=>{const l=c(async e=>{"json"===e?await o():"markdown"===e?await n():"pdf"===e&&await s()});return e(d,{transparent:!0,keepMounted:!0,className:a,style:i,sx:r,disabled:t,options:Y,onAction:l})},te=y(),ae=V(async(e,t)=>{const a=("backtest"===t?await n.backtestGlobalService.list():await n.liveGlobalService.list()).find(t=>t.id===e);if(!a)throw new Error(`Item not found: ${e}`);const{symbol:i,strategyName:r,exchangeName:o,frameName:s}=a,[l,c,d,p,h,w,m,k,g,b,v]=await Promise.all(["backtest"===t?n.markdownViewService.getBacktestReport(i,r,o,s):Promise.resolve(""),"live"===t?n.markdownViewService.getLiveReport(i,r,o):Promise.resolve(""),n.markdownViewService.getBreakevenReport(i,r,o,s,"backtest"===t),n.markdownViewService.getRiskReport(i,r,o,s,"backtest"===t),n.markdownViewService.getPartialReport(i,r,o,s,"backtest"===t),n.markdownViewService.getHighestProfitReport(i,r,o,s,"backtest"===t),n.markdownViewService.getScheduleReport(i,r,o,s,"backtest"===t),n.markdownViewService.getPerformanceReport(i,r,o,s,"backtest"===t),n.markdownViewService.getSyncReport(i,r,o,s,"backtest"===t),n.markdownViewService.getHeatReport(r,o,s,"backtest"===t),n.markdownViewService.getStrategyReport(i,r,o,s,"backtest"===t)]);return{type:t,backtest:l,live:c,breakeven:d,risk:p,partial:h,highest_profit:w,schedule:m,performance:k,sync:g,heat:b,strategy:v}},{timeout:45e3,key:([e,t])=>`${e}_${t}`}),ie=()=>{const[t,a]=k(""),[r,o]=k("backtest"),l=g(),{push:c,pop:d}=l,[p,h]=b(te.location.pathname),w=async()=>{const e=(await ae(t.current,r.current))[p.current.replace("/markdown_report/","")];"string"==typeof e&&await D(e)},m=async()=>{const e=await ae(t.current,r.current),a=p.current.replace("/markdown_report/",""),i=e[a];if("string"==typeof i){const e=new Blob([i],{type:"text/plain"}),t=URL.createObjectURL(e);n.layoutService.downloadFile(t,`${a}_${r.current}_${Date.now()}.md`)}},y=async()=>{const e=("backtest"===r.current?await n.backtestGlobalService.list():await n.liveGlobalService.list()).find(e=>e.id===t.current);if(!e)throw new Error(`Item not found: ${t.current}`);const{symbol:a,strategyName:i,exchangeName:o,frameName:s}=e,l=p.current.replace("/markdown_report/",""),c="backtest"===r.current;let d;if("backtest"===l?d=await n.markdownViewService.getBacktestData(a,i,o,s):"live"===l?d=await n.markdownViewService.getLiveData(a,i,o):"breakeven"===l?d=await n.markdownViewService.getBreakevenData(a,i,o,s,c):"risk"===l?d=await n.markdownViewService.getRiskData(a,i,o,s,c):"partial"===l?d=await n.markdownViewService.getPartialData(a,i,o,s,c):"highest_profit"===l?d=await n.markdownViewService.getHighestProfitData(a,i,o,s,c):"schedule"===l?d=await n.markdownViewService.getScheduleData(a,i,o,s,c):"performance"===l?d=await n.markdownViewService.getPerformanceData(a,i,o,s,c):"sync"===l?d=await n.markdownViewService.getSyncData(a,i,o,s,c):"heat"===l?d=await n.markdownViewService.getHeatData(i,o,s,c):"strategy"===l&&(d=await n.markdownViewService.getStrategyData(a,i,o,s,c)),void 0!==d){const e=new Blob([JSON.stringify(d,null,2)],{type:"application/json"}),t=URL.createObjectURL(e);n.layoutService.downloadFile(t,`${l}_${r.current}_${Date.now()}.json`)}},{pickData:V,render:N}=v({tabs:Q,withStaticAction:!0,onTabChange:(e,t)=>{const a=`/markdown_report/${e}`;t.replace(a),h(a)},animation:"none",title:"Markdown Report",sizeRequest:u,history:te,routes:W,BeforeTitle:({onClose:t})=>{const{total:a}=g();return e(i,{sx:{mr:1,display:1===a?"none":"flex"},children:e(s,{onClick:t,children:e(_,{})})})},AfterTitle:({onClose:a})=>e(x,{direction:"row",gap:1,children:[e(s,{sx:{mr:"10px"},onClick:()=>w(),children:e(f,{})}),e(Z,{onClick:async(e,a)=>{await(async(e,t,a,i)=>{const r=("backtest"===a?await n.backtestGlobalService.list():await n.liveGlobalService.list()).find(e=>e.id===t);if(!r)throw new Error(`Item not found: ${t}`);const{symbol:o,strategyName:s,exchangeName:l,frameName:c}=r,d="backtest"===a;e.includes("/markdown_report/backtest")?i(JSON.stringify(await n.markdownViewService.getBacktestData(o,s,l,c),null,2)):e.includes("/markdown_report/live")?i(JSON.stringify(await n.markdownViewService.getLiveData(o,s,l),null,2)):e.includes("/markdown_report/breakeven")?i(JSON.stringify(await n.markdownViewService.getBreakevenData(o,s,l,c,d),null,2)):e.includes("/markdown_report/risk")?i(JSON.stringify(await n.markdownViewService.getRiskData(o,s,l,c,d),null,2)):e.includes("/markdown_report/partial")?i(JSON.stringify(await n.markdownViewService.getPartialData(o,s,l,c,d),null,2)):e.includes("/markdown_report/highest_profit")?i(JSON.stringify(await n.markdownViewService.getHighestProfitData(o,s,l,c,d),null,2)):e.includes("/markdown_report/schedule")?i(JSON.stringify(await n.markdownViewService.getScheduleData(o,s,l,c,d),null,2)):e.includes("/markdown_report/performance")?i(JSON.stringify(await n.markdownViewService.getPerformanceData(o,s,l,c,d),null,2)):e.includes("/markdown_report/sync")?i(JSON.stringify(await n.markdownViewService.getSyncData(o,s,l,c,d),null,2)):e.includes("/markdown_report/heat")?i(JSON.stringify(await n.markdownViewService.getHeatData(s,l,c,d),null,2)):e.includes("/markdown_report/strategy")&&i(JSON.stringify(await n.markdownViewService.getStrategyData(o,s,l,c,d),null,2))})(p.current,t.current,r.current,a)},sx:{mr:"10px",mt:"2.5px"}}),e(ee,{sx:{mr:"10px",mt:"0.5px"},onDownloadJson:y,onDownloadMarkdown:m,onDownloadPdf:w}),e(s,{onClick:a,children:e(S,{})})]}),fetchState:async()=>await ae(t.current,r.current),mapInitialData:([{type:e,backtest:t,live:a,breakeven:i,risk:r,partial:o,highest_profit:n,schedule:s,performance:l,sync:c,heat:d,strategy:p}])=>({backtest:t,live:a,breakeven:i,risk:r,partial:o,highest_profit:n,schedule:s,performance:l,sync:c,heat:d,strategy:p,type:e}),mapPayload:([{type:e}])=>({type:e}),onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),onClose:()=>{d()}});return(e,t)=>{c({id:"markdown_report_modal",render:N,onInit:()=>{const e="live"===t?"/markdown_report/live":"/markdown_report/backtest";te.push(e),h(e)},onMount:()=>{a(e),o(t),V()}})}},re="backtest-kit__groupHeader",oe="backtest-kit__groupRoot",ne="backtest-kit__symbolImage",se=B()({root:{[`& .${oe}:hover .${re}`]:{opacity:"1 !important"}}});function le(e){return I(e,"#000000")>I(e,"#FFFFFF")}const ce=[{type:R.Link,action:"back-action",label:e(K,{sx:{display:"block"}})},{type:R.Link,action:"back-action",label:"Main"},{type:R.Link,action:"back-action",label:"Markdown Report"}],de=[{action:"update-now",label:"Refresh",icon:()=>e(h,{icon:q,color:"#4caf50"})}],pe=(t,a)=>({type:A.Group,className:oe,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:A.Component,className:re,style:{transition:"opacity 500ms",opacity:.5},element:()=>e(x,{direction:"row",children:[e(J,{variant:"outlined",size:"small",color:"info",label:`${G.bullet} ${t}`,sx:{mb:1,pr:.5,fontSize:"14px",background:"white",cursor:"not-allowed"}}),e(i,{flex:1})]})},{type:A.Group,fields:a.map(({symbol:t,label:a,id:i,type:r,color:o})=>((t,a,i,r,o)=>({type:A.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:({payload:n})=>e(H,{component:M,onClick:()=>{n.handleOpen(t,a)},sx:{width:"100%",background:o,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${ne}`]:{transition:"filter 500ms"},"&:hover":{background:()=>le(o)?F(o,.33):X(o,.33),[`& .${ne}`]:{transition:"filter 500ms",filter:le(o)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:e(T,{className:ne,symbol:i}),children:r})}))(i,r,t,a,o))}]}),he=[{id:"main",element:()=>{const{classes:t}=se(),{reloadTrigger:a,doReload:r}=N(),[o,{loading:s}]=O(async()=>await(async()=>{const[e,t,a]=await Promise.all([n.symbolGlobalService.getSymbolMap(),n.backtestGlobalService.list(),n.liveGlobalService.list()]),i={},r={};t.forEach(t=>{const a=e[t.symbol],r=t.strategyName;i[r]||(i[r]=[]),i[r].push({symbol:t.symbol,label:(null==a?void 0:a.displayName)||t.symbol,color:(null==a?void 0:a.color)||"#ccc",type:"backtest",id:t.id})}),a.forEach(t=>{const a=e[t.symbol],i=t.strategyName;r[i]||(r[i]=[]),r[i].push({symbol:t.symbol,label:(null==a?void 0:a.displayName)||t.symbol,color:(null==a?void 0:a.color)||"#ccc",id:t.id,type:"live"})});const o=Object.entries(i).sort(([,e],[,t])=>t.length-e.length).map(([e,t])=>pe(e,t)),s=Object.entries(r).sort(([,e],[,t])=>t.length-e.length).map(([e,t])=>pe(e,t));return s.length||o.length?[{type:A.Fragment,isVisible:()=>!!o.length,fields:[{type:A.Line,title:"Backtest"},{type:A.Group,columns:"12",fields:o}]},{type:A.Fragment,isVisible:()=>!!s.length,fields:[{type:A.Line,title:"Live"},{type:A.Group,columns:"12",fields:s}]}]:[]})(),{onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),deps:[a]}),l=ie(),c=(e,t)=>{l(e,t)};return e(U,{children:[e(L,{items:ce,actions:de,onAction:e=>{"back-action"===e&&n.routerService.push("/"),"update-now"===e&&r()}}),s||!o?e(C,{children:e(P,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):o.length?e(j,{children:[e($,{className:t.root,fields:o,payload:()=>({handleOpen:c})},a),e(i,{paddingBottom:"24px"})]}):e(C,{children:e(P,{variant:"h6",sx:{opacity:.5},children:"No pending signals"})})]})},isActive:e=>z(["/report"],e)}],we=({id:t})=>e(E,{history:n.routerService,onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),routes:he,params:{id:t}});export{we as StatusPage,we as default};
|