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 language: node_js
node_js: node_js:
- stable - 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'); app.set('view engine', 'hbs');
// uncomment after placing your favicon in /public // 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(logger('dev'));
app.use(bodyParser.json()); app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false })); 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 mongo = require('mongodb');
var request = require('request'); var request = require('request');
var async = require('async'); var async = require('async');
var fs = require('fs'); var fs = require('fs');
var svurl = "mongodb://localhost:27017/eve-reactor"; var svurl = "mongodb://localhost:27017/eve-reactor";
var items = require('./items.json'); var items = require('./items.json');
var systems = require('./systems.json'); var systems = require('./systems.json');
var marketUrl = "https://market.fuzzwork.co.uk/aggregates/?region=60003760&types="; 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 testMarketUrl = "https://market.fuzzwork.co.uk/aggregates/?region=60003760&types=34,35,36";
var cron = require('node-cron');
//genItems(); //generate base item collection
//genItems(); //generate base item collection
addDaily();
newUpdateItems(); cron.schedule('*/30 * * * *', function() {
updateCostIndex(); console.log("Updating Items!");
newUpdateItems();
function getItemID(name) { console.log("Updating Cost Index!");
for (let i = 0; i < items.length; i++) { updateCostIndex();
if (items[i].NAME === name) { });
return items[i].TypeID;
} cron.schedule('10 12 * * *', function() {
} console.log("Adding daily price!");
} addDaily();
});
function getDate() {
var today = new Date(); function getItemID(name) {
var dd = today.getDate(); for (let i = 0; i < items.length; i++) {
var mm = today.getMonth() + 1; //January is 0! if (items[i].NAME === name) {
return items[i].TypeID;
var yyyy = today.getFullYear(); }
if (dd < 10) { }
dd = '0' + dd; }
}
if (mm < 10) { function getDate() {
mm = '0' + mm; var today = new Date();
} var dd = today.getDate();
var today = yyyy + '/' + mm + '/' + dd; var mm = today.getMonth() + 1; //January is 0!
return today;
} var yyyy = today.getFullYear();
if (dd < 10) {
function getSystem(arr, id) { dd = '0' + dd;
for (let i = 0; i < arr.length; i++) { }
if (arr[i].solar_system_id === id) { if (mm < 10) {
return arr[i]; mm = '0' + mm;
} }
} var today = yyyy + '/' + mm + '/' + dd;
} return today;
}
function updateCostIndex() {
let esiurl = "https://esi.tech.ccp.is/latest/industry/systems/?datasource=tranquility"; function getSystem(arr, id) {
request(esiurl, function(err, res, body) { for (let i = 0; i < arr.length; i++) {
let esi = JSON.parse(body); if (arr[i].solar_system_id === id) {
let sys = []; return arr[i];
for (let i = 0; i < systems.length; i++) { }
let temp = { }
"updateOne": { }
"filter": {
"_id": systems[i].solarSystemID function updateCostIndex() {
}, let esiurl = "https://esi.tech.ccp.is/latest/industry/systems/?datasource=tranquility";
"update": { request(esiurl, function(err, res, body) {
"_id": systems[i].solarSystemID, let esi = JSON.parse(body);
"name": systems[i].solarSystemName, let sys = [];
"index": getSystem(esi, systems[i].solarSystemID).cost_indices[5].cost_index for (let i = 0; i < systems.length; i++) {
} let temp = {
} "updateOne": {
} "filter": {
sys.push(temp); "_id": systems[i].solarSystemID
} },
mongo.connect(svurl, function(err, db) { "update": {
if (err) { "_id": systems[i].solarSystemID,
console.log(err); "name": systems[i].solarSystemName,
} else { "index": getSystem(esi, systems[i].solarSystemID).cost_indices[5].cost_index
db.collection('systems').bulkWrite(sys, { "ordered": true, "w": 1 }, function(err, result) { }
if (err) throw err; }
console.log(result.modifiedCount); }
console.log("success!!"); sys.push(temp);
db.close(); }
}); 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;
function split50() { console.log(result.modifiedCount);
let arr = []; console.log("Cost Index UPDATED!");
let tam = items.length; db.close();
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 += ","; function split50() {
itemcounter++; let arr = [];
} let tam = items.length;
tam -= 50; let itemcounter = 0;
ids = ids.slice(0, -1); for (let i = 0; i < Math.ceil(items.length / 50); i++) {
arr.push(ids); let ids = "";
} for (let ii = 0; ii < tam; ii++) {
return arr if (ii === 50) break;
} ids += items[itemcounter].TypeID;
ids += ",";
function genItems() { itemcounter++;
idarr = split50(); }
let itms = []; tam -= 50;
async.map(idarr, function(ids, callback) { ids = ids.slice(0, -1);
request(marketUrl + ids, function(err, res, body) { arr.push(ids);
callback(null, JSON.parse(body)); }
}); return arr
}, function(err, results) { }
let arr = [];
for (let i = 0; i < results.length; i++) { function genItems() {
for (var prop in results[i]) { idarr = split50();
arr.push(results[i][prop]); let itms = [];
} async.map(idarr, function(ids, callback) {
} request(marketUrl + ids, function(err, res, body) {
for (let ii = 0; ii < arr.length; ii++) { callback(null, JSON.parse(body));
let temp = { });
"_id": items[ii].TypeID, }, function(err, results) {
"name": items[ii].NAME, let arr = [];
"sell": parseFloat(arr[ii].sell.min), for (let i = 0; i < results.length; i++) {
"buy": parseFloat(arr[ii].buy.max), for (var prop in results[i]) {
"med": ((parseFloat(arr[ii].sell.min) + parseFloat(arr[ii].buy.max)) / 2) arr.push(results[i][prop]);
} }
itms.push(temp); }
} for (let ii = 0; ii < arr.length; ii++) {
mongo.connect(svurl, function(err, db) { let temp = {
if (err) { "_id": items[ii].TypeID,
console.log(err); "name": items[ii].NAME,
} else { "sell": parseFloat(arr[ii].sell.min),
db.collection('items').insertMany(itms, function(err, result) { "buy": parseFloat(arr[ii].buy.max),
if (err) throw err; "med": ((parseFloat(arr[ii].sell.min) + parseFloat(arr[ii].buy.max)) / 2)
console.log("success!!"); }
db.close(); itms.push(temp);
}); }
} mongo.connect(svurl, function(err, db) {
}); if (err) {
}); console.log(err);
} } else {
db.collection('items').insertMany(itms, function(err, result) {
function newUpdateItems() { if (err) throw err;
idarr = split50(); console.log("Iems Generated!!");
let itms = []; db.close();
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++) { function newUpdateItems() {
for (var prop in results[i]) { idarr = split50();
arr.push(results[i][prop]); let itms = [];
} async.map(idarr, function(ids, callback) {
} request(marketUrl + ids, function(err, res, body) {
for (let ii = 0; ii < arr.length; ii++) { callback(null, JSON.parse(body));
let temp = { });
"updateOne": { }, function(err, results) {
"filter": { let arr = [];
"_id": items[ii].TypeID for (let i = 0; i < results.length; i++) {
}, for (var prop in results[i]) {
"update": { arr.push(results[i][prop]);
"_id": items[ii].TypeID, }
"name": items[ii].NAME, }
"sell": parseFloat(arr[ii].sell.min), for (let ii = 0; ii < arr.length; ii++) {
"buy": parseFloat(arr[ii].buy.max), let temp = {
"med": ((parseFloat(arr[ii].sell.min) + parseFloat(arr[ii].buy.max)) / 2) "updateOne": {
} "filter": {
} "_id": items[ii].TypeID
} },
itms.push(temp); "update": {
} "_id": items[ii].TypeID,
updateDB(itms); "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)
function updateDB(itms) { }
console.log("UPDATING DB"); }
mongo.connect(svurl, function(err, db) { }
if (err) { itms.push(temp);
console.log(err); }
} else { updateDB(itms);
db.collection('items').bulkWrite(itms, { "ordered": true, "w": 1 }, function(err, result) { });
if (err) throw err; }
console.log(result.modifiedCount);
console.log("success!!"); function updateDB(itms) {
db.close(); 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;
function addDaily() { //need to re-write this console.log(result.modifiedCount);
let ids = ""; console.log("Items Updated!!");
for (let i = 0; i < items.length; i++) { db.close();
ids += items[i].TypeID; });
ids += ","; }
} });
ids = ids.slice(0, -1); }
request(marketUrl + ids, function(err, res, body) { function addDaily() { //need to re-write this
let data = JSON.parse(body); let ids = "";
let arr = [] for (let i = 0; i < items.length; i++) {
for (var prop in data) { ids += items[i].TypeID;
arr.push(data[prop]); ids += ",";
} }
let itms = [] ids = ids.slice(0, -1);
for (let i = 0; i < arr.length; i++) {
let temp = { request(marketUrl + ids, function(err, res, body) {
_id: parseInt(items[i].TypeID), let data = JSON.parse(body);
"name": items[i].NAME, let arr = []
"sell": parseFloat(arr[i].sell.min), for (var prop in data) {
"buy": parseFloat(arr[i].buy.max), arr.push(data[prop]);
"med": ((parseFloat(arr[i].sell.min) + parseFloat(arr[i].buy.max)) / 2) }
} let itms = []
itms.push(temp); for (let i = 0; i < arr.length; i++) {
} let temp = {
var insert = { _id: parseInt(items[i].TypeID),
"timestamp": getDate(), "name": items[i].NAME,
itms "sell": parseFloat(arr[i].sell.min),
} "buy": parseFloat(arr[i].buy.max),
mongo.connect(svurl, function(err, db) { "med": ((parseFloat(arr[i].sell.min) + parseFloat(arr[i].buy.max)) / 2)
if (err) { }
console.log(err); itms.push(temp);
} else { }
db.collection('history').insert(insert, function(err, result) { var insert = {
console.log("success!!"); "timestamp": getDate(),
db.close(); 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" "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": { "oauth-sign": {
"version": "0.8.2", "version": "0.8.2",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "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", "async": "^2.6.0",
"fs": "0.0.1-security", "fs": "0.0.1-security",
"mongodb": "^2.2.33", "mongodb": "^2.2.33",
"node-cron": "^1.2.1",
"request": "^2.83.0" "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; line-height: 30px;
/* Vertically center the text there */ /* Vertically center the text there */
background-color: #f5f5f5; 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) { function getCostIndex(sys, name) {
for (let i = 0; i < sys.length; i++) { 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; return sys[i].index;
} }
} }
@ -65,15 +65,15 @@ router.get('/', function(req, res, next) {
//set cookies if not found //set cookies if not found
var ck = req.cookies; var ck = req.cookies;
//console.log(ck); //console.log(ck);
if (!ck.input) { res.cookie('input', 'buy'); var imeth = "buy"; } if (!ck.input) { res.cookie('input', 'buy', { maxAge: 31556952000, }); var imeth = "buy"; }
if (!ck.output) { res.cookie('output', 'sell'); var ometh = "sell"; } if (!ck.output) { res.cookie('output', 'sell', { maxAge: 31556952000, }); var ometh = "sell"; }
if (!ck.skill) { res.cookie('skill', 5); var skill = 5; } if (!ck.skill) { res.cookie('skill', 5, { maxAge: 31556952000, }); var skill = 5; }
if (!ck.facility) { res.cookie('facility', 'large'); var facility = "large"; } if (!ck.facility) { res.cookie('facility', 'large', { maxAge: 31556952000, }); var facility = "large"; }
if (!ck.rig) { res.cookie('rig', 1); var rig = 1; var rige = true; } if (!ck.rig) { res.cookie('rig', 1, { maxAge: 31556952000, }); var rig = 1; var rige = true; }
if (!ck.space) { res.cookie('space', 'null'); var space = "null"; } if (!ck.space) { res.cookie('space', 'null', { maxAge: 31556952000, }); var space = "null"; }
if (!ck.indyTax) { res.cookie('indyTax', 0); var indyTax = 0; } if (!ck.indyTax) { res.cookie('indyTax', 0, { maxAge: 31556952000, }); var indyTax = 0; }
if (!ck.duration) { res.cookie('duration', 10080); var duration = 10080; } if (!ck.duration) { res.cookie('duration', 10080, { maxAge: 31556952000, }); var duration = 10080; }
if (!ck.system) { res.cookie('system', 'Basgerin'); var syst = "Basgerin" } if (!ck.system) { res.cookie('system', 'Basgerin', { maxAge: 31556952000, }); var syst = "Basgerin" }
//set internal vars to use cookie values //set internal vars to use cookie values
if (ck.input.toLowerCase() === "buy" || ck.input.toLowerCase() === "sell") { if (ck.input.toLowerCase() === "buy" || ck.input.toLowerCase() === "sell") {
@ -119,7 +119,12 @@ router.get('/', function(req, res, next) {
var duration = 10080; var duration = 10080;
} }
if (ck.system) { 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 //calc bonus with opts
@ -325,9 +330,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.sell - (tibuy + ttax)).format('0,0.00'), "prof": numeral(rout.sell - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tibuy + ttax)) / rout.sell)).format('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; temp.pos = true;
} else if (((rout.sell - tibuy) / rout.sell) < 0) { } else if (((rout.sell - (tibuy + ttax)) / rout.sell) < 0) {
temp.neg = true; temp.neg = true;
} }
} else if (imeth === "buy" && ometh === "buy") { } 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'), "prof": numeral(rout.buy - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.buy - (tibuy + ttax)) / rout.buy)).format('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; temp.pos = true;
} else if (((rout.buy - tibuy) / rout.buy) < 0) { } else if (((rout.buy - (tibuy + ttax)) / rout.buy) < 0) {
temp.neg = true; temp.neg = true;
} }
} else if (imeth === "sell" && ometh === "sell") { } 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'), "prof": numeral(rout.sell - (tisell + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tisell + ttax)) / rout.sell)).format('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; temp.pos = true;
} else if (((rout.sell - tisell) / rout.sell) < 0) { } else if (((rout.sell - (tisell + ttax)) / rout.sell) < 0) {
temp.neg = true; temp.neg = true;
} }
} else if (imeth === "sell" && ometh === "buy") { } 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'), "prof": numeral(rout.buy - (tisell + ttax)).format('0,0.00'),
"per": numeral(((rout.buy - (tisell + ttax)) / rout.buy)).format('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; temp.pos = true;
} else if (((rout.buy - tisell) / rout.buy) < 0) { } else if (((rout.buy - (tisell + ttax)) / rout.buy) < 0) {
temp.neg = true; temp.neg = true;
} }
} else if (ometh === "buy") { } else if (ometh === "buy") {
@ -409,9 +414,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.buy - (tibuy + ttax)).format('0,0.00'), "prof": numeral(rout.buy - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.buy - (tibuy + ttax)) / rout.buy)).format('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; temp.pos = true;
} else if (((rout.buy - tibuy) / rout.buy) < 0) { } else if (((rout.buy - (tibuy + ttax)) / rout.buy) < 0) {
temp.neg = true; temp.neg = true;
} }
} else if (imeth === "sell") { } else if (imeth === "sell") {
@ -430,9 +435,9 @@ router.get('/', function(req, res, next) {
"prof": numeral(rout.sell - (tisell + ttax)).format('0,0.00'), "prof": numeral(rout.sell - (tisell + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tisell + ttax)) / rout.sell)).format('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; temp.pos = true;
} else if (((rout.sell - tisell) / rout.sell) < 0) { } else if (((rout.sell - (tisell + ttax)) / rout.sell) < 0) {
temp.neg = true; temp.neg = true;
} }
} else { //default I BUY / S SELL } 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'), "prof": numeral(rout.sell - (tibuy + ttax)).format('0,0.00'),
"per": numeral(((rout.sell - (tibuy + ttax)) / rout.sell)).format('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; temp.pos = true;
} else if (((rout.sell - tibuy) / rout.sell) < 0) { } else if (((rout.sell - (tibuy + ttax)) / rout.sell) < 0) {
temp.neg = true; 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) { router.get('/', function(req, res, next) {
//set cookies if not found //set cookies if not found
var ck = req.cookies; var ck = req.cookies;
if (!ck.input) { res.cookie('input', 'buy'); var imeth = "buy"; } if (!ck.input) { res.cookie('input', 'buy', { maxAge: 31556952000, }); var imeth = "buy"; }
if (!ck.output) { res.cookie('output', 'sell'); var ometh = "sell"; } if (!ck.output) { res.cookie('output', 'sell', { maxAge: 31556952000, }); var ometh = "sell"; }
if (!ck.skill) { res.cookie('skill', 5); var skill = 5; } if (!ck.skill) { res.cookie('skill', 5, { maxAge: 31556952000, }); var skill = 5; }
if (!ck.facility) { res.cookie('facility', 'large'); var facility = "large"; } if (!ck.facility) { res.cookie('facility', 'large', { maxAge: 31556952000, }); var facility = "large"; }
if (!ck.rig) { res.cookie('rig', 1); var rig = 1; var rige = true; } if (!ck.rig) { res.cookie('rig', 1, { maxAge: 31556952000, }); var rig = 1; var rige = true; }
if (!ck.space) { res.cookie('space', 'null'); var space = "null"; } if (!ck.space) { res.cookie('space', 'null', { maxAge: 31556952000, }); var space = "null"; }
if (!ck.indyTax) { res.cookie('indyTax', 0); var indyTax = 0; } if (!ck.indyTax) { res.cookie('indyTax', 0, { maxAge: 31556952000, }); var indyTax = 0; }
if (!ck.duration) { res.cookie('duration', 10080); var duration = 10080; } if (!ck.duration) { res.cookie('duration', 10080, { maxAge: 31556952000, }); var duration = 10080; }
if (!ck.system) { res.cookie('system', 'Basgerin'); var syst = "Basgerin" } if (!ck.system) { res.cookie('system', 'Basgerin', { maxAge: 31556952000, }); var syst = "Basgerin" }
//reply //reply
res.render('index', { title: 'EVE Reactions Calculator', root: true }); 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; let ck = req.query;
if (ck.input.toLowerCase() === "buy" || ck.input.toLowerCase() === "sell") { if (ck.input.toLowerCase() === "buy" || ck.input.toLowerCase() === "sell") {
res.cookie('input', ck.input.toLowerCase()); res.cookie('input', ck.input.toLowerCase(), { maxAge: 31556952000});
} else { } else {
res.cookie('input', 'buy'); res.cookie('input', 'buy', { maxAge: 31556952000, });
} }
if (ck.output.toLowerCase() === "buy" || ck.output.toLowerCase() === "sell") { if (ck.output.toLowerCase() === "buy" || ck.output.toLowerCase() === "sell") {
res.cookie('output', ck.output.toLowerCase()); res.cookie('output', ck.output.toLowerCase(), { maxAge: 31556952000});
} else { } else {
res.cookie('output', 'sell'); res.cookie('output', 'sell', { maxAge: 31556952000 });
} }
if (parseInt(ck.skill) >= 0 && parseInt(ck.skill) <= 5) { if (parseInt(ck.skill) >= 0 && parseInt(ck.skill) <= 5) {
res.cookie('skill', parseInt(ck.skill)); res.cookie('skill', parseInt(ck.skill), { maxAge: 31556952000, });
} else { } else {
res.cookie('skill', 5); res.cookie('skill', 5, { maxAge: 31556952000, });
} }
if (ck.facility.toLowerCase() === "med" || ck.facility.toLowerCase() === "large") { if (ck.facility.toLowerCase() === "med" || ck.facility.toLowerCase() === "large") {
res.cookie('facility', ck.facility.toLowerCase()); res.cookie('facility', ck.facility.toLowerCase(), { maxAge: 31556952000, });
} else { } else {
res.cookie('facility', 'large'); res.cookie('facility', 'large', { maxAge: 31556952000, });
} }
if (parseInt(ck.rig) >= 0 && parseInt(ck.rig) <= 2) { if (parseInt(ck.rigs) >= 0 && parseInt(ck.rigs) <= 2) {
res.cookie('rig', parseInt(ck.rig)); res.cookie('rig', parseInt(ck.rigs), { maxAge: 31556952000, });
} else { } else {
res.cookie('rig', 1); res.cookie('rig', 1, { maxAge: 31556952000, });
} }
if (ck.space.toLowerCase() === "low" || ck.space.toLowerCase() === "null") { if (ck.space.toLowerCase() === "low" || ck.space.toLowerCase() === "null") {
res.cookie('space', ck.space.toLowerCase()); res.cookie('space', ck.space.toLowerCase(), { maxAge: 31556952000, });
} else { } else {
res.cookie('space', 'null'); res.cookie('space', 'null', { maxAge: 31556952000, });
} }
if (parseFloat(ck.indyTax) >= 0 && parseFloat(ck.indyTax) <= 50) { if (parseFloat(ck.indyTax) >= 0 && parseFloat(ck.indyTax) <= 50) {
res.cookie('indyTax', parseFloat(ck.indyTax)); res.cookie('indyTax', parseFloat(ck.indyTax), { maxAge: 31556952000, });
} else { } else {
res.cookie('indyTax', 0); res.cookie('indyTax', 0, { maxAge: 31556952000, });
} }
if (parseInt(ck.duration) >= 1 && parseInt(ck.duration) <= 43200) { if (parseInt(ck.duration) >= 1 && parseInt(ck.duration) <= 43200) {
res.cookie('duration', parseInt(ck.duration)); res.cookie('duration', parseInt(ck.duration), { maxAge: 31556952000, });
} else { } else {
res.cookie('duration', 10080); res.cookie('duration', 10080, { maxAge: 31556952000, });
} }
if (ck.system) { 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 //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"> <script>
<div class="row mt-4"> $(document).ready(function() {
<table class="table table-sm table-bordered text-center"> $('#stab').DataTable( {
<thead> searching: false,
<th>In Method</th> info: false,
<th>Out Method</th> paging: false,
<th>Reactions</th> columnsDefs: [
<th>Facility</th> null,
<th>Rig</th> { "sType": "numeric" },
<th>Space</th> { "sType": "numeric" },
<th>System</th> { "sType": "numeric" },
<th>IndyTax</th> { "sType": "numeric" },
<th>Build Time</th> { "sType": "numeric" },
</thead> null
<tbody> ]
<tr class=""> } );
<td>{{sett.input}}</td> $('#ctab').DataTable( {
<td>{{sett.output}}</td> searching: false,
<td>Level {{sett.skill}}</td> info: false,
<td>{{sett.facility}} Refinery</td> paging: false,
<td>T{{sett.rig}} Rig</td> columnsDefs: [
<td>{{sett.space}}sec</td> null,
<td>{{sett.system}}</td> { "sType": "numeric" },
<td>{{sett.indyTax}}</td> { "sType": "numeric" },
<td>{{sett.duration}} Minutes</td> { "sType": "numeric" },
</tr> { "sType": "numeric" },
</tbody> { "sType": "numeric" },
</table> null
</div> ]
<div class="row mt-3"> } );
<table class="table table-bordered text-center"> $('#chtab').DataTable( {
<tbody> searching: false,
<tr> info: false,
<td class="bg-info text-white text-center" id="simple" colspan="7">Simple Reactions</td> paging: false,
</tr> columnsDefs: [
<tr> null,
<th scope="col">Reaction</th> { "sType": "numeric" },
<th scope="col">Inputs</th> { "sType": "numeric" },
<th scope="col">Tax</th> { "sType": "numeric" },
<th scope="col">Output</th> { "sType": "numeric" },
<th scope="col">Profit</th> { "sType": "numeric" },
<th scope="col">% prof</th> null
</tr> ]
{{#stable}} } );
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}"> });
<td>{{name}}</td> </script>
<td>{{i}} ISK</td> <div class="container">
<td>{{tax}} ISK</td> <div class="row mt-4">
<td>{{o}} ISK</td> <table class="table table-sm table-bordered text-center">
<td>{{prof}} ISK</td> <thead>
<td>{{per}}</td> <th>In Method</th>
</tr> <th>Out Method</th>
{{/stable}} <th>Reactions</th>
<tr> <th>Facility</th>
<td class="" colspan="7"></td> <th>Rig</th>
</tr> <th>Space</th>
<tr> <th>System</th>
<td class="bg-info text-white text-center" id="complex" colspan="7">Complex Reactions</td> <th>IndyTax</th>
</tr> <th>Build Time</th>
<tr> </thead>
<th scope="col">Reaction</th> <tbody>
<th scope="col">Inputs</th> <tr class="">
<th scope="col">Tax</th> <td>{{sett.input}}</td>
<th scope="col">Output</th> <td>{{sett.output}}</td>
<th scope="col">Profit</th> <td>Level {{sett.skill}}</td>
<th scope="col">% prof</th> <td>{{sett.facility}} Refinery</td>
</tr> <td>T{{sett.rig}} Rig</td>
{{#ctable}} <td>{{sett.space}}sec</td>
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}"> <td>{{sett.system}}</td>
<td>{{name}}</td> <td>{{sett.indyTax}}</td>
<td>{{i}} ISK</td> <td>{{sett.duration}} Minutes</td>
<td>{{tax}} ISK</td> </tr>
<td>{{o}} ISK</td> </tbody>
<td>{{prof}} ISK</td> </table>
<td>{{per}}</td> </div>
</tr> <div class="row mt-3">
{{/ctable}} <h5 class="bg-info text-white text-center w-100 p-2">Simple Reactions</h5>
<tr> <table width="100%" id="stab" class="table table-bordered text-center">
<td class="" colspan="7"></td> <thead>
</tr> <th>Reaction</th>
<tr> <th>Inputs</th>
<td class="bg-info text-white text-center" id="chain" colspan="7">Complex Chain Reactions</td> <th>Tax</th>
</tr> <th>Output</th>
<tr> <th>Profit</th>
<th scope="col">Reaction</th> <th>% prof.</th>
<th scope="col">Inputs</th> </thead>
<th scope="col">Tax</th> <tbody>
<th scope="col">Output</th> {{#stable}}
<th scope="col">Profit</th> <tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}">
<th scope="col">% prof</th> <td>{{name}}</td>
</tr> <td class="isk">{{i}}</td>
{{#chtable}} <td class="isk">{{tax}}</td>
<tr class="text-white {{#if pos}}bg-success{{/if}}{{#if neg}}bg-danger{{/if}}"> <td class="isk">{{o}}</td>
<td>{{name}}</td> <td class="isk">{{prof}}</td>
<td>{{i}} ISK</td> <td>{{per}}</td>
<td>{{tax}} ISK</td> </tr>
<td>{{o}} ISK</td> {{/stable}}
<td>{{prof}} ISK</td> </tbody>
<td>{{per}}</td> </table>
</tr>
{{/chtable}} <h5 class="bg-info text-white text-center w-100 p-2 mt-3">Complex Reactions</h5>
</tbody> <table width="100%" id="ctab" class="table table-bordered text-center">
</table> <thead>
</div> <th>Reaction</th>
</div> <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="author" content="Oxed G">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{{title}}</title> <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://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://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 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="/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/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" 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> </head>
<body> <body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"> <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="container">
<div class="row mt-4"> <div class="row mt-4">
<div class="col-lg-8"> <div class="col-lg-8">
<h4 class="">New Settings:</h3> <h4 class="">New Settings:</h3>
<form class="mt-4" action="/settings/set" method="get"> <form class="mt-4" action="/settings/set" method="get">
<div class="form-group row"> <div class="form-group row">
<label class="col-4">Input Method</label> <label class="col-4">Input Method</label>
<div class="col-8"> <div class="col-8">
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Sell order</span> <span class="custom-control-description">Sell order</span>
</label> </label>
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Buy order</span> <span class="custom-control-description">Buy order</span>
</label> </label>
<span id="inputHelpBlock" class="form-text text-muted">How you are getting your input materials</span> <span id="inputHelpBlock" class="form-text text-muted">How you are getting your input materials</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="col-4">Output Method</label> <label class="col-4">Output Method</label>
<div class="col-8"> <div class="col-8">
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Sell order</span> <span class="custom-control-description">Sell order</span>
</label> </label>
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Buy order</span> <span class="custom-control-description">Buy order</span>
</label> </label>
<span id="outputHelpBlock" class="form-text text-muted">How you are selling your output materials</span> <span id="outputHelpBlock" class="form-text text-muted">How you are selling your output materials</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="skill" class="col-4 col-form-label">Reactions Skill Level</label> <label for="skill" class="col-4 col-form-label">Reactions Skill Level</label>
<div class="col-8"> <div class="col-8">
<select id="skill" name="skill" class="custom-select" aria-describedby="skillHelpBlock" required="required"> <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="0" {{#ifCond sett.skill '0'}}selected="selected"{{/ifCond}}>0</option>
<option value="1" {{#ifCond sett.skill '1'}}selected="selected"{{/ifCond}}>1</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="2" {{#ifCond sett.skill '2'}}selected="selected"{{/ifCond}}>2</option>
<option value="3" {{#ifCond sett.skill '3'}}selected="selected"{{/ifCond}}>3</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="4" {{#ifCond sett.skill '4'}}selected="selected"{{/ifCond}}>4</option>
<option value="5" {{#ifCond sett.skill '5'}}selected="selected"{{/ifCond}}>5</option> <option value="5" {{#ifCond sett.skill '5'}}selected="selected"{{/ifCond}}>5</option>
</select> </select>
<span id="skillHelpBlock" class="form-text text-muted">What is your reactions skill level at</span> <span id="skillHelpBlock" class="form-text text-muted">What is your reactions skill level at</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="col-4">Facility Size</label> <label class="col-4">Facility Size</label>
<div class="col-8"> <div class="col-8">
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Medium</span> <span class="custom-control-description">Medium</span>
</label> </label>
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Large</span> <span class="custom-control-description">Large</span>
</label> </label>
<span id="facilityHelpBlock" class="form-text text-muted">Are you using a med or large refinery</span> <span id="facilityHelpBlock" class="form-text text-muted">Are you using a med or large refinery</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="col-4">Rigs installed</label> <label class="col-4">Rigs installed</label>
<div class="col-8"> <div class="col-8">
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">None</span> <span class="custom-control-description">None</span>
</label> </label>
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Tech 1</span> <span class="custom-control-description">Tech 1</span>
</label> </label>
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Tech 2</span> <span class="custom-control-description">Tech 2</span>
</label> </label>
<span id="rigsHelpBlock" class="form-text text-muted">Does your facility have any rigs for reactions?</span> <span id="rigsHelpBlock" class="form-text text-muted">Does your facility have any rigs for reactions?</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="col-4">Type of space?</label> <label class="col-4">Type of space?</label>
<div class="col-8"> <div class="col-8">
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Nullsec</span> <span class="custom-control-description">Nullsec</span>
</label> </label>
<label class="custom-control custom-radio"> <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}}> <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-indicator"></span>
<span class="custom-control-description">Lowsec</span> <span class="custom-control-description">Lowsec</span>
</label> </label>
<span id="spaceHelpBlock" class="form-text text-muted">Are you doing reactions in Nullsec or Lowsec?</span> <span id="spaceHelpBlock" class="form-text text-muted">Are you doing reactions in Nullsec or Lowsec?</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="system" class="col-4 col-form-label">System</label> <label for="system" class="col-4 col-form-label">System</label>
<div class="col-8"> <div class="col-8">
<div class="input-group"> <div class="input-group">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-home"></i> <i class="fa fa-home"></i>
</div> </div>
<input id="system" name="system" placeholder="Basgerin" type="text" value="{{sett.system}}" class="form-control here" aria-describedby="systemHelpBlock" required="required"> <input id="system" name="system" placeholder="Basgerin" type="text" value="{{sett.system}}" class="form-control here" aria-describedby="systemHelpBlock" required="required">
</div> </div>
<span id="systemHelpBlock" class="form-text text-muted">What system are you doing reactions in? used to calculate cost index</span> <span id="systemHelpBlock" class="form-text text-muted">What system are you doing reactions in? used to calculate cost index</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="indyTax" class="col-4 col-form-label">Industry Tax</label> <label for="indyTax" class="col-4 col-form-label">Industry Tax</label>
<div class="col-8"> <div class="col-8">
<div class="input-group"> <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"> <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 class="input-group-addon append">%</div>
</div> </div>
<span id="indyTaxHelpBlock" class="form-text text-muted">What's your industry tax % ?</span> <span id="indyTaxHelpBlock" class="form-text text-muted">What's your industry tax % ?</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="duration" class="col-4 col-form-label">Batch build time</label> <label for="duration" class="col-4 col-form-label">Batch build time</label>
<div class="col-8"> <div class="col-8">
<div class="input-group"> <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"> <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 class="input-group-addon append">Minutes</div>
</div> </div>
<span id="durationHelpBlock" class="form-text text-muted">Time in minutes each of your jobs is going to run for</span> <span id="durationHelpBlock" class="form-text text-muted">Time in minutes each of your jobs is going to run for</span>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="offset-4 col-8"> <div class="offset-4 col-8">
<button name="submit" type="submit" class="btn btn-primary">Save Settings</button> <button name="submit" type="submit" class="btn btn-primary">Save Settings</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<h4 class="">Current Settings:</h4> <h4 class="">Current Settings:</h4>
<table class="table table-sm table-bordered mt-4"> <table class="table table-sm table-bordered mt-4">
<tbody> <tbody>
<tr> <tr>
<th>In Method</th> <th>In Method</th>
<td>{{sett.input}}</td> <td>{{sett.input}}</td>
</tr> </tr>
<tr> <tr>
<th>Out Method</th> <th>Out Method</th>
<td>{{sett.output}}</td> <td>{{sett.output}}</td>
</tr> </tr>
<tr> <tr>
<th>Reactions</th> <th>Reactions</th>
<td>Level {{sett.skill}}</td> <td>Level {{sett.skill}}</td>
</tr> </tr>
<tr> <tr>
<th>Facility</th> <th>Facility</th>
<td>{{sett.facility}} Refinery</td> <td>{{sett.facility}} Refinery</td>
</tr> </tr>
<tr> <tr>
<th>Rig</th> <th>Rig</th>
<td>T{{sett.rig}} Rig</td> <td>T{{sett.rig}} Rig</td>
</tr> </tr>
<tr> <tr>
<th>Space</th> <th>Space</th>
<td>{{sett.space}}sec</td> <td>{{sett.space}}sec</td>
</tr> </tr>
<tr> <tr>
<th>System</th> <th>System</th>
<td>{{sett.system}}</td> <td>{{sett.system}}</td>
</tr> </tr>
<tr> <tr>
<th>IndyTax</th> <th>IndyTax</th>
<td>{{sett.indyTax}}</td> <td>{{sett.indyTax}}</td>
</tr> </tr>
<tr> <tr>
<th>Build Time</th> <th>Build Time</th>
<td>{{sett.duration}} Minutes</td> <td>{{sett.duration}} Minutes</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>