Small improvements on the mining page UX

- INDEXING_BLOCKS_AMOUNT = 0 disable indexing, INDEXING_BLOCKS_AMOUNT = -1 indexes everything
- Show only available timespan in the mining page according to available datas
- Change default INDEXING_BLOCKS_AMOUNT to 1100

Don't use unfiltered mysql user input

Enable http cache header for mining pools (1 min)
This commit is contained in:
nymkappa
2022-01-25 18:33:46 +09:00
parent 2c31fe6328
commit 6e61de3a96
20 changed files with 183 additions and 121 deletions

View File

@@ -535,9 +535,9 @@ class Routes {
public async $getPools(req: Request, res: Response) {
try {
let stats = await miningStats.$getPoolsStats(req.query.interval as string);
// res.header('Pragma', 'public');
// res.header('Cache-control', 'public');
// res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString());
res.header('Pragma', 'public');
res.header('Cache-control', 'public');
res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString());
res.json(stats);
} catch (e) {
res.status(500).send(e instanceof Error ? e.message : e);