diff --git a/api/admin.py b/api/admin.py index 08a947cb..0e0d1793 100644 --- a/api/admin.py +++ b/api/admin.py @@ -19,6 +19,7 @@ class EUserAdmin(UserAdmin): inlines = [ProfileInline] list_display = ('avatar_tag','id','username','last_login','date_joined','is_staff') list_display_links = ('id','username') + ordering = ('-id',) def avatar_tag(self, obj): return obj.profile.avatar_tag() @@ -36,6 +37,7 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin): list_display_links = ('hash','concept') change_links = ('sender','receiver','order_made','order_taken','order_escrow','order_paid') list_filter = ('type','concept','status') + ordering = ('-expires_at',) @admin.register(Profile) class UserProfileAdmin(AdminChangeLinksMixin, admin.ModelAdmin): @@ -49,9 +51,11 @@ class CurrencieAdmin(admin.ModelAdmin): list_display = ('id','currency','exchange_rate','timestamp') list_display_links = ('id','currency') readonly_fields = ('currency','exchange_rate','timestamp') + ordering = ('id',) @admin.register(MarketTick) class MarketTickAdmin(admin.ModelAdmin): list_display = ('timestamp','price','volume','premium','currency','fee') readonly_fields = ('timestamp','price','volume','premium','currency','fee') - list_filter = ['currency'] \ No newline at end of file + list_filter = ['currency'] + ordering = ('-timestamp',) \ No newline at end of file diff --git a/api/views.py b/api/views.py index a34b0bb0..bf0b8d9d 100644 --- a/api/views.py +++ b/api/views.py @@ -492,8 +492,18 @@ class InfoView(ListAPIView): avg_premium = 0 total_volume = 0 + queryset = MarketTick.objects.all() + if not len(queryset) == 0: + volume_settled = [] + for tick in queryset: + volume_settled.append(tick.volume) + lifetime_volume_settled = int(sum(volume_settled)*100000000) + else: + lifetime_volume_settled = 0 + context['today_avg_nonkyc_btc_premium'] = round(avg_premium,2) context['today_total_volume'] = total_volume + context['lifetime_satoshis_settled'] = lifetime_volume_settled context['lnd_version'] = get_lnd_version() context['robosats_running_commit_hash'] = get_commit_robosats() context['fee'] = FEE diff --git a/frontend/src/components/BottomBar.js b/frontend/src/components/BottomBar.js index efaa1c95..b6137cfa 100644 --- a/frontend/src/components/BottomBar.js +++ b/frontend/src/components/BottomBar.js @@ -15,6 +15,11 @@ import EqualizerIcon from '@mui/icons-material/Equalizer'; import SendIcon from '@mui/icons-material/Send'; import PublicIcon from '@mui/icons-material/Public'; +// pretty numbers +function pn(x) { + return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + } + export default class BottomBar extends Component { constructor(props) { super(props); @@ -27,6 +32,7 @@ export default class BottomBar extends Component { fee: 0, today_avg_nonkyc_btc_premium: 0, today_total_volume: 0, + lifetime_satoshis_settled: 0, }; this.getInfo(); } @@ -61,7 +67,7 @@ export default class BottomBar extends Component { > Stats For Nerds - + @@ -84,6 +90,12 @@ export default class BottomBar extends Component { + + + + + + diff --git a/frontend/src/components/OrderPage.js b/frontend/src/components/OrderPage.js index a69d3422..e6b989b4 100644 --- a/frontend/src/components/OrderPage.js +++ b/frontend/src/components/OrderPage.js @@ -147,11 +147,11 @@ export default class OrderPage extends Component { countdownPenaltyRenderer = ({ minutes, seconds, completed }) => { if (completed) { // Render a completed state - return ( nothing. Good to go!); + return ( Penalty lifted, good to go!); } else { return ( - {zeroPad(minutes)}m {zeroPad(seconds)}s + Wait {zeroPad(minutes)}m {zeroPad(seconds)}s ); } }; @@ -445,7 +445,7 @@ export default class OrderPage extends Component { - You cannot take an order yet! Wait + You cannot take an order yet!