@backtest-kit/ui 6.4.0 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.cjs +82 -0
- package/build/index.mjs +83 -1
- package/build/modules/frontend/build/assets/{Article-B3sJn9jj.js → Article-DyYNpEtB.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-vKerKkRx.js → Background-DDJ7Q4Pm.js} +1 -1
- package/build/modules/frontend/build/assets/{Container-BpsVEc--.js → Container-z8MK4qnG.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-OJ8YDbpd.js → IconPhoto-Cg4v-bGP.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-BasR_jXs.js → KeyboardArrowLeft-Qu4ADu24.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-CWqrXG9u.js → Refresh-CpqMl1GA.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-KtRGywuC.js +1 -0
- package/build/modules/frontend/build/assets/{hasRouteMatch-CnhjHmvr.js → hasRouteMatch-Dey0ib7y.js} +1 -1
- package/build/modules/frontend/build/assets/{html2canvas-D60qFSRE.js → html2canvas-ClWjPDr-.js} +1 -1
- package/build/modules/frontend/build/assets/{index-8foWT5Mj.js → index-BBJWfxo3.js} +1 -1
- package/build/modules/frontend/build/assets/{index-UYNJGlrB.js → index-C1PCAMYk.js} +1 -1
- package/build/modules/frontend/build/assets/{index-D-1_V7j0.js → index-CG_ibFMd.js} +5 -5
- package/build/modules/frontend/build/assets/index-CJyOsYqQ.js +1 -0
- package/build/modules/frontend/build/assets/{index-DzN6_JU4.js → index-CKb6wiGE.js} +1 -1
- package/build/modules/frontend/build/assets/{index-BWBFhgRg.js → index-DDUa8CVZ.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CVo6552X.js → index-DItOhKh9.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CK2_oS-n.js → index-DZE5LSiz.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CcisxbBU.js → index-Db5YcpoN.js} +1 -1
- package/build/modules/frontend/build/assets/{index-D5Th-vBe.js → index-DvU9U5lk.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Dsl-2Lab.js → index-oiX-eXJa.js} +1 -1
- package/build/modules/frontend/build/assets/{index.es-BD_vECSZ.js → index.es-D-z8vfdt.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-CgXxhHBO.js → markdownit-B18lsWXw.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +3 -3
- package/types.d.ts +4 -0
- package/build/modules/frontend/build/assets/emitters-84Kl3lbG.js +0 -1
- package/build/modules/frontend/build/assets/index-Cd5VPLjQ.js +0 -1
package/build/index.cjs
CHANGED
|
@@ -518,6 +518,7 @@ const readBreakeven = makeReader("breakeven.md");
|
|
|
518
518
|
const readRisk = makeReader("risk.md");
|
|
519
519
|
const readPartial = makeReader("partial.md");
|
|
520
520
|
const readHighestProfit = makeReader("highest_profit.md");
|
|
521
|
+
const readMaxDrawdown = makeReader("max_drawdown.md");
|
|
521
522
|
const readSchedule = makeReader("schedule.md");
|
|
522
523
|
const readPerformance = makeReader("performance.md");
|
|
523
524
|
const readSync = makeReader("sync.md");
|
|
@@ -530,6 +531,7 @@ const readBreakevenData = makeDataReader("breakeven.json");
|
|
|
530
531
|
const readRiskData = makeDataReader("risk.json");
|
|
531
532
|
const readPartialData = makeDataReader("partial.json");
|
|
532
533
|
const readHighestProfitData = makeDataReader("highest_profit.json");
|
|
534
|
+
const readMaxDrawdownData = makeDataReader("max_drawdown.json");
|
|
533
535
|
const readScheduleData = makeDataReader("schedule.json");
|
|
534
536
|
const readPerformanceData = makeDataReader("performance.json");
|
|
535
537
|
const readSyncData = makeDataReader("sync.json");
|
|
@@ -601,6 +603,15 @@ class MarkdownMockService {
|
|
|
601
603
|
this.loggerService.log("markdownMockService getHighestProfitReport", { symbol, strategyName, exchangeName, frameName });
|
|
602
604
|
return readHighestProfit();
|
|
603
605
|
};
|
|
606
|
+
// MaxDrawdown
|
|
607
|
+
this.getMaxDrawdownData = async (symbol, strategyName, exchangeName, frameName) => {
|
|
608
|
+
this.loggerService.log("markdownMockService getMaxDrawdownData", { symbol, strategyName, exchangeName, frameName });
|
|
609
|
+
return readMaxDrawdownData();
|
|
610
|
+
};
|
|
611
|
+
this.getMaxDrawdownReport = async (symbol, strategyName, exchangeName, frameName) => {
|
|
612
|
+
this.loggerService.log("markdownMockService getMaxDrawdownReport", { symbol, strategyName, exchangeName, frameName });
|
|
613
|
+
return readMaxDrawdown();
|
|
614
|
+
};
|
|
604
615
|
// Schedule
|
|
605
616
|
this.getScheduleData = async (symbol, strategyName, exchangeName, frameName) => {
|
|
606
617
|
this.loggerService.log("markdownMockService getScheduleData", { symbol, strategyName, exchangeName, frameName });
|
|
@@ -1340,6 +1351,21 @@ class MarkdownViewService {
|
|
|
1340
1351
|
}
|
|
1341
1352
|
return await backtestKit.HighestProfit.getReport(symbol, { strategyName, exchangeName, frameName }, backtest);
|
|
1342
1353
|
};
|
|
1354
|
+
// MaxDrawdown
|
|
1355
|
+
this.getMaxDrawdownData = async (symbol, strategyName, exchangeName, frameName, backtest = false) => {
|
|
1356
|
+
this.loggerService.log("markdownViewService getMaxDrawdownData", { symbol, strategyName, exchangeName, frameName, backtest });
|
|
1357
|
+
if (CC_ENABLE_MOCK) {
|
|
1358
|
+
return await this.markdownMockService.getMaxDrawdownData(symbol, strategyName, exchangeName, frameName);
|
|
1359
|
+
}
|
|
1360
|
+
return await backtestKit.MaxDrawdown.getData(symbol, { strategyName, exchangeName, frameName }, backtest);
|
|
1361
|
+
};
|
|
1362
|
+
this.getMaxDrawdownReport = async (symbol, strategyName, exchangeName, frameName, backtest = false) => {
|
|
1363
|
+
this.loggerService.log("markdownViewService getMaxDrawdownReport", { symbol, strategyName, exchangeName, frameName, backtest });
|
|
1364
|
+
if (CC_ENABLE_MOCK) {
|
|
1365
|
+
return await this.markdownMockService.getMaxDrawdownReport(symbol, strategyName, exchangeName, frameName);
|
|
1366
|
+
}
|
|
1367
|
+
return await backtestKit.MaxDrawdown.getReport(symbol, { strategyName, exchangeName, frameName }, backtest);
|
|
1368
|
+
};
|
|
1343
1369
|
// Schedule
|
|
1344
1370
|
this.getScheduleData = async (symbol, strategyName, exchangeName, frameName, backtest = false) => {
|
|
1345
1371
|
this.loggerService.log("markdownViewService getScheduleData", { symbol, strategyName, exchangeName, frameName, backtest });
|
|
@@ -3391,6 +3417,34 @@ router$6.post("/api/v1/markdown_mock/highest_profit_report", async (req, res) =>
|
|
|
3391
3417
|
return await micro.send(res, 200, { status: "error", error: functoolsKit.getErrorMessage(error) });
|
|
3392
3418
|
}
|
|
3393
3419
|
});
|
|
3420
|
+
router$6.post("/api/v1/markdown_mock/max_drawdown_data", async (req, res) => {
|
|
3421
|
+
try {
|
|
3422
|
+
const request = await micro.json(req);
|
|
3423
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName } = request;
|
|
3424
|
+
const data = await ioc.markdownMockService.getMaxDrawdownData(symbol, strategyName, exchangeName, frameName);
|
|
3425
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3426
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_data ok", { request, result: omit(result, "data") });
|
|
3427
|
+
return await micro.send(res, 200, result);
|
|
3428
|
+
}
|
|
3429
|
+
catch (error) {
|
|
3430
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_data error", { error: functoolsKit.errorData(error) });
|
|
3431
|
+
return await micro.send(res, 200, { status: "error", error: functoolsKit.getErrorMessage(error) });
|
|
3432
|
+
}
|
|
3433
|
+
});
|
|
3434
|
+
router$6.post("/api/v1/markdown_mock/max_drawdown_report", async (req, res) => {
|
|
3435
|
+
try {
|
|
3436
|
+
const request = await micro.json(req);
|
|
3437
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName } = request;
|
|
3438
|
+
const data = await ioc.markdownMockService.getMaxDrawdownReport(symbol, strategyName, exchangeName, frameName);
|
|
3439
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3440
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_report ok", { request, result: omit(result, "data") });
|
|
3441
|
+
return await micro.send(res, 200, result);
|
|
3442
|
+
}
|
|
3443
|
+
catch (error) {
|
|
3444
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_report error", { error: functoolsKit.errorData(error) });
|
|
3445
|
+
return await micro.send(res, 200, { status: "error", error: functoolsKit.getErrorMessage(error) });
|
|
3446
|
+
}
|
|
3447
|
+
});
|
|
3394
3448
|
router$6.post("/api/v1/markdown_mock/schedule_data", async (req, res) => {
|
|
3395
3449
|
try {
|
|
3396
3450
|
const request = await micro.json(req);
|
|
@@ -3731,6 +3785,34 @@ router$5.post("/api/v1/markdown_view/highest_profit_report", async (req, res) =>
|
|
|
3731
3785
|
return await micro.send(res, 200, { status: "error", error: functoolsKit.getErrorMessage(error) });
|
|
3732
3786
|
}
|
|
3733
3787
|
});
|
|
3788
|
+
router$5.post("/api/v1/markdown_view/max_drawdown_data", async (req, res) => {
|
|
3789
|
+
try {
|
|
3790
|
+
const request = await micro.json(req);
|
|
3791
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName, backtest } = request;
|
|
3792
|
+
const data = await ioc.markdownViewService.getMaxDrawdownData(symbol, strategyName, exchangeName, frameName, backtest);
|
|
3793
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3794
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_data ok", { request, result: omit(result, "data") });
|
|
3795
|
+
return await micro.send(res, 200, result);
|
|
3796
|
+
}
|
|
3797
|
+
catch (error) {
|
|
3798
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_data error", { error: functoolsKit.errorData(error) });
|
|
3799
|
+
return await micro.send(res, 200, { status: "error", error: functoolsKit.getErrorMessage(error) });
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
3802
|
+
router$5.post("/api/v1/markdown_view/max_drawdown_report", async (req, res) => {
|
|
3803
|
+
try {
|
|
3804
|
+
const request = await micro.json(req);
|
|
3805
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName, backtest } = request;
|
|
3806
|
+
const data = await ioc.markdownViewService.getMaxDrawdownReport(symbol, strategyName, exchangeName, frameName, backtest);
|
|
3807
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3808
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_report ok", { request, result: omit(result, "data") });
|
|
3809
|
+
return await micro.send(res, 200, result);
|
|
3810
|
+
}
|
|
3811
|
+
catch (error) {
|
|
3812
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_report error", { error: functoolsKit.errorData(error) });
|
|
3813
|
+
return await micro.send(res, 200, { status: "error", error: functoolsKit.getErrorMessage(error) });
|
|
3814
|
+
}
|
|
3815
|
+
});
|
|
3734
3816
|
router$5.post("/api/v1/markdown_view/schedule_data", async (req, res) => {
|
|
3735
3817
|
try {
|
|
3736
3818
|
const request = await micro.json(req);
|
package/build/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import finalhandler from 'finalhandler';
|
|
|
6
6
|
import serveHandler from 'serve-handler';
|
|
7
7
|
import os from 'os';
|
|
8
8
|
import { createActivator } from 'di-kit';
|
|
9
|
-
import { alignToInterval, Exchange, Backtest, Live, listExchangeSchema, Notification, Storage, Log, lib, Heat, Strategy, Breakeven, Risk, Partial, HighestProfit, Schedule, Performance, Sync, Walker, StorageLive, StorageBacktest } from 'backtest-kit';
|
|
9
|
+
import { alignToInterval, Exchange, Backtest, Live, listExchangeSchema, Notification, Storage, Log, lib, Heat, Strategy, Breakeven, Risk, Partial, HighestProfit, MaxDrawdown, Schedule, Performance, Sync, Walker, StorageLive, StorageBacktest } from 'backtest-kit';
|
|
10
10
|
import fs, { readdir, readFile } from 'fs/promises';
|
|
11
11
|
import path, { join, dirname } from 'path';
|
|
12
12
|
import mime from 'mime-types';
|
|
@@ -515,6 +515,7 @@ const readBreakeven = makeReader("breakeven.md");
|
|
|
515
515
|
const readRisk = makeReader("risk.md");
|
|
516
516
|
const readPartial = makeReader("partial.md");
|
|
517
517
|
const readHighestProfit = makeReader("highest_profit.md");
|
|
518
|
+
const readMaxDrawdown = makeReader("max_drawdown.md");
|
|
518
519
|
const readSchedule = makeReader("schedule.md");
|
|
519
520
|
const readPerformance = makeReader("performance.md");
|
|
520
521
|
const readSync = makeReader("sync.md");
|
|
@@ -527,6 +528,7 @@ const readBreakevenData = makeDataReader("breakeven.json");
|
|
|
527
528
|
const readRiskData = makeDataReader("risk.json");
|
|
528
529
|
const readPartialData = makeDataReader("partial.json");
|
|
529
530
|
const readHighestProfitData = makeDataReader("highest_profit.json");
|
|
531
|
+
const readMaxDrawdownData = makeDataReader("max_drawdown.json");
|
|
530
532
|
const readScheduleData = makeDataReader("schedule.json");
|
|
531
533
|
const readPerformanceData = makeDataReader("performance.json");
|
|
532
534
|
const readSyncData = makeDataReader("sync.json");
|
|
@@ -598,6 +600,15 @@ class MarkdownMockService {
|
|
|
598
600
|
this.loggerService.log("markdownMockService getHighestProfitReport", { symbol, strategyName, exchangeName, frameName });
|
|
599
601
|
return readHighestProfit();
|
|
600
602
|
};
|
|
603
|
+
// MaxDrawdown
|
|
604
|
+
this.getMaxDrawdownData = async (symbol, strategyName, exchangeName, frameName) => {
|
|
605
|
+
this.loggerService.log("markdownMockService getMaxDrawdownData", { symbol, strategyName, exchangeName, frameName });
|
|
606
|
+
return readMaxDrawdownData();
|
|
607
|
+
};
|
|
608
|
+
this.getMaxDrawdownReport = async (symbol, strategyName, exchangeName, frameName) => {
|
|
609
|
+
this.loggerService.log("markdownMockService getMaxDrawdownReport", { symbol, strategyName, exchangeName, frameName });
|
|
610
|
+
return readMaxDrawdown();
|
|
611
|
+
};
|
|
601
612
|
// Schedule
|
|
602
613
|
this.getScheduleData = async (symbol, strategyName, exchangeName, frameName) => {
|
|
603
614
|
this.loggerService.log("markdownMockService getScheduleData", { symbol, strategyName, exchangeName, frameName });
|
|
@@ -1337,6 +1348,21 @@ class MarkdownViewService {
|
|
|
1337
1348
|
}
|
|
1338
1349
|
return await HighestProfit.getReport(symbol, { strategyName, exchangeName, frameName }, backtest);
|
|
1339
1350
|
};
|
|
1351
|
+
// MaxDrawdown
|
|
1352
|
+
this.getMaxDrawdownData = async (symbol, strategyName, exchangeName, frameName, backtest = false) => {
|
|
1353
|
+
this.loggerService.log("markdownViewService getMaxDrawdownData", { symbol, strategyName, exchangeName, frameName, backtest });
|
|
1354
|
+
if (CC_ENABLE_MOCK) {
|
|
1355
|
+
return await this.markdownMockService.getMaxDrawdownData(symbol, strategyName, exchangeName, frameName);
|
|
1356
|
+
}
|
|
1357
|
+
return await MaxDrawdown.getData(symbol, { strategyName, exchangeName, frameName }, backtest);
|
|
1358
|
+
};
|
|
1359
|
+
this.getMaxDrawdownReport = async (symbol, strategyName, exchangeName, frameName, backtest = false) => {
|
|
1360
|
+
this.loggerService.log("markdownViewService getMaxDrawdownReport", { symbol, strategyName, exchangeName, frameName, backtest });
|
|
1361
|
+
if (CC_ENABLE_MOCK) {
|
|
1362
|
+
return await this.markdownMockService.getMaxDrawdownReport(symbol, strategyName, exchangeName, frameName);
|
|
1363
|
+
}
|
|
1364
|
+
return await MaxDrawdown.getReport(symbol, { strategyName, exchangeName, frameName }, backtest);
|
|
1365
|
+
};
|
|
1340
1366
|
// Schedule
|
|
1341
1367
|
this.getScheduleData = async (symbol, strategyName, exchangeName, frameName, backtest = false) => {
|
|
1342
1368
|
this.loggerService.log("markdownViewService getScheduleData", { symbol, strategyName, exchangeName, frameName, backtest });
|
|
@@ -3388,6 +3414,34 @@ router$6.post("/api/v1/markdown_mock/highest_profit_report", async (req, res) =>
|
|
|
3388
3414
|
return await micro.send(res, 200, { status: "error", error: getErrorMessage(error) });
|
|
3389
3415
|
}
|
|
3390
3416
|
});
|
|
3417
|
+
router$6.post("/api/v1/markdown_mock/max_drawdown_data", async (req, res) => {
|
|
3418
|
+
try {
|
|
3419
|
+
const request = await micro.json(req);
|
|
3420
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName } = request;
|
|
3421
|
+
const data = await ioc.markdownMockService.getMaxDrawdownData(symbol, strategyName, exchangeName, frameName);
|
|
3422
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3423
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_data ok", { request, result: omit(result, "data") });
|
|
3424
|
+
return await micro.send(res, 200, result);
|
|
3425
|
+
}
|
|
3426
|
+
catch (error) {
|
|
3427
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_data error", { error: errorData(error) });
|
|
3428
|
+
return await micro.send(res, 200, { status: "error", error: getErrorMessage(error) });
|
|
3429
|
+
}
|
|
3430
|
+
});
|
|
3431
|
+
router$6.post("/api/v1/markdown_mock/max_drawdown_report", async (req, res) => {
|
|
3432
|
+
try {
|
|
3433
|
+
const request = await micro.json(req);
|
|
3434
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName } = request;
|
|
3435
|
+
const data = await ioc.markdownMockService.getMaxDrawdownReport(symbol, strategyName, exchangeName, frameName);
|
|
3436
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3437
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_report ok", { request, result: omit(result, "data") });
|
|
3438
|
+
return await micro.send(res, 200, result);
|
|
3439
|
+
}
|
|
3440
|
+
catch (error) {
|
|
3441
|
+
ioc.loggerService.log("/api/v1/markdown_mock/max_drawdown_report error", { error: errorData(error) });
|
|
3442
|
+
return await micro.send(res, 200, { status: "error", error: getErrorMessage(error) });
|
|
3443
|
+
}
|
|
3444
|
+
});
|
|
3391
3445
|
router$6.post("/api/v1/markdown_mock/schedule_data", async (req, res) => {
|
|
3392
3446
|
try {
|
|
3393
3447
|
const request = await micro.json(req);
|
|
@@ -3728,6 +3782,34 @@ router$5.post("/api/v1/markdown_view/highest_profit_report", async (req, res) =>
|
|
|
3728
3782
|
return await micro.send(res, 200, { status: "error", error: getErrorMessage(error) });
|
|
3729
3783
|
}
|
|
3730
3784
|
});
|
|
3785
|
+
router$5.post("/api/v1/markdown_view/max_drawdown_data", async (req, res) => {
|
|
3786
|
+
try {
|
|
3787
|
+
const request = await micro.json(req);
|
|
3788
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName, backtest } = request;
|
|
3789
|
+
const data = await ioc.markdownViewService.getMaxDrawdownData(symbol, strategyName, exchangeName, frameName, backtest);
|
|
3790
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3791
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_data ok", { request, result: omit(result, "data") });
|
|
3792
|
+
return await micro.send(res, 200, result);
|
|
3793
|
+
}
|
|
3794
|
+
catch (error) {
|
|
3795
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_data error", { error: errorData(error) });
|
|
3796
|
+
return await micro.send(res, 200, { status: "error", error: getErrorMessage(error) });
|
|
3797
|
+
}
|
|
3798
|
+
});
|
|
3799
|
+
router$5.post("/api/v1/markdown_view/max_drawdown_report", async (req, res) => {
|
|
3800
|
+
try {
|
|
3801
|
+
const request = await micro.json(req);
|
|
3802
|
+
const { requestId, serviceName, symbol, strategyName, exchangeName, frameName, backtest } = request;
|
|
3803
|
+
const data = await ioc.markdownViewService.getMaxDrawdownReport(symbol, strategyName, exchangeName, frameName, backtest);
|
|
3804
|
+
const result = { data, status: "ok", error: "", requestId, serviceName };
|
|
3805
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_report ok", { request, result: omit(result, "data") });
|
|
3806
|
+
return await micro.send(res, 200, result);
|
|
3807
|
+
}
|
|
3808
|
+
catch (error) {
|
|
3809
|
+
ioc.loggerService.log("/api/v1/markdown_view/max_drawdown_report error", { error: errorData(error) });
|
|
3810
|
+
return await micro.send(res, 200, { status: "error", error: getErrorMessage(error) });
|
|
3811
|
+
}
|
|
3812
|
+
});
|
|
3731
3813
|
router$5.post("/api/v1/markdown_view/schedule_data", async (req, res) => {
|
|
3732
3814
|
try {
|
|
3733
3815
|
const request = await micro.json(req);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,f as v}from"./index-
|
|
1
|
+
import{c,f as v}from"./index-CG_ibFMd.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-vKerKkRx.js → Background-DDJ7Q4Pm.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as n,b8 as o}from"./index-
|
|
1
|
+
import{f as n,b8 as o}from"./index-CG_ibFMd.js";const d=()=>n(o,{children:"\n body {\n background-color: #ddd !important;\n }\n "});export{d as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bh as e,b as t,r as a,_ as s,f as i,bi as n,e as o,bj as r,h as d,bk as m,g as u,u as p,s as x}from"./index-
|
|
1
|
+
import{bh as e,b as t,r as a,_ as s,f as i,bi as n,e as o,bj as r,h as d,bk as m,g as u,u as p,s as x}from"./index-CG_ibFMd.js";const b=e(),h=["className","component","disableGutters","fixed","maxWidth","classes"],l=m(),c=b("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),f=e=>r({props:e,name:"MuiContainer",defaultTheme:l});const g=function(e={}){const{createStyledComponent:r=c,useThemeProps:m=f,componentName:p="MuiContainer"}=e,x=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const s=a,i=e.breakpoints.values[s];return 0!==i&&(t[e.breakpoints.up(s)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=m(e),{className:b,component:l="div",disableGutters:c=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,h),k=t({},r,{component:l,disableGutters:c,fixed:f,maxWidth:g}),S=((e,t)=>{const{classes:a,fixed:s,disableGutters:i,maxWidth:n}=e,r={root:["root",n&&`maxWidth${o(String(n))}`,s&&"fixed",i&&"disableGutters"]};return d(r,e=>u(t,e),a)})(k,p);return i(x,t({as:l,ownerState:k,className:n(S.root,b),ref:a},W))})}({createStyledComponent:x("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})});export{g as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,v as t,B as r,J as s}from"./index-
|
|
1
|
+
import{f as e,v as t,B as r,J as s}from"./index-CG_ibFMd.js";const o=({className:o,symbol:a,style:i,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[a],l=(null==s?void 0:s.logo)||(null==s?void 0:s.icon),c=(null==s?void 0:s.color)||"#ccc";return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:l?"transparent":c,...n},style:i,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:a,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,r=t.parentElement;r&&(r.style.background=c,t.style.display="none")}}):e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:i,children:e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});export{o as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,f as r}from"./index-
|
|
1
|
+
import{c as o,f as r}from"./index-CG_ibFMd.js";const a=o(r("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");export{a as K};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,f as c}from"./index-
|
|
1
|
+
import{c as s,f as c}from"./index-CG_ibFMd.js";const a=s(c("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");export{a as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as o}from"./index-CG_ibFMd.js";const r=new o;export{r};
|
package/build/modules/frontend/build/assets/{hasRouteMatch-CnhjHmvr.js → hasRouteMatch-Dey0ib7y.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as a,bl as e,bm as t}from"./index-
|
|
1
|
+
import{v as a,bl as e,bm as t}from"./index-CG_ibFMd.js";const o=(o,r=a.routerService.location.pathname)=>!!e(t.filter(({path:a})=>o.includes(a)),r);export{o as h};
|
package/build/modules/frontend/build/assets/{html2canvas-D60qFSRE.js → html2canvas-ClWjPDr-.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,bo as t}from"./index-
|
|
1
|
+
import{m as e,bo as t}from"./index-CG_ibFMd.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,f as o,aS as t,W as i,v as a,t as n,Z as l,o as s,y as r,T as c,aT as p,w as d,B as m,F as u,G as h,H as b,K as y,S as f,N as g,i as k,l as v,L as S,Q as C,r as L,ak as x,ba as w,bb as P,bc as T,bd as V,be as $,bf as M,ac as z,a6 as H,X as N,Y as A,a$ as O,aP as _,az as F,P as I,E,ag as R,bg as j,U as W,aq as D,ar as G,aV as U,as as B,I as Y,at as K,D as X,aX as q}from"./index-D-1_V7j0.js";import{h as J}from"./hasRouteMatch-CnhjHmvr.js";import{I as Q}from"./IconPhoto-OJ8YDbpd.js";import{C as Z}from"./Container-BpsVEc--.js";import{R as ee}from"./Refresh-CWqrXG9u.js";import{K as oe}from"./KeyboardArrowLeft-BasR_jXs.js";const te=e([o("path",{d:"M5 19h14V5H5v14zm4-4h4v-2h-2v-2h2V9H9V7h4c1.1 0 2 .89 2 2v1.5c0 .83-.67 1.5-1.5 1.5.83 0 1.5.67 1.5 1.5V15c0 1.11-.9 2-2 2H9v-2z",opacity:".3"}),o("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-2zm0 16H5V5h14v14zm-4-4v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V9c0-1.11-.9-2-2-2H9v2h4v2h-2v2h2v2H9v2h4c1.1 0 2-.89 2-2z"})],"Looks3TwoTone"),ie=e([o("path",{d:"M19 5H5v14h14V5zm-5 12h-2V9h-2V7h4v10z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm5 4h2v8h2V7h-4z"})],"LooksOneTwoTone"),ae=e([o("path",{d:"M19 5H5v14h14V5zm-4 6c0 1.11-.9 2-2 2h-2v2h4v2H9v-4c0-1.11.9-2 2-2h2V9H9V7h4c1.1 0 2 .89 2 2v2z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm8 2H9v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2h-4v-2h2c1.1 0 2-.89 2-2V9c0-1.11-.9-2-2-2z"})],"LooksTwoTwoTone"),ne="backtest-kit__groupHeader",le="backtest-kit__groupRoot",se="backtest-kit__symbolImage",re=s()({root:{[`& .${le}:hover .${ne}`]:{opacity:"1 !important"}}});function ce(e){return C(e,"#000000")>C(e,"#FFFFFF")}const pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"}],de=[{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],me=e=>({type:h.Group,className:le,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:h.Component,className:ne,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"small",color:"info",label:`${y.bullet} Symbols`,sx:{mb:1,pr:.5,fontSize:"14px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:e.map(({symbol:e,label:t,color:i})=>((e,t,i)=>({type:h.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(`/price_chart/${e.toLowerCase()}`)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${se}`]:{transition:"filter 500ms"},"&:hover":{background:()=>ce(i)?k(i,.33):v(i,.33),[`& .${se}`]:{transition:"filter 500ms",filter:ce(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(Q,{className:se,symbol:e}),children:t})}))(e,t,i))}]}),ue="backtest-kit__groupHeader",he="backtest-kit__groupRoot",be="backtest-kit__symbolImage",ye=s()({root:{[`& .${he}:hover .${ue}`]:{opacity:"1 !important"}}});function fe(e){return C(e,"#000000")>C(e,"#FFFFFF")}const ge=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:e=>String(e).toUpperCase()}],ke=(e,t)=>({type:h.Group,className:he,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:h.Component,className:ue,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"medium",color:"info",label:`${y.bullet} ${e}`,sx:{mb:1,pr:.5,fontSize:"16px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:t.map(({label:e,to:t,color:i,icon:n})=>((e,t,i,n)=>({type:h.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(e)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px",[`& .${be}`]:{transition:"filter 500ms"},"&:hover":{background:()=>fe(i)?k(i,.33):v(i,.33),[`& .${be}`]:{transition:"filter 500ms",filter:fe(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(n,{className:be}),children:t})}))(t,e,i,n))}]}),ve=s()({root:{position:"relative"},tooltip:{position:"absolute",margin:0,left:5,top:5,backgroundColor:"#343434",zIndex:999,color:"white",fontWeight:"bold",padding:"5px 10px",borderRadius:3,fontSize:"12px",pointerEvents:"none",touchAction:"none"}}),Se={layout:{textColor:"#d4d4d8",backgroundColor:"#ffffff"},rightPriceScale:{scaleMargins:{top:.3,bottom:.25}},crosshair:{vertLine:{width:4,color:"#ebe0e301",style:0},horzLine:{visible:!1,labelVisible:!1}},grid:{vertLines:{color:"#f8b3"},horzLines:{color:"#f8b3"}},handleScroll:{vertTouchDrag:!1}},Ce=({height:e,width:t,items:i,position:a,priceOpen:n,priceStopLoss:l,priceTakeProfit:s})=>{const{classes:r}=ve(),c=L.useRef(void 0),[p,d]=L.useState(null);return L.useLayoutEffect(()=>{const{current:o}=c,r=x(o,{...Se,width:t,height:e,crosshair:{mode:w.Normal,vertLine:{labelVisible:!1},horzLine:{visible:!1,labelVisible:!0}},timeScale:{timeVisible:!0,secondsVisible:!0,tickMarkFormatter:e=>{const o=i.find(o=>o.timestamp===Number(e))||i[0];if(!o||!o.timestamp)return"Invalid date";const t=z(o.timestamp);return t.isValid()?t.format("HH:mm:ss"):"Invalid date"}}}),p=r.addLineSeries({lastValueVisible:!1,color:P[400]}),m=i.map(e=>({time:Math.floor(e.timestamp),value:parseFloat(e.close)}));if(p.setData(m),a&&n){const e="long"===a?P[700]:V[700];p.createPriceLine({price:n,color:e,lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"long"===a?"LONG Entry":"SHORT Entry"})}return l&&p.createPriceLine({price:l,color:$[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"SL"}),s&&p.createPriceLine({price:s,color:M[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"TP"}),r.subscribeCrosshairMove(e=>{if(e.time){const o=i.find(o=>o.timestamp===Number(e.time));if(o){const e=z(o.timestamp).format("DD/MM/YYYY HH:mm:ss"),t=H(o.close.toFixed(6));d(`${e}: ${t}`)}else d(null)}else d(null)}),r.timeScale().fitContent(),()=>{r.remove()}},[e,t,i]),o("div",{ref:c,className:r.root,children:p&&o("div",{className:r.tooltip,children:p})})},Le={"1m":"#2979ff","15m":"#f3a43a","1h":"#d500f9"},xe={"1m":"1 minute","15m":"15 minutes","1h":"1 hour"};const we=({symbol:e,interval:t,reloadSubject:n,downloadSubject:l,onInfoClick:s,disableInfo:r,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h,sx:y})=>{const[f,{loading:g,execute:k}]=i(async()=>await a.exchangeViewService.getLastCandles(e,t),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e,t]}),v=N(f);A(()=>n.subscribe(k)),A(()=>l.subscribe(()=>{const{current:o}=v;!function(e,o="data.json"){const t=new Blob([e],{type:"application/json"}),i=window.URL.createObjectURL(t);a.layoutService.downloadFile(i,o)}(JSON.stringify(o,null,2),`${e}-${t}.json`)}));return o(I,{sx:{...y,display:"flex",flexDirection:"column",alignItems:"stretch",overflow:"clip"},children:[o(m,{sx:{background:Le[t]||"#607d8b",minHeight:"48px",display:"flex",alignItems:"center",pl:2,pr:1},children:[o(c,{variant:"h6",sx:{color:"white",fontWeight:"bold",mr:1},children:xe[t]||t}),!!p&&o(b,{variant:"filled",sx:{color:"white"},color:"short"===p?"warning":"success",label:String(p).toUpperCase()}),o(m,{sx:{flex:1}}),o(O,{disabled:r,onClick:s,children:o(_,{style:{color:"white",opacity:r?.5:1}})})]}),o(F,{}),!f||g?o(E,{sx:{height:"100%",width:"100%"}}):o(m,{sx:{position:"relative",flex:1},children:o(R,{style:{position:"absolute"},children:({height:e,width:t})=>o(Ce,{items:f,height:e,width:t,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h})})})]})},Pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:({symbol:e})=>String(e).toUpperCase()},{type:l.Link,action:"back-action",compute:({interval:e})=>String(e).toUpperCase()}],Te=[{action:"download-now",label:"Download",icon:()=>o(r,{icon:X,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],Ve=new W,$e=new W,Me=[{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"symbol",title:"Symbol",readonly:!0,compute:e=>e.symbol||"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"position",title:"Position",readonly:!0,compute:e=>"long"===e.position?"🔵 LONG (profit on rise)":"🟠 SHORT (profit on fall)"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceOpen",title:"Entry",readonly:!0,compute:e=>e.priceOpen?`${H(e.priceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceOpen",title:"Original Entry",readonly:!0,isVisible:e=>null!=e.originalPriceOpen&&e.originalPriceOpen!==e.priceOpen,compute:e=>e.originalPriceOpen?`${H(e.originalPriceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceTakeProfit",title:"Take Profit",readonly:!0,compute:e=>e.priceTakeProfit?`${H(e.priceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceTakeProfit",title:"Original Take Profit",readonly:!0,isVisible:e=>null!=e.originalPriceTakeProfit&&e.originalPriceTakeProfit!==e.priceTakeProfit,compute:e=>e.originalPriceTakeProfit?`${H(e.originalPriceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceStopLoss",title:"Stop Loss",readonly:!0,compute:e=>e.priceStopLoss?`${H(e.priceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceStopLoss",title:"Original Stop Loss",readonly:!0,isVisible:e=>null!=e.originalPriceStopLoss&&e.originalPriceStopLoss!==e.priceStopLoss,compute:e=>e.originalPriceStopLoss?`${H(e.originalPriceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalEntries",title:"Total Entries",readonly:!0,isVisible:e=>null!=e.totalEntries&&e.totalEntries>1,compute:e=>String(e.totalEntries)},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalPartials",title:"Total Closes",readonly:!0,isVisible:e=>null!=e.totalPartials&&e.totalPartials>0,compute:e=>String(e.totalPartials)},{type:h.Component,sx:{mt:2},element:({payload:e})=>o(S,{variant:"outlined",onClick:e.handleClose,children:"Back"})}],ze=[{id:"chart",element:({params:e})=>{const t=j(()=>({symbol:String(e.symbol).toUpperCase(),interval:e.interval})),[l,{loading:s,execute:r}]=i(async()=>{const o=String(e.symbol).toUpperCase();return await a.signalViewService.getPendingSignal(o)},{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e.symbol]});A(()=>Ve.subscribe(r));const c=L.useMemo(()=>l?l.priceTakeProfit:0,[l]),p=L.useMemo(()=>l?l.priceStopLoss:0,[l]),d=L.useMemo(()=>l?l.priceOpen:0,[l]),m=L.useMemo(()=>l?l.position:null,[l]),[u,h]=D(null),{pickData:b,setOpen:y,render:g}=G({title:"Info",AfterTitle:({onClose:e})=>o(f,{direction:"row",gap:2,children:[o(B,{onClick:()=>a.layoutService.pickSignal(u.current.id),variant:"outlined",children:"Show Details"}),o(Y,{size:"small",onClick:e,children:o(K,{})})]}),payload:()=>({handleClose(){y(!1)}}),fields:Me,handler:()=>u.current,withActionButton:!1}),k=U(async()=>{l&&(h(l),b(l.id))});return o(Z,{children:[o(n,{items:Pe,actions:Te,payload:t,onAction:async o=>{"back-action"===o&&a.routerService.push(`/price_chart/${e.symbol}`),"update-now"===o&&await Ve.next(),"download-now"===o&&await $e.next()}}),s?null:o(we,{symbol:t.symbol,interval:t.interval,disableInfo:!l,reloadSubject:Ve,downloadSubject:$e,onInfoClick:k,position:m,priceOpen:d,priceStopLoss:p,priceTakeProfit:c,sx:{height:"calc(100dvh - 165px)"}}),g()]})},isActive:e=>J(["/price_chart/:symbol/:interval"],e)},{id:"coin",element:({params:e})=>{const{classes:t}=ye(),i=e.symbol,l=L.useMemo(()=>[{label:"1 minute",to:`/price_chart/${i}/1m`,color:"#2979ff",icon:ie},{label:"15 minutes",to:`/price_chart/${i}/15m`,color:"#f3a43a",icon:ae},{label:"1 hour",to:`/price_chart/${i}/1h`,color:"#d500f9",icon:te}],[i]),s=L.useMemo(()=>[ke("Chart",l)],[l]);return o(Z,{children:[o(n,{items:ge,payload:i,onAction:e=>{"back-action"===e&&a.routerService.push("/price_chart")}}),o(d,{className:t.root,fields:s}),o(m,{paddingBottom:"24px"})]})},isActive:e=>J(["/price_chart/:symbol"],e)},{id:"main",element:()=>{const{classes:e}=re(),{reloadTrigger:l,doReload:s}=t(),[r,{loading:h}]=i(async()=>await(async()=>{const[e,o]=await Promise.all([a.symbolGlobalService.getSymbolList(),a.symbolGlobalService.getSymbolMap()]),t=e.map(e=>{const t=o[e];return{symbol:e,label:(null==t?void 0:t.displayName)||e,color:(null==t?void 0:t.color)||"#ccc"}});return t.length?[me(t)]:[]})(),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[l]});return o(Z,{children:[o(n,{items:pe,actions:de,onAction:e=>{"back-action"===e&&a.routerService.push("/"),"update-now"===e&&s()}}),h||!r?o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):r.length?o(u,{children:[o(d,{className:e.root,fields:r},l),o(m,{paddingBottom:"24px"})]}):o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"No symbols found"})})]})},isActive:e=>J(["/price_chart"],e)}],He=({symbol:e,interval:t})=>o(q,{history:a.routerService,onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),routes:ze,params:{symbol:e,interval:t}});export{He as PriceChartPage,He as default};
|
|
1
|
+
import{c as e,f as o,aS as t,W as i,v as a,t as n,Z as l,o as s,y as r,T as c,aT as p,w as d,B as m,F as u,G as h,H as b,K as y,S as f,N as g,i as k,l as v,L as S,Q as C,r as L,ak as x,ba as w,bb as P,bc as T,bd as V,be as $,bf as M,ac as z,a6 as H,X as N,Y as A,a$ as O,aP as _,az as F,P as I,E,ag as R,bg as j,U as W,aq as D,ar as G,aV as U,as as B,I as Y,at as K,D as X,aX as q}from"./index-CG_ibFMd.js";import{h as J}from"./hasRouteMatch-Dey0ib7y.js";import{I as Q}from"./IconPhoto-Cg4v-bGP.js";import{C as Z}from"./Container-z8MK4qnG.js";import{R as ee}from"./Refresh-CpqMl1GA.js";import{K as oe}from"./KeyboardArrowLeft-Qu4ADu24.js";const te=e([o("path",{d:"M5 19h14V5H5v14zm4-4h4v-2h-2v-2h2V9H9V7h4c1.1 0 2 .89 2 2v1.5c0 .83-.67 1.5-1.5 1.5.83 0 1.5.67 1.5 1.5V15c0 1.11-.9 2-2 2H9v-2z",opacity:".3"}),o("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-2zm0 16H5V5h14v14zm-4-4v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V9c0-1.11-.9-2-2-2H9v2h4v2h-2v2h2v2H9v2h4c1.1 0 2-.89 2-2z"})],"Looks3TwoTone"),ie=e([o("path",{d:"M19 5H5v14h14V5zm-5 12h-2V9h-2V7h4v10z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm5 4h2v8h2V7h-4z"})],"LooksOneTwoTone"),ae=e([o("path",{d:"M19 5H5v14h14V5zm-4 6c0 1.11-.9 2-2 2h-2v2h4v2H9v-4c0-1.11.9-2 2-2h2V9H9V7h4c1.1 0 2 .89 2 2v2z",opacity:".3"}),o("path",{d:"M5 21h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2zM5 5h14v14H5V5zm8 2H9v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2h-4v-2h2c1.1 0 2-.89 2-2V9c0-1.11-.9-2-2-2z"})],"LooksTwoTwoTone"),ne="backtest-kit__groupHeader",le="backtest-kit__groupRoot",se="backtest-kit__symbolImage",re=s()({root:{[`& .${le}:hover .${ne}`]:{opacity:"1 !important"}}});function ce(e){return C(e,"#000000")>C(e,"#FFFFFF")}const pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"}],de=[{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],me=e=>({type:h.Group,className:le,sx:{p:2},tabletColumns:"12",desktopColumns:"3",fields:[{type:h.Component,className:ne,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"small",color:"info",label:`${y.bullet} Symbols`,sx:{mb:1,pr:.5,fontSize:"14px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:e.map(({symbol:e,label:t,color:i})=>((e,t,i)=>({type:h.Component,desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(`/price_chart/${e.toLowerCase()}`)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"14px",height:"75px",minHeight:"75px",textWrap:"wrap",padding:"16px",[`& .${se}`]:{transition:"filter 500ms"},"&:hover":{background:()=>ce(i)?k(i,.33):v(i,.33),[`& .${se}`]:{transition:"filter 500ms",filter:ce(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(Q,{className:se,symbol:e}),children:t})}))(e,t,i))}]}),ue="backtest-kit__groupHeader",he="backtest-kit__groupRoot",be="backtest-kit__symbolImage",ye=s()({root:{[`& .${he}:hover .${ue}`]:{opacity:"1 !important"}}});function fe(e){return C(e,"#000000")>C(e,"#FFFFFF")}const ge=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:e=>String(e).toUpperCase()}],ke=(e,t)=>({type:h.Group,className:he,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:h.Component,className:ue,style:{transition:"opacity 500ms",opacity:.5},element:()=>o(f,{direction:"row",children:[o(b,{variant:"outlined",size:"medium",color:"info",label:`${y.bullet} ${e}`,sx:{mb:1,pr:.5,fontSize:"16px",background:"white",cursor:"not-allowed"}}),o(m,{flex:1})]})},{type:h.Group,fields:t.map(({label:e,to:t,color:i,icon:n})=>((e,t,i,n)=>({type:h.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",element:()=>o(S,{component:g,onClick:()=>{a.routerService.push(e)},sx:{width:"100%",background:i,color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px",[`& .${be}`]:{transition:"filter 500ms"},"&:hover":{background:()=>fe(i)?k(i,.33):v(i,.33),[`& .${be}`]:{transition:"filter 500ms",filter:fe(i)?"brightness(0.7) contrast(1.2)":"brightness(1.3) contrast(0.5)"}},transition:"background 500ms"},startIcon:o(n,{className:be}),children:t})}))(t,e,i,n))}]}),ve=s()({root:{position:"relative"},tooltip:{position:"absolute",margin:0,left:5,top:5,backgroundColor:"#343434",zIndex:999,color:"white",fontWeight:"bold",padding:"5px 10px",borderRadius:3,fontSize:"12px",pointerEvents:"none",touchAction:"none"}}),Se={layout:{textColor:"#d4d4d8",backgroundColor:"#ffffff"},rightPriceScale:{scaleMargins:{top:.3,bottom:.25}},crosshair:{vertLine:{width:4,color:"#ebe0e301",style:0},horzLine:{visible:!1,labelVisible:!1}},grid:{vertLines:{color:"#f8b3"},horzLines:{color:"#f8b3"}},handleScroll:{vertTouchDrag:!1}},Ce=({height:e,width:t,items:i,position:a,priceOpen:n,priceStopLoss:l,priceTakeProfit:s})=>{const{classes:r}=ve(),c=L.useRef(void 0),[p,d]=L.useState(null);return L.useLayoutEffect(()=>{const{current:o}=c,r=x(o,{...Se,width:t,height:e,crosshair:{mode:w.Normal,vertLine:{labelVisible:!1},horzLine:{visible:!1,labelVisible:!0}},timeScale:{timeVisible:!0,secondsVisible:!0,tickMarkFormatter:e=>{const o=i.find(o=>o.timestamp===Number(e))||i[0];if(!o||!o.timestamp)return"Invalid date";const t=z(o.timestamp);return t.isValid()?t.format("HH:mm:ss"):"Invalid date"}}}),p=r.addLineSeries({lastValueVisible:!1,color:P[400]}),m=i.map(e=>({time:Math.floor(e.timestamp),value:parseFloat(e.close)}));if(p.setData(m),a&&n){const e="long"===a?P[700]:V[700];p.createPriceLine({price:n,color:e,lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"long"===a?"LONG Entry":"SHORT Entry"})}return l&&p.createPriceLine({price:l,color:$[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"SL"}),s&&p.createPriceLine({price:s,color:M[500],lineWidth:2,lineStyle:T.Solid,axisLabelVisible:!0,title:"TP"}),r.subscribeCrosshairMove(e=>{if(e.time){const o=i.find(o=>o.timestamp===Number(e.time));if(o){const e=z(o.timestamp).format("DD/MM/YYYY HH:mm:ss"),t=H(o.close.toFixed(6));d(`${e}: ${t}`)}else d(null)}else d(null)}),r.timeScale().fitContent(),()=>{r.remove()}},[e,t,i]),o("div",{ref:c,className:r.root,children:p&&o("div",{className:r.tooltip,children:p})})},Le={"1m":"#2979ff","15m":"#f3a43a","1h":"#d500f9"},xe={"1m":"1 minute","15m":"15 minutes","1h":"1 hour"};const we=({symbol:e,interval:t,reloadSubject:n,downloadSubject:l,onInfoClick:s,disableInfo:r,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h,sx:y})=>{const[f,{loading:g,execute:k}]=i(async()=>await a.exchangeViewService.getLastCandles(e,t),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e,t]}),v=N(f);A(()=>n.subscribe(k)),A(()=>l.subscribe(()=>{const{current:o}=v;!function(e,o="data.json"){const t=new Blob([e],{type:"application/json"}),i=window.URL.createObjectURL(t);a.layoutService.downloadFile(i,o)}(JSON.stringify(o,null,2),`${e}-${t}.json`)}));return o(I,{sx:{...y,display:"flex",flexDirection:"column",alignItems:"stretch",overflow:"clip"},children:[o(m,{sx:{background:Le[t]||"#607d8b",minHeight:"48px",display:"flex",alignItems:"center",pl:2,pr:1},children:[o(c,{variant:"h6",sx:{color:"white",fontWeight:"bold",mr:1},children:xe[t]||t}),!!p&&o(b,{variant:"filled",sx:{color:"white"},color:"short"===p?"warning":"success",label:String(p).toUpperCase()}),o(m,{sx:{flex:1}}),o(O,{disabled:r,onClick:s,children:o(_,{style:{color:"white",opacity:r?.5:1}})})]}),o(F,{}),!f||g?o(E,{sx:{height:"100%",width:"100%"}}):o(m,{sx:{position:"relative",flex:1},children:o(R,{style:{position:"absolute"},children:({height:e,width:t})=>o(Ce,{items:f,height:e,width:t,position:p,priceOpen:d,priceStopLoss:u,priceTakeProfit:h})})})]})},Pe=[{type:l.Link,action:"back-action",label:o(oe,{sx:{display:"block"}})},{type:l.Link,action:"back-action",label:"Main"},{type:l.Link,action:"back-action",label:"Price Chart"},{type:l.Link,action:"back-action",compute:({symbol:e})=>String(e).toUpperCase()},{type:l.Link,action:"back-action",compute:({interval:e})=>String(e).toUpperCase()}],Te=[{action:"download-now",label:"Download",icon:()=>o(r,{icon:X,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>o(r,{icon:ee,color:"#4caf50"})}],Ve=new W,$e=new W,Me=[{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"symbol",title:"Symbol",readonly:!0,compute:e=>e.symbol||"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"position",title:"Position",readonly:!0,compute:e=>"long"===e.position?"🔵 LONG (profit on rise)":"🟠 SHORT (profit on fall)"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceOpen",title:"Entry",readonly:!0,compute:e=>e.priceOpen?`${H(e.priceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceOpen",title:"Original Entry",readonly:!0,isVisible:e=>null!=e.originalPriceOpen&&e.originalPriceOpen!==e.priceOpen,compute:e=>e.originalPriceOpen?`${H(e.originalPriceOpen)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceTakeProfit",title:"Take Profit",readonly:!0,compute:e=>e.priceTakeProfit?`${H(e.priceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceTakeProfit",title:"Original Take Profit",readonly:!0,isVisible:e=>null!=e.originalPriceTakeProfit&&e.originalPriceTakeProfit!==e.priceTakeProfit,compute:e=>e.originalPriceTakeProfit?`${H(e.originalPriceTakeProfit)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"priceStopLoss",title:"Stop Loss",readonly:!0,compute:e=>e.priceStopLoss?`${H(e.priceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"originalPriceStopLoss",title:"Original Stop Loss",readonly:!0,isVisible:e=>null!=e.originalPriceStopLoss&&e.originalPriceStopLoss!==e.priceStopLoss,compute:e=>e.originalPriceStopLoss?`${H(e.originalPriceStopLoss)}$`:"N/A"},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalEntries",title:"Total Entries",readonly:!0,isVisible:e=>null!=e.totalEntries&&e.totalEntries>1,compute:e=>String(e.totalEntries)},{type:h.Text,outlined:!1,desktopColumns:"12",tabletColumns:"12",phoneColumns:"12",name:"totalPartials",title:"Total Closes",readonly:!0,isVisible:e=>null!=e.totalPartials&&e.totalPartials>0,compute:e=>String(e.totalPartials)},{type:h.Component,sx:{mt:2},element:({payload:e})=>o(S,{variant:"outlined",onClick:e.handleClose,children:"Back"})}],ze=[{id:"chart",element:({params:e})=>{const t=j(()=>({symbol:String(e.symbol).toUpperCase(),interval:e.interval})),[l,{loading:s,execute:r}]=i(async()=>{const o=String(e.symbol).toUpperCase();return await a.signalViewService.getPendingSignal(o)},{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[e.symbol]});A(()=>Ve.subscribe(r));const c=L.useMemo(()=>l?l.priceTakeProfit:0,[l]),p=L.useMemo(()=>l?l.priceStopLoss:0,[l]),d=L.useMemo(()=>l?l.priceOpen:0,[l]),m=L.useMemo(()=>l?l.position:null,[l]),[u,h]=D(null),{pickData:b,setOpen:y,render:g}=G({title:"Info",AfterTitle:({onClose:e})=>o(f,{direction:"row",gap:2,children:[o(B,{onClick:()=>a.layoutService.pickSignal(u.current.id),variant:"outlined",children:"Show Details"}),o(Y,{size:"small",onClick:e,children:o(K,{})})]}),payload:()=>({handleClose(){y(!1)}}),fields:Me,handler:()=>u.current,withActionButton:!1}),k=U(async()=>{l&&(h(l),b(l.id))});return o(Z,{children:[o(n,{items:Pe,actions:Te,payload:t,onAction:async o=>{"back-action"===o&&a.routerService.push(`/price_chart/${e.symbol}`),"update-now"===o&&await Ve.next(),"download-now"===o&&await $e.next()}}),s?null:o(we,{symbol:t.symbol,interval:t.interval,disableInfo:!l,reloadSubject:Ve,downloadSubject:$e,onInfoClick:k,position:m,priceOpen:d,priceStopLoss:p,priceTakeProfit:c,sx:{height:"calc(100dvh - 165px)"}}),g()]})},isActive:e=>J(["/price_chart/:symbol/:interval"],e)},{id:"coin",element:({params:e})=>{const{classes:t}=ye(),i=e.symbol,l=L.useMemo(()=>[{label:"1 minute",to:`/price_chart/${i}/1m`,color:"#2979ff",icon:ie},{label:"15 minutes",to:`/price_chart/${i}/15m`,color:"#f3a43a",icon:ae},{label:"1 hour",to:`/price_chart/${i}/1h`,color:"#d500f9",icon:te}],[i]),s=L.useMemo(()=>[ke("Chart",l)],[l]);return o(Z,{children:[o(n,{items:ge,payload:i,onAction:e=>{"back-action"===e&&a.routerService.push("/price_chart")}}),o(d,{className:t.root,fields:s}),o(m,{paddingBottom:"24px"})]})},isActive:e=>J(["/price_chart/:symbol"],e)},{id:"main",element:()=>{const{classes:e}=re(),{reloadTrigger:l,doReload:s}=t(),[r,{loading:h}]=i(async()=>await(async()=>{const[e,o]=await Promise.all([a.symbolGlobalService.getSymbolList(),a.symbolGlobalService.getSymbolMap()]),t=e.map(e=>{const t=o[e];return{symbol:e,label:(null==t?void 0:t.displayName)||e,color:(null==t?void 0:t.color)||"#ccc"}});return t.length?[me(t)]:[]})(),{onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),deps:[l]});return o(Z,{children:[o(n,{items:pe,actions:de,onAction:e=>{"back-action"===e&&a.routerService.push("/"),"update-now"===e&&s()}}),h||!r?o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"Loading..."})}):r.length?o(u,{children:[o(d,{className:e.root,fields:r},l),o(m,{paddingBottom:"24px"})]}):o(p,{children:o(c,{variant:"h6",sx:{opacity:.5},children:"No symbols found"})})]})},isActive:e=>J(["/price_chart"],e)}],He=({symbol:e,interval:t})=>o(q,{history:a.routerService,onLoadStart:()=>a.layoutService.setAppbarLoader(!0),onLoadEnd:()=>a.layoutService.setAppbarLoader(!1),routes:ze,params:{symbol:e,interval:t}});export{He as PriceChartPage,He as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,f as e,aN as t,B as o,S as r,ay as n,T as i,ac as s,H as c,F as l,az as d,P as h,aC as p,aP as u,aQ as w,ao as f,U as b,v as x,ap as g,X as y,av as v,t as m,Z as S,aR as k,aO as L,D as j,y as z}from"./index-
|
|
1
|
+
import{c as a,f as e,aN as t,B as o,S as r,ay as n,T as i,ac as s,H as c,F as l,az as d,P as h,aC as p,aP as u,aQ as w,ao as f,U as b,v as x,ap as g,X as y,av as v,t as m,Z as S,aR as k,aO as L,D as j,y as z}from"./index-CG_ibFMd.js";import{A}from"./Article-DyYNpEtB.js";import{C as R}from"./Container-z8MK4qnG.js";import{R as C}from"./Refresh-CpqMl1GA.js";import{K as H}from"./KeyboardArrowLeft-Qu4ADu24.js";const B=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"),D=a=>{const t={color:"white",fontSize:28};switch(a.type){case"debug":return e(B,{sx:t});case"info":return e(u,{sx:t});case"warn":return e(p,{sx:t});default:return e(A,{sx:t})}},E=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:D(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}})]})})}),F=[{action:"download-action",label:"Download",icon:()=>e(z,{icon:j,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh manually",icon:()=>e(z,{icon:C,color:"#4caf50"})}],M=[{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"}],O=new b,U=()=>{const[a,o]=w(""),{data:r,hasMore:n,loading:i,onSkip:s}=f({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:O}),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:M,actions:F,onAction:async a=>{"back-action"===a&&x.routerService.push("/"),"download-action"===a&&l(),"update-now"===a&&(o(""),await O.next()),"search-action"===a&&(async()=>{const a=await x.layoutService.prompt("Search keyword");if(a)return o(a),void O.next();o(""),O.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(E,{data:a,sx:{mb:1}},a.id))})]})};export{U as LogPage,U as default};
|