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
db.update_markets_db(key, split_pair[0], split_pair[1], function(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++;
if (complete == total_pairs)
get_last_usd_price();
} else {
console.log('%s: %s: %s', key, pair_key, err);
console.log('%s[%s] error: %s', key, pair_key, err);
complete++;
if (complete == total_pairs)
get_last_usd_price();
+4 -5
View File
@@ -5,7 +5,7 @@ block content
- var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && 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.
$(document).ready(function() {
$('.summary-table').dataTable({
@@ -82,7 +82,7 @@ block content
i.market-logo.fas.fa-question-circle
span #{mkt.name}
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
script.
$(document).ready(function() {
@@ -156,6 +156,7 @@ block content
th.text-center #{settings.locale.mkt_low}
if marketdata.data.summary.volume != null
th.text-center #{settings.locale.mkt_volume}
span.small (#{marketdata.coin})
if marketdata.data.summary.volume_btc != null
th.text-center #{settings.locale.mkt_volume}
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
if marketdata.data.summary.change == '' || marketdata.data.summary.change == '-'
td.text-center.font-weight-bold 0.
span.decimal 00
span %
- var price_change = "0.00";
else
- var price_change = Number(marketdata.data.summary.change).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':2,'useGrouping':true});
else