@backtest-kit/ui 6.12.2 → 6.13.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/modules/frontend/build/assets/{Article-8KNWLEdt.js → Article-DUthMA2I.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-Cg_pRnA2.js → Background-BZTVvgnU.js} +1 -1
- package/build/modules/frontend/build/assets/{Container-B3L78b74.js → Container-BBViIS7X.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-BdOC0CVV.js → IconPhoto-CS2NpiIj.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-CRSPaoDv.js → KeyboardArrowLeft-owX-yN_7.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-pgeEdZyY.js → Refresh-akuelqlP.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-DOx-C_KA.js +1 -0
- package/build/modules/frontend/build/assets/{hasRouteMatch-DUJkFZih.js → hasRouteMatch-DZe0TSIA.js} +1 -1
- package/build/modules/frontend/build/assets/{html2canvas-BOxZT7Pg.js → html2canvas-CzoVCJID.js} +1 -1
- package/build/modules/frontend/build/assets/index-BStrYqGU.js +1 -0
- package/build/modules/frontend/build/assets/{index-08mSy1TS.js → index-BZrLDvG1.js} +1 -1
- package/build/modules/frontend/build/assets/{index-d3YCdp1b.js → index-Bcz5AwsF.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CdDMwS35.js → index-C5ZXh7XK.js} +1 -1
- package/build/modules/frontend/build/assets/{index-B0xWR_Ua.js → index-C7hPKS3q.js} +9 -9
- package/build/modules/frontend/build/assets/{index-DRPJ-jbK.js → index-D-D2YyJz.js} +1 -1
- package/build/modules/frontend/build/assets/{index-BFlDvmEL.js → index-D8mkxmnZ.js} +1 -1
- package/build/modules/frontend/build/assets/{index-B9MVhnMv.js → index-DWjyow_8.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DfvxJO7G.js → index-VzekKsLJ.js} +1 -1
- package/build/modules/frontend/build/assets/{index-BsxQ4WtY.js → index-rL2URh7W.js} +1 -1
- package/build/modules/frontend/build/assets/index-t0dqiYvZ.js +1 -0
- package/build/modules/frontend/build/assets/{index.es-qc4_IWw_.js → index.es-D52fyxjw.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-BJecoBnP.js → markdownit-t-ThY4XZ.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +3 -3
- package/build/modules/frontend/build/assets/emitters-UJbT6Stq.js +0 -1
- package/build/modules/frontend/build/assets/index-Bb2L44EK.js +0 -1
- package/build/modules/frontend/build/assets/index-sghtggRw.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,f as v}from"./index-
|
|
1
|
+
import{c,f as v}from"./index-C7hPKS3q.js";const h=c(v("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-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}),"Article");export{h as A};
|
package/build/modules/frontend/build/assets/{Background-Cg_pRnA2.js → Background-BZTVvgnU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as n,
|
|
1
|
+
import{f as n,b7 as o}from"./index-C7hPKS3q.js";const d=()=>n(o,{children:"\n body {\n background-color: #ddd !important;\n }\n "});export{d as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bg as e,b as t,r as a,_ as s,f as i,bh as n,e as o,bi as r,h as d,bj as m,g as u,u as p,s as x}from"./index-C7hPKS3q.js";const b=e(),h=["className","component","disableGutters","fixed","maxWidth","classes"],l=m(),c=b("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),f=e=>r({props:e,name:"MuiContainer",defaultTheme:l});const g=function(e={}){const{createStyledComponent:r=c,useThemeProps:m=f,componentName:p="MuiContainer"}=e,x=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const s=a,i=e.breakpoints.values[s];return 0!==i&&(t[e.breakpoints.up(s)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=m(e),{className:b,component:l="div",disableGutters:c=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,h),k=t({},r,{component:l,disableGutters:c,fixed:f,maxWidth:g}),S=((e,t)=>{const{classes:a,fixed:s,disableGutters:i,maxWidth:n}=e,r={root:["root",n&&`maxWidth${o(String(n))}`,s&&"fixed",i&&"disableGutters"]};return d(r,e=>u(t,e),a)})(k,p);return i(x,t({as:l,ownerState:k,className:n(S.root,b),ref:a},W))})}({createStyledComponent:x("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})});export{g as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,w as t,B as r,J as s}from"./index-
|
|
1
|
+
import{f as e,w as t,B as r,J as s}from"./index-C7hPKS3q.js";const o=({className:o,symbol:a,style:i,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[a],l=(null==s?void 0:s.logo)||(null==s?void 0:s.icon),c=(null==s?void 0:s.color)||"#ccc";return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:l?"transparent":c,...n},style:i,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:a,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,r=t.parentElement;r&&(r.style.background=c,t.style.display="none")}}):e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:i,children:e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});export{o as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,f as r}from"./index-
|
|
1
|
+
import{c as o,f as r}from"./index-C7hPKS3q.js";const a=o(r("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");export{a as K};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,f as c}from"./index-
|
|
1
|
+
import{c as s,f as c}from"./index-C7hPKS3q.js";const a=s(c("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");export{a as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as o}from"./index-C7hPKS3q.js";const r=new o;export{r};
|
package/build/modules/frontend/build/assets/{hasRouteMatch-DUJkFZih.js → hasRouteMatch-DZe0TSIA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as a,
|
|
1
|
+
import{w as a,bk as e,bl as t}from"./index-C7hPKS3q.js";const o=(o,r=a.routerService.location.pathname)=>!!e(t.filter(({path:a})=>o.includes(a)),r);export{o as h};
|
package/build/modules/frontend/build/assets/{html2canvas-BOxZT7Pg.js → html2canvas-CzoVCJID.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,
|
|
1
|
+
import{m as e,bn as t}from"./index-C7hPKS3q.js";function r(e,t){for(var r=0;r<t.length;r++){const o=t[r];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(o,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o=t();const n=r({__proto__:null,default:e(o)},[o]);export{n as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,f as a,P as i,B as r,S as n,ay as t,T as o,ac as l,K as s,al as c,F as d,az as p,M as m,aA as u,aB as b,aC as v,aD as y,at as g,aE as h,aF as k,aG as $,aH as f,aI as x,aJ as S,aK as _,w as C,ao as P,V as w,ap as L,t as A,v as z,aL as E,aM as O,z as j}from"./index-C7hPKS3q.js";import{C as F}from"./Container-BBViIS7X.js";import{R as T}from"./Refresh-akuelqlP.js";import{K as B}from"./KeyboardArrowLeft-owX-yN_7.js";const R=e=>{const i={color:"white",fontSize:28};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return a(S,{sx:i});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return a(g,{sx:i});case"signal.scheduled":return a(_,{sx:i});case"signal.cancelled":case"cancel_scheduled.commit":return a(h,{sx:i});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return a(f,{sx:i});case"breakeven.available":case"breakeven.commit":return a(x,{sx:i});case"activate_scheduled.commit":case"signal_sync.open":return a(k,{sx:i});case"trailing_stop.commit":case"trailing_take.commit":return a($,{sx:i});case"risk.rejection":return a(y,{sx:i});case"error.info":case"error.validation":return a(v,{sx:i});case"error.critical":return a(b,{sx:i});default:return a(u,{sx:i})}},D=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")}},I=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")}},U=e=>"symbol"in e,M=e=>"position"in e,W=e=>"priceOpen"in e&&"priceTakeProfit"in e&&"priceStopLoss"in e,N=e=>"pnlPercentage"in e,H=e=>"level"in e,K=e=>"percentToClose"in e,V=e=>"currentPrice"in e,Y=e=>"duration"in e,q=e=>"closeReason"in e,G=e=>"cancelReason"in e,J=e=>"priceClose"in e,Q=e=>"percentShift"in e,X=e=>"signal.opened"===e.type?"note"in e&&!!e.note:"activate_scheduled.commit"===e.type?"note"in e&&!!e.note&&!!e.activateId:"close_pending.commit"===e.type?"note"in e&&!!e.note&&!!e.closeId:"cancel_scheduled.commit"===e.type&&("note"in e&&!!e.note&&!!e.cancelId),Z=e=>"message"in e,ee=e=>"rejectionNote"in e,ae=e=>"activePositionCount"in e,ie=e=>"effectivePriceOpen"in e,re=e=>"totalEntries"in e&&e.totalEntries>1,ne=e=>"originalPriceOpen"in e&&"priceOpen"in e&&e.originalPriceOpen!==e.priceOpen,te=e=>"totalPartials"in e&&e.totalPartials>0,oe=e=>"cost"in e,le=e=>"pnlPriceOpen"in e&&"pnlPriceClose"in e&&"pnlCost"in e&&"pnlEntries"in e,se=e.forwardRef(({item:e,className:u,style:b,sx:v},y)=>{const g=(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),h=(e=>"timestamp"in e)(e)?e.timestamp:Date.now();return a("div",{className:u,style:b,ref:y,children:a(i,{variant:"outlined",onClick:()=>(e=>{switch(e.type){case"risk.rejection":C.layoutService.pickRisk(e.id);break;case"signal.opened":C.layoutService.pickSignalOpened(e.id);break;case"signal.closed":C.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":C.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":C.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":C.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":C.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":C.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":C.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":C.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":C.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":C.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":C.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":C.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":C.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":C.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":C.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":C.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":C.layoutService.pickClosePending(e.id)}})(e),sx:{transition:"box-shadow 0.2s ease",cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{boxShadow:4},...v},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:g},children:R(e)}),a(n,{flex:1,spacing:1,children:[a(n,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[a(o,{variant:"h6",sx:{fontWeight:600},children:D(e)}),a(o,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:l(h).format("HH:mm DD/MM/YYYY")})]}),a(n,{direction:"row",spacing:1,flexWrap:"wrap",children:[a(s,{size:"small",label:I(e),sx:{background:g,color:"white",fontWeight:500}}),U(e)&&a(s,{size:"small",label:e.symbol,variant:"outlined"}),M(e)&&a(s,{size:"small",label:e.position.toUpperCase(),variant:"outlined",color:"long"===e.position?"success":"error"}),N(e)&&a(s,{size:"small",label:`PnL: ${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`,color:e.pnlPercentage>=0?"success":"error",variant:"outlined"}),H(e)&&a(s,{size:"small",label:`${c("Level")}: ${e.level}%`,variant:"outlined"}),K(e)&&a(s,{size:"small",label:`${c("Close")}: ${e.percentToClose}%`,variant:"outlined"}),Y(e)&&a(s,{size:"small",label:`${c("Duration")}: ${e.duration} ${c("min")}`,variant:"outlined"}),q(e)&&a(s,{size:"small",label:e.closeReason,variant:"outlined",color:"info"}),G(e)&&a(s,{size:"small",label:e.cancelReason,variant:"outlined",color:"info"}),Q(e)&&a(s,{size:"small",label:`${c("Shift")}: ${e.percentShift>0?"+":""}${e.percentShift}%`,variant:"outlined"}),ae(e)&&a(s,{size:"small",label:`${c("Active")}: ${e.activePositionCount}`,variant:"outlined"}),re(e)&&a(s,{size:"small",label:`${c("Entries")}: ${e.totalEntries}`,variant:"outlined"}),te(e)&&a(s,{size:"small",label:`${c("Partials")}: ${e.totalPartials}`,variant:"outlined"}),oe(e)&&a(s,{size:"small",label:`${c("Cost")}: ${e.cost.toFixed(2)}$`,variant:"outlined"}),ie(e)&&a(s,{size:"small",label:`${c("Avg entry")}: ${e.effectivePriceOpen}`,variant:"outlined",color:"warning"}),ne(e)&&a(s,{size:"small",label:`${c("Orig entry")}: ${e.originalPriceOpen}`,variant:"outlined"})]}),W(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Entry"),":"," "]}),e.priceOpen]}),J(e)&&a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Close"),":"," "]}),e.priceClose]}),V(e)&&a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Current"),":"," "]}),e.currentPrice]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Take Profit"),":"," "]}),e.priceTakeProfit]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Stop Loss"),":"," "]}),e.priceStopLoss]})]})]}),le(e)&&a(d,{children:[a(p,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("PnL Entry"),":"," "]}),e.pnlPriceOpen]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("PnL Exit"),":"," "]}),e.pnlPriceClose]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("PnL"),":"," "]}),a(o,{component:"span",color:e.pnlCost>=0?"success.main":"error.main",children:[e.pnlCost>=0?"+":"",e.pnlCost.toFixed(2),"$"]})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[c("Invested"),":"," "]}),e.pnlEntries.toFixed(2),"$"]})]})]})]})]}),X(e)&&a(r,{onClick:e=>{e.preventDefault(),e.stopPropagation()},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,{content:e.note})})]}),ee(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"error",children:e.rejectionNote})]}),Z(e)&&!X(e)&&a(r,{sx:{px:2,pb:2},children:[a(p,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"text.secondary",children:e.message})]}),a(r,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:g}})]})})})}),ce=[{action:"update-now",label:"Refresh manually",icon:()=>a(j,{icon:T,color:"#4caf50"})}],de=[{type:z.Link,action:"back-action",label:a(B,{sx:{display:"block"}})},{type:z.Link,action:"back-action",label:"Main"},{type:z.Link,action:"back-action",label:"Notifications"}],pe=new w,me=()=>{const{data:e,hasMore:i,loading:r,onSkip:n}=P({handler:async(e,a)=>{const i=await C.notificationViewService.getList(),r=L(e,a);for(const n of i)if(r([n]).done)break;return r().rows},onLoadStart:()=>C.layoutService.setAppbarLoader(!0),onLoadEnd:()=>C.layoutService.setAppbarLoader(!1),reloadSubject:pe});return a(F,{children:[a(A,{items:de,actions:ce,onAction:async e=>{"back-action"===e&&C.routerService.push("/"),"update-now"===e&&await pe.next()}}),a(E,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:r,onDataRequest:n,bufferSize:O,hasMore:i,children:e.map(e=>a(se,{item:e,sx:{mb:1}},e.id))})]})};export{me as NotificationPage,me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aQ as t,X as a,w as e,f as o,t as s,v as i,o as n,H as r,z as c,T as l,aR as d,x as p,B as u,F as m,K as b,L as y,S as h,O as g,i as S,l as f,N as L,R as v,aS as k,aT as w,Z as x,V as A,D as C,aU as N,aV as R}from"./index-
|
|
1
|
+
import{aQ as t,X as a,w as e,f as o,t as s,v as i,o as n,H as r,z as c,T as l,aR as d,x as p,B as u,F as m,K as b,L as y,S as h,O as g,i as S,l as f,N as L,R as v,aS as k,aT as w,Z as x,V as A,D as C,aU as N,aV as R}from"./index-C7hPKS3q.js";import{h as j}from"./hasRouteMatch-DZe0TSIA.js";import{I as $}from"./IconPhoto-CS2NpiIj.js";import{C as F}from"./Container-BBViIS7X.js";import{R as H}from"./Refresh-akuelqlP.js";import{K as V}from"./KeyboardArrowLeft-owX-yN_7.js";import{B}from"./Background-BZTVvgnU.js";const E="backtest-kit__groupHeader",M="backtest-kit__groupRoot",_="backtest-kit__symbolImage",G=n()({root:{[`& .${M}:hover .${E}`]:{opacity:"1 !important"}}});function O(t){return v(t,"#000000")>v(t,"#FFFFFF")}const z=[{type:i.Link,action:"back-action",label:o(V,{sx:{display:"block"}})},{type:i.Link,action:"back-action",label:"Main"},{type:i.Link,action:"back-action",label:"Status"}],I=[{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:E,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",[`& .${_}`]:{transition:"filter 500ms"},"&:hover":{background:()=>O(i)?S(i,.33):f(i,.33),[`& .${_}`]:{transition:"filter 500ms",filter:O(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o($,{className:_,symbol:t}),children:s})}))(t,s,a,i))}]}),U=[{type:i.Link,action:"back-action",label:o(V,{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"}],D=[{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"})}],K=new A,P=[{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(()=>K.subscribe(c));return o(F,{children:[o(s,{items:U,actions:D,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 K.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(B,{})]})},isActive:t=>j(["/status/:id"],t)},{id:"main",element:()=>{const{classes:i}=G(),{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:z,actions:I,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=>j(["/status"],t)}],W=({id:t})=>o(R,{history:e.routerService,onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),routes:P,params:{id:t}});export{W as StatusPage,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,f as a,T as e,L as o,
|
|
1
|
+
import{c as t,f as a,T as e,L as o,b8 as n,H as i,P as l,o as r,X as c,w as s,Z as d,t as p,v as m,y as h,z as y,A as w,E as u,G as x,x as f,aW as g,q as b,aV as v}from"./index-C7hPKS3q.js";import{h as S}from"./hasRouteMatch-DZe0TSIA.js";import{r as L}from"./emitters-DOx-C_KA.js";import{I as k}from"./IconPhoto-CS2NpiIj.js";import{C as D}from"./Container-BBViIS7X.js";import{R}from"./Refresh-akuelqlP.js";import{K as j}from"./KeyboardArrowLeft-owX-yN_7.js";const A=t(a("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm12 6V9c0-.55-.45-1-1-1h-2v5h2c.55 0 1-.45 1-1zm-2-3h1v3h-1V9zm4 2h1v-1h-1V9h1V8h-2v5h1zm-8 0h1c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9v5h1v-2zm0-2h1v1h-1V9z"}),"PictureAsPdfOutlined"),V=r()(t=>({root:{position:"relative",background:"#0001",overflow:"clip"},header:{position:"absolute",top:0,left:0,height:"48px",width:"calc(100% - 16px)",display:"flex",alignItems:"center",justifyContent:"space-between",marginLeft:"8px",marginRight:"8px"},container:{marginTop:"48px",width:"100%",background:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},content:{display:"flex",width:"100%",padding:t.spacing(1),paddingBottom:t.spacing(2),gap:10,flexDirection:"column"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"128px",minWidth:"128px"}})),N=[{type:i.Text,name:"totalPnl",title:"Total PNL",compute:t=>null!==t.totalPnl?`${t.totalPnl.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,columns:"6",name:"winRate",title:"Win Rate",compute:t=>null!==t.winRate?`${t.winRate.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,columns:"6",name:"profitFactor",title:"Profit Factor",compute:t=>null!==t.profitFactor?t.profitFactor.toFixed(2):"N/A",readonly:!0},{type:i.Text,columns:"6",name:"maxDrawdown",title:"Max Drawdown",compute:t=>null!==t.maxDrawdown?`${t.maxDrawdown.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,columns:"6",name:"expectancy",title:"Expectancy",compute:t=>null!==t.expectancy?`${t.expectancy.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,fieldBottomMargin:"0",name:"totalTrades",title:"Trades",readonly:!0}],F=({row:t})=>{const{classes:i}=V();return a(l,{className:i.root,children:[a("div",{className:i.header,children:a(e,{variant:"h6",sx:{opacity:.8},children:`${o.bullet} ${t.symbol}`})}),a("div",{className:i.container,children:a("div",{className:i.content,children:[a("div",{className:i.avatar,children:a(k,{symbol:t.symbol,sx:{width:128,height:128}})}),a(n,{handler:()=>t,fields:N,sx:{mb:2}})]})})]})},H=[{type:m.Link,action:"back-action",label:a(j,{sx:{display:"block"}})},{type:m.Link,action:"back-action",label:"Dashboard"},{type:m.Link,action:"back-action",label:"Heatmap"},{type:m.Button,action:"download-pdf",label:"Download PDF",icon:A}],T=[{action:"download-json",label:"Download JSON",icon:()=>a(y,{icon:h,color:"#4caf50"})},{action:"download-markdown",label:"Download Markdown",icon:()=>a(y,{icon:w,color:"#4caf50"})},{action:"download-pdf",label:"Download PDF",icon:()=>a(y,{icon:u,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>a(y,{icon:R,color:"#4caf50"})}],P=[{id:"main",element:()=>{const[t,{loading:e,execute:o}]=c(async()=>(t=>{if(!t.length)return[{type:i.Typography,typoVariant:"h6",placeholder:"No data",sx:{textAlign:"center",opacity:.5,mt:4}}];const e=t.map(t=>({type:i.Group,desktopColumns:"4",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",child:{type:i.Component,element:()=>a(F,{row:t})}}));return e.length>2?e:[{type:i.Center,sx:t=>({[t.breakpoints.up("lg")]:{height:"calc(100dvh - 165px)","& > *":{transform:"translateY(-56px)"}}}),fields:e}]})((await s.heatViewService.getStrategyHeatData()).symbols),{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1)});d(()=>L.subscribe(o));return a(D,{children:[a(p,{items:H,actions:T,onAction:async t=>{"back-action"===t&&s.routerService.push("/"),"update-now"===t&&await L.next(),"download-markdown"===t&&await(async()=>{const t=await s.heatViewService.getStrategyHeatReport(),a=new Blob([t],{type:"text/plain"}),e=URL.createObjectURL(a);s.layoutService.downloadFile(e,`heat_${Date.now()}.md`)})(),"download-pdf"===t&&await(async()=>{const t=await s.heatViewService.getStrategyHeatReport();await b(t)})(),"download-json"===t&&await(async()=>{const t=await s.heatViewService.getStrategyHeatData(),a=JSON.stringify(t,null,2),e=new Blob([a],{type:"text/plain"}),o=URL.createObjectURL(e);s.layoutService.downloadFile(o,`heat_${Date.now()}.md`)})()}}),!t||e?a(x,{sx:{height:"calc(100dvh - 165px)"}}):a(g,{withScrollbar:!0,sx:{height:"calc(100dvh - 165px)"},hideOverflowX:!0,children:a(f,{fields:t})})]})},isActive:t=>S(["/heat"],t)}],C=({id:t})=>a(v,{history:s.routerService,onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1),routes:P,params:{id:t}});export{C as HeatPage,C as default};
|