Polish mining page UI
Make sure to wait for all mining pools queries before continuing
This commit is contained in:
@@ -265,7 +265,7 @@ class Server {
|
||||
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/1y', routes.$getStatisticsByTime.bind(routes, '1y'))
|
||||
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/2y', routes.$getStatisticsByTime.bind(routes, '2y'))
|
||||
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/3y', routes.$getStatisticsByTime.bind(routes, '3y'))
|
||||
.get(config.MEMPOOL.API_URL_PREFIX + 'pools', routes.getPools)
|
||||
.get(config.MEMPOOL.API_URL_PREFIX + 'pools', routes.$getPools)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -532,9 +532,12 @@ class Routes {
|
||||
}
|
||||
}
|
||||
|
||||
public async getPools(req: Request, res: Response) {
|
||||
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.json(stats);
|
||||
} catch (e) {
|
||||
res.status(500).send(e instanceof Error ? e.message : e);
|
||||
|
||||
Reference in New Issue
Block a user