@backtest-kit/ui 3.6.1 → 3.7.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/{IconPhoto-BVSNFoD-.js → IconPhoto-86CaMXyE.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-O7xj_a61.js → KeyboardArrowLeft-B_GUtMrz.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-2TJmdCaw.js → Refresh-D4MbCAZa.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CKpdXV4w.js → index-D7QlR-1Q.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DAPmBn9z.js → index-DT7K1Sty.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CQw54LOf.js → index-P8opbWlu.js} +9 -9
- package/build/modules/frontend/build/assets/{index-BY4WXWLo.js → index-mDNl21qg.js} +1 -1
- package/build/modules/frontend/build/assets/{index-R3cTwRHI.js → index-muajFgRx.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-6w4Ekeyc.js → markdownit-CI2WF3yJ.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,f as a,j as t,Z as o,q as n,D as i,I as s,k as r,n as l,i as c,z as d,X as p,R as h,J as u,L as b,o as m,p as g,B as y,T as v,v as x,d as f,l as k,r as w,h as S,s as L,t as R,u as z,w as j,x as F,F as A,y as P,A as W,E as $}from"./index-
|
|
1
|
+
import{c as e,f as a,j as t,Z as o,q as n,D as i,I as s,k as r,n as l,i as c,z as d,X as p,R as h,J as u,L as b,o as m,p as g,B as y,T as v,v as x,d as f,l as k,r as w,h as S,s as L,t as R,u as z,w as j,x as F,F as A,y as P,A as W,E as $}from"./index-P8opbWlu.js";import{R as C,C as D}from"./Refresh-D4MbCAZa.js";import{K as T}from"./KeyboardArrowLeft-B_GUtMrz.js";import{I as B}from"./IconPhoto-86CaMXyE.js";const H=e(a("path",{d:"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"}),"Dashboard"),M=e(a("path",{d:"M3 10h11v2H3v-2zm0-2h11V6H3v2zm0 8h7v-2H3v2zm15.01-3.13.71-.71c.39-.39 1.02-.39 1.41 0l.71.71c.39.39.39 1.02 0 1.41l-.71.71-2.12-2.12zm-.71.71-5.3 5.3V21h2.12l5.3-5.3-2.12-2.12z"}),"EditNote"),N=new t,O=[{type:o.Link,action:"back-action",label:a(T,{sx:{display:"block"}})},{type:o.Link,action:"back-action",label:"Main"},{type:o.Link,action:"back-action",label:"Overview"}],V=[{action:"download-action",label:"Download",icon:()=>a(s,{icon:i,color:"#4caf50"})},{divider:!0},{action:"dashboard-action",label:"Dashboard",icon:()=>a(s,{icon:H,color:"#4caf50"})},{action:"logs-action",label:"Logs",icon:()=>a(s,{icon:M,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>a(s,{icon:C,color:"#4caf50"})}],I=()=>a(n,{items:O,actions:V,onAction:N.next});const E=({data:{type:e},setLoading:t})=>{const{elementRef:o,size:n}=r({closest:".MuiContainer-root",compute:e=>(e.height-=150,e)}),[i,{loading:s,execute:P}]=l(async()=>{if("live"===e){return(await c.storageViewService.listSignalLive()).filter(e=>"closed"===e.status)}return(await c.storageViewService.listSignalBacktest()).filter(e=>"closed"===e.status)},{onLoadStart:()=>t(!0),onLoadEnd:()=>t(!1),deps:[e]}),W=d(i),$=d(e);p(()=>N.subscribe(e=>{if("update-now"===e&&P(),"download-action"===e){const e=new Blob([JSON.stringify(W.current,null,2)],{type:"application/json"}),a=URL.createObjectURL(e);c.layoutService.downloadFile(a,`signals_${$.current}_${Date.now()}.json`)}"dashboard-action"===e&&c.routerService.push(`/dashboard/${$.current}`),"logs-action"===e&&c.routerService.push("/logs"),"back-action"===e&&c.routerService.push("/main")}));const C=h.useMemo(()=>i?i.reduce((e,a)=>(e[a.symbol]||(e[a.symbol]=[]),e[a.symbol].push(a),e),{}):{},[i]),D=e=>{const t=C[e]||[];return t.length?a(A,{children:t.map((t,o)=>{return a(L,{sx:{background:e=>o%2==1?z(e.palette.getContrastText(e.palette.background.paper),.02):void 0},onClick:()=>c.layoutService.pickSignal(t.id),children:[a(m,{primary:a(y,{sx:{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center"},children:[a(v,{variant:"body2",component:"span",sx:{fontWeight:"bold",px:1,py:.5,borderRadius:1,background:"long"===t.position?"#1976D2":"#F57C00",color:"white"},children:"long"===t.position?"LONG":"SHORT"}),a(v,{variant:"body2",component:"span",sx:{fontWeight:"medium"},children:[a(y,{component:"span",sx:{color:"text.secondary",mr:.5},children:"Entry:"}),R(t.priceOpen),"$"]}),a(v,{variant:"body2",component:"span",sx:{fontWeight:"medium",color:"success.main"},children:[a(y,{component:"span",sx:{color:"text.secondary",mr:.5},children:"TP:"}),R(t.priceTakeProfit),"$"]}),a(v,{variant:"body2",component:"span",sx:{fontWeight:"medium",color:"error.main"},children:[a(y,{component:"span",sx:{color:"text.secondary",mr:.5},children:"SL:"}),R(t.priceStopLoss),"$"]}),"pnl"in t&&a(v,{variant:"body2",component:"span",sx:{fontWeight:"bold",px:1,py:.5,borderRadius:1,background:t.pnl.pnlPercentage>=0?z("#4caf50",.15):z("#f44336",.15),color:t.pnl.pnlPercentage>=0?"#2e7d32":"#c62828"},children:["PNL: ",t.pnl.pnlPercentage>=0?"+":"",t.pnl.pnlPercentage.toFixed(2),"%"]}),a(v,{variant:"caption",component:"span",sx:{px:1,py:.25,borderRadius:.5,background:"opened"===t.status?z("#4caf50",.2):"scheduled"===t.status?z("#ff9800",.2):"closed"===t.status?z("#9e9e9e",.2):z("#f44336",.2),color:"opened"===t.status?"#2e7d32":"scheduled"===t.status?"#e65100":"closed"===t.status?"#616161":"#c62828"},children:t.status})]}),secondary:a(v,{pt:.5,variant:"subtitle2",sx:{opacity:.5},children:(n=t.createdAt||t.pendingAt,new Date(n).toLocaleString([],{year:"numeric",month:"numeric",day:"numeric",hourCycle:"h24",hour:"2-digit",minute:"2-digit",second:"2-digit"}))})}),a(j,{disableRipple:!0,children:a(F,{})})]},`item-${e}-${t.id}`);var n})}):a(b,{children:a(m,{sx:{"& .MuiTypography-body2":{maxWidth:"435px"}},primary:"No signals",secondary:"Signals will be displayed here after they appear"})})};return s?null:a(w,{ref:o,sx:{width:"100%",maxHeight:n.height,overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",bgcolor:"background.paper",position:"relative","& ul":{padding:0}},subheader:a("li",{}),children:a(u,{deps:[C],children:async()=>{const t=Object.keys(C),o=await c.symbolGlobalService.getSymbolMap();return t.length?t.map(e=>{var t,n,i;const s=null==(t=o[e])?void 0:t.color,r=(null==(n=C[e])?void 0:n.length)||0;return a("li",{children:a("ul",{children:[a(g,{sx:{background:(l=s,S(l,"#000000")>S(l,"#FFFFFF")?f(s,.1):k(s,.1)),color:"white !important",zIndex:9,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[a(y,{sx:{position:"relative",paddingRight:"8px"},children:a(B,{symbol:e})}),(null==(i=o[e])?void 0:i.displayName)||e,a(y,{flex:1}),a(v,{variant:"body2",sx:{fontWeight:"medium"},children:x(r,{one:"Signal",two:"Signals",many:"Signals"})})]}),a(y,{sx:{marginTop:"16px",marginBottom:"16px"},children:D(e)})]})},`section-${e}`);var l}):a(b,{children:a(m,{primary:"No signals yet",secondary:"live"===e?"Live signals will be displayed here":"Backtest signals will be displayed here"})})}})})},G=()=>a(P,{children:"\n body {\n background-color: #ddd !important;\n }\n "}),J=$(),K=(e,a)=>e.some(e=>e.includes(a)),U=[{id:"backtest",element:E,isActive:e=>K(["/backtest"],e)},{id:"live",element:E,isActive:e=>K(["/live"],e)}],X=[{id:"backtest",label:"Backtest"},{id:"live",label:"Live"}],_=()=>{p(()=>J.replace("/backtest"));return a(D,{children:[a(W,{withScroll:!0,sx:{height:"calc(100vh - 105px)"},BeforePaper:I,onLoadStart:()=>c.layoutService.setAppbarLoader(!0),onLoadEnd:()=>c.layoutService.setAppbarLoader(!1),routes:U,tabs:X,history:J,initialData:()=>({backtest:{type:"backtest"},live:{type:"live"}}),onTabChange:(e,a)=>{"backtest"===e&&a.replace("/backtest"),"live"===e&&a.replace("/live")}}),a(G,{})]})};export{_ as OverviewPage,_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,f as t,q as a,Z as e,b as n,B as i,m as s,I as c,M as r,C as l,e as h,S as p,a as m,d,l as v,i as u,g as b,h as g}from"./index-
|
|
1
|
+
import{c as o,f as t,q as a,Z as e,b as n,B as i,m as s,I as c,M as r,C as l,e as h,S as p,a as m,d,l as v,i as u,g as b,h as g}from"./index-P8opbWlu.js";import{C as f,R as z}from"./Refresh-D4MbCAZa.js";const y=o([t("path",{d:"M13 17c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h6V5H5v14h14v-2h-6z",opacity:".3"}),t("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.38-1-1.72zM20 9v6h-7V9h7zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2H5z"}),t("circle",{cx:"16",cy:"12",r:"1.5"})],"AccountBalanceWalletTwoTone"),x=o([t("path",{d:"M19 5H5v14h14V5zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z",opacity:".3"}),t("path",{d:"M3 5v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2zm2 0h14v14H5V5zm2 5h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"})],"InsertChartTwoTone"),M=o([t("path",{d:"M4 18h16V8H4v10zm8-3h6v2h-6v-2zm-5.91-4.59L7.5 9l4 4-4 4-1.41-1.41L8.67 13l-2.58-2.59z",opacity:".3"}),t("path",{d:"M12 15h6v2h-6z"}),t("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm0 14H4V8h16v10z"}),t("path",{d:"m7.5 17 4-4-4-4-1.41 1.41L8.67 13l-2.58 2.59z"})],"TerminalTwoTone"),H="trade-gpt__groupHeader",V="trade-gpt__groupRoot",w="trade-gpt__symbolImage",C=s()({root:{[`& .${V}:hover .${H}`]:{opacity:"1 !important"}}});function k(o){return g(o,"#000000")>g(o,"#FFFFFF")}const F=[{type:e.Link,action:"back-action",label:"Main"},{type:e.Link,action:"back-action",label:"Navigation"}],L=[{action:"update-now",label:"Refresh",icon:()=>t(c,{icon:z,color:"#4caf50"})}],T=[(N="Application",$=[{label:"Portfolio Overview",to:"/overview",color:"#0033AD",icon:y},{label:"PNL Performance",to:"/dashboard",color:"#E6007A",icon:x},{label:"System Logs",to:"/logs",color:"#58BF00",icon:M}],{type:r.Group,className:V,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:r.Component,className:H,style:{transition:"opacity 500ms",opacity:.5},element:()=>t(p,{direction:"row",children:[t(l,{variant:"outlined",size:"medium",color:"info",label:`${h.bullet} ${N}`,sx:{mb:1,pr:.5,fontSize:"16px",background:"white",cursor:"not-allowed"}}),t(i,{flex:1})]})},{type:r.Group,fields:$.map(({label:o,to:a,color:e,icon:n})=>((o,a,e,n)=>({type:r.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>t(b,{component:m,onClick:()=>{u.routerService.push(o)},sx:{width:"100%",background:e,color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px",[`& .${w}`]:{transition:"filter 500ms"},"&:hover":{background:()=>k(e)?d(e,.33):v(e,.33),[`& .${w}`]:{transition:"filter 500ms",filter:k(e)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:t(n,{className:w}),children:a})}))(a,o,e,n))}]})];var N,$;const _=()=>{const{classes:o}=C();return t(f,{children:[t(a,{items:F,actions:L,onAction:async o=>{}}),t(n,{className:o.root,fields:T,payload:()=>({history:history})}),t(i,{paddingBottom:"24px"})]})};export{_ as MainPage,_ as default};
|
package/build/modules/frontend/build/assets/{markdownit-6w4Ekeyc.js → markdownit-CI2WF3yJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aq as e,ar as r}from"./index-
|
|
1
|
+
import{aq as e,ar as r}from"./index-P8opbWlu.js";function t(e,r){for(var t=0;t<r.length;t++){const o=r[t];if("string"!=typeof o&&!Array.isArray(o))for(const r in o)if("default"!==r&&!(r in e)){const t=Object.getOwnPropertyDescriptor(o,r);t&&Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>o[r]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o=r();const n=t({__proto__:null,default:e(o)},[o]);export{n as m};
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
|
|
141
141
|
rel="stylesheet"
|
|
142
142
|
/>
|
|
143
|
-
<script type="module" crossorigin src="/assets/index-
|
|
143
|
+
<script type="module" crossorigin src="/assets/index-P8opbWlu.js"></script>
|
|
144
144
|
<link rel="stylesheet" crossorigin href="/assets/index-DrRm3Jka.css">
|
|
145
145
|
</head>
|
|
146
146
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backtest-kit/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "Full-stack UI framework for visualizing cryptocurrency trading signals, backtests, and real-time market data. React dashboard with candlestick charts, signal tracking, and risk analysis.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Petr Tripolsky",
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
"ccxt": "4.5.24",
|
|
93
93
|
"touch": "3.1.1",
|
|
94
94
|
"worker-testbed": "1.0.12",
|
|
95
|
-
"backtest-kit": "3.
|
|
95
|
+
"backtest-kit": "3.7.0",
|
|
96
96
|
"markdown-it": "14.1.0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"backtest-kit": "^3.
|
|
99
|
+
"backtest-kit": "^3.7.0",
|
|
100
100
|
"markdown-it": "^14.1.0",
|
|
101
101
|
"ccxt": "^4.5.24",
|
|
102
102
|
"typescript": "^5.0.0"
|