Skip to content

Commit f372fc1

Browse files
Merge pull request #53 from ROZ-MOFUMOFU-ME/develop
Develop
2 parents cc01fb8 + 3dc1d88 commit f372fc1

File tree

9 files changed

+1652
-28
lines changed

9 files changed

+1652
-28
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
steps:
106106
- checkout
107107
- node/install:
108-
node-version: "20.12"
108+
node-version: "20.18"
109109
- run:
110110
name: Run build
111111
command: npm install
@@ -121,7 +121,7 @@ jobs:
121121
steps:
122122
- checkout
123123
- node/install:
124-
node-version: "22.0"
124+
node-version: "22.11"
125125
- run:
126126
name: Run build
127127
command: npm install

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
1515
node-version: [16.x, 18.x, 20.x, 22.x]

libs/stats.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,10 +754,10 @@ module.exports = function(logger, portalConfig, poolConfigs){
754754
this.getReadableHashRateString = function(hashrate){
755755
hashrate = (hashrate * 1000000);
756756
if (hashrate < 1000000) {
757-
return '0 Hash/s';
757+
return '0 H/s';
758758
//return (Math.round(hashrate / 1000) / 1000 ).toFixed(2)+' Sol/s';
759759
}
760-
var byteUnits = [' Hash/s', ' KHash/s', ' MHash/s', ' GHash/s', ' THash/s', ' PHash/s', ' EHash/s', ' ZHash/s', ' YHash/s' ];
760+
var byteUnits = [' H/s', ' KH/s', ' MH/s', ' GH/s', ' TH/s', ' PH/s', ' EH/s', ' ZH/s', ' YH/s' ];
761761
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
762762
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
763763
return hashrate.toFixed(2) + byteUnits[i];
@@ -766,8 +766,8 @@ module.exports = function(logger, portalConfig, poolConfigs){
766766
function getReadableNetworkHashRateString(hashrate) {
767767
hashrate = (hashrate * 1000000);
768768
if (hashrate < 1000000)
769-
return '0 Hash/s';
770-
var byteUnits = [' Hash/s', ' KHash/s', ' MHash/s', ' GHash/s', ' THash/s', ' PHash/s', ' EHash/s', ' ZHash/s', ' YHash/s' ];
769+
return '0 H/s';
770+
var byteUnits = [' H/s', ' KH/s', ' MH/s', ' GH/s', ' TH/s', ' PH/s', ' EH/s', ' ZH/s', ' YH/s' ];
771771
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
772772
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
773773
return hashrate.toFixed(2) + byteUnits[i];

libs/website.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var redis = require('redis');
88

99
var dot = require('dot');
1010
var express = require('express');
11-
var bodyParser = require('body-parser');
1211
var compress = require('compression');
1312

1413
var Stratum = require('stratum-pool');
@@ -284,8 +283,8 @@ module.exports = function(logger){
284283

285284
var app = express();
286285

287-
288-
app.use(bodyParser.json());
286+
app.use(express.json());
287+
app.use(express.urlencoded({ extended: true }));
289288

290289
app.get('/get_page', function(req, res, next){
291290
var requestedPage = getPage(req.query.id);
@@ -315,7 +314,7 @@ module.exports = function(logger){
315314
if (portalConfig.website.adminCenter.password === req.body.password)
316315
portalApi.handleAdminApiRequest(req, res, next);
317316
else
318-
res.send(401, JSON.stringify({error: 'Incorrect Password'}));
317+
res.status(401).json({error: 'Incorrect Password'});
319318

320319
}
321320
else
@@ -328,7 +327,7 @@ module.exports = function(logger){
328327

329328
app.use(function(err, req, res, next){
330329
console.error(err.stack);
331-
res.send(500, 'Something broke!');
330+
res.status(500).send('Something broke!');
332331
});
333332

334333
try {

0 commit comments

Comments
 (0)