From cdee2730f56eca0e5912231ef8d20a6294c4f904 Mon Sep 17 00:00:00 2001
From: joeuhren <46763106+joeuhren@users.noreply.github.com>
Date: Sun, 22 Nov 2020 19:51:23 -0700
Subject: [PATCH] Add optional market cap box to heading
---
lib/settings.js | 2 ++
settings.json.template | 4 ++++
views/layout.pug | 14 ++++++++++----
3 files changed, 16 insertions(+), 4 deletions(-)
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 '