diff --git a/lib/settings.js b/lib/settings.js index 314fc69..29bcb0e 100644 --- a/lib/settings.js +++ b/lib/settings.js @@ -115,6 +115,8 @@ exports.movement = { //index exports.index = { "show_hashrate": false, + "show_market_cap": false, + "show_market_cap_over_price": false, "difficulty": "POS", "last_txs": 100, "txs_per_page": 10 diff --git a/settings.json.template b/settings.json.template index 1d6f74e..1151286 100644 --- a/settings.json.template +++ b/settings.json.template @@ -97,6 +97,10 @@ // index page (valid options for difficulty are POW, POS or Hybrid) "index": { "show_hashrate": true, + // Show Market Cap in header + "show_market_cap": false, + // Show Market Cap in place of price box + "show_market_cap_over_price": false, "difficulty": "POS", "last_txs": 100, "txs_per_page": 10 diff --git a/views/layout.pug b/views/layout.pug index b8ed38e..a5a0d47 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -34,7 +34,8 @@ html $("#difficulty").text(parseFloat(json.data[0].difficulty).toFixed(2)); $("#difficultyHybrid").text(json.data[0].difficultyHybrid); $("#hashrate").text(parseFloat(json.data[0].hashrate).toLocaleString('en')); - $("#lastPrice").text(parseFloat(json.data[0].lastPrice).toFixed(8)); + $("#lastPrice").text(parseFloat(json.data[0].lastPrice).toFixed(8) + ' #{settings.markets.exchange}'.toUpperCase()); + $("#marketCap").text((parseFloat(json.data[0].lastPrice).toFixed(8) * parseInt(parseFloat(json.data[0].supply).toFixed(0))).toLocaleString('en') + ' #{settings.markets.exchange}'.toUpperCase()); $("#lblConnections").text(json.data[0].connections + ' connections'); $("#lblBlockcount").text(json.data[0].blockcount + ' blocks'); $("#lblX1").text(' '); @@ -96,12 +97,17 @@ html function getCoinSupplyPanel() { var supplyType=''; if ('#{settings.index.difficulty}' == 'Hybrid') supplyType+='
'; + if (#{settings.index.show_market_cap} == true && #{settings.index.show_market_cap_over_price} != true) supplyType+='
'; return '
#{settings.locale.ex_supply} (#{settings.symbol})
'+supplyType+'
'; } function getPricePanel() { - var priceType=''; - if ('#{settings.index.difficulty}' == 'Hybrid') priceType+='
'; - return '
#{settings.markets.exchange} Price
'+priceType+'
'; + if (#{settings.index.show_market_cap} == true && #{settings.index.show_market_cap_over_price} == true) { + return '
Market Cap
'; + } else { + var priceType=''; + if ('#{settings.index.difficulty}' == 'Hybrid') priceType+='
'; + return '
#{settings.markets.exchange} Price
'+priceType+'
'; + } } function getActivePanel(nPanelName) { var sReturn='';