@backtest-kit/ui 11.7.0 → 11.9.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 +117 -8
- package/build/index.mjs +117 -8
- package/build/modules/frontend/build/assets/{Article-CYNOK9n9.js → Article-cVpAg67f.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-DtU4lH09.js → Background-BH--6xAD.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-B1J620Vq.js → IconPhoto-dhtH47SN.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-XE5ADfKG.js → KeyboardArrowLeft-Cesmg5AP.js} +1 -1
- package/build/modules/frontend/build/assets/{PictureAsPdfOutlined-m2BO1_gG.js → PictureAsPdfOutlined-CrADy_Z6.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-Bs5my3Fa.js → Refresh-BnizeO5c.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-CncrD_BX.js +1 -0
- package/build/modules/frontend/build/assets/hasRouteMatch-DHHNIPte.js +1 -0
- package/build/modules/frontend/build/assets/{html2canvas-DZim_iNK.js → html2canvas-BdzWxETw.js} +1 -1
- package/build/modules/frontend/build/assets/index-B5gb4k3w.js +1 -0
- package/build/modules/frontend/build/assets/index-BtYapa75.js +1 -0
- package/build/modules/frontend/build/assets/index-C3WRde97.js +1 -0
- package/build/modules/frontend/build/assets/index-C7ab2rQi.js +1 -0
- package/build/modules/frontend/build/assets/index-Cq3jOwW6.js +1 -0
- package/build/modules/frontend/build/assets/{index-CgexeU-m.js → index-CvllC0lS.js} +1 -1
- package/build/modules/frontend/build/assets/index-CweIrC8b.js +1 -0
- package/build/modules/frontend/build/assets/index-DRSduTqB.js +1 -0
- package/build/modules/frontend/build/assets/index-DlSjrMHu.js +1 -0
- package/build/modules/frontend/build/assets/index-DnelSt2-.js +1 -0
- package/build/modules/frontend/build/assets/index-T0gLwUgt.js +1 -0
- package/build/modules/frontend/build/assets/index-dZ6l1ywQ.js +1 -0
- package/build/modules/frontend/build/assets/{index-DdRXymvn.js → index-fsQnmonU.js} +56 -56
- package/build/modules/frontend/build/assets/{index.es-Cu-atqbR.js → index.es-iaxQIlqX.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-AwxKNksU.js → markdownit-C01iqcLq.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +3 -3
- package/types.d.ts +14 -1
- package/build/modules/frontend/build/assets/emitters-DxYtfX1b.js +0 -1
- package/build/modules/frontend/build/assets/hasRouteMatch-BdSLJ8tx.js +0 -1
- package/build/modules/frontend/build/assets/index-1GyweKyN.js +0 -1
- package/build/modules/frontend/build/assets/index-A_a_l8g_.js +0 -1
- package/build/modules/frontend/build/assets/index-B8cgXWQa.js +0 -1
- package/build/modules/frontend/build/assets/index-BBBUKPeg.js +0 -1
- package/build/modules/frontend/build/assets/index-BocNYL-p.js +0 -1
- package/build/modules/frontend/build/assets/index-BwZAXYx4.js +0 -1
- package/build/modules/frontend/build/assets/index-C2-GeRog.js +0 -1
- package/build/modules/frontend/build/assets/index-D-KxXXY6.js +0 -1
- package/build/modules/frontend/build/assets/index-RHKOVbjw.js +0 -1
- package/build/modules/frontend/build/assets/index-RKdfdVzq.js +0 -1
- package/build/modules/frontend/build/assets/index-p_slI1_B.js +0 -1
package/build/index.cjs
CHANGED
|
@@ -107,6 +107,7 @@ const mockServices$1 = {
|
|
|
107
107
|
performanceMockService: Symbol("performanceMockService"),
|
|
108
108
|
environmentMockService: Symbol("environmentMockService"),
|
|
109
109
|
setupMockService: Symbol("setupMockService"),
|
|
110
|
+
runtimeMockService: Symbol("runtimeMockService"),
|
|
110
111
|
};
|
|
111
112
|
const viewServices$1 = {
|
|
112
113
|
notificationViewService: Symbol("notificationViewService"),
|
|
@@ -121,6 +122,7 @@ const viewServices$1 = {
|
|
|
121
122
|
performanceViewService: Symbol("performanceViewService"),
|
|
122
123
|
environmentViewService: Symbol("environmentViewService"),
|
|
123
124
|
setupViewService: Symbol("setupViewService"),
|
|
125
|
+
runtimeViewService: Symbol("runtimeViewService"),
|
|
124
126
|
};
|
|
125
127
|
const TYPES = {
|
|
126
128
|
...baseServices$1,
|
|
@@ -801,10 +803,10 @@ class SignalMockService {
|
|
|
801
803
|
}
|
|
802
804
|
}
|
|
803
805
|
|
|
804
|
-
const MOCK_DATA_PATH$
|
|
806
|
+
const MOCK_DATA_PATH$4 = "./mock/heat.json";
|
|
805
807
|
const MOCK_REPORT_PATH$1 = "./mock/heat-report.md";
|
|
806
808
|
const READ_HEAT_DATA_FN = functoolsKit.singleshot(async () => {
|
|
807
|
-
const data = await fs.readFile(MOCK_DATA_PATH$
|
|
809
|
+
const data = await fs.readFile(MOCK_DATA_PATH$4, "utf-8");
|
|
808
810
|
return JSON.parse(data);
|
|
809
811
|
});
|
|
810
812
|
const READ_HEAT_REPORT_FN = functoolsKit.singleshot(async () => {
|
|
@@ -1953,10 +1955,10 @@ class LiveMetaService {
|
|
|
1953
1955
|
}
|
|
1954
1956
|
}
|
|
1955
1957
|
|
|
1956
|
-
const MOCK_DATA_PATH$
|
|
1958
|
+
const MOCK_DATA_PATH$3 = "./mock/performance.json";
|
|
1957
1959
|
const MOCK_REPORT_PATH = "./mock/performance-report.md";
|
|
1958
1960
|
const READ_PERFORMANCE_DATA_FN = functoolsKit.singleshot(async () => {
|
|
1959
|
-
const data = await fs.readFile(MOCK_DATA_PATH$
|
|
1961
|
+
const data = await fs.readFile(MOCK_DATA_PATH$3, "utf-8");
|
|
1960
1962
|
return JSON.parse(data);
|
|
1961
1963
|
});
|
|
1962
1964
|
const READ_PERFORMANCE_REPORT_FN = functoolsKit.singleshot(async () => {
|
|
@@ -1976,9 +1978,9 @@ class PerformanceMockService {
|
|
|
1976
1978
|
}
|
|
1977
1979
|
}
|
|
1978
1980
|
|
|
1979
|
-
const MOCK_DATA_PATH$
|
|
1981
|
+
const MOCK_DATA_PATH$2 = "./mock/environment.json";
|
|
1980
1982
|
const READ_ENVIRONMENT_DATA_FN = functoolsKit.singleshot(async () => {
|
|
1981
|
-
const data = await fs.readFile(MOCK_DATA_PATH$
|
|
1983
|
+
const data = await fs.readFile(MOCK_DATA_PATH$2, "utf-8");
|
|
1982
1984
|
return JSON.parse(data);
|
|
1983
1985
|
});
|
|
1984
1986
|
class EnvironmentMockService {
|
|
@@ -1991,9 +1993,9 @@ class EnvironmentMockService {
|
|
|
1991
1993
|
}
|
|
1992
1994
|
}
|
|
1993
1995
|
|
|
1994
|
-
const MOCK_DATA_PATH = "./mock/setup.json";
|
|
1996
|
+
const MOCK_DATA_PATH$1 = "./mock/setup.json";
|
|
1995
1997
|
const READ_SETUP_DATA_FN = functoolsKit.singleshot(async () => {
|
|
1996
|
-
const data = await fs.readFile(MOCK_DATA_PATH, "utf-8");
|
|
1998
|
+
const data = await fs.readFile(MOCK_DATA_PATH$1, "utf-8");
|
|
1997
1999
|
return JSON.parse(data);
|
|
1998
2000
|
});
|
|
1999
2001
|
class SetupMockService {
|
|
@@ -2006,6 +2008,21 @@ class SetupMockService {
|
|
|
2006
2008
|
}
|
|
2007
2009
|
}
|
|
2008
2010
|
|
|
2011
|
+
const MOCK_DATA_PATH = "./mock/runtime.json";
|
|
2012
|
+
const READ_RUNTIME_INFO_FN = functoolsKit.singleshot(async () => {
|
|
2013
|
+
const data = await fs.readFile(MOCK_DATA_PATH, "utf-8");
|
|
2014
|
+
return JSON.parse(data);
|
|
2015
|
+
});
|
|
2016
|
+
class RuntimeMockService {
|
|
2017
|
+
constructor() {
|
|
2018
|
+
this.loggerService = inject(TYPES.loggerService);
|
|
2019
|
+
this.getRuntimeInfo = async () => {
|
|
2020
|
+
this.loggerService.log("runtimeMockService getRuntimeInfo");
|
|
2021
|
+
return await READ_RUNTIME_INFO_FN();
|
|
2022
|
+
};
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2009
2026
|
class PerformanceViewService {
|
|
2010
2027
|
constructor() {
|
|
2011
2028
|
this.loggerService = inject(TYPES.loggerService);
|
|
@@ -2131,6 +2148,36 @@ class SetupViewService {
|
|
|
2131
2148
|
}
|
|
2132
2149
|
}
|
|
2133
2150
|
|
|
2151
|
+
class RuntimeViewService {
|
|
2152
|
+
constructor() {
|
|
2153
|
+
this.loggerService = inject(TYPES.loggerService);
|
|
2154
|
+
this.runtimeMockService = inject(TYPES.runtimeMockService);
|
|
2155
|
+
this.getRuntimeInfo = async () => {
|
|
2156
|
+
this.loggerService.log("runtimeViewService getRuntimeInfo");
|
|
2157
|
+
if (CC_ENABLE_MOCK) {
|
|
2158
|
+
return await this.runtimeMockService.getRuntimeInfo();
|
|
2159
|
+
}
|
|
2160
|
+
const [backtestItem] = await BacktestKit.Backtest.list();
|
|
2161
|
+
const [liveItem] = await BacktestKit.Live.list();
|
|
2162
|
+
if (backtestItem) {
|
|
2163
|
+
return await BacktestKit.lib.runtimeMetaService.getRuntimeInfo(backtestItem.symbol, {
|
|
2164
|
+
strategyName: backtestItem.strategyName,
|
|
2165
|
+
exchangeName: backtestItem.exchangeName,
|
|
2166
|
+
frameName: backtestItem.frameName,
|
|
2167
|
+
}, true);
|
|
2168
|
+
}
|
|
2169
|
+
if (liveItem) {
|
|
2170
|
+
return await BacktestKit.lib.runtimeMetaService.getRuntimeInfo(liveItem.symbol, {
|
|
2171
|
+
strategyName: liveItem.strategyName,
|
|
2172
|
+
exchangeName: liveItem.exchangeName,
|
|
2173
|
+
frameName: "",
|
|
2174
|
+
}, false);
|
|
2175
|
+
}
|
|
2176
|
+
return null;
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2134
2181
|
{
|
|
2135
2182
|
provide(TYPES.loggerService, () => new LoggerService());
|
|
2136
2183
|
provide(TYPES.exchangeService, () => new ExchangeService());
|
|
@@ -2157,6 +2204,7 @@ class SetupViewService {
|
|
|
2157
2204
|
provide(TYPES.performanceMockService, () => new PerformanceMockService());
|
|
2158
2205
|
provide(TYPES.environmentMockService, () => new EnvironmentMockService());
|
|
2159
2206
|
provide(TYPES.setupMockService, () => new SetupMockService());
|
|
2207
|
+
provide(TYPES.runtimeMockService, () => new RuntimeMockService());
|
|
2160
2208
|
}
|
|
2161
2209
|
{
|
|
2162
2210
|
provide(TYPES.notificationViewService, () => new NotificationViewService());
|
|
@@ -2171,6 +2219,7 @@ class SetupViewService {
|
|
|
2171
2219
|
provide(TYPES.performanceViewService, () => new PerformanceViewService());
|
|
2172
2220
|
provide(TYPES.environmentViewService, () => new EnvironmentViewService());
|
|
2173
2221
|
provide(TYPES.setupViewService, () => new SetupViewService());
|
|
2222
|
+
provide(TYPES.runtimeViewService, () => new RuntimeViewService());
|
|
2174
2223
|
}
|
|
2175
2224
|
|
|
2176
2225
|
const baseServices = {
|
|
@@ -2199,6 +2248,7 @@ const mockServices = {
|
|
|
2199
2248
|
performanceMockService: inject(TYPES.performanceMockService),
|
|
2200
2249
|
environmentMockService: inject(TYPES.environmentMockService),
|
|
2201
2250
|
setupMockService: inject(TYPES.setupMockService),
|
|
2251
|
+
runtimeMockService: inject(TYPES.runtimeMockService),
|
|
2202
2252
|
};
|
|
2203
2253
|
const viewServices = {
|
|
2204
2254
|
notificationViewService: inject(TYPES.notificationViewService),
|
|
@@ -2213,6 +2263,7 @@ const viewServices = {
|
|
|
2213
2263
|
performanceViewService: inject(TYPES.performanceViewService),
|
|
2214
2264
|
environmentViewService: inject(TYPES.environmentViewService),
|
|
2215
2265
|
setupViewService: inject(TYPES.setupViewService),
|
|
2266
|
+
runtimeViewService: inject(TYPES.runtimeViewService),
|
|
2216
2267
|
};
|
|
2217
2268
|
const ioc = {
|
|
2218
2269
|
...baseServices,
|
|
@@ -2952,6 +3003,35 @@ router$b.post("/api/v1/mock/environment_data", async (req, res) => {
|
|
|
2952
3003
|
});
|
|
2953
3004
|
}
|
|
2954
3005
|
});
|
|
3006
|
+
// RuntimeMockService endpoints
|
|
3007
|
+
router$b.post("/api/v1/mock/runtime_info", async (req, res) => {
|
|
3008
|
+
try {
|
|
3009
|
+
const request = await micro.json(req);
|
|
3010
|
+
const { requestId, serviceName } = request;
|
|
3011
|
+
const data = await ioc.runtimeMockService.getRuntimeInfo();
|
|
3012
|
+
const result = {
|
|
3013
|
+
data,
|
|
3014
|
+
status: "ok",
|
|
3015
|
+
error: "",
|
|
3016
|
+
requestId,
|
|
3017
|
+
serviceName,
|
|
3018
|
+
};
|
|
3019
|
+
ioc.loggerService.log("/api/v1/mock/runtime_info ok", {
|
|
3020
|
+
request,
|
|
3021
|
+
result: omit(result, "data"),
|
|
3022
|
+
});
|
|
3023
|
+
return await micro.send(res, 200, result);
|
|
3024
|
+
}
|
|
3025
|
+
catch (error) {
|
|
3026
|
+
ioc.loggerService.log("/api/v1/mock/runtime_info error", {
|
|
3027
|
+
error: functoolsKit.errorData(error),
|
|
3028
|
+
});
|
|
3029
|
+
return await micro.send(res, 200, {
|
|
3030
|
+
status: "error",
|
|
3031
|
+
error: functoolsKit.getErrorMessage(error),
|
|
3032
|
+
});
|
|
3033
|
+
}
|
|
3034
|
+
});
|
|
2955
3035
|
|
|
2956
3036
|
const router$a = Router({
|
|
2957
3037
|
params: true,
|
|
@@ -3682,6 +3762,35 @@ router$a.post("/api/v1/view/environment_data", async (req, res) => {
|
|
|
3682
3762
|
});
|
|
3683
3763
|
}
|
|
3684
3764
|
});
|
|
3765
|
+
// RuntimeViewService endpoints
|
|
3766
|
+
router$a.post("/api/v1/view/runtime_info", async (req, res) => {
|
|
3767
|
+
try {
|
|
3768
|
+
const request = await micro.json(req);
|
|
3769
|
+
const { requestId, serviceName } = request;
|
|
3770
|
+
const data = await ioc.runtimeViewService.getRuntimeInfo();
|
|
3771
|
+
const result = {
|
|
3772
|
+
data,
|
|
3773
|
+
status: "ok",
|
|
3774
|
+
error: "",
|
|
3775
|
+
requestId,
|
|
3776
|
+
serviceName,
|
|
3777
|
+
};
|
|
3778
|
+
ioc.loggerService.log("/api/v1/view/runtime_info ok", {
|
|
3779
|
+
request,
|
|
3780
|
+
result: omit(result, "data"),
|
|
3781
|
+
});
|
|
3782
|
+
return await micro.send(res, 200, result);
|
|
3783
|
+
}
|
|
3784
|
+
catch (error) {
|
|
3785
|
+
ioc.loggerService.log("/api/v1/view/runtime_info error", {
|
|
3786
|
+
error: functoolsKit.errorData(error),
|
|
3787
|
+
});
|
|
3788
|
+
return await micro.send(res, 200, {
|
|
3789
|
+
status: "error",
|
|
3790
|
+
error: functoolsKit.getErrorMessage(error),
|
|
3791
|
+
});
|
|
3792
|
+
}
|
|
3793
|
+
});
|
|
3685
3794
|
|
|
3686
3795
|
const require$2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
3687
3796
|
function getModulesPath() {
|
package/build/index.mjs
CHANGED
|
@@ -86,6 +86,7 @@ const mockServices$1 = {
|
|
|
86
86
|
performanceMockService: Symbol("performanceMockService"),
|
|
87
87
|
environmentMockService: Symbol("environmentMockService"),
|
|
88
88
|
setupMockService: Symbol("setupMockService"),
|
|
89
|
+
runtimeMockService: Symbol("runtimeMockService"),
|
|
89
90
|
};
|
|
90
91
|
const viewServices$1 = {
|
|
91
92
|
notificationViewService: Symbol("notificationViewService"),
|
|
@@ -100,6 +101,7 @@ const viewServices$1 = {
|
|
|
100
101
|
performanceViewService: Symbol("performanceViewService"),
|
|
101
102
|
environmentViewService: Symbol("environmentViewService"),
|
|
102
103
|
setupViewService: Symbol("setupViewService"),
|
|
104
|
+
runtimeViewService: Symbol("runtimeViewService"),
|
|
103
105
|
};
|
|
104
106
|
const TYPES = {
|
|
105
107
|
...baseServices$1,
|
|
@@ -780,10 +782,10 @@ class SignalMockService {
|
|
|
780
782
|
}
|
|
781
783
|
}
|
|
782
784
|
|
|
783
|
-
const MOCK_DATA_PATH$
|
|
785
|
+
const MOCK_DATA_PATH$4 = "./mock/heat.json";
|
|
784
786
|
const MOCK_REPORT_PATH$1 = "./mock/heat-report.md";
|
|
785
787
|
const READ_HEAT_DATA_FN = singleshot(async () => {
|
|
786
|
-
const data = await fs.readFile(MOCK_DATA_PATH$
|
|
788
|
+
const data = await fs.readFile(MOCK_DATA_PATH$4, "utf-8");
|
|
787
789
|
return JSON.parse(data);
|
|
788
790
|
});
|
|
789
791
|
const READ_HEAT_REPORT_FN = singleshot(async () => {
|
|
@@ -1932,10 +1934,10 @@ class LiveMetaService {
|
|
|
1932
1934
|
}
|
|
1933
1935
|
}
|
|
1934
1936
|
|
|
1935
|
-
const MOCK_DATA_PATH$
|
|
1937
|
+
const MOCK_DATA_PATH$3 = "./mock/performance.json";
|
|
1936
1938
|
const MOCK_REPORT_PATH = "./mock/performance-report.md";
|
|
1937
1939
|
const READ_PERFORMANCE_DATA_FN = singleshot(async () => {
|
|
1938
|
-
const data = await fs.readFile(MOCK_DATA_PATH$
|
|
1940
|
+
const data = await fs.readFile(MOCK_DATA_PATH$3, "utf-8");
|
|
1939
1941
|
return JSON.parse(data);
|
|
1940
1942
|
});
|
|
1941
1943
|
const READ_PERFORMANCE_REPORT_FN = singleshot(async () => {
|
|
@@ -1955,9 +1957,9 @@ class PerformanceMockService {
|
|
|
1955
1957
|
}
|
|
1956
1958
|
}
|
|
1957
1959
|
|
|
1958
|
-
const MOCK_DATA_PATH$
|
|
1960
|
+
const MOCK_DATA_PATH$2 = "./mock/environment.json";
|
|
1959
1961
|
const READ_ENVIRONMENT_DATA_FN = singleshot(async () => {
|
|
1960
|
-
const data = await fs.readFile(MOCK_DATA_PATH$
|
|
1962
|
+
const data = await fs.readFile(MOCK_DATA_PATH$2, "utf-8");
|
|
1961
1963
|
return JSON.parse(data);
|
|
1962
1964
|
});
|
|
1963
1965
|
class EnvironmentMockService {
|
|
@@ -1970,9 +1972,9 @@ class EnvironmentMockService {
|
|
|
1970
1972
|
}
|
|
1971
1973
|
}
|
|
1972
1974
|
|
|
1973
|
-
const MOCK_DATA_PATH = "./mock/setup.json";
|
|
1975
|
+
const MOCK_DATA_PATH$1 = "./mock/setup.json";
|
|
1974
1976
|
const READ_SETUP_DATA_FN = singleshot(async () => {
|
|
1975
|
-
const data = await fs.readFile(MOCK_DATA_PATH, "utf-8");
|
|
1977
|
+
const data = await fs.readFile(MOCK_DATA_PATH$1, "utf-8");
|
|
1976
1978
|
return JSON.parse(data);
|
|
1977
1979
|
});
|
|
1978
1980
|
class SetupMockService {
|
|
@@ -1985,6 +1987,21 @@ class SetupMockService {
|
|
|
1985
1987
|
}
|
|
1986
1988
|
}
|
|
1987
1989
|
|
|
1990
|
+
const MOCK_DATA_PATH = "./mock/runtime.json";
|
|
1991
|
+
const READ_RUNTIME_INFO_FN = singleshot(async () => {
|
|
1992
|
+
const data = await fs.readFile(MOCK_DATA_PATH, "utf-8");
|
|
1993
|
+
return JSON.parse(data);
|
|
1994
|
+
});
|
|
1995
|
+
class RuntimeMockService {
|
|
1996
|
+
constructor() {
|
|
1997
|
+
this.loggerService = inject(TYPES.loggerService);
|
|
1998
|
+
this.getRuntimeInfo = async () => {
|
|
1999
|
+
this.loggerService.log("runtimeMockService getRuntimeInfo");
|
|
2000
|
+
return await READ_RUNTIME_INFO_FN();
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
|
|
1988
2005
|
class PerformanceViewService {
|
|
1989
2006
|
constructor() {
|
|
1990
2007
|
this.loggerService = inject(TYPES.loggerService);
|
|
@@ -2110,6 +2127,36 @@ class SetupViewService {
|
|
|
2110
2127
|
}
|
|
2111
2128
|
}
|
|
2112
2129
|
|
|
2130
|
+
class RuntimeViewService {
|
|
2131
|
+
constructor() {
|
|
2132
|
+
this.loggerService = inject(TYPES.loggerService);
|
|
2133
|
+
this.runtimeMockService = inject(TYPES.runtimeMockService);
|
|
2134
|
+
this.getRuntimeInfo = async () => {
|
|
2135
|
+
this.loggerService.log("runtimeViewService getRuntimeInfo");
|
|
2136
|
+
if (CC_ENABLE_MOCK) {
|
|
2137
|
+
return await this.runtimeMockService.getRuntimeInfo();
|
|
2138
|
+
}
|
|
2139
|
+
const [backtestItem] = await Backtest.list();
|
|
2140
|
+
const [liveItem] = await Live.list();
|
|
2141
|
+
if (backtestItem) {
|
|
2142
|
+
return await lib.runtimeMetaService.getRuntimeInfo(backtestItem.symbol, {
|
|
2143
|
+
strategyName: backtestItem.strategyName,
|
|
2144
|
+
exchangeName: backtestItem.exchangeName,
|
|
2145
|
+
frameName: backtestItem.frameName,
|
|
2146
|
+
}, true);
|
|
2147
|
+
}
|
|
2148
|
+
if (liveItem) {
|
|
2149
|
+
return await lib.runtimeMetaService.getRuntimeInfo(liveItem.symbol, {
|
|
2150
|
+
strategyName: liveItem.strategyName,
|
|
2151
|
+
exchangeName: liveItem.exchangeName,
|
|
2152
|
+
frameName: "",
|
|
2153
|
+
}, false);
|
|
2154
|
+
}
|
|
2155
|
+
return null;
|
|
2156
|
+
};
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2113
2160
|
{
|
|
2114
2161
|
provide(TYPES.loggerService, () => new LoggerService());
|
|
2115
2162
|
provide(TYPES.exchangeService, () => new ExchangeService());
|
|
@@ -2136,6 +2183,7 @@ class SetupViewService {
|
|
|
2136
2183
|
provide(TYPES.performanceMockService, () => new PerformanceMockService());
|
|
2137
2184
|
provide(TYPES.environmentMockService, () => new EnvironmentMockService());
|
|
2138
2185
|
provide(TYPES.setupMockService, () => new SetupMockService());
|
|
2186
|
+
provide(TYPES.runtimeMockService, () => new RuntimeMockService());
|
|
2139
2187
|
}
|
|
2140
2188
|
{
|
|
2141
2189
|
provide(TYPES.notificationViewService, () => new NotificationViewService());
|
|
@@ -2150,6 +2198,7 @@ class SetupViewService {
|
|
|
2150
2198
|
provide(TYPES.performanceViewService, () => new PerformanceViewService());
|
|
2151
2199
|
provide(TYPES.environmentViewService, () => new EnvironmentViewService());
|
|
2152
2200
|
provide(TYPES.setupViewService, () => new SetupViewService());
|
|
2201
|
+
provide(TYPES.runtimeViewService, () => new RuntimeViewService());
|
|
2153
2202
|
}
|
|
2154
2203
|
|
|
2155
2204
|
const baseServices = {
|
|
@@ -2178,6 +2227,7 @@ const mockServices = {
|
|
|
2178
2227
|
performanceMockService: inject(TYPES.performanceMockService),
|
|
2179
2228
|
environmentMockService: inject(TYPES.environmentMockService),
|
|
2180
2229
|
setupMockService: inject(TYPES.setupMockService),
|
|
2230
|
+
runtimeMockService: inject(TYPES.runtimeMockService),
|
|
2181
2231
|
};
|
|
2182
2232
|
const viewServices = {
|
|
2183
2233
|
notificationViewService: inject(TYPES.notificationViewService),
|
|
@@ -2192,6 +2242,7 @@ const viewServices = {
|
|
|
2192
2242
|
performanceViewService: inject(TYPES.performanceViewService),
|
|
2193
2243
|
environmentViewService: inject(TYPES.environmentViewService),
|
|
2194
2244
|
setupViewService: inject(TYPES.setupViewService),
|
|
2245
|
+
runtimeViewService: inject(TYPES.runtimeViewService),
|
|
2195
2246
|
};
|
|
2196
2247
|
const ioc = {
|
|
2197
2248
|
...baseServices,
|
|
@@ -2931,6 +2982,35 @@ router$b.post("/api/v1/mock/environment_data", async (req, res) => {
|
|
|
2931
2982
|
});
|
|
2932
2983
|
}
|
|
2933
2984
|
});
|
|
2985
|
+
// RuntimeMockService endpoints
|
|
2986
|
+
router$b.post("/api/v1/mock/runtime_info", async (req, res) => {
|
|
2987
|
+
try {
|
|
2988
|
+
const request = await micro.json(req);
|
|
2989
|
+
const { requestId, serviceName } = request;
|
|
2990
|
+
const data = await ioc.runtimeMockService.getRuntimeInfo();
|
|
2991
|
+
const result = {
|
|
2992
|
+
data,
|
|
2993
|
+
status: "ok",
|
|
2994
|
+
error: "",
|
|
2995
|
+
requestId,
|
|
2996
|
+
serviceName,
|
|
2997
|
+
};
|
|
2998
|
+
ioc.loggerService.log("/api/v1/mock/runtime_info ok", {
|
|
2999
|
+
request,
|
|
3000
|
+
result: omit(result, "data"),
|
|
3001
|
+
});
|
|
3002
|
+
return await micro.send(res, 200, result);
|
|
3003
|
+
}
|
|
3004
|
+
catch (error) {
|
|
3005
|
+
ioc.loggerService.log("/api/v1/mock/runtime_info error", {
|
|
3006
|
+
error: errorData(error),
|
|
3007
|
+
});
|
|
3008
|
+
return await micro.send(res, 200, {
|
|
3009
|
+
status: "error",
|
|
3010
|
+
error: getErrorMessage(error),
|
|
3011
|
+
});
|
|
3012
|
+
}
|
|
3013
|
+
});
|
|
2934
3014
|
|
|
2935
3015
|
const router$a = Router({
|
|
2936
3016
|
params: true,
|
|
@@ -3661,6 +3741,35 @@ router$a.post("/api/v1/view/environment_data", async (req, res) => {
|
|
|
3661
3741
|
});
|
|
3662
3742
|
}
|
|
3663
3743
|
});
|
|
3744
|
+
// RuntimeViewService endpoints
|
|
3745
|
+
router$a.post("/api/v1/view/runtime_info", async (req, res) => {
|
|
3746
|
+
try {
|
|
3747
|
+
const request = await micro.json(req);
|
|
3748
|
+
const { requestId, serviceName } = request;
|
|
3749
|
+
const data = await ioc.runtimeViewService.getRuntimeInfo();
|
|
3750
|
+
const result = {
|
|
3751
|
+
data,
|
|
3752
|
+
status: "ok",
|
|
3753
|
+
error: "",
|
|
3754
|
+
requestId,
|
|
3755
|
+
serviceName,
|
|
3756
|
+
};
|
|
3757
|
+
ioc.loggerService.log("/api/v1/view/runtime_info ok", {
|
|
3758
|
+
request,
|
|
3759
|
+
result: omit(result, "data"),
|
|
3760
|
+
});
|
|
3761
|
+
return await micro.send(res, 200, result);
|
|
3762
|
+
}
|
|
3763
|
+
catch (error) {
|
|
3764
|
+
ioc.loggerService.log("/api/v1/view/runtime_info error", {
|
|
3765
|
+
error: errorData(error),
|
|
3766
|
+
});
|
|
3767
|
+
return await micro.send(res, 200, {
|
|
3768
|
+
status: "error",
|
|
3769
|
+
error: getErrorMessage(error),
|
|
3770
|
+
});
|
|
3771
|
+
}
|
|
3772
|
+
});
|
|
3664
3773
|
|
|
3665
3774
|
const require$1 = createRequire(import.meta.url);
|
|
3666
3775
|
function getModulesPath() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c,f as v}from"./index-
|
|
1
|
+
import{b as c,f as v}from"./index-fsQnmonU.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-DtU4lH09.js → Background-BH--6xAD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as n,S as o}from"./index-
|
|
1
|
+
import{f as n,S as o}from"./index-fsQnmonU.js";const d=()=>n(o,{children:"\n body {\n background-color: #ddd !important;\n }\n "});export{d as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,i as t,B as r,J as s}from"./index-
|
|
1
|
+
import{f as e,i as t,B as r,J as s}from"./index-fsQnmonU.js";const o=({className:o,symbol:i,style:a,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[i],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:a,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:i,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:a,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{b as o,f as r}from"./index-
|
|
1
|
+
import{b as o,f as r}from"./index-fsQnmonU.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{b as h,f as c}from"./index-
|
|
1
|
+
import{b as h,f as c}from"./index-fsQnmonU.js";const v=h(c("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");export{v as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bx as e,d as t,r as a,_ as s,f as i,by as n,j as o,bz as r,k as d,bA as m,g as u,u as p,s as x,b as c}from"./index-fsQnmonU.js";const h=e(),b=["className","component","disableGutters","fixed","maxWidth","classes"],l=m(),f=h("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]}}),g=e=>r({props:e,name:"MuiContainer",defaultTheme:l});const W=function(e={}){const{createStyledComponent:r=f,useThemeProps:m=g,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:c,component:h="div",disableGutters:l=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,b),k=t({},r,{component:h,disableGutters:l,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:h,ownerState:k,className:n(S.root,c),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"})}),k=c(i("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{W as C,k as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a6 as o}from"./index-fsQnmonU.js";const r=new o;export{r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as a,bv as e,bw as t}from"./index-fsQnmonU.js";const i=(i,o=a.routerService.location.pathname)=>!!e(t.filter(({path:a})=>i.includes(a)),o);export{i as h};
|
package/build/modules/frontend/build/assets/{html2canvas-DZim_iNK.js → html2canvas-BdzWxETw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bB as e,bD as t}from"./index-fsQnmonU.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{b as e,f as a,r as t,be as i,bf as o,a4 as r,i as s,bg as n,bh as c,bi as l,I as d,ab as p,a$ as h,bj as m,p as b,af as u,bk as f,Y as y,T as g,b1 as x,al as v,a1 as w,bl as L,am as S,bm as k,aX as A,A as j,a5 as C,a6 as N,x as z,y as E,b6 as H,B as R,E as T,ah as I}from"./index-fsQnmonU.js";import{h as M}from"./hasRouteMatch-DHHNIPte.js";import{B as V}from"./Background-BH--6xAD.js";import{A as B}from"./Article-cVpAg67f.js";import{C as D,R as F}from"./Refresh-BnizeO5c.js";import{K}from"./KeyboardArrowLeft-Cesmg5AP.js";const P=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"),W=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"),X="65px",$=e=>e.mimeType.startsWith("image/")?a(P,{sx:{color:"#f57c00",fontSize:20}}):"application/json"===e.mimeType?a(j,{sx:{color:"#7b1fa2",fontSize:20}}):e.mimeType.startsWith("text/")?a(B,{sx:{color:"#1976d2",fontSize:20}}):a(W,{sx:{color:"#546e7a",fontSize:20}}),O=b()(e=>({root:{position:"relative",height:"100%",width:"100%",background:"#eee",overflow:"clip"},header:{position:"absolute",top:0,left:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"8px",paddingRight:"4px",height:X},input:{height:X,paddingRight:e.spacing(2),paddingLeft:e.spacing(1),width:"100%"},container:{position:"absolute",top:X,left:0,right:0,bottom:0,height:`calc(100% - ${X})`,width:"100%",background:"white",overflow:"clip",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{display:"flex",flex:1},loader:{height:"100%",width:"100%"},accent:{background:u("#00c3ff",.05)}})),Y=({outlinePaper:e,className:b,style:u,sx:j,nodes:C,initialSearch:N=""})=>{const{classes:z,cx:E}=O(),[H,R]=t.useState(N),T=i(H),[I,{flush:M}]=o(H,2500),[V,{loading:B}]=r(async()=>await(async(e,a)=>{const t=e.trim().toLowerCase(),i=[];let o=0;for(const r of s.explorerHelperService.deepFlat(a))if("file"!==r.type||t&&!r.path.toLowerCase().includes(t)||i.push(r),++o%1e4==0&&await f(0),i.length>25e3)break;return i})(I,C),{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1),deps:[I,C]}),{execute:D}=n(async e=>{await s.layoutService.pickDumpContent(e)},{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1)});return a(m,{outlinePaper:e,className:E(z.root,b),style:u,sx:j,children:[a("div",{className:z.header,children:a(c,{disabled:B,className:z.input,endAdornment:a(l,{position:"end",children:a(d,{disabled:B||!H,onClick:()=>{T.once(async()=>{await f(500),M()}),R("")},edge:"end",children:a(H?p:h,{})})}),placeholder:"Search",value:H,onBlur:()=>M(),onChange:({target:e})=>R(e.value),onKeyDown:({key:e,currentTarget:a})=>"Enter"===e&&a.blur()})}),a("div",{className:z.container,children:a("div",{className:z.content,children:V?V.length?a(A,{withScrollbar:!0,children:V.map((e,t)=>a(v,{className:E({[z.accent]:t%2==1}),component:w,onClick:()=>(async e=>{await D(e)})(e.id),children:[a(L,{children:$(e)}),a(S,{primary:e.label,secondary:e.path}),a(k,{content:e.path,label:"Copy path"})]},e.id))}):a(x,{sx:{height:"100%",width:"100%"},children:a(g,{variant:"h6",sx:{opacity:.5},children:"Not found"})}):a(y,{className:z.loader})})})]})},q=[{type:E.Link,action:"back-action",label:a(K,{sx:{display:"block"}})},{type:E.Link,action:"back-action",label:"Main"},{type:E.Link,action:"back-action",label:"Dump Explorer"}],G=[{action:"update-now",label:"Refresh",icon:()=>a(T,{icon:F,color:"#4caf50"})}],J=new N,Q=({params:e})=>{const[t,{loading:i,execute:o}]=r(async()=>await s.explorerViewService.getFolderTree(),{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1)});C(()=>J.subscribe(o));return a(D,{children:[a(z,{items:q,actions:G,onAction:e=>{"back-action"===e&&s.routerService.push("/"),"update-now"===e&&(s.explorerViewService.clear(),J.next())}}),a(H,{withScrollbar:!0,hideOverflowX:!0,sx:{height:"calc(100vh - 150px)"},children:a(R,{pr:2,pl:2,children:i||!t?a(x,{children:a(g,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):a(Y,{nodes:t,initialSearch:e.search})})}),a(V,{})]})},U=[{id:"search",element:Q,isActive:e=>M(["/dump/:search"],e)},{id:"main",element:Q,isActive:e=>M(["/dump"],e)}],Z=({search:e=""})=>a(I,{history:s.routerService,onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1),routes:U,params:{search:e}});export{Z as DumpPage,Z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b0 as t,a4 as a,i as e,f as o,x as i,y as n,p as s,Z as r,E as c,T as l,b1 as d,z as p,B as u,F as b,$ as m,R as y,Q as h,a1 as g,l as f,n as S,a0 as v,a2 as w,ag as L,b2 as k,b3 as x,w as A,a5 as C,a6 as N,b4 as R,D as $,b5 as j,ah as F}from"./index-fsQnmonU.js";import{h as B}from"./hasRouteMatch-DHHNIPte.js";import{I as E}from"./IconPhoto-dhtH47SN.js";import{C as H,R as M}from"./Refresh-BnizeO5c.js";import{K as _}from"./KeyboardArrowLeft-Cesmg5AP.js";import{B as G}from"./Background-BH--6xAD.js";const V="backtest-kit__groupHeader",O="backtest-kit__groupRoot",z="backtest-kit__symbolImage",I=s()({root:{[`& .${O}:hover .${V}`]:{opacity:"1 !important"}}});function P(t){return w(t,"#000000")>w(t,"#FFFFFF")}const D=[{type:n.Link,action:"back-action",label:o(_,{sx:{display:"block"}})},{type:n.Link,action:"back-action",label:"Main"},{type:n.Link,action:"back-action",label:"Status"}],T=[{action:"update-now",label:"Refresh",icon:()=>o(c,{icon:M,color:"#4caf50"})}],U=(t,a)=>({type:r.Group,className:O,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:r.Component,className:V,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(h,{direction:"row",children:[o(m,{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:i,color:n})=>((t,a,i,n)=>({type:r.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(v,{component:g,onClick:()=>{e.routerService.push(`/status/${a}`)},sx:{width:"100%",background:n,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${z}`]:{transition:"filter 500ms"},"&:hover":{background:()=>P(n)?f(n,.33):S(n,.33),[`& .${z}`]:{transition:"filter 500ms",filter:P(n)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(E,{className:z,symbol:t}),children:o(u,{sx:{overflow:"hidden",textOverflow:"ellipsis",width:"75px"},children:i})})}))(t,i,a,n))}]}),K=[{type:n.Link,action:"back-action",label:o(_,{sx:{display:"block"}})},{type:n.Link,action:"back-action",label:"Main"},{type:n.Link,action:"back-action",label:"Status"},{type:n.Link,action:"back-action",compute:t=>t?`${String(t.symbol).toUpperCase()} (${t.strategyName})`:"Live"},{type:n.Button,action:"print-action",label:"Print",icon:R}],W=[{action:"print-action",label:"Print",icon:()=>o(c,{icon:R,color:"#4caf50"})},{action:"download-action",label:"Download",icon:()=>o(c,{icon:$,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(c,{icon:M,color:"#4caf50"})}],J=new N,Q=[{id:"status",element:({params:t})=>{const[n]=a(async()=>{const a=await e.statusViewService.getStatusMap();return L.get(a,t.id,null)},{onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),deps:[t.id]}),[s,{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]}),m=k(async()=>{if(!s)return;const t=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),a=URL.createObjectURL(t);e.layoutService.downloadFile(a,`status_${Date.now()}.json`)}),y=k(async()=>{if(!s)return;const t=e.markdownHelperService.buildMarkdownFromFields(x,s);await A(t)});C(()=>J.subscribe(c));return o(H,{children:[o(i,{items:K,actions:W,payload:n,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 J.next(),"download-action"===t&&await m(),"print-action"===t&&await y()}}),r?o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):s?o(b,{children:[o(p,{handler:s,fields:j}),o(u,{paddingBottom:"24px"})]}):o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"No pending signal"})}),o(G,{})]})},isActive:t=>B(["/status/:id"],t)},{id:"main",element:()=>{const{classes:n}=I(),{reloadTrigger:s,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:[s]});const[m,{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],i=a.strategyName;o[i]||(o[i]=[]),o[i].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 i=Object.entries(o).sort(([,t],[,a])=>a.length-t.length),n=[],s=[],c=[];return i.forEach(([t,a],e)=>{const o=U(t,a);e%2==0?n.push(o):s.push(o),c.push(o)}),[{type:r.Group,columns:"6",className:"tabletLeftColumn",phoneHidden:!0,desktopHidden:!0,fields:n},{type:r.Group,columns:"6",className:"tabletRightColumn",phoneHidden:!0,desktopHidden:!0,fields:s},{type:r.Group,columns:"12",className:"wideColumn",tabletHidden:!0,fields:c}]})(),{onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),deps:[s]});return o(H,{children:[o(i,{items:D,actions:T,onAction:t=>{"back-action"===t&&e.routerService.push("/"),"update-now"===t&&c()}}),y||!m?o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):m.length?o(b,{children:[o(p,{className:n.root,fields:m},s),o(u,{paddingBottom:"24px"})]}):o(d,{children:o(l,{variant:"h6",sx:{opacity:.5},children:"No pending signals"})})]})},isActive:t=>B(["/status"],t)}],Z=({id:t})=>o(F,{history:e.routerService,onLoadStart:()=>e.layoutService.setAppbarLoader(!0),onLoadEnd:()=>e.layoutService.setAppbarLoader(!1),routes:Q,params:{id:t}});export{Z as StatusPage,Z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a,f as e,aX as t,B as o,Q as r,a7 as n,T as i,W as s,$ as c,F as l,V as d,P as h,aM as p,aZ as u,a_ as w,aE as b,a6 as f,i as x,aF as g,aj as y,aJ as v,x as m,y as S,a$ as k,aY as L,D as j,E as A}from"./index-fsQnmonU.js";import{A as z}from"./Article-cVpAg67f.js";import{C as R,R as E}from"./Refresh-BnizeO5c.js";import{K as H}from"./KeyboardArrowLeft-Cesmg5AP.js";const C=a(e("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"}),"BugReport"),F=a=>{const t={color:"white",fontSize:28};switch(a.type){case"debug":return e(C,{sx:t});case"info":return e(u,{sx:t});case"warn":return e(p,{sx:t});default:return e(z,{sx:t})}},M=t.virtualize(({data:a,sx:t})=>{const p=(a=>{switch(a.type){case"debug":default:return"#9E9E9E";case"info":return"#2196F3";case"warn":return"#FF9800";case"log":return"#4CAF50"}})(a);return e(h,{variant:"outlined",sx:{display:"flex",alignItems:"stretch",justifyContent:"stretch",...t},children:e(o,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[e(r,{direction:"row",spacing:2,sx:{p:2},children:[e(n,{sx:{width:56,height:56,background:p},children:F(a)}),e(r,{flex:1,spacing:1,children:[e(r,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e(i,{variant:"h6",sx:{fontWeight:600,wordBreak:"break-all"},children:a.topic}),e(i,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:s(a.createdAt).format("HH:mm DD/MM/YYYY")})]}),e(r,{direction:"row",spacing:1,flexWrap:"wrap",children:e(c,{size:"small",label:a.type.toUpperCase(),sx:{background:p,color:"white",fontWeight:500}})}),a.args.length>0&&e(l,{children:[e(d,{sx:{my:1}}),e(o,{component:"pre",sx:{m:0,fontSize:"0.75rem",whiteSpace:"pre-wrap",wordBreak:"break-all",color:"text.secondary"},children:JSON.stringify(1===a.args.length?a.args[0]:a.args,null,2)})]})]})]}),e(o,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:p}})]})})}),B=[{action:"download-action",label:"Download",icon:()=>e(A,{icon:j,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh manually",icon:()=>e(A,{icon:E,color:"#4caf50"})}],D=[{type:S.Link,action:"back-action",label:e(H,{sx:{display:"block"}})},{type:S.Link,action:"back-action",label:"Main"},{type:S.Link,action:"back-action",label:"Logs"},{type:S.Button,icon:k,action:"search-action",label:"Search"}],Y=new f,W=()=>{const[a,o]=w(""),{data:r,hasMore:n,loading:i,onSkip:s}=b({handler:async(e,t)=>{const o=await x.logViewService.getList(),r=g(e,t);for(const n of o)if(new RegExp(a.current,"i").test(n.topic)&&r([n]).done)break;return r().rows},onLoadStart:()=>x.layoutService.setAppbarLoader(!0),onLoadEnd:()=>x.layoutService.setAppbarLoader(!1),reloadSubject:Y}),c=y(r),{execute:l}=v(async()=>{const a=new Blob([JSON.stringify(c.current,null,2)],{type:"application/json"}),e=URL.createObjectURL(a);x.layoutService.downloadFile(e,`logs_${Date.now()}.json`)},{onLoadStart:()=>x.layoutService.setAppbarLoader(!0),onLoadEnd:()=>x.layoutService.setAppbarLoader(!1)});return e(R,{children:[e(m,{items:D,actions:B,onAction:async a=>{"back-action"===a&&x.routerService.push("/"),"download-action"===a&&l(),"update-now"===a&&(o(""),await Y.next()),"search-action"===a&&(async()=>{const a=await x.layoutService.prompt("Search keyword");if(a)return o(a),void Y.next();o(""),Y.next()})()}}),e(t,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:i,onDataRequest:s,bufferSize:L,hasMore:n,children:r.map(a=>e(M,{data:a,sx:{mb:1}},a.id))})]})};export{W as LogPage,W as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,b6 as t,M as a,B as i,q as r,b7 as o,i as n,b8 as l,v as s,b2 as c,b9 as d,A as w,E as p,G as h,H as m,a_ as k,ba as g,aG as b,bb as v,at as y,bc as u,b4 as f,ab as S,Q as x,bd as _,av as D,w as V,b0 as N,a4 as O,x as R,y as L,p as B,Z as A,T as P,b1 as C,z as $,F as J,$ as M,R as G,a1 as j,l as F,n as X,a0 as H,a2 as E,ah as I}from"./index-fsQnmonU.js";import{h as z}from"./hasRouteMatch-DHHNIPte.js";import{I as T}from"./IconPhoto-dhtH47SN.js";import{C as U,R as q}from"./Refresh-BnizeO5c.js";import{K}from"./KeyboardArrowLeft-Cesmg5AP.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:"max_drawdown",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/max_drawdown")},{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:"max_drawdown",label:"Max Drawdown"},{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:w})=>e(l,{className:a,style:i,sx:c,disabled:t,color:w,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 s(String(e))})(i),n.alertService.notify("Copied!")},children:e(r,{})}),Y=[{action:"json",label:"Download JSON",icon:()=>e(p,{icon:w,color:"#4caf50"})},{action:"markdown",label:"Download Markdown",icon:()=>e(p,{icon:h,color:"#4caf50"})},{action:"pdf",label:"Download PDF",icon:()=>e(p,{icon:m,color:"#4caf50"})}],ee=({disabled:t,className:a,style:i,sx:r,onDownloadJson:o,onDownloadMarkdown:n,onDownloadPdf:l})=>{const s=c(async e=>{"json"===e?await o():"markdown"===e?await n():"pdf"===e&&await l()});return e(d,{transparent:!0,className:a,style:i,sx:r,disabled:t,options:Y,onAction:s})},te=y(),ae=D(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:l}=a,[s,c,d,w,p,h,m,k,g,b,v,y]=await Promise.all(["backtest"===t?n.markdownViewService.getBacktestReport(i,r,o,l):Promise.resolve(""),"live"===t?n.markdownViewService.getLiveReport(i,r,o):Promise.resolve(""),n.markdownViewService.getBreakevenReport(i,r,o,l,"backtest"===t),n.markdownViewService.getRiskReport(i,r,o,l,"backtest"===t),n.markdownViewService.getPartialReport(i,r,o,l,"backtest"===t),n.markdownViewService.getHighestProfitReport(i,r,o,l,"backtest"===t),n.markdownViewService.getMaxDrawdownReport(i,r,o,l,"backtest"===t),n.markdownViewService.getScheduleReport(i,r,o,l,"backtest"===t),n.markdownViewService.getPerformanceReport(i,r,o,l,"backtest"===t),n.markdownViewService.getSyncReport(i,r,o,l,"backtest"===t),n.markdownViewService.getHeatReport(r,o,l,"backtest"===t),n.markdownViewService.getStrategyReport(i,r,o,l,"backtest"===t)]);return{type:t,backtest:s,live:c,breakeven:d,risk:w,partial:p,highest_profit:h,max_drawdown:m,schedule:k,performance:g,sync:b,heat:v,strategy:y}},{timeout:45e3,key:([e,t])=>`${e}_${t}`}),ie=()=>{const[t,a]=k(""),[r,o]=k("backtest"),s=g(),{push:c,pop:d}=s,[w,p]=b(te.location.pathname),h=async()=>{const e=(await ae(t.current,r.current))[w.current.replace("/markdown_report/","")];"string"==typeof e&&await V(e)},m=async()=>{const e=await ae(t.current,r.current),a=w.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:l}=e,s=w.current.replace("/markdown_report/",""),c="backtest"===r.current;let d;if("backtest"===s?d=await n.markdownViewService.getBacktestData(a,i,o,l):"live"===s?d=await n.markdownViewService.getLiveData(a,i,o):"breakeven"===s?d=await n.markdownViewService.getBreakevenData(a,i,o,l,c):"risk"===s?d=await n.markdownViewService.getRiskData(a,i,o,l,c):"partial"===s?d=await n.markdownViewService.getPartialData(a,i,o,l,c):"highest_profit"===s?d=await n.markdownViewService.getHighestProfitData(a,i,o,l,c):"max_drawdown"===s?d=await n.markdownViewService.getMaxDrawdownData(a,i,o,l,c):"schedule"===s?d=await n.markdownViewService.getScheduleData(a,i,o,l,c):"performance"===s?d=await n.markdownViewService.getPerformanceData(a,i,o,l,c):"sync"===s?d=await n.markdownViewService.getSyncData(a,i,o,l,c):"heat"===s?d=await n.markdownViewService.getHeatData(i,o,l,c):"strategy"===s&&(d=await n.markdownViewService.getStrategyData(a,i,o,l,c)),void 0!==d){const e=new Blob([JSON.stringify(d,null,2)],{type:"application/json"}),t=URL.createObjectURL(e);n.layoutService.downloadFile(t,`${s}_${r.current}_${Date.now()}.json`)}},{pickData:D,render:N}=v({tabs:Q,withStaticAction:!0,onTabChange:(e,t)=>{const a=`/markdown_report/${e}`;t.replace(a),p(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(l,{onClick:t,children:e(_,{})})})},AfterTitle:({onClose:a})=>e(x,{direction:"row",gap:1,children:[e(l,{sx:{mr:"10px"},onClick:()=>h(),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:l,exchangeName:s,frameName:c}=r,d="backtest"===a;e.includes("/markdown_report/backtest")?i(JSON.stringify(await n.markdownViewService.getBacktestData(o,l,s,c),null,2)):e.includes("/markdown_report/live")?i(JSON.stringify(await n.markdownViewService.getLiveData(o,l,s),null,2)):e.includes("/markdown_report/breakeven")?i(JSON.stringify(await n.markdownViewService.getBreakevenData(o,l,s,c,d),null,2)):e.includes("/markdown_report/risk")?i(JSON.stringify(await n.markdownViewService.getRiskData(o,l,s,c,d),null,2)):e.includes("/markdown_report/partial")?i(JSON.stringify(await n.markdownViewService.getPartialData(o,l,s,c,d),null,2)):e.includes("/markdown_report/highest_profit")?i(JSON.stringify(await n.markdownViewService.getHighestProfitData(o,l,s,c,d),null,2)):e.includes("/markdown_report/max_drawdown")?i(JSON.stringify(await n.markdownViewService.getMaxDrawdownData(o,l,s,c,d),null,2)):e.includes("/markdown_report/schedule")?i(JSON.stringify(await n.markdownViewService.getScheduleData(o,l,s,c,d),null,2)):e.includes("/markdown_report/performance")?i(JSON.stringify(await n.markdownViewService.getPerformanceData(o,l,s,c,d),null,2)):e.includes("/markdown_report/sync")?i(JSON.stringify(await n.markdownViewService.getSyncData(o,l,s,c,d),null,2)):e.includes("/markdown_report/heat")?i(JSON.stringify(await n.markdownViewService.getHeatData(l,s,c,d),null,2)):e.includes("/markdown_report/strategy")&&i(JSON.stringify(await n.markdownViewService.getStrategyData(o,l,s,c,d),null,2))})(w.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:h}),e(l,{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,max_drawdown:l,schedule:s,performance:c,sync:d,heat:w,strategy:p}])=>({backtest:t,live:a,breakeven:i,risk:r,partial:o,highest_profit:n,max_drawdown:l,schedule:s,performance:c,sync:d,heat:w,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),p(e)},onMount:()=>{a(e),o(t),D()}})}},re="backtest-kit__groupHeader",oe="backtest-kit__groupRoot",ne="backtest-kit__symbolImage",le=B()({root:{[`& .${oe}:hover .${re}`]:{opacity:"1 !important"}}});function se(e){return E(e,"#000000")>E(e,"#FFFFFF")}const ce=[{type:L.Link,action:"back-action",label:e(K,{sx:{display:"block"}})},{type:L.Link,action:"back-action",label:"Main"},{type:L.Link,action:"back-action",label:"Markdown Report"}],de=[{action:"update-now",label:"Refresh",icon:()=>e(p,{icon:q,color:"#4caf50"})}],we=(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(M,{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:r,type:o,color:n})=>((t,a,r,o,n)=>({type:A.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:({payload:l})=>e(H,{component:j,onClick:()=>{l.handleOpen(t,a)},sx:{width:"100%",background:n,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${ne}`]:{transition:"filter 500ms"},"&:hover":{background:()=>se(n)?F(n,.33):X(n,.33),[`& .${ne}`]:{transition:"filter 500ms",filter:se(n)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:e(T,{className:ne,symbol:r}),children:e(i,{sx:{overflow:"hidden",textOverflow:"ellipsis",width:"75px"},children:o})})}))(r,o,t,a,n))}]}),pe=[{id:"main",element:()=>{const{classes:t}=le(),{reloadTrigger:a,doReload:r}=N(),[o,{loading:l}]=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])=>we(e,t)),l=Object.entries(r).sort(([,e],[,t])=>t.length-e.length).map(([e,t])=>we(e,t));return l.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:()=>!!l.length,fields:[{type:A.Line,title:"Live"},{type:A.Group,columns:"12",fields:l}]}]:[]})(),{onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),deps:[a]}),s=ie(),c=(e,t)=>{s(e,t)};return e(U,{children:[e(R,{items:ce,actions:de,onAction:e=>{"back-action"===e&&n.routerService.push("/"),"update-now"===e&&r()}}),l||!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)}],he=({id:t})=>e(I,{history:n.routerService,onLoadStart:()=>n.layoutService.setAppbarLoader(!0),onLoadEnd:()=>n.layoutService.setAppbarLoader(!1),routes:pe,params:{id:t}});export{he as StatusPage,he as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as t,T as e,R as a,bn as o,Z as n,P as i,p as l,a4 as r,i as c,a5 as s,x as d,y as p,A as m,E as y,G as h,H as u,Y as x,z as w,b6 as f,w as b,ah as g}from"./index-fsQnmonU.js";import{h as v}from"./hasRouteMatch-DHHNIPte.js";import{r as R}from"./emitters-CncrD_BX.js";import{I as S}from"./IconPhoto-dhtH47SN.js";import{P as F}from"./PictureAsPdfOutlined-CrADy_Z6.js";import{C as A,R as L}from"./Refresh-BnizeO5c.js";import{K as N}from"./KeyboardArrowLeft-Cesmg5AP.js";const j=l()(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"}})),k=[{type:n.Text,columns:"6",name:"totalPnl",title:"Total PNL",compute:t=>null!==t.totalPnl?`${t.totalPnl.toFixed(2)}%`:"N/A",readonly:!0},{type:n.Text,columns:"6",name:"sharpeRatio",title:"Sharpe Ratio",compute:t=>null!==t.sharpeRatio?`${t.sharpeRatio.toFixed(2)}%`:"N/A",readonly:!0},{type:n.Text,columns:"6",name:"winRate",title:"Win Rate",compute:t=>null!==t.winRate?`${t.winRate.toFixed(2)}%`:"N/A",readonly:!0},{type:n.Text,columns:"6",name:"profitFactor",title:"Profit Factor",compute:t=>null!==t.profitFactor?t.profitFactor.toFixed(2):"N/A",readonly:!0},{type:n.Text,columns:"6",name:"maxDrawdown",title:"Max Drawdown",compute:t=>null!==t.maxDrawdown?`${t.maxDrawdown.toFixed(2)}%`:"N/A",readonly:!0},{type:n.Text,columns:"6",name:"expectancy",title:"Expectancy",compute:t=>null!==t.expectancy?`${t.expectancy.toFixed(2)}%`:"N/A",readonly:!0},{type:n.Text,columns:"6",name:"sortinoRatio",title:"Sortino Ratio",compute:t=>null!==t.sortinoRatio?t.sortinoRatio.toFixed(3):"N/A",readonly:!0},{type:n.Text,columns:"6",name:"calmarRatio",title:"Calmar Ratio",compute:t=>null!==t.calmarRatio?t.calmarRatio.toFixed(3):"N/A",readonly:!0},{type:n.Text,columns:"6",name:"recoveryFactor",title:"Recovery Factor",compute:t=>null!==t.recoveryFactor?t.recoveryFactor.toFixed(3):"N/A",readonly:!0},{type:n.Text,columns:"6",name:"totalTrades",title:"Trades",readonly:!0}],D=({row:n})=>{const{classes:l}=j();return t(i,{className:l.root,children:[t("div",{className:l.header,children:t(e,{variant:"h6",sx:{opacity:.8},children:`${a.bullet} ${n.symbol}`})}),t("div",{className:l.container,children:t("div",{className:l.content,children:[t("div",{className:l.avatar,children:t(S,{symbol:n.symbol,sx:{width:128,height:128}})}),t(o,{handler:()=>n,fields:k,sx:{mb:2}})]})})]})},T=[{type:p.Link,action:"back-action",label:t(N,{sx:{display:"block"}})},{type:p.Link,action:"back-action",label:"Dashboard"},{type:p.Link,action:"back-action",label:"Heatmap"},{type:p.Button,action:"download-pdf",label:"Download PDF",icon:F}],P=[{action:"download-json",label:"Download JSON",icon:()=>t(y,{icon:m,color:"#4caf50"})},{action:"download-markdown",label:"Download Markdown",icon:()=>t(y,{icon:h,color:"#4caf50"})},{action:"download-pdf",label:"Download PDF",icon:()=>t(y,{icon:u,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>t(y,{icon:L,color:"#4caf50"})}],C=[{id:"main",element:()=>{const[e,{loading:a,execute:o}]=r(async()=>(e=>{if(!e.length)return[{type:n.Typography,typoVariant:"h6",placeholder:"No data",sx:{textAlign:"center",opacity:.5,mt:4}}];const a=e.map(e=>({type:n.Group,desktopColumns:"4",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",child:{type:n.Component,element:()=>t(D,{row:e})}}));return a.length>2?a:[{type:n.Center,sx:t=>({[t.breakpoints.up("lg")]:{"@media (min-height: 900px)":{height:"calc(100dvh - 165px)","& > *":{transform:"translateY(-56px)"}}}}),fields:a}]})((await c.heatViewService.getStrategyHeatData()).symbols),{onLoadStart:()=>c.layoutService.setAppbarLoader(!0),onLoadEnd:()=>c.layoutService.setAppbarLoader(!1)});s(()=>R.subscribe(o));return t(A,{children:[t(d,{items:T,actions:P,onAction:async t=>{"back-action"===t&&c.routerService.push("/"),"update-now"===t&&await R.next(),"download-markdown"===t&&await(async()=>{const t=await c.heatViewService.getStrategyHeatReport(),e=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(e);c.layoutService.downloadFile(a,`heat_${Date.now()}.md`)})(),"download-pdf"===t&&await(async()=>{const t=await c.heatViewService.getStrategyHeatReport();await b(t)})(),"download-json"===t&&await(async()=>{const t=await c.heatViewService.getStrategyHeatData(),e=JSON.stringify(t,null,2),a=new Blob([e],{type:"text/plain"}),o=URL.createObjectURL(a);c.layoutService.downloadFile(o,`heat_${Date.now()}.json`)})()}}),!e||a?t(x,{sx:{height:"calc(100dvh - 165px)"}}):t(f,{withScrollbar:!0,sx:{height:"calc(100dvh - 165px)"},hideOverflowX:!0,children:t(w,{fields:e})})]})},isActive:t=>v(["/heat"],t)}],$=({id:e})=>t(g,{history:c.routerService,onLoadStart:()=>c.layoutService.setAppbarLoader(!0),onLoadEnd:()=>c.layoutService.setAppbarLoader(!1),routes:C,params:{id:e}});export{$ as HeatPage,$ as default};
|