Show actual operations execution and history

This commit is contained in:
wuyang
2026-11-04 12:22:08 +08:00
parent ac440f5299
commit 204387efa2
4 changed files with 35 additions and 3 deletions
+1
View File
@@ -154,6 +154,7 @@ export function createApp(options = process.env) {
}
if (route.startsWith('/api/')) {
if (!session(req)) return json(res, 401, { error: '请先登录' });
if (req.method === 'GET' && route === '/api/execution') return json(res, 200, await jsonFile('ops-status.json', { schema: 1, observed_at: null, units: [], running_tasks: [], history: [] }));
if (req.method === 'GET' && route === '/api/overview') {
const strategy = await jsonFile('ops-strategy.json', {}), market = await jsonFile('market-latest.json', {});
const short = (v, n = 300) => typeof v === 'string' ? v.slice(0, n) : '';