You can nor sort the tables, yay

This commit is contained in:
José Valdiviesso 2017-12-09 03:48:32 +00:00
parent deeef10be3
commit 629ff9762a
55 changed files with 23770 additions and 23634 deletions

0
.gitignore vendored Normal file → Executable file
View File

6
.travis.yml Normal file → Executable file
View File

@ -1,4 +1,4 @@
language: node_js
node_js:
language: node_js
node_js:
- stable

0
README.md Normal file → Executable file
View File

2
app.js Normal file → Executable file
View File

@ -22,7 +22,7 @@ app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'hbs');
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

0
bin/www Normal file → Executable file
View File

0
bin/www-old Normal file → Executable file
View File

1646
db_server/bps.json Normal file → Executable file

File diff suppressed because it is too large Load Diff

470
db_server/dbserver.js Normal file → Executable file
View File

@ -1,232 +1,240 @@
var mongo = require('mongodb');
var request = require('request');
var async = require('async');
var fs = require('fs');
var svurl = "mongodb://localhost:27017/eve-reactor";
var items = require('./items.json');
var systems = require('./systems.json');
var marketUrl = "https://market.fuzzwork.co.uk/aggregates/?region=60003760&types=";
var testMarketUrl = "https://market.fuzzwork.co.uk/aggregates/?region=60003760&types=34,35,36";
//genItems(); //generate base item collection
addDaily();
newUpdateItems();
updateCostIndex();
function getItemID(name) {
for (let i = 0; i < items.length; i++) {
if (items[i].NAME === name) {
return items[i].TypeID;
}
}
}
function getDate() {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
}
var today = yyyy + '/' + mm + '/' + dd;
return today;
}
function getSystem(arr, id) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].solar_system_id === id) {
return arr[i];
}
}
}
function updateCostIndex() {
let esiurl = "https://esi.tech.ccp.is/latest/industry/systems/?datasource=tranquility";
request(esiurl, function(err, res, body) {
let esi = JSON.parse(body);
let sys = [];
for (let i = 0; i < systems.length; i++) {
let temp = {
"updateOne": {
"filter": {
"_id": systems[i].solarSystemID
},
"update": {
"_id": systems[i].solarSystemID,
"name": systems[i].solarSystemName,
"index": getSystem(esi, systems[i].solarSystemID).cost_indices[5].cost_index
}
}
}
sys.push(temp);
}
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('systems').bulkWrite(sys, { "ordered": true, "w": 1 }, function(err, result) {
if (err) throw err;
console.log(result.modifiedCount);
console.log("success!!");
db.close();
});
}
});
});
}
function split50() {
let arr = [];
let tam = items.length;
let itemcounter = 0;
for (let i = 0; i < Math.ceil(items.length / 50); i++) {
let ids = "";
for (let ii = 0; ii < tam; ii++) {
if (ii === 50) break;
ids += items[itemcounter].TypeID;
ids += ",";
itemcounter++;
}
tam -= 50;
ids = ids.slice(0, -1);
arr.push(ids);
}
return arr
}
function genItems() {
idarr = split50();
let itms = [];
async.map(idarr, function(ids, callback) {
request(marketUrl + ids, function(err, res, body) {
callback(null, JSON.parse(body));
});
}, function(err, results) {
let arr = [];
for (let i = 0; i < results.length; i++) {
for (var prop in results[i]) {
arr.push(results[i][prop]);
}
}
for (let ii = 0; ii < arr.length; ii++) {
let temp = {
"_id": items[ii].TypeID,
"name": items[ii].NAME,
"sell": parseFloat(arr[ii].sell.min),
"buy": parseFloat(arr[ii].buy.max),
"med": ((parseFloat(arr[ii].sell.min) + parseFloat(arr[ii].buy.max)) / 2)
}
itms.push(temp);
}
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('items').insertMany(itms, function(err, result) {
if (err) throw err;
console.log("success!!");
db.close();
});
}
});
});
}
function newUpdateItems() {
idarr = split50();
let itms = [];
async.map(idarr, function(ids, callback) {
request(marketUrl + ids, function(err, res, body) {
callback(null, JSON.parse(body));
});
}, function(err, results) {
let arr = [];
for (let i = 0; i < results.length; i++) {
for (var prop in results[i]) {
arr.push(results[i][prop]);
}
}
for (let ii = 0; ii < arr.length; ii++) {
let temp = {
"updateOne": {
"filter": {
"_id": items[ii].TypeID
},
"update": {
"_id": items[ii].TypeID,
"name": items[ii].NAME,
"sell": parseFloat(arr[ii].sell.min),
"buy": parseFloat(arr[ii].buy.max),
"med": ((parseFloat(arr[ii].sell.min) + parseFloat(arr[ii].buy.max)) / 2)
}
}
}
itms.push(temp);
}
updateDB(itms);
});
}
function updateDB(itms) {
console.log("UPDATING DB");
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('items').bulkWrite(itms, { "ordered": true, "w": 1 }, function(err, result) {
if (err) throw err;
console.log(result.modifiedCount);
console.log("success!!");
db.close();
});
}
});
}
function addDaily() { //need to re-write this
let ids = "";
for (let i = 0; i < items.length; i++) {
ids += items[i].TypeID;
ids += ",";
}
ids = ids.slice(0, -1);
request(marketUrl + ids, function(err, res, body) {
let data = JSON.parse(body);
let arr = []
for (var prop in data) {
arr.push(data[prop]);
}
let itms = []
for (let i = 0; i < arr.length; i++) {
let temp = {
_id: parseInt(items[i].TypeID),
"name": items[i].NAME,
"sell": parseFloat(arr[i].sell.min),
"buy": parseFloat(arr[i].buy.max),
"med": ((parseFloat(arr[i].sell.min) + parseFloat(arr[i].buy.max)) / 2)
}
itms.push(temp);
}
var insert = {
"timestamp": getDate(),
itms
}
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('history').insert(insert, function(err, result) {
console.log("success!!");
db.close();
});
}
});
});
var mongo = require('mongodb');
var request = require('request');
var async = require('async');
var fs = require('fs');
var svurl = "mongodb://localhost:27017/eve-reactor";
var items = require('./items.json');
var systems = require('./systems.json');
var marketUrl = "https://market.fuzzwork.co.uk/aggregates/?region=60003760&types=";
var testMarketUrl = "https://market.fuzzwork.co.uk/aggregates/?region=60003760&types=34,35,36";
var cron = require('node-cron');
//genItems(); //generate base item collection
cron.schedule('*/30 * * * *', function() {
console.log("Updating Items!");
newUpdateItems();
console.log("Updating Cost Index!");
updateCostIndex();
});
cron.schedule('10 12 * * *', function() {
console.log("Adding daily price!");
addDaily();
});
function getItemID(name) {
for (let i = 0; i < items.length; i++) {
if (items[i].NAME === name) {
return items[i].TypeID;
}
}
}
function getDate() {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
}
var today = yyyy + '/' + mm + '/' + dd;
return today;
}
function getSystem(arr, id) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].solar_system_id === id) {
return arr[i];
}
}
}
function updateCostIndex() {
let esiurl = "https://esi.tech.ccp.is/latest/industry/systems/?datasource=tranquility";
request(esiurl, function(err, res, body) {
let esi = JSON.parse(body);
let sys = [];
for (let i = 0; i < systems.length; i++) {
let temp = {
"updateOne": {
"filter": {
"_id": systems[i].solarSystemID
},
"update": {
"_id": systems[i].solarSystemID,
"name": systems[i].solarSystemName,
"index": getSystem(esi, systems[i].solarSystemID).cost_indices[5].cost_index
}
}
}
sys.push(temp);
}
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('systems').bulkWrite(sys, { "ordered": true, "w": 1 }, function(err, result) {
if (err) throw err;
console.log(result.modifiedCount);
console.log("Cost Index UPDATED!");
db.close();
});
}
});
});
}
function split50() {
let arr = [];
let tam = items.length;
let itemcounter = 0;
for (let i = 0; i < Math.ceil(items.length / 50); i++) {
let ids = "";
for (let ii = 0; ii < tam; ii++) {
if (ii === 50) break;
ids += items[itemcounter].TypeID;
ids += ",";
itemcounter++;
}
tam -= 50;
ids = ids.slice(0, -1);
arr.push(ids);
}
return arr
}
function genItems() {
idarr = split50();
let itms = [];
async.map(idarr, function(ids, callback) {
request(marketUrl + ids, function(err, res, body) {
callback(null, JSON.parse(body));
});
}, function(err, results) {
let arr = [];
for (let i = 0; i < results.length; i++) {
for (var prop in results[i]) {
arr.push(results[i][prop]);
}
}
for (let ii = 0; ii < arr.length; ii++) {
let temp = {
"_id": items[ii].TypeID,
"name": items[ii].NAME,
"sell": parseFloat(arr[ii].sell.min),
"buy": parseFloat(arr[ii].buy.max),
"med": ((parseFloat(arr[ii].sell.min) + parseFloat(arr[ii].buy.max)) / 2)
}
itms.push(temp);
}
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('items').insertMany(itms, function(err, result) {
if (err) throw err;
console.log("Iems Generated!!");
db.close();
});
}
});
});
}
function newUpdateItems() {
idarr = split50();
let itms = [];
async.map(idarr, function(ids, callback) {
request(marketUrl + ids, function(err, res, body) {
callback(null, JSON.parse(body));
});
}, function(err, results) {
let arr = [];
for (let i = 0; i < results.length; i++) {
for (var prop in results[i]) {
arr.push(results[i][prop]);
}
}
for (let ii = 0; ii < arr.length; ii++) {
let temp = {
"updateOne": {
"filter": {
"_id": items[ii].TypeID
},
"update": {
"_id": items[ii].TypeID,
"name": items[ii].NAME,
"sell": parseFloat(arr[ii].sell.min),
"buy": parseFloat(arr[ii].buy.max),
"med": ((parseFloat(arr[ii].sell.min) + parseFloat(arr[ii].buy.max)) / 2)
}
}
}
itms.push(temp);
}
updateDB(itms);
});
}
function updateDB(itms) {
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('items').bulkWrite(itms, { "ordered": true, "w": 1 }, function(err, result) {
if (err) throw err;
console.log(result.modifiedCount);
console.log("Items Updated!!");
db.close();
});
}
});
}
function addDaily() { //need to re-write this
let ids = "";
for (let i = 0; i < items.length; i++) {
ids += items[i].TypeID;
ids += ",";
}
ids = ids.slice(0, -1);
request(marketUrl + ids, function(err, res, body) {
let data = JSON.parse(body);
let arr = []
for (var prop in data) {
arr.push(data[prop]);
}
let itms = []
for (let i = 0; i < arr.length; i++) {
let temp = {
_id: parseInt(items[i].TypeID),
"name": items[i].NAME,
"sell": parseFloat(arr[i].sell.min),
"buy": parseFloat(arr[i].buy.max),
"med": ((parseFloat(arr[i].sell.min) + parseFloat(arr[i].buy.max)) / 2)
}
itms.push(temp);
}
var insert = {
"timestamp": getDate(),
itms
}
mongo.connect(svurl, function(err, db) {
if (err) {
console.log(err);
} else {
db.collection('history').insert(insert, function(err, result) {
console.log("Daily Added!!");
db.close();
});
}
});
});
}

1016
db_server/items.json Normal file → Executable file

File diff suppressed because it is too large Load Diff

5
db_server/package-lock.json generated Normal file → Executable file
View File

@ -320,6 +320,11 @@
"require_optional": "1.0.1"
}
},
"node-cron": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/node-cron/-/node-cron-1.2.1.tgz",
"integrity": "sha1-jJC8XccjpWKJsHhmVatKHEy2A2g="
},
"oauth-sign": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",

1
db_server/package.json Normal file → Executable file
View File

@ -12,6 +12,7 @@
"async": "^2.6.0",
"fs": "0.0.1-security",
"mongodb": "^2.2.33",
"node-cron": "^1.2.1",
"request": "^2.83.0"
}
}

43444
db_server/systems.json Normal file → Executable file

File diff suppressed because it is too large Load Diff

0
package-lock.json generated Normal file → Executable file
View File

0
package.json Normal file → Executable file
View File

BIN
public/android-icon-144x144.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
public/android-icon-192x192.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
public/android-icon-36x36.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/android-icon-48x48.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/android-icon-72x72.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
public/android-icon-96x96.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
public/apple-icon-114x114.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
public/apple-icon-120x120.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
public/apple-icon-144x144.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
public/apple-icon-152x152.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
public/apple-icon-180x180.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
public/apple-icon-57x57.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
public/apple-icon-60x60.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
public/apple-icon-72x72.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
public/apple-icon-76x76.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
public/apple-icon-precomposed.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
public/apple-icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

2
public/browserconfig.xml Executable file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>

BIN
public/favicon-16x16.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
public/favicon-32x32.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
public/favicon-96x96.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
public/favicon.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

41
public/manifest.json Executable file
View File

@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}

BIN
public/ms-icon-144x144.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
public/ms-icon-150x150.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
public/ms-icon-310x310.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
public/ms-icon-70x70.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

8
public/stylesheets/style.css Normal file → Executable file
View File

@ -17,4 +17,12 @@ a {
line-height: 30px;
/* Vertically center the text there */
background-color: #f5f5f5;
}
.isk::after{
content: " ISK";
}
.col-sm-12{
padding: 0 !important;
}

0
routes/bio.js Normal file → Executable file
View File

55
routes/comp.js Normal file → Executable file
View File

@ -11,7 +11,7 @@ var svurl = "mongodb://localhost:27017/eve-reactor";
function getCostIndex(sys, name) {
for (let i = 0; i < sys.length; i++) {
if (sys[i].name.toUpperCase() === name.toUpperCase()) {
if (sys[i].name.toLowerCase() === name.toLowerCase()) {
return sys[i].index;
}
}
@ -65,15 +65,15 @@ router.get('/', function(req, res, next) {
//set cookies if not found
var ck = req.cookies;
//console.log(ck);
if (!ck.input) { res.cookie('input', 'buy'); var imeth = "buy"; }
if (!ck.output) { res.cookie('output', 'sell'); var ometh = "sell"; }
if (!ck.skill) { res.cookie('skill', 5); var skill = 5; }
if (!ck.facility) { res.cookie('facility', 'large'); var facility = "large"; }
if (!ck.rig) { res.cookie('rig', 1); var rig = 1; var rige = true; }
if (!ck.space) { res.cookie('space', 'null'); var space = "null"; }
if (!ck.indyTax) { res.cookie('indyTax', 0); var indyTax = 0; }
if (!ck.duration) { res.cookie('duration', 10080); var duration = 10080; }
if (!ck.system) { res.cookie('system', 'Basgerin'); var syst = "Basgerin" }
if (!ck.input) { res.cookie('input', 'buy', { maxAge: 31556952000, }); var imeth = "buy"; }
if (!ck.output) { res.cookie('output', 'sell', { maxAge: 31556952000, }); var ometh = "sell"; }
if (!ck.skill) { res.cookie('skill', 5, { maxAge: 31556952000, }); var skill = 5; }
if (!ck.facility) { res.cookie('facility', 'large', { maxAge: 31556952000, }); var facility = "large"; }
if (!ck.rig) { res.cookie('rig', 1, { maxAge: 31556952000, }); var rig = 1; var rige = true; }
if (!ck.space) { res.cookie('space', 'null', { maxAge: 31556952000, }); var space = "null"; }
if (!ck.indyTax) { res.cookie('indyTax', 0, { maxAge: 31556952000, }); var indyTax = 0; }
if (!ck.duration) { res.cookie('duration', 10080, { maxAge: 31556952000, }); var duration = 10080; }
if (!ck.system) { res.cookie('system', 'Basgerin', { maxAge: 31556952000, }); var syst = "Basgerin" }
//set internal vars to use cookie values
if (ck.input.toLowerCase() === "buy" || ck.input.toLowerCase() === "sell") {
@ -119,7 +119,12 @@ router.get('/', function(req, res, next) {
var duration = 10080;
}
if (ck.system) {
var syst = ck.system;
var re = /^[a-zA-Z0-9-]+$/;
if (re.test(ck.system)) {
var syst = ck.system;
} else {
var syst = 'Basgerin';
}
}
//calc bonus with opts
@ -325,9 +330,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.sell - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tibuy + ttax)) / rout.sell)).format('0.00%')
}
if (((rout.sell - tibuy) / rout.sell) > 0) {
if (((rout.sell - (tibuy + ttax)) / rout.sell) > 0) {
temp.pos = true;
} else if (((rout.sell - tibuy) / rout.sell) < 0) {
} else if (((rout.sell - (tibuy + ttax)) / rout.sell) < 0) {
temp.neg = true;
}
} else if (imeth === "buy" && ometh === "buy") {
@ -346,9 +351,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.buy - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.buy - (tibuy + ttax)) / rout.buy)).format('0.00%')
}
if (((rout.buy - tibuy) / rout.buy) > 0) {
if (((rout.buy - (tibuy + ttax)) / rout.buy) > 0) {
temp.pos = true;
} else if (((rout.buy - tibuy) / rout.buy) < 0) {
} else if (((rout.buy - (tibuy + ttax)) / rout.buy) < 0) {
temp.neg = true;
}
} else if (imeth === "sell" && ometh === "sell") {
@ -367,9 +372,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.sell - (tisell + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tisell + ttax)) / rout.sell)).format('0.00%')
}
if (((rout.sell - tisell) / rout.sell) > 0) {
if (((rout.sell - (tisell + ttax)) / rout.sell) > 0) {
temp.pos = true;
} else if (((rout.sell - tisell) / rout.sell) < 0) {
} else if (((rout.sell - (tisell + ttax)) / rout.sell) < 0) {
temp.neg = true;
}
} else if (imeth === "sell" && ometh === "buy") {
@ -388,9 +393,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.buy - (tisell + ttax)).format('0,0.00'),
"per": numeral(((rout.buy - (tisell + ttax)) / rout.buy)).format('0.00%')
}
if (((rout.buy - tisell) / rout.buy) > 0) {
if (((rout.buy - (tisell + ttax)) / rout.buy) > 0) {
temp.pos = true;
} else if (((rout.buy - tisell) / rout.buy) < 0) {
} else if (((rout.buy - (tisell + ttax)) / rout.buy) < 0) {
temp.neg = true;
}
} else if (ometh === "buy") {
@ -409,9 +414,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.buy - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.buy - (tibuy + ttax)) / rout.buy)).format('0.00%')
}
if (((rout.buy - tibuy) / rout.buy) > 0) {
if (((rout.buy - (tibuy + ttax)) / rout.buy) > 0) {
temp.pos = true;
} else if (((rout.buy - tibuy) / rout.buy) < 0) {
} else if (((rout.buy - (tibuy + ttax)) / rout.buy) < 0) {
temp.neg = true;
}
} else if (imeth === "sell") {
@ -430,9 +435,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.sell - (tisell + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tisell + ttax)) / rout.sell)).format('0.00%')
}
if (((rout.sell - tisell) / rout.sell) > 0) {
if (((rout.sell - (tisell + ttax)) / rout.sell) > 0) {
temp.pos = true;
} else if (((rout.sell - tisell) / rout.sell) < 0) {
} else if (((rout.sell - (tisell + ttax)) / rout.sell) < 0) {
temp.neg = true;
}
} else { //default I BUY / S SELL
@ -451,9 +456,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.sell - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tibuy + ttax)) / rout.sell)).format('0.00%')
}
if (((rout.sell - tibuy) / rout.sell) > 0) {
if (((rout.sell - (tibuy + ttax)) / rout.sell) > 0) {
temp.pos = true;
} else if (((rout.sell - tibuy) / rout.sell) < 0) {
} else if (((rout.sell - (tibuy + ttax)) / rout.sell) < 0) {
temp.neg = true;
}
}

0
routes/hyb.js Normal file → Executable file
View File

18
routes/index.js Normal file → Executable file
View File

@ -5,15 +5,15 @@ var router = express.Router();
router.get('/', function(req, res, next) {
//set cookies if not found
var ck = req.cookies;
if (!ck.input) { res.cookie('input', 'buy'); var imeth = "buy"; }
if (!ck.output) { res.cookie('output', 'sell'); var ometh = "sell"; }
if (!ck.skill) { res.cookie('skill', 5); var skill = 5; }
if (!ck.facility) { res.cookie('facility', 'large'); var facility = "large"; }
if (!ck.rig) { res.cookie('rig', 1); var rig = 1; var rige = true; }
if (!ck.space) { res.cookie('space', 'null'); var space = "null"; }
if (!ck.indyTax) { res.cookie('indyTax', 0); var indyTax = 0; }
if (!ck.duration) { res.cookie('duration', 10080); var duration = 10080; }
if (!ck.system) { res.cookie('system', 'Basgerin'); var syst = "Basgerin" }
if (!ck.input) { res.cookie('input', 'buy', { maxAge: 31556952000, }); var imeth = "buy"; }
if (!ck.output) { res.cookie('output', 'sell', { maxAge: 31556952000, }); var ometh = "sell"; }
if (!ck.skill) { res.cookie('skill', 5, { maxAge: 31556952000, }); var skill = 5; }
if (!ck.facility) { res.cookie('facility', 'large', { maxAge: 31556952000, }); var facility = "large"; }
if (!ck.rig) { res.cookie('rig', 1, { maxAge: 31556952000, }); var rig = 1; var rige = true; }
if (!ck.space) { res.cookie('space', 'null', { maxAge: 31556952000, }); var space = "null"; }
if (!ck.indyTax) { res.cookie('indyTax', 0, { maxAge: 31556952000, }); var indyTax = 0; }
if (!ck.duration) { res.cookie('duration', 10080, { maxAge: 31556952000, }); var duration = 10080; }
if (!ck.system) { res.cookie('system', 'Basgerin', { maxAge: 31556952000, }); var syst = "Basgerin" }
//reply
res.render('index', { title: 'EVE Reactions Calculator', root: true });
});

41
routes/set.js Normal file → Executable file
View File

@ -13,47 +13,52 @@ router.get('/set', function(req, res, next) {
let ck = req.query;
if (ck.input.toLowerCase() === "buy" || ck.input.toLowerCase() === "sell") {
res.cookie('input', ck.input.toLowerCase());
res.cookie('input', ck.input.toLowerCase(), { maxAge: 31556952000});
} else {
res.cookie('input', 'buy');
res.cookie('input', 'buy', { maxAge: 31556952000, });
}
if (ck.output.toLowerCase() === "buy" || ck.output.toLowerCase() === "sell") {
res.cookie('output', ck.output.toLowerCase());
res.cookie('output', ck.output.toLowerCase(), { maxAge: 31556952000});
} else {
res.cookie('output', 'sell');
res.cookie('output', 'sell', { maxAge: 31556952000 });
}
if (parseInt(ck.skill) >= 0 && parseInt(ck.skill) <= 5) {
res.cookie('skill', parseInt(ck.skill));
res.cookie('skill', parseInt(ck.skill), { maxAge: 31556952000, });
} else {
res.cookie('skill', 5);
res.cookie('skill', 5, { maxAge: 31556952000, });
}
if (ck.facility.toLowerCase() === "med" || ck.facility.toLowerCase() === "large") {
res.cookie('facility', ck.facility.toLowerCase());
res.cookie('facility', ck.facility.toLowerCase(), { maxAge: 31556952000, });
} else {
res.cookie('facility', 'large');
res.cookie('facility', 'large', { maxAge: 31556952000, });
}
if (parseInt(ck.rig) >= 0 && parseInt(ck.rig) <= 2) {
res.cookie('rig', parseInt(ck.rig));
if (parseInt(ck.rigs) >= 0 && parseInt(ck.rigs) <= 2) {
res.cookie('rig', parseInt(ck.rigs), { maxAge: 31556952000, });
} else {
res.cookie('rig', 1);
res.cookie('rig', 1, { maxAge: 31556952000, });
}
if (ck.space.toLowerCase() === "low" || ck.space.toLowerCase() === "null") {
res.cookie('space', ck.space.toLowerCase());
res.cookie('space', ck.space.toLowerCase(), { maxAge: 31556952000, });
} else {
res.cookie('space', 'null');
res.cookie('space', 'null', { maxAge: 31556952000, });
}
if (parseFloat(ck.indyTax) >= 0 && parseFloat(ck.indyTax) <= 50) {
res.cookie('indyTax', parseFloat(ck.indyTax));
res.cookie('indyTax', parseFloat(ck.indyTax), { maxAge: 31556952000, });
} else {
res.cookie('indyTax', 0);
res.cookie('indyTax', 0, { maxAge: 31556952000, });
}
if (parseInt(ck.duration) >= 1 && parseInt(ck.duration) <= 43200) {
res.cookie('duration', parseInt(ck.duration));
res.cookie('duration', parseInt(ck.duration), { maxAge: 31556952000, });
} else {
res.cookie('duration', 10080);
res.cookie('duration', 10080, { maxAge: 31556952000, });
}
if (ck.system) {
res.cookie('system', ck.system);
var re = /^[a-zA-Z0-9-]+$/;
if (re.test(ck.system)) {
res.cookie('system', ck.system, { maxAge: 31556952000, });
} else {
res.cookie('system', 'Basgerin', { maxAge: 31556952000, });
}
}
//reply

0
views/bio.hbs Normal file → Executable file
View File

254
views/comp.hbs Normal file → Executable file
View File

@ -1,105 +1,149 @@
<div class="container">
<div class="row mt-4">
<table class="table table-sm table-bordered text-center">
<thead>
<th>In Method</th>
<th>Out Method</th>
<th>Reactions</th>
<th>Facility</th>
<th>Rig</th>
<th>Space</th>
<th>System</th>
<th>IndyTax</th>
<th>Build Time</th>
</thead>
<tbody>
<tr class="">
<td>{{sett.input}}</td>
<td>{{sett.output}}</td>
<td>Level {{sett.skill}}</td>
<td>{{sett.facility}} Refinery</td>
<td>T{{sett.rig}} Rig</td>
<td>{{sett.space}}sec</td>
<td>{{sett.system}}</td>
<td>{{sett.indyTax}}</td>
<td>{{sett.duration}} Minutes</td>
</tr>
</tbody>
</table>
</div>
<div class="row mt-3">
<table class="table table-bordered text-center">
<tbody>
<tr>
<td class="bg-info text-white text-center" id="simple" colspan="7">Simple Reactions</td>
</tr>
<tr>
<th scope="col">Reaction</th>
<th scope="col">Inputs</th>
<th scope="col">Tax</th>
<th scope="col">Output</th>
<th scope="col">Profit</th>
<th scope="col">% prof</th>
</tr>
{{#stable}}
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}">
<td>{{name}}</td>
<td>{{i}} ISK</td>
<td>{{tax}} ISK</td>
<td>{{o}} ISK</td>
<td>{{prof}} ISK</td>
<td>{{per}}</td>
</tr>
{{/stable}}
<tr>
<td class="" colspan="7"></td>
</tr>
<tr>
<td class="bg-info text-white text-center" id="complex" colspan="7">Complex Reactions</td>
</tr>
<tr>
<th scope="col">Reaction</th>
<th scope="col">Inputs</th>
<th scope="col">Tax</th>
<th scope="col">Output</th>
<th scope="col">Profit</th>
<th scope="col">% prof</th>
</tr>
{{#ctable}}
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}">
<td>{{name}}</td>
<td>{{i}} ISK</td>
<td>{{tax}} ISK</td>
<td>{{o}} ISK</td>
<td>{{prof}} ISK</td>
<td>{{per}}</td>
</tr>
{{/ctable}}
<tr>
<td class="" colspan="7"></td>
</tr>
<tr>
<td class="bg-info text-white text-center" id="chain" colspan="7">Complex Chain Reactions</td>
</tr>
<tr>
<th scope="col">Reaction</th>
<th scope="col">Inputs</th>
<th scope="col">Tax</th>
<th scope="col">Output</th>
<th scope="col">Profit</th>
<th scope="col">% prof</th>
</tr>
{{#chtable}}
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}">
<td>{{name}}</td>
<td>{{i}} ISK</td>
<td>{{tax}} ISK</td>
<td>{{o}} ISK</td>
<td>{{prof}} ISK</td>
<td>{{per}}</td>
</tr>
{{/chtable}}
</tbody>
</table>
</div>
</div>
<script>
$(document).ready(function() {
$('#stab').DataTable( {
searching: false,
info: false,
paging: false,
columnsDefs: [
null,
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
null
]
} );
$('#ctab').DataTable( {
searching: false,
info: false,
paging: false,
columnsDefs: [
null,
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
null
]
} );
$('#chtab').DataTable( {
searching: false,
info: false,
paging: false,
columnsDefs: [
null,
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
null
]
} );
});
</script>
<div class="container">
<div class="row mt-4">
<table class="table table-sm table-bordered text-center">
<thead>
<th>In Method</th>
<th>Out Method</th>
<th>Reactions</th>
<th>Facility</th>
<th>Rig</th>
<th>Space</th>
<th>System</th>
<th>IndyTax</th>
<th>Build Time</th>
</thead>
<tbody>
<tr class="">
<td>{{sett.input}}</td>
<td>{{sett.output}}</td>
<td>Level {{sett.skill}}</td>
<td>{{sett.facility}} Refinery</td>
<td>T{{sett.rig}} Rig</td>
<td>{{sett.space}}sec</td>
<td>{{sett.system}}</td>
<td>{{sett.indyTax}}</td>
<td>{{sett.duration}} Minutes</td>
</tr>
</tbody>
</table>
</div>
<div class="row mt-3">
<h5 class="bg-info text-white text-center w-100 p-2">Simple Reactions</h5>
<table width="100%" id="stab" class="table table-bordered text-center">
<thead>
<th>Reaction</th>
<th>Inputs</th>
<th>Tax</th>
<th>Output</th>
<th>Profit</th>
<th>% prof.</th>
</thead>
<tbody>
{{#stable}}
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}">
<td>{{name}}</td>
<td class="isk">{{i}}</td>
<td class="isk">{{tax}}</td>
<td class="isk">{{o}}</td>
<td class="isk">{{prof}}</td>
<td>{{per}}</td>
</tr>
{{/stable}}
</tbody>
</table>
<h5 class="bg-info text-white text-center w-100 p-2 mt-3">Complex Reactions</h5>
<table width="100%" id="ctab" class="table table-bordered text-center">
<thead>
<th>Reaction</th>
<th>Inputs</th>
<th>Tax</th>
<th>Output</th>
<th>Profit</th>
<th>% prof.</th>
</thead>
<tbody>
{{#ctable}}
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}">
<td>{{name}}</td>
<td class="isk">{{i}}</td>
<td class="isk">{{tax}}</td>
<td class="isk">{{o}}</td>
<td class="isk">{{prof}}</td>
<td>{{per}}</td>
</tr>
{{/ctable}}
</tbody>
</table>
<h5 class="bg-info text-white text-center w-100 p-2 mt-3">Complex Chain Reactions</h5>
<table width="100%" id="chtab" class="table table-bordered text-center">
<thead>
<th>Reaction</th>
<th>Inputs</th>
<th>Tax</th>
<th>Output</th>
<th>Profit</th>
<th>% prof.</th>
</thead>
<tbody>
{{#chtable}}
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}">
<td>{{name}}</td>
<td class="isk">{{i}}</td>
<td class="isk">{{tax}}</td>
<td class="isk">{{o}}</td>
<td class="isk">{{prof}}</td>
<td>{{per}}</td>
</tr>
{{/chtable}}
</tbody>
</table>
</div>
</div>

0
views/error.hbs Normal file → Executable file
View File

0
views/hyb.hbs Normal file → Executable file
View File

0
views/index.hbs Normal file → Executable file
View File

12
views/layout.hbs Normal file → Executable file
View File

@ -16,12 +16,24 @@
<meta name="author" content="Oxed G">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{{title}}</title>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.0/js/dataTables.responsive.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.0/js/responsive.bootstrap4.min.js"></script>
<link rel="stylesheet" href="/stylesheets/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/responsive/2.2.0/css/responsive.bootstrap4.min.css"/>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">

9
views/reac.hbs Executable file
View File

@ -0,0 +1,9 @@
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h1 class="mt-5">A Bootstrap 4 Starter Template</h1>
<p class="lead">{{reac}}</p>
</ul>
</div>
</div>
</div>

374
views/set.hbs Normal file → Executable file
View File

@ -1,188 +1,188 @@
<div class="container">
<div class="row mt-4">
<div class="col-lg-8">
<h4 class="">New Settings:</h3>
<form class="mt-4" action="/settings/set" method="get">
<div class="form-group row">
<label class="col-4">Input Method</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="input" type="radio" class="custom-control-input" value="sell" aria-describedby="inputHelpBlock" required="required" {{#ifCond sett.input 'sell'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Sell order</span>
</label>
<label class="custom-control custom-radio">
<input name="input" type="radio" class="custom-control-input" value="buy" aria-describedby="inputHelpBlock" required="required" {{#ifCond sett.input 'buy'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Buy order</span>
</label>
<span id="inputHelpBlock" class="form-text text-muted">How you are getting your input materials</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Output Method</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="output" type="radio" class="custom-control-input" value="sell" aria-describedby="outputHelpBlock" required="required" {{#ifCond sett.output 'sell'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Sell order</span>
</label>
<label class="custom-control custom-radio">
<input name="output" type="radio" class="custom-control-input" value="buy" aria-describedby="outputHelpBlock" required="required" {{#ifCond sett.output 'buy'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Buy order</span>
</label>
<span id="outputHelpBlock" class="form-text text-muted">How you are selling your output materials</span>
</div>
</div>
<div class="form-group row">
<label for="skill" class="col-4 col-form-label">Reactions Skill Level</label>
<div class="col-8">
<select id="skill" name="skill" class="custom-select" aria-describedby="skillHelpBlock" required="required">
<option value="0" {{#ifCond sett.skill '0'}}selected="selected"{{/ifCond}}>0</option>
<option value="1" {{#ifCond sett.skill '1'}}selected="selected"{{/ifCond}}>1</option>
<option value="2" {{#ifCond sett.skill '2'}}selected="selected"{{/ifCond}}>2</option>
<option value="3" {{#ifCond sett.skill '3'}}selected="selected"{{/ifCond}}>3</option>
<option value="4" {{#ifCond sett.skill '4'}}selected="selected"{{/ifCond}}>4</option>
<option value="5" {{#ifCond sett.skill '5'}}selected="selected"{{/ifCond}}>5</option>
</select>
<span id="skillHelpBlock" class="form-text text-muted">What is your reactions skill level at</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Facility Size</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="facility" type="radio" class="custom-control-input" value="med" aria-describedby="facilityHelpBlock" required="required" {{#ifCond sett.facility 'med'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Medium</span>
</label>
<label class="custom-control custom-radio">
<input name="facility" type="radio" class="custom-control-input" value="large" aria-describedby="facilityHelpBlock" required="required" {{#ifCond sett.facility 'large'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Large</span>
</label>
<span id="facilityHelpBlock" class="form-text text-muted">Are you using a med or large refinery</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Rigs installed</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="rigs" type="radio" class="custom-control-input" value="0" aria-describedby="rigsHelpBlock" required="required" {{#ifCond sett.rig '0'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">None</span>
</label>
<label class="custom-control custom-radio">
<input name="rigs" type="radio" class="custom-control-input" value="1" aria-describedby="rigsHelpBlock" required="required" {{#ifCond sett.rig '1'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Tech 1</span>
</label>
<label class="custom-control custom-radio">
<input name="rigs" type="radio" class="custom-control-input" value="2" aria-describedby="rigsHelpBlock" required="required" {{#ifCond sett.rig '2'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Tech 2</span>
</label>
<span id="rigsHelpBlock" class="form-text text-muted">Does your facility have any rigs for reactions?</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Type of space?</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="space" type="radio" class="custom-control-input" value="null" aria-describedby="spaceHelpBlock" required="required" {{#ifCond sett.space 'null'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Nullsec</span>
</label>
<label class="custom-control custom-radio">
<input name="space" type="radio" class="custom-control-input" value="low" aria-describedby="spaceHelpBlock" required="required" {{#ifCond sett.space 'sell'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Lowsec</span>
</label>
<span id="spaceHelpBlock" class="form-text text-muted">Are you doing reactions in Nullsec or Lowsec?</span>
</div>
</div>
<div class="form-group row">
<label for="system" class="col-4 col-form-label">System</label>
<div class="col-8">
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-home"></i>
</div>
<input id="system" name="system" placeholder="Basgerin" type="text" value="{{sett.system}}" class="form-control here" aria-describedby="systemHelpBlock" required="required">
</div>
<span id="systemHelpBlock" class="form-text text-muted">What system are you doing reactions in? used to calculate cost index</span>
</div>
</div>
<div class="form-group row">
<label for="indyTax" class="col-4 col-form-label">Industry Tax</label>
<div class="col-8">
<div class="input-group">
<input id="indyTax" name="indyTax" placeholder="0" type="number" value="{{sett.indyTax}}" class="form-control here" aria-describedby="indyTaxHelpBlock" required="required">
<div class="input-group-addon append">%</div>
</div>
<span id="indyTaxHelpBlock" class="form-text text-muted">What's your industry tax % ?</span>
</div>
</div>
<div class="form-group row">
<label for="duration" class="col-4 col-form-label">Batch build time</label>
<div class="col-8">
<div class="input-group">
<input id="duration" name="duration" placeholder="10080" type="number" value="{{sett.duration}}" class="form-control here" aria-describedby="durationHelpBlock" required="required">
<div class="input-group-addon append">Minutes</div>
</div>
<span id="durationHelpBlock" class="form-text text-muted">Time in minutes each of your jobs is going to run for</span>
</div>
</div>
<div class="form-group row">
<div class="offset-4 col-8">
<button name="submit" type="submit" class="btn btn-primary">Save Settings</button>
</div>
</div>
</form>
</div>
<div class="col-lg-4">
<h4 class="">Current Settings:</h4>
<table class="table table-sm table-bordered mt-4">
<tbody>
<tr>
<th>In Method</th>
<td>{{sett.input}}</td>
</tr>
<tr>
<th>Out Method</th>
<td>{{sett.output}}</td>
</tr>
<tr>
<th>Reactions</th>
<td>Level {{sett.skill}}</td>
</tr>
<tr>
<th>Facility</th>
<td>{{sett.facility}} Refinery</td>
</tr>
<tr>
<th>Rig</th>
<td>T{{sett.rig}} Rig</td>
</tr>
<tr>
<th>Space</th>
<td>{{sett.space}}sec</td>
</tr>
<tr>
<th>System</th>
<td>{{sett.system}}</td>
</tr>
<tr>
<th>IndyTax</th>
<td>{{sett.indyTax}}</td>
</tr>
<tr>
<th>Build Time</th>
<td>{{sett.duration}} Minutes</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container">
<div class="row mt-4">
<div class="col-lg-8">
<h4 class="">New Settings:</h3>
<form class="mt-4" action="/settings/set" method="get">
<div class="form-group row">
<label class="col-4">Input Method</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="input" type="radio" class="custom-control-input" value="sell" aria-describedby="inputHelpBlock" required="required" {{#ifCond sett.input 'sell'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Sell order</span>
</label>
<label class="custom-control custom-radio">
<input name="input" type="radio" class="custom-control-input" value="buy" aria-describedby="inputHelpBlock" required="required" {{#ifCond sett.input 'buy'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Buy order</span>
</label>
<span id="inputHelpBlock" class="form-text text-muted">How you are getting your input materials</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Output Method</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="output" type="radio" class="custom-control-input" value="sell" aria-describedby="outputHelpBlock" required="required" {{#ifCond sett.output 'sell'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Sell order</span>
</label>
<label class="custom-control custom-radio">
<input name="output" type="radio" class="custom-control-input" value="buy" aria-describedby="outputHelpBlock" required="required" {{#ifCond sett.output 'buy'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Buy order</span>
</label>
<span id="outputHelpBlock" class="form-text text-muted">How you are selling your output materials</span>
</div>
</div>
<div class="form-group row">
<label for="skill" class="col-4 col-form-label">Reactions Skill Level</label>
<div class="col-8">
<select id="skill" name="skill" class="custom-select" aria-describedby="skillHelpBlock" required="required">
<option value="0" {{#ifCond sett.skill '0'}}selected="selected"{{/ifCond}}>0</option>
<option value="1" {{#ifCond sett.skill '1'}}selected="selected"{{/ifCond}}>1</option>
<option value="2" {{#ifCond sett.skill '2'}}selected="selected"{{/ifCond}}>2</option>
<option value="3" {{#ifCond sett.skill '3'}}selected="selected"{{/ifCond}}>3</option>
<option value="4" {{#ifCond sett.skill '4'}}selected="selected"{{/ifCond}}>4</option>
<option value="5" {{#ifCond sett.skill '5'}}selected="selected"{{/ifCond}}>5</option>
</select>
<span id="skillHelpBlock" class="form-text text-muted">What is your reactions skill level at</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Facility Size</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="facility" type="radio" class="custom-control-input" value="med" aria-describedby="facilityHelpBlock" required="required" {{#ifCond sett.facility 'med'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Medium</span>
</label>
<label class="custom-control custom-radio">
<input name="facility" type="radio" class="custom-control-input" value="large" aria-describedby="facilityHelpBlock" required="required" {{#ifCond sett.facility 'large'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Large</span>
</label>
<span id="facilityHelpBlock" class="form-text text-muted">Are you using a med or large refinery</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Rigs installed</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="rigs" type="radio" class="custom-control-input" value="0" aria-describedby="rigsHelpBlock" required="required" {{#ifCond sett.rig '0'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">None</span>
</label>
<label class="custom-control custom-radio">
<input name="rigs" type="radio" class="custom-control-input" value="1" aria-describedby="rigsHelpBlock" required="required" {{#ifCond sett.rig '1'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Tech 1</span>
</label>
<label class="custom-control custom-radio">
<input name="rigs" type="radio" class="custom-control-input" value="2" aria-describedby="rigsHelpBlock" required="required" {{#ifCond sett.rig '2'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Tech 2</span>
</label>
<span id="rigsHelpBlock" class="form-text text-muted">Does your facility have any rigs for reactions?</span>
</div>
</div>
<div class="form-group row">
<label class="col-4">Type of space?</label>
<div class="col-8">
<label class="custom-control custom-radio">
<input name="space" type="radio" class="custom-control-input" value="null" aria-describedby="spaceHelpBlock" required="required" {{#ifCond sett.space 'null'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Nullsec</span>
</label>
<label class="custom-control custom-radio">
<input name="space" type="radio" class="custom-control-input" value="low" aria-describedby="spaceHelpBlock" required="required" {{#ifCond sett.space 'sell'}}checked{{/ifCond}}>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Lowsec</span>
</label>
<span id="spaceHelpBlock" class="form-text text-muted">Are you doing reactions in Nullsec or Lowsec?</span>
</div>
</div>
<div class="form-group row">
<label for="system" class="col-4 col-form-label">System</label>
<div class="col-8">
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-home"></i>
</div>
<input id="system" name="system" placeholder="Basgerin" type="text" value="{{sett.system}}" class="form-control here" aria-describedby="systemHelpBlock" required="required">
</div>
<span id="systemHelpBlock" class="form-text text-muted">What system are you doing reactions in? used to calculate cost index</span>
</div>
</div>
<div class="form-group row">
<label for="indyTax" class="col-4 col-form-label">Industry Tax</label>
<div class="col-8">
<div class="input-group">
<input id="indyTax" name="indyTax" placeholder="0" type="number" step="0.01" value="{{sett.indyTax}}" class="form-control here" aria-describedby="indyTaxHelpBlock" required="required">
<div class="input-group-addon append">%</div>
</div>
<span id="indyTaxHelpBlock" class="form-text text-muted">What's your industry tax % ?</span>
</div>
</div>
<div class="form-group row">
<label for="duration" class="col-4 col-form-label">Batch build time</label>
<div class="col-8">
<div class="input-group">
<input id="duration" name="duration" placeholder="10080" type="number" value="{{sett.duration}}" class="form-control here" aria-describedby="durationHelpBlock" required="required">
<div class="input-group-addon append">Minutes</div>
</div>
<span id="durationHelpBlock" class="form-text text-muted">Time in minutes each of your jobs is going to run for</span>
</div>
</div>
<div class="form-group row">
<div class="offset-4 col-8">
<button name="submit" type="submit" class="btn btn-primary">Save Settings</button>
</div>
</div>
</form>
</div>
<div class="col-lg-4">
<h4 class="">Current Settings:</h4>
<table class="table table-sm table-bordered mt-4">
<tbody>
<tr>
<th>In Method</th>
<td>{{sett.input}}</td>
</tr>
<tr>
<th>Out Method</th>
<td>{{sett.output}}</td>
</tr>
<tr>
<th>Reactions</th>
<td>Level {{sett.skill}}</td>
</tr>
<tr>
<th>Facility</th>
<td>{{sett.facility}} Refinery</td>
</tr>
<tr>
<th>Rig</th>
<td>T{{sett.rig}} Rig</td>
</tr>
<tr>
<th>Space</th>
<td>{{sett.space}}sec</td>
</tr>
<tr>
<th>System</th>
<td>{{sett.system}}</td>
</tr>
<tr>
<th>IndyTax</th>
<td>{{sett.indyTax}}</td>
</tr>
<tr>
<th>Build Time</th>
<td>{{sett.duration}} Minutes</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>