Compare commits
15 Commits
c236cb964d
...
3844acdaf8
| Author | SHA1 | Date | |
|---|---|---|---|
|
3844acdaf8
|
|||
|
a1d1a6337e
|
|||
|
9507bc17a8
|
|||
|
4b15a1aa0c
|
|||
|
fb9cb50a90
|
|||
|
209c3794fc
|
|||
|
8099320673
|
|||
|
aa92220756
|
|||
|
2595503dc0
|
|||
|
d516e91592
|
|||
|
b24a3147dd
|
|||
|
f8e03aca73
|
|||
|
38f08c069c
|
|||
|
16ac6c7d2b
|
|||
|
b0c7fcf779
|
Binary file not shown.
@@ -571,6 +571,10 @@ def getBids(account, domain="NONE"):
|
||||
for bid in response:
|
||||
if 'value' not in bid:
|
||||
bid['value'] = -1000000
|
||||
|
||||
# Backup for older HSD versions
|
||||
if 'height' not in bid:
|
||||
bid['height'] = 0
|
||||
bids.append(bid)
|
||||
return bids
|
||||
|
||||
|
||||
19
main.py
19
main.py
@@ -297,6 +297,8 @@ def auctions():
|
||||
if direction == "⬆":
|
||||
reverse = True
|
||||
|
||||
sortbyDomain = False
|
||||
|
||||
if sort == "price":
|
||||
# Sort by price
|
||||
bids = sorted(bids, key=lambda k: k['value'],reverse=reverse)
|
||||
@@ -306,9 +308,16 @@ def auctions():
|
||||
sort_state = direction
|
||||
sort_state_next = reverseDirection(direction)
|
||||
domains = sorted(domains, key=lambda k: k['state'],reverse=reverse)
|
||||
sortbyDomain = True
|
||||
elif sort == "time":
|
||||
sort_time = direction
|
||||
sort_time_next = reverseDirection(direction)
|
||||
|
||||
# If older HSD version sort by domain height
|
||||
if bids[0]['height'] == 0:
|
||||
domains = sorted(domains, key=lambda k: k['height'],reverse=reverse)
|
||||
sortbyDomain = True
|
||||
else:
|
||||
bids = sorted(bids, key=lambda k: k['height'],reverse=reverse)
|
||||
else:
|
||||
# Sort by domain
|
||||
@@ -316,16 +325,8 @@ def auctions():
|
||||
sort_domain = direction
|
||||
sort_domain_next = reverseDirection(direction)
|
||||
|
||||
if sort == "state":
|
||||
bidsHtml = render.bidDomains(bids,domains,True)
|
||||
else:
|
||||
bidsHtml = render.bidDomains(bids,domains)
|
||||
|
||||
|
||||
|
||||
|
||||
bidsHtml = render.bidDomains(bids,domains,sortbyDomain)
|
||||
plugins = ""
|
||||
|
||||
message = ''
|
||||
if 'message' in request.args:
|
||||
message = request.args.get("message")
|
||||
|
||||
@@ -183,9 +183,10 @@ def bids(bids,reveals):
|
||||
return html
|
||||
|
||||
|
||||
def bidDomains(bids,domains, sortState=False):
|
||||
def bidDomains(bids,domains, sortbyDomains=False):
|
||||
html = ''
|
||||
if not sortState:
|
||||
|
||||
if not sortbyDomains:
|
||||
for bid in bids:
|
||||
for domain in domains:
|
||||
if bid['name'] == domain['name']:
|
||||
@@ -201,7 +202,7 @@ def bidDomains(bids,domains, sortState=False):
|
||||
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{domain['name']}</a></td>"
|
||||
html += f"<td>{domain['state']}</td>"
|
||||
html += f"<td>{bidDisplay}</td>"
|
||||
html += f"<td>{bid['height']:,}</td>"
|
||||
html += f"<td>{domain['height']:,}</td>"
|
||||
html += "</tr>"
|
||||
else:
|
||||
for domain in domains:
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><a href="/auctions?direction={{sort_domain_next}}">Domain{{sort_domain}}</a></th>
|
||||
<th><a href="/auctions?sort=domain&direction={{sort_domain_next}}">Domain{{sort_domain}}</a></th>
|
||||
<th><a href="/auctions?sort=state&direction={{sort_state_next}}">State{{sort_state}}</a></th>
|
||||
<th><a href="/auctions?sort=price&direction={{sort_price_next}}">Bid{{sort_price}}</a></th>
|
||||
<th><a href="/auctions?sort=time&direction={{sort_time_next}}">Block{{sort_time}}</a></th>
|
||||
|
||||
Reference in New Issue
Block a user