fix: Hide expired domains
All checks were successful
Build Docker / Build Image (push) Successful in 43s
All checks were successful
Build Docker / Build Image (push) Successful in 43s
This commit is contained in:
parent
f695d53f8d
commit
da9354cb23
19
account.py
19
account.py
@ -15,6 +15,9 @@ ip = os.getenv("hsd_ip")
|
|||||||
if ip is None:
|
if ip is None:
|
||||||
ip = "localhost"
|
ip = "localhost"
|
||||||
|
|
||||||
|
show_expired = os.getenv("show_expired")
|
||||||
|
if show_expired is None:
|
||||||
|
show_expired = False
|
||||||
|
|
||||||
hsd = api.hsd(APIKEY,ip)
|
hsd = api.hsd(APIKEY,ip)
|
||||||
hsw = api.hsw(APIKEY,ip)
|
hsw = api.hsw(APIKEY,ip)
|
||||||
@ -179,7 +182,21 @@ def getDomains(account,own=True):
|
|||||||
else:
|
else:
|
||||||
response = requests.get(f"http://x:{APIKEY}@{ip}:12039/wallet/{account}/name")
|
response = requests.get(f"http://x:{APIKEY}@{ip}:12039/wallet/{account}/name")
|
||||||
info = response.json()
|
info = response.json()
|
||||||
return info
|
|
||||||
|
if show_expired:
|
||||||
|
return info
|
||||||
|
|
||||||
|
# Remove any expired domains
|
||||||
|
domains = []
|
||||||
|
for domain in info:
|
||||||
|
if 'stats' in domain:
|
||||||
|
if 'daysUntilExpire' in domain['stats']:
|
||||||
|
if domain['stats']['daysUntilExpire'] < 0:
|
||||||
|
continue
|
||||||
|
domains.append(domain)
|
||||||
|
|
||||||
|
|
||||||
|
return domains
|
||||||
|
|
||||||
def getTransactions(account):
|
def getTransactions(account):
|
||||||
# Get the transactions
|
# Get the transactions
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
hsd_api=123480615465636893475aCwyaae6s45
|
hsd_api=123480615465636893475aCwyaae6s45
|
||||||
hsd_ip=localhost
|
hsd_ip=localhost
|
||||||
theme=black
|
theme=black
|
||||||
|
show_expired=false
|
Loading…
Reference in New Issue
Block a user