@backtest-kit/ui 8.0.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +254 -254
- package/build/index.cjs +136 -6
- package/build/index.mjs +137 -7
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/ace.js +21337 -21337
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/mode-javascript.js +797 -797
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/theme-chrome.js +137 -137
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/theme-twilight.js +115 -115
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/worker-javascript.js +15012 -15012
- package/build/modules/frontend/build/3rdparty/qfchart_0.8.7/echarts.min.js +45 -45
- package/build/modules/frontend/build/assets/{Article-Jdmz7aZ2.js → Article-DDKZjbkz.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-EK9k_h9v.js → Background-5Pc2kls4.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-CDjyp9zD.js → IconPhoto-2KIaDXXx.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-Dr0dCIxL.js → KeyboardArrowLeft-nUGbVivG.js} +1 -1
- package/build/modules/frontend/build/assets/{PictureAsPdfOutlined-HbiH_Q-c.js → PictureAsPdfOutlined-BKzXxbqU.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-B8TqdmHB.js → Refresh-6IBmzTpL.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-1aP5uqiT.js +1 -0
- package/build/modules/frontend/build/assets/hasRouteMatch-Bw2df_bl.js +1 -0
- package/build/modules/frontend/build/assets/{html2canvas-DljqBlXP.js → html2canvas-731slHaR.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Bg-hgDXg.js → index-BFZbztqX.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CJY9g0ao.js → index-BgpdZ4rO.js} +1 -1
- package/build/modules/frontend/build/assets/{index-dcGK7g_Z.js → index-CZUmXlNR.js} +1 -1
- package/build/modules/frontend/build/assets/{index-BdVXoDcb.js → index-CljWW6CQ.js} +1 -1
- package/build/modules/frontend/build/assets/index-Cpcp7B0Y.js +1 -0
- package/build/modules/frontend/build/assets/{index-VbqABn7v.js → index-DVsJHggN.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DpvQhidl.js → index-Dbf0lzpr.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Qr2GaVV1.js → index-DbkxgA90.js} +1 -1
- package/build/modules/frontend/build/assets/{index-cETv4rVS.js → index-Di2oEk8q.js} +1 -1
- package/build/modules/frontend/build/assets/{index-HAAb1Hoc.js → index-DtUu3BzB.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CtMweBSG.js → index-DywLUAcD.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DP0KiPHM.js → index-GZdKxtUQ.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Dj5yCZBM.js → index-is6UARFt.js} +10 -10
- package/build/modules/frontend/build/assets/{index.es-BNKwZTfP.js → index.es-CShnY6Uk.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-BHwoI8cd.js → markdownit-DnS0ASYl.js} +1 -1
- package/build/modules/frontend/build/index.html +87 -87
- package/build/modules/frontend/build/manifest.json +23 -23
- package/package.json +118 -118
- package/types.d.ts +13 -0
- package/build/modules/frontend/build/assets/emitters-CSLwhjBD.js +0 -1
- package/build/modules/frontend/build/assets/hasRouteMatch-CikI4OQa.js +0 -1
- package/build/modules/frontend/build/assets/index-0QTAHHmG.js +0 -1
package/package.json
CHANGED
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@backtest-kit/ui",
|
|
3
|
-
"version": "8.
|
|
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
|
-
"author": {
|
|
6
|
-
"name": "Petr Tripolsky",
|
|
7
|
-
"email": "tripolskypetr@gmail.com",
|
|
8
|
-
"url": "https://github.com/tripolskypetr"
|
|
9
|
-
},
|
|
10
|
-
"funding": {
|
|
11
|
-
"type": "individual",
|
|
12
|
-
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"backtest",
|
|
18
|
-
"backtesting",
|
|
19
|
-
"trading",
|
|
20
|
-
"crypto",
|
|
21
|
-
"cryptocurrency",
|
|
22
|
-
"bitcoin",
|
|
23
|
-
"ethereum",
|
|
24
|
-
"dashboard",
|
|
25
|
-
"ui",
|
|
26
|
-
"react",
|
|
27
|
-
"material-ui",
|
|
28
|
-
"mui",
|
|
29
|
-
"charts",
|
|
30
|
-
"candlestick",
|
|
31
|
-
"lightweight-charts",
|
|
32
|
-
"signals",
|
|
33
|
-
"trading-signals",
|
|
34
|
-
"risk-management",
|
|
35
|
-
"ccxt",
|
|
36
|
-
"binance",
|
|
37
|
-
"exchange",
|
|
38
|
-
"visualization",
|
|
39
|
-
"trading-bot",
|
|
40
|
-
"algo-trading",
|
|
41
|
-
"algorithmic-trading",
|
|
42
|
-
"quantitative-trading"
|
|
43
|
-
],
|
|
44
|
-
"files": [
|
|
45
|
-
"build",
|
|
46
|
-
"types.d.ts",
|
|
47
|
-
"README.md"
|
|
48
|
-
],
|
|
49
|
-
"repository": {
|
|
50
|
-
"type": "git",
|
|
51
|
-
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
52
|
-
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
53
|
-
},
|
|
54
|
-
"bugs": {
|
|
55
|
-
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"start": "npm run build && cross-env NODE_ENV=development CC_ENABLE_MOCK=1 npm run serve",
|
|
59
|
-
"serve": "node ./scripts/mock.mjs",
|
|
60
|
-
"build:modules": "npm run build:modules:win",
|
|
61
|
-
"build:modules:win": "dotenv -e .env -- .\\scripts\\win\\build.bat && npm run build:copy && npm run build:postbuild",
|
|
62
|
-
"build:modules:x": "dotenv -e .env -- sh ./scripts/linux/build.sh && npm run build:copy && npm run build:postbuild",
|
|
63
|
-
"build:copy": "node ./scripts/copy.mjs",
|
|
64
|
-
"build:postbuild": "node ./scripts/postbuild.mjs",
|
|
65
|
-
"build": "rollup -c"
|
|
66
|
-
},
|
|
67
|
-
"main": "build/index.cjs",
|
|
68
|
-
"module": "build/index.mjs",
|
|
69
|
-
"source": "src/index.ts",
|
|
70
|
-
"types": "./types.d.ts",
|
|
71
|
-
"exports": {
|
|
72
|
-
"require": "./build/index.cjs",
|
|
73
|
-
"types": "./types.d.ts",
|
|
74
|
-
"import": "./build/index.mjs",
|
|
75
|
-
"default": "./build/index.cjs"
|
|
76
|
-
},
|
|
77
|
-
"devDependencies": {
|
|
78
|
-
"@rollup/plugin-typescript": "11.1.6",
|
|
79
|
-
"@rollup/plugin-terser": "0.4.4",
|
|
80
|
-
"@types/finalhandler": "1.2.3",
|
|
81
|
-
"@types/serve-handler": "6.1.4",
|
|
82
|
-
"cross-env": "7.0.3",
|
|
83
|
-
"@types/node": "22.9.0",
|
|
84
|
-
"glob": "11.0.1",
|
|
85
|
-
"rimraf": "6.0.1",
|
|
86
|
-
"rollup": "3.29.5",
|
|
87
|
-
"rollup-plugin-dts": "6.1.1",
|
|
88
|
-
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
89
|
-
"ts-morph": "27.0.2",
|
|
90
|
-
"tslib": "2.7.0",
|
|
91
|
-
"typedoc": "0.27.9",
|
|
92
|
-
"ccxt": "4.5.24",
|
|
93
|
-
"touch": "3.1.1",
|
|
94
|
-
"worker-testbed": "2.0.0",
|
|
95
|
-
"backtest-kit": "8.
|
|
96
|
-
"markdown-it": "14.1.0"
|
|
97
|
-
},
|
|
98
|
-
"peerDependencies": {
|
|
99
|
-
"backtest-kit": "^8.
|
|
100
|
-
"markdown-it": "^14.1.0",
|
|
101
|
-
"ccxt": "^4.5.24",
|
|
102
|
-
"typescript": "^5.0.0"
|
|
103
|
-
},
|
|
104
|
-
"dependencies": {
|
|
105
|
-
"di-kit": "^1.1.1",
|
|
106
|
-
"di-scoped": "^1.0.21",
|
|
107
|
-
"functools-kit": "^2.3.0",
|
|
108
|
-
"get-moment-stamp": "^1.1.2",
|
|
109
|
-
"finalhandler": "^1.3.1",
|
|
110
|
-
"serve-handler": "^6.1.6",
|
|
111
|
-
"cryptocurrency-icons": "^0.18.1",
|
|
112
|
-
"router": "^1.3.8",
|
|
113
|
-
"micro": "^10.0.1"
|
|
114
|
-
},
|
|
115
|
-
"publishConfig": {
|
|
116
|
-
"access": "public"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@backtest-kit/ui",
|
|
3
|
+
"version": "8.2.0",
|
|
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
|
+
"author": {
|
|
6
|
+
"name": "Petr Tripolsky",
|
|
7
|
+
"email": "tripolskypetr@gmail.com",
|
|
8
|
+
"url": "https://github.com/tripolskypetr"
|
|
9
|
+
},
|
|
10
|
+
"funding": {
|
|
11
|
+
"type": "individual",
|
|
12
|
+
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"backtest",
|
|
18
|
+
"backtesting",
|
|
19
|
+
"trading",
|
|
20
|
+
"crypto",
|
|
21
|
+
"cryptocurrency",
|
|
22
|
+
"bitcoin",
|
|
23
|
+
"ethereum",
|
|
24
|
+
"dashboard",
|
|
25
|
+
"ui",
|
|
26
|
+
"react",
|
|
27
|
+
"material-ui",
|
|
28
|
+
"mui",
|
|
29
|
+
"charts",
|
|
30
|
+
"candlestick",
|
|
31
|
+
"lightweight-charts",
|
|
32
|
+
"signals",
|
|
33
|
+
"trading-signals",
|
|
34
|
+
"risk-management",
|
|
35
|
+
"ccxt",
|
|
36
|
+
"binance",
|
|
37
|
+
"exchange",
|
|
38
|
+
"visualization",
|
|
39
|
+
"trading-bot",
|
|
40
|
+
"algo-trading",
|
|
41
|
+
"algorithmic-trading",
|
|
42
|
+
"quantitative-trading"
|
|
43
|
+
],
|
|
44
|
+
"files": [
|
|
45
|
+
"build",
|
|
46
|
+
"types.d.ts",
|
|
47
|
+
"README.md"
|
|
48
|
+
],
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
52
|
+
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
53
|
+
},
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"start": "npm run build && cross-env NODE_ENV=development CC_ENABLE_MOCK=1 npm run serve",
|
|
59
|
+
"serve": "node ./scripts/mock.mjs",
|
|
60
|
+
"build:modules": "npm run build:modules:win",
|
|
61
|
+
"build:modules:win": "dotenv -e .env -- .\\scripts\\win\\build.bat && npm run build:copy && npm run build:postbuild",
|
|
62
|
+
"build:modules:x": "dotenv -e .env -- sh ./scripts/linux/build.sh && npm run build:copy && npm run build:postbuild",
|
|
63
|
+
"build:copy": "node ./scripts/copy.mjs",
|
|
64
|
+
"build:postbuild": "node ./scripts/postbuild.mjs",
|
|
65
|
+
"build": "rollup -c"
|
|
66
|
+
},
|
|
67
|
+
"main": "build/index.cjs",
|
|
68
|
+
"module": "build/index.mjs",
|
|
69
|
+
"source": "src/index.ts",
|
|
70
|
+
"types": "./types.d.ts",
|
|
71
|
+
"exports": {
|
|
72
|
+
"require": "./build/index.cjs",
|
|
73
|
+
"types": "./types.d.ts",
|
|
74
|
+
"import": "./build/index.mjs",
|
|
75
|
+
"default": "./build/index.cjs"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
79
|
+
"@rollup/plugin-terser": "0.4.4",
|
|
80
|
+
"@types/finalhandler": "1.2.3",
|
|
81
|
+
"@types/serve-handler": "6.1.4",
|
|
82
|
+
"cross-env": "7.0.3",
|
|
83
|
+
"@types/node": "22.9.0",
|
|
84
|
+
"glob": "11.0.1",
|
|
85
|
+
"rimraf": "6.0.1",
|
|
86
|
+
"rollup": "3.29.5",
|
|
87
|
+
"rollup-plugin-dts": "6.1.1",
|
|
88
|
+
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
89
|
+
"ts-morph": "27.0.2",
|
|
90
|
+
"tslib": "2.7.0",
|
|
91
|
+
"typedoc": "0.27.9",
|
|
92
|
+
"ccxt": "4.5.24",
|
|
93
|
+
"touch": "3.1.1",
|
|
94
|
+
"worker-testbed": "2.0.0",
|
|
95
|
+
"backtest-kit": "8.2.0",
|
|
96
|
+
"markdown-it": "14.1.0"
|
|
97
|
+
},
|
|
98
|
+
"peerDependencies": {
|
|
99
|
+
"backtest-kit": "^8.2.0",
|
|
100
|
+
"markdown-it": "^14.1.0",
|
|
101
|
+
"ccxt": "^4.5.24",
|
|
102
|
+
"typescript": "^5.0.0"
|
|
103
|
+
},
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"di-kit": "^1.1.1",
|
|
106
|
+
"di-scoped": "^1.0.21",
|
|
107
|
+
"functools-kit": "^2.3.0",
|
|
108
|
+
"get-moment-stamp": "^1.1.2",
|
|
109
|
+
"finalhandler": "^1.3.1",
|
|
110
|
+
"serve-handler": "^6.1.6",
|
|
111
|
+
"cryptocurrency-icons": "^0.18.1",
|
|
112
|
+
"router": "^1.3.8",
|
|
113
|
+
"micro": "^10.0.1"
|
|
114
|
+
},
|
|
115
|
+
"publishConfig": {
|
|
116
|
+
"access": "public"
|
|
117
|
+
}
|
|
118
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -424,12 +424,23 @@ declare class EnvironmentMockService {
|
|
|
424
424
|
getEnvironmentData: () => Promise<any>;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
declare class SetupMockService {
|
|
428
|
+
private readonly loggerService;
|
|
429
|
+
getSetupData: () => Promise<any>;
|
|
430
|
+
}
|
|
431
|
+
|
|
427
432
|
declare class EnvironmentViewService {
|
|
428
433
|
private readonly loggerService;
|
|
429
434
|
private readonly enviromentMockService;
|
|
430
435
|
getEnvironmentData: () => Promise<any>;
|
|
431
436
|
}
|
|
432
437
|
|
|
438
|
+
declare class SetupViewService {
|
|
439
|
+
private readonly loggerService;
|
|
440
|
+
private readonly setupMockService;
|
|
441
|
+
getSetupData: () => Promise<any>;
|
|
442
|
+
}
|
|
443
|
+
|
|
433
444
|
declare const ioc: {
|
|
434
445
|
notificationViewService: NotificationViewService;
|
|
435
446
|
storageViewService: StorageViewService;
|
|
@@ -442,6 +453,7 @@ declare const ioc: {
|
|
|
442
453
|
heatViewService: HeatViewService;
|
|
443
454
|
performanceViewService: PerformanceViewService;
|
|
444
455
|
environmentViewService: EnvironmentViewService;
|
|
456
|
+
setupViewService: SetupViewService;
|
|
445
457
|
notificationMockService: NotificationMockService;
|
|
446
458
|
storageMockService: StorageMockService;
|
|
447
459
|
exchangeMockService: ExchangeMockService;
|
|
@@ -453,6 +465,7 @@ declare const ioc: {
|
|
|
453
465
|
heatMockService: HeatMockService;
|
|
454
466
|
performanceMockService: PerformanceMockService;
|
|
455
467
|
environmentMockService: EnvironmentMockService;
|
|
468
|
+
setupMockService: SetupMockService;
|
|
456
469
|
liveMetaService: LiveMetaService;
|
|
457
470
|
symbolMetaService: SymbolMetaService;
|
|
458
471
|
backtestMetaService: BacktestMetaService;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as o}from"./index-Dj5yCZBM.js";const r=new o;export{r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as a,bq as e,br as r}from"./index-Dj5yCZBM.js";const t=(t,i=a.routerService.location.pathname)=>!!e(r.filter(({path:a})=>t.includes(a)),i);export{t as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,f as t,X as a,i as o,Y as n,Z as i,v as r,w as l,x as c,H as s,y as d,z as p,A as m,E as g,$ as y,T as u,l as f,B as h,a0 as w,P as b,q as x,a1 as v,a2 as D,O as k}from"./index-Dj5yCZBM.js";import{P as S}from"./PictureAsPdfOutlined-HbiH_Q-c.js";import{C as L,R as B}from"./Refresh-B8TqdmHB.js";import{K as A}from"./KeyboardArrowLeft-Dr0dCIxL.js";const P=e(t("path",{d:"M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"}),"Telegram"),R=144,E=[{type:l.Link,action:"back-action",label:t(A,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Dashboard"},{type:l.Link,action:"back-action",label:"Performance"},{type:l.Button,action:"download-pdf",label:"Download PDF",icon:S}],V=[{action:"download-json",label:"Download JSON",icon:()=>t(p,{icon:d,color:"#4caf50"})},{action:"download-markdown",label:"Download Markdown",icon:()=>t(p,{icon:m,color:"#4caf50"})},{action:"download-pdf",label:"Download PDF",icon:()=>t(p,{icon:g,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>t(p,{icon:B,color:"#4caf50"})}],j=({name:e,title:t})=>({type:s.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",paddingBottom:"8px",alignItems:"center"},fields:[{type:s.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:t},{type:s.Div},{type:s.Typography,typoVariant:"h6",style:{textAlign:"right",fontWeight:"bold"},fieldBottomMargin:"0",fieldRightMargin:"0",compute:({[e]:t})=>t||0===t?"totalEvents"===e?Number(t).toFixed(2):"totalDuration"===e||"avgDuration"===e?`${Number(t).toFixed(2)} ${w("ms")}`:t:"-",name:e}]}),T=({name:e,title:a})=>({type:s.Box,sx:{display:"grid",gridTemplateColumns:"auto 1fr auto",paddingBottom:"8px",alignItems:"center"},fields:[{type:s.Typography,fieldBottomMargin:"0",typoVariant:"body1",placeholder:a},{type:s.Div},{type:s.Component,style:{textAlign:"right",fontWeight:"bold"},fieldBottomMargin:"0",fieldRightMargin:"0",element:({[e]:a})=>{const o="github"===e,n=o?"#6A1B9A":"#24A1DE";return t(k,{size:"medium",disabled:!a,startIcon:t(y,{sx:{background:"#eee",height:"25px",width:"25px"},children:t(o?D:P,{sx:{color:n,fontSize:"16px !important",transform:"translate(-0.5px, 0px)"}})}),sx:{background:"white",color:n,"&:hover":{background:"white",color:n}},onClick:()=>{if(o)v(String(a));else{const e=String(a).replaceAll("@","");v(`https://t.me/${e}`)}},children:w(a?"Open":"Not configured")})},name:e}]}),C=[{type:s.Box,sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"80vh"},child:{type:s.Layout,customLayout:({children:e})=>t(b,{sx:{width:"335px"},children:e}),fields:[{type:s.Component,element:()=>t(h,{sx:{background:e=>f(e.palette.background.paper,.13),display:"flex",alignItems:"center",flexDirection:"column",gap:1,p:1},children:[t(y,{sx:{height:R,width:R,marginTop:"36px",marginBottom:"36px"},src:"/logo/icon512_maskable.png"}),t(u,{variant:"subtitle2",sx:{opacity:.5},children:"Backtest Kit"})]})},{type:s.Layout,customLayout:({children:e})=>t(h,{p:1,children:e}),fields:[{type:s.Div,style:{height:"2px"}},{type:s.Div,style:{height:"12px"}},j({name:"totalEvents",title:w("Total events")}),j({name:"totalDuration",title:w("Total time")}),j({name:"avgDuration",title:w("Average time")}),T({name:"channel",title:w("Channel")}),T({name:"github",title:"GitHub"})]}]}}],M=new i,O=()=>{const[e,{execute:i,loading:l}]=a(async()=>await o.performanceViewService.getPerformanceData(),{onLoadStart:()=>o.layoutService.setAppbarLoader(!0),onLoadEnd:()=>o.layoutService.setAppbarLoader(!1)});n(()=>M.subscribe(i));const[s,{execute:d,loading:p}]=a(async()=>await o.environmentViewService.getEnvironmentData());return n(()=>M.subscribe(d)),e&&s?l||p?null:t(L,{children:[t(r,{items:E,actions:V,onAction:async e=>{"back-action"===e&&o.routerService.push("/main"),"update-now"===e&&await(async()=>{o.performanceViewService.getPerformanceData.clear(),o.performanceViewService.getPerformanceReport.clear(),o.environmentViewService.getEnvironmentData.clear(),await M.next()})(),"download-markdown"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceReport(),t=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(t);o.layoutService.downloadFile(a,`performance_${Date.now()}.md`)})(),"download-pdf"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceReport();await x(e)})(),"download-json"===e&&await(async()=>{const e=await o.performanceViewService.getPerformanceData(),t=JSON.stringify(e,null,2),a=new Blob([t],{type:"text/plain"}),n=URL.createObjectURL(a);o.layoutService.downloadFile(n,`performance_${Date.now()}.md`)})()}}),t(c,{handler:()=>{const t=e.totalEvents>0?e.totalDuration/e.totalEvents:0;return{channel:s.telegram_channel,github:"https://github.com/tripolskypetr/backtest-kit",totalEvents:e.totalEvents,totalDuration:e.totalDuration,avgDuration:t}},fields:C})]}):null};export{O as DashboardView,O as default};
|