General market improvements

-Improved the display of the market page so that as long as one section has data (stats, buys, sells, trade history) the page will load properly even if it's only one section that isn't blank. Previously it would display an error if just one section was blank.
-Added the coin name beside the market pages volume header column in the 24h stats section
-Fixed a bug that was displaying an error when the summary value from the 24h stats section was supplied but was a blank string or '-' character
-Better success/error message during market sync
This commit is contained in:
joeuhren
2021-03-07 14:47:34 -07:00
parent 58c0dfc82e
commit e0928dd0fd
2 changed files with 6 additions and 7 deletions
+2 -2
View File
@@ -455,12 +455,12 @@ if (database == 'peers') {
// update market data // update market data
db.update_markets_db(key, split_pair[0], split_pair[1], function(err) { db.update_markets_db(key, split_pair[0], split_pair[1], function(err) {
if (!err) { if (!err) {
console.log('%s: %s market data updated successfully.', key, pair_key); console.log('%s[%s]: market data updated successfully.', key, pair_key);
complete++; complete++;
if (complete == total_pairs) if (complete == total_pairs)
get_last_usd_price(); get_last_usd_price();
} else { } else {
console.log('%s: %s: %s', key, pair_key, err); console.log('%s[%s] error: %s', key, pair_key, err);
complete++; complete++;
if (complete == total_pairs) if (complete == total_pairs)
get_last_usd_price(); get_last_usd_price();
+4 -5
View File
@@ -5,7 +5,7 @@ block content
- var theadClasses = []; - var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != '' if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != ''
- theadClasses.push('thead-' + settings.shared_pages.table_header_bgcolor); - theadClasses.push('thead-' + settings.shared_pages.table_header_bgcolor);
if marketdata.data != null && marketdata.data.buys != null && marketdata.data.buys.length > 0 && marketdata.data.sells != null && marketdata.data.sells.length > 0 && marketdata.data.history != null && marketdata.data.history.length > 0 if marketdata.data != null && ((marketdata.data.buys != null && marketdata.data.buys.length > 0) || (marketdata.data.sells != null && marketdata.data.sells.length > 0) || (marketdata.data.history != null && marketdata.data.history.length > 0))
script. script.
$(document).ready(function() { $(document).ready(function() {
$('.summary-table').dataTable({ $('.summary-table').dataTable({
@@ -82,7 +82,7 @@ block content
i.market-logo.fas.fa-question-circle i.market-logo.fas.fa-question-circle
span #{mkt.name} span #{mkt.name}
span.small (#{pair}) span.small (#{pair})
if marketdata.data != null && marketdata.data.buys != null && marketdata.data.buys.length > 0 && marketdata.data.sells != null && marketdata.data.sells.length > 0 && marketdata.data.history != null && marketdata.data.history.length > 0 if marketdata.data != null && ((marketdata.data.buys != null && marketdata.data.buys.length > 0) || (marketdata.data.sells != null && marketdata.data.sells.length > 0) || (marketdata.data.history != null && marketdata.data.history.length > 0))
block market_view block market_view
script. script.
$(document).ready(function() { $(document).ready(function() {
@@ -156,6 +156,7 @@ block content
th.text-center #{settings.locale.mkt_low} th.text-center #{settings.locale.mkt_low}
if marketdata.data.summary.volume != null if marketdata.data.summary.volume != null
th.text-center #{settings.locale.mkt_volume} th.text-center #{settings.locale.mkt_volume}
span.small (#{marketdata.coin})
if marketdata.data.summary.volume_btc != null if marketdata.data.summary.volume_btc != null
th.text-center #{settings.locale.mkt_volume} th.text-center #{settings.locale.mkt_volume}
span.small (#{marketdata.exchange}) span.small (#{marketdata.exchange})
@@ -214,9 +215,7 @@ block content
if marketdata.data.summary.change != null || (marketdata.data.summary.last != null && marketdata.data.summary.prev != null) if marketdata.data.summary.change != null || (marketdata.data.summary.last != null && marketdata.data.summary.prev != null)
if marketdata.data.summary.change != null if marketdata.data.summary.change != null
if marketdata.data.summary.change == '' || marketdata.data.summary.change == '-' if marketdata.data.summary.change == '' || marketdata.data.summary.change == '-'
td.text-center.font-weight-bold 0. - var price_change = "0.00";
span.decimal 00
span %
else else
- var price_change = Number(marketdata.data.summary.change).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':2,'useGrouping':true}); - var price_change = Number(marketdata.data.summary.change).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':2,'useGrouping':true});
else else