fix: dashboard errors — Math.abs, API routing, fetchHistorical guard
Fixes three bugs in dashboard: 1. vbt.html: bare abs(dd) → Math.abs(dd) — fixes ReferenceError 2. server.py: Add /cv/ routing for Next.js quant dashboard - Mount _next static assets at /cv/_next (not /cv/ which eats API routes) - Add /cv/api/* routes for backtests/historical, detail, recalc, risk - Add /cv/ws WebSocket endpoints for live/paper metrics - Add /cv/ catchall for Next.js HTML pages 3. dashboard-next/src/lib/api.ts: add res.ok guard to fetchHistorical() — prevents SyntaxError when API returns HTML error pages 4. sim/maker.py: guard observe() against zero mid_price
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
1:"$Sreact.fragment"
|
||||
2:I[47257,["/cv/_next/static/chunks/0h2qsuyze9ds1.js"],"ClientPageRoot"]
|
||||
3:I[52683,["/cv/_next/static/chunks/0h2qsuyze9ds1.js","/cv/_next/static/chunks/0oyhbmfwzlodf.js"],"default"]
|
||||
6:I[97367,["/cv/_next/static/chunks/0h2qsuyze9ds1.js"],"OutletBoundary"]
|
||||
2:I[47257,["/cv/_next/static/chunks/3fntmmi971322.js"],"ClientPageRoot"]
|
||||
3:I[52683,["/cv/_next/static/chunks/3fntmmi971322.js","/cv/_next/static/chunks/0mhish5833-2s.js"],"default"]
|
||||
6:I[97367,["/cv/_next/static/chunks/3fntmmi971322.js"],"OutletBoundary"]
|
||||
7:"$Sreact.suspense"
|
||||
b:I[97367,["/cv/_next/static/chunks/0h2qsuyze9ds1.js"],"ViewportBoundary"]
|
||||
c:I[97367,["/cv/_next/static/chunks/0h2qsuyze9ds1.js"],"MetadataBoundary"]
|
||||
d:I[27201,["/cv/_next/static/chunks/0h2qsuyze9ds1.js"],"IconMark"]
|
||||
f:I[39756,["/cv/_next/static/chunks/0h2qsuyze9ds1.js"],"default"]
|
||||
10:I[37457,["/cv/_next/static/chunks/0h2qsuyze9ds1.js"],"default"]
|
||||
:HL["/cv/_next/static/chunks/3wqi32p1v2fl1.css","style"]
|
||||
b:I[97367,["/cv/_next/static/chunks/3fntmmi971322.js"],"ViewportBoundary"]
|
||||
c:I[97367,["/cv/_next/static/chunks/3fntmmi971322.js"],"MetadataBoundary"]
|
||||
e:I[39756,["/cv/_next/static/chunks/3fntmmi971322.js"],"default"]
|
||||
f:I[37457,["/cv/_next/static/chunks/3fntmmi971322.js"],"default"]
|
||||
:HL["/cv/_next/static/chunks/0us7x72qor82s.css","style"]
|
||||
a:X
|
||||
0:{"buildId":"CxC9DIW0Ude54_bbbG52g","data":[{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/cv/_next/static/chunks/0oyhbmfwzlodf.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":"$@9","staleTime":"$a","varyParams":null},{"rsc":["$","$1","h",{"children":[null,["$","$Lb",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$7",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"FTDT Quant Lab"}],["$","meta","1",{"name":"description","content":"Professional quantitative trading dashboard — Live, Paper, Backtest, Historical"}],["$","link","2",{"rel":"icon","href":"/cv/favicon.ico?favicon.2vob68tjqpejf.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Ld","3",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":"$@e","staleTime":"$a","varyParams":null},{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/cv/_next/static/chunks/3wqi32p1v2fl1.css","precedence":"next"}],["$","script","script-0",{"src":"/cv/_next/static/chunks/0h2qsuyze9ds1.js","async":true}]],["$","html",null,{"lang":"en","className":"dark","children":["$","body",null,{"className":"inter_b2991b2-module__9mH_6q__variable jetbrains_mono_d5591ac2-module__D88TVW__variable antialiased","children":["$","$Lf",null,{"parallelRouterKey":"children","template":["$","$L10",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]]}],"isPartial":"$@11","staleTime":"$a","varyParams":null}],"isUpgradeableISRFallback":false,"a":"$@12","rootVaryParams":null,"needsRuntimeRequest":"$@13"}
|
||||
0:{"buildId":"Xg18NDpPi68Ops9KjxYps","data":[{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/cv/_next/static/chunks/0mhish5833-2s.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":"$@9","staleTime":"$a","varyParams":null},{"rsc":["$","$1","h",{"children":[null,["$","$Lb",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$7",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Quant Dashboard"}],["$","meta","1",{"name":"description","content":"Live testnet, paper mainnet, historical backtests"}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":"$@d","staleTime":"$a","varyParams":null},{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/cv/_next/static/chunks/0us7x72qor82s.css","precedence":"next"}],["$","script","script-0",{"src":"/cv/_next/static/chunks/3fntmmi971322.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"ubuntu_e7568d61-module__BLWD4a__variable ubuntu_mono_1f805d33-module__LpGd4W__variable antialiased","children":["$","$Le",null,{"parallelRouterKey":"children","template":["$","$Lf",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]]}],"isPartial":"$@10","staleTime":"$a","varyParams":null}],"isUpgradeableISRFallback":false,"a":"$@11","rootVaryParams":null,"needsRuntimeRequest":"$@12"}
|
||||
4:{}
|
||||
5:"$0:data:0:rsc:props:children:0:props:serverProvidedParams:params"
|
||||
8:null
|
||||
a:300
|
||||
13:true
|
||||
12:true
|
||||
a:C
|
||||
12:0
|
||||
e:"$undefined"
|
||||
11:"$undefined"
|
||||
11:0
|
||||
d:"$undefined"
|
||||
10:"$undefined"
|
||||
9:"$undefined"
|
||||
|
||||
Reference in New Issue
Block a user