diff --git a/FireWalletBrowser.bsdesign b/FireWalletBrowser.bsdesign index e4d7098..eb14d1f 100644 Binary files a/FireWalletBrowser.bsdesign and b/FireWalletBrowser.bsdesign differ diff --git a/account.py b/account.py index 6382493..f24b242 100644 --- a/account.py +++ b/account.py @@ -655,8 +655,6 @@ def getPossibleOutbids(account): current_highest_bid = bid['value'] domain_bids = getBids(account, domain) - print(domain) - print(json.dumps(domain_bids, indent=4)) for domain_bid in domain_bids: if domain_bid["own"]: current_highest_bid = max(current_highest_bid, domain_bid['value']) diff --git a/main.py b/main.py index a5b0052..220891b 100644 --- a/main.py +++ b/main.py @@ -330,7 +330,14 @@ def auctions(): sort_domain = direction sort_domain_next = reverseDirection(direction) - bidsHtml = render.bidDomains(bids,domains,sortbyDomain) + # Check if outbids set to true + outbids = request.args.get("outbids") + if outbids is not None and outbids.lower() == "true": + # Get outbid domains + outbids = account_module.getPossibleOutbids(account) + + + bidsHtml = render.bidDomains(bids,domains,sortbyDomain,outbids) plugins = "" message = '' if 'message' in request.args: diff --git a/render.py b/render.py index 74a598b..11dc574 100644 --- a/render.py +++ b/render.py @@ -336,9 +336,8 @@ def bids(bids,reveals): return html -def bidDomains(bids,domains, sortbyDomains=False): +def bidDomains(bids,domains, sortbyDomains=False, outbids=[]): html = '' - if not sortbyDomains: for bid in bids: for domain in domains: @@ -352,10 +351,12 @@ def bidDomains(bids,domains, sortbyDomains=False): bidDisplay = f'{bidValue:,.2f} (+{blind:,.2f}) HNS' else: bidDisplay = f'{bidValue:,.2f} HNS' - - + html += "" - html += f"{renderDomain(domain['name'])}" + if domain['name'] in outbids: + html += f"{renderDomain(domain['name'])}" + else: + html += f"{renderDomain(domain['name'])}" html += f"{domain['state']}" html += f"{bidDisplay}" html += f"{bid['height']:,}" diff --git a/templates/assets/js/dashboard.min.js b/templates/assets/js/dashboard.min.js index c2f0aaa..3f7d973 100644 --- a/templates/assets/js/dashboard.min.js +++ b/templates/assets/js/dashboard.min.js @@ -1 +1 @@ -function createCard(e,n,t){if(document.getElementById(t)&&document.getElementById(t).remove(),n<=0)return;const a=document.createElement("div");a.classList.add("col-md-6","col-xl-3","mb-4"),a.id=t,html=`\n
\n
\n
\n
\n
${e}
\n
${n}
\n
\n \n
\n \n \n \n \n \n \n
\n
\n
`,a.innerHTML=html,document.getElementById("actions-row").appendChild(a)}async function updateActions(){const e={Finalize:"Pending Finalizes",Register:"Pending Register",Redeem:"Pending Redeem",Reveal:"Pending Reveal"};for(const n in e){const t=await request(`wallet/pending${n}`);"Error"!=t&&createCard(e[n],t.length,n)}}window.addEventListener("load",(async()=>{updateActions()})),setInterval((async function(){updateActions()}),2e4); \ No newline at end of file +function createCard(e,n,t){if(document.getElementById(t)&&document.getElementById(t).remove(),n<=0)return;const s=document.createElement("div");s.classList.add("col-md-6","col-xl-3","mb-4"),s.id=t,html=`\n
\n
\n
\n
\n
${e}
\n
${n}
\n
\n \n
\n \n \n \n \n \n \n
\n
\n
`,s.innerHTML=html,document.getElementById("actions-row").appendChild(s)}async function updateActions(){const e={Finalize:"Pending Finalizes",Register:"Pending Register",Redeem:"Pending Redeem",Reveal:"Pending Reveal"},n=Object.keys(e).map((e=>request(`wallet/pending${e}`).then((n=>({id:e,result:n}))))),t=await Promise.all(n);for(const{id:n,result:s}of t)"Error"!==s&&createCard(e[n],s.length,n);const s=await request("wallet/possibleOutbids");if("Error"===s)return;const d=document.getElementById("outbids");if(d&&d.remove(),s.length<=0)return;const i=document.createElement("div");i.classList.add("col-md-6","col-xl-3","mb-4"),i.id="outbids",i.innerHTML=`\n
\n
\n
\n
\n
Names with possible outbids
\n
${s.length}
\n
\n \n
\n \n \n \n \n \n \n
\n
\n
\n
\n `,document.getElementById("actions-row").appendChild(i)}window.addEventListener("load",(async()=>{updateActions()})),setInterval((async function(){updateActions()}),2e4); \ No newline at end of file