Skip to content

Commit

Permalink
Merge pull request #53 from ROZ-MOFUMOFU-ME/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ROZ-MOFUMOFU-ME authored Nov 6, 2024
2 parents cc01fb8 + 3dc1d88 commit f372fc1
Show file tree
Hide file tree
Showing 9 changed files with 1,652 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
steps:
- checkout
- node/install:
node-version: "20.12"
node-version: "20.18"
- run:
name: Run build
command: npm install
Expand All @@ -121,7 +121,7 @@ jobs:
steps:
- checkout
- node/install:
node-version: "22.0"
node-version: "22.11"
- run:
name: Run build
command: npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
Expand Down
8 changes: 4 additions & 4 deletions libs/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,10 @@ module.exports = function(logger, portalConfig, poolConfigs){
this.getReadableHashRateString = function(hashrate){
hashrate = (hashrate * 1000000);
if (hashrate < 1000000) {
return '0 Hash/s';
return '0 H/s';
//return (Math.round(hashrate / 1000) / 1000 ).toFixed(2)+' Sol/s';
}
var byteUnits = [' Hash/s', ' KHash/s', ' MHash/s', ' GHash/s', ' THash/s', ' PHash/s', ' EHash/s', ' ZHash/s', ' YHash/s' ];
var byteUnits = [' H/s', ' KH/s', ' MH/s', ' GH/s', ' TH/s', ' PH/s', ' EH/s', ' ZH/s', ' YH/s' ];
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
return hashrate.toFixed(2) + byteUnits[i];
Expand All @@ -766,8 +766,8 @@ module.exports = function(logger, portalConfig, poolConfigs){
function getReadableNetworkHashRateString(hashrate) {
hashrate = (hashrate * 1000000);
if (hashrate < 1000000)
return '0 Hash/s';
var byteUnits = [' Hash/s', ' KHash/s', ' MHash/s', ' GHash/s', ' THash/s', ' PHash/s', ' EHash/s', ' ZHash/s', ' YHash/s' ];
return '0 H/s';
var byteUnits = [' H/s', ' KH/s', ' MH/s', ' GH/s', ' TH/s', ' PH/s', ' EH/s', ' ZH/s', ' YH/s' ];
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
return hashrate.toFixed(2) + byteUnits[i];
Expand Down
9 changes: 4 additions & 5 deletions libs/website.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var redis = require('redis');

var dot = require('dot');
var express = require('express');
var bodyParser = require('body-parser');
var compress = require('compression');

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

var app = express();


app.use(bodyParser.json());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

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

}
else
Expand All @@ -328,7 +327,7 @@ module.exports = function(logger){

app.use(function(err, req, res, next){
console.error(err.stack);
res.send(500, 'Something broke!');
res.status(500).send('Something broke!');
});

try {
Expand Down
Loading

0 comments on commit f372fc1

Please sign in to comment.