Skip to content

Commit

Permalink
versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
acktarius committed Jun 2, 2023
1 parent 28c1fab commit b6afe28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions controllers/logoutController.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ const minersDB = {
setUsers: function (data) { this.users = data }
}
require('dotenv').config()

const fs = require('fs');
const fsPromises = require('fs').promises
const path = require('path')
const fsPromises = require('fs').promises;
const path = require('path');
const pjson = require('pjson');

const logEvents = require('../middleware/logEvents')
const logEvents = require('../middleware/logEvents');
const { remover } = require('../middleware/forMiner/remover');
const deleteOFP = require('../middleware/forMiner/deleteOFP');
const { sysInfo } = require('../middleware/sysInfo');
Expand Down Expand Up @@ -154,7 +156,7 @@ const handleUser = async (req, res) => {
res.render(('settings'), { user: foundUser.username, cpu: "???" , load: "???" , gpu: "???" , tgpu: "???" , wgpu: "???" });
} else {
const infoS = JSON.parse(contents);
res.render(('settings'), { user: foundUser.username, cpu: infoS.cpu , load: infoS.load , gpu: infoS.gpu , tgpu: infoS.temp , wgpu: infoS.watt });
res.render(('settings'), { user: foundUser.username, cpu: infoS.cpu , load: infoS.load , gpu: infoS.gpu , tgpu: infoS.temp , wgpu: infoS.watt, version: pjson.version });
}
});
}
Expand Down
12 changes: 6 additions & 6 deletions middleware/serviceCheckRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const minerD = (req, res) => {
Promise.allSettled([guardianRunningP,minerRunningP]).then((results) => {
const gr = JSON.parse(JSON.stringify(results[0]))._settledValueField.slice(0,6);
const mr = JSON.parse(JSON.stringify(results[1]))._settledValueField.slice(0,6);
res.render("minerd", { title: "Miner", minerstatus: mr });
res.render("minerd", { title: "Miner", minerstatus: mr, version: pjson.version });
});
}
//Miner activation
Expand All @@ -52,7 +52,7 @@ const minerA = (req, res) => {
Promise.allSettled([guardianRunningP,minerRunningP]).then((results) => {
const gr = JSON.parse(JSON.stringify(results[0]))._settledValueField.slice(0,6);
const mr = JSON.parse(JSON.stringify(results[1]))._settledValueField.slice(0,6);
res.render("minera", { title: "Miner", minerstatus: mr });
res.render("minera", { title: "Miner", minerstatus: mr, version: pjson.version });
});
}

Expand All @@ -66,7 +66,7 @@ const minerDnext = (req, res, next) => {
if (mr != "active") {
return next();
} else {
res.status(403).render('40x', { erreur: 'unauthorized when miner is running' });
res.status(403).render('40x', { erreur: 'unauthorized when miner is running', version: pjson.version });
}
});
}
Expand All @@ -78,7 +78,7 @@ const guardianD = (req, res) => {
Promise.allSettled([guardianRunningP,minerRunningP]).then((results) => {
const gr = JSON.parse(JSON.stringify(results[0]))._settledValueField.slice(0,6);
const mr = JSON.parse(JSON.stringify(results[1]))._settledValueField.slice(0,6);
res.render("guardiand", { title: "Node", guardianstatus: gr });
res.render("guardiand", { title: "Node", guardianstatus: gr, version: pjson.version });
});
}
//guardian node activation
Expand All @@ -88,7 +88,7 @@ const guardianA = (req, res) => {
Promise.allSettled([guardianRunningP,minerRunningP]).then((results) => {
const gr = JSON.parse(JSON.stringify(results[0]))._settledValueField.slice(0,6);
const mr = JSON.parse(JSON.stringify(results[1]))._settledValueField.slice(0,6);
res.render("guardiana", { title: "Node", guardianstatus: gr });
res.render("guardiana", { title: "Node", guardianstatus: gr, version: pjson.version });
});
}

Expand All @@ -102,7 +102,7 @@ const guardianDnext = (req, res, next) => {
if (gr != "active") {
return next();
} else {
res.status(403).render('40x', { erreur: 'unauthorized when guardian is running' });
res.status(403).render('40x', { erreur: 'unauthorized when guardian is running', version: pjson.version });
}
});
}
Expand Down

0 comments on commit b6afe28

Please sign in to comment.