ui: Add new count of active received bids.
This commit is contained in:
		
							parent
							
								
									0432fae5b5
								
							
						
					
					
						commit
						d4f6286980
					
				@ -3585,7 +3585,7 @@ class BasicSwap(BaseApp):
 | 
			
		||||
 | 
			
		||||
                        if was_received:
 | 
			
		||||
                            delay = random.randrange(self.min_delay_event, self.max_delay_event)
 | 
			
		||||
                            self.log.info('Releasing xmr script coin lock tx for bid %s in %d seconds', bid_id.hex(), delay)
 | 
			
		||||
                            self.log.info('Releasing ads script coin lock tx for bid %s in %d seconds', bid_id.hex(), delay)
 | 
			
		||||
                            self.createActionInSession(delay, ActionTypes.SEND_XMR_LOCK_RELEASE, bid_id, session)
 | 
			
		||||
 | 
			
		||||
                if bid_changed:
 | 
			
		||||
@ -6240,18 +6240,20 @@ class BasicSwap(BaseApp):
 | 
			
		||||
        now: int = self.getTime()
 | 
			
		||||
        q_str = '''SELECT
 | 
			
		||||
                   COUNT(CASE WHEN b.was_sent THEN 1 ELSE NULL END) AS count_sent,
 | 
			
		||||
                   COUNT(CASE WHEN b.was_sent AND s.swap_ended = 0 AND b.expire_at > {} AND o.expire_at > {} THEN 1 ELSE NULL END) AS count_sent_active,
 | 
			
		||||
                   COUNT(CASE WHEN b.was_sent AND (s.in_progress OR (s.swap_ended = 0 AND b.expire_at > {} AND o.expire_at > {})) THEN 1 ELSE NULL END) AS count_sent_active,
 | 
			
		||||
                   COUNT(CASE WHEN b.was_received THEN 1 ELSE NULL END) AS count_received,
 | 
			
		||||
                   COUNT(CASE WHEN b.was_received AND b.state = {} AND b.expire_at > {} AND o.expire_at > {} THEN 1 ELSE NULL END) AS count_available
 | 
			
		||||
                   COUNT(CASE WHEN b.was_received AND b.state = {} AND b.expire_at > {} AND o.expire_at > {} THEN 1 ELSE NULL END) AS count_available,
 | 
			
		||||
                   COUNT(CASE WHEN b.was_received AND (s.in_progress OR (s.swap_ended = 0 AND b.expire_at > {} AND o.expire_at > {})) THEN 1 ELSE NULL END) AS count_recv_active
 | 
			
		||||
                   FROM bids b
 | 
			
		||||
                   JOIN offers o ON b.offer_id = o.offer_id
 | 
			
		||||
                   JOIN bidstates s ON b.state = s.state_id
 | 
			
		||||
                   WHERE b.active_ind = 1'''.format(now, now, BidStates.BID_RECEIVED, now, now)
 | 
			
		||||
                   WHERE b.active_ind = 1'''.format(now, now, BidStates.BID_RECEIVED, now, now, now, now)
 | 
			
		||||
        q = self.engine.execute(q_str).first()
 | 
			
		||||
        bids_sent = q[0]
 | 
			
		||||
        bids_sent_active = q[1]
 | 
			
		||||
        bids_received = q[2]
 | 
			
		||||
        bids_available = q[3]
 | 
			
		||||
        bids_recv_active = q[4]
 | 
			
		||||
 | 
			
		||||
        q_str = '''SELECT
 | 
			
		||||
                   COUNT(CASE WHEN expire_at > {} THEN 1 ELSE NULL END) AS count_active,
 | 
			
		||||
@ -6272,6 +6274,7 @@ class BasicSwap(BaseApp):
 | 
			
		||||
            'num_recv_bids': bids_received,
 | 
			
		||||
            'num_sent_bids': bids_sent,
 | 
			
		||||
            'num_sent_active_bids': bids_sent_active,
 | 
			
		||||
            'num_recv_active_bids': bids_recv_active,
 | 
			
		||||
            'num_available_bids': bids_available,
 | 
			
		||||
            'num_watched_outputs': num_watched_outputs,
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -482,7 +482,7 @@
 | 
			
		||||
                          <line data-cap="butt" x1="12" y1="1" x2="12" y2="16" stroke="#6b7280"></line>
 | 
			
		||||
                          <polyline points="7 11 12 16 17 11" stroke="#6b7280"></polyline>
 | 
			
		||||
                        </g>
 | 
			
		||||
                      </svg><span>Bids Received</span> <span class="inline-flex justify-center items-center text-xs font-semibold ml-3 mr-2 px-2.5 py-1 font-small text-white bg-blue-500 rounded-full">{{ summary.num_available_bids }}</span></a>
 | 
			
		||||
                      </svg><span>Bids Received</span> <span class="inline-flex justify-center items-center text-xs font-semibold ml-3 mr-2 px-2.5 py-1 font-small text-white bg-blue-500 rounded-full">{{ summary.num_recv_active_bids }}</span></a>
 | 
			
		||||
                  </li>
 | 
			
		||||
 | 
			
		||||
                <div id="tooltip-bids-received" role="tooltip" class="inline-block absolute invisible z-10 py-2 px-3 text-sm font-medium text-white bg-blue-500 rounded-lg shadow-sm opacity-0 transition-opacity duration-300 tooltip">
 | 
			
		||||
@ -497,7 +497,7 @@
 | 
			
		||||
                          <line data-cap="butt" x1="12" y1="17" x2="12" y2="2" stroke="#6b7280"></line>
 | 
			
		||||
                          <polyline points="17 7 12 2 7 7" stroke="#6b7280"></polyline>
 | 
			
		||||
                        </g>
 | 
			
		||||
                      </svg><span>Bids Sent</span><span class="inline-flex justify-center items-center text-xs font-semibold ml-3 mr-2 px-2.5 py-1 font-small text-white bg-blue-500 rounded-full">{{ summary.num_sent_active_bids }}</span></a>              
 | 
			
		||||
                      </svg><span>Bids Sent</span><span class="inline-flex justify-center items-center text-xs font-semibold ml-3 mr-2 px-2.5 py-1 font-small text-white bg-blue-500 rounded-full">{{ summary.num_sent_active_bids }}</span></a>
 | 
			
		||||
                <div id="tooltip-bids-sent" role="tooltip" class="inline-block absolute invisible z-10 py-2 px-3 text-sm font-medium text-white bg-blue-500 rounded-lg shadow-sm opacity-0 transition-opacity duration-300 tooltip">
 | 
			
		||||
                  <p><b>Total:</b>  {{ summary.num_sent_bids }}</p>
 | 
			
		||||
                <div class="tooltip-arrow" data-popper-arrow></div>
 | 
			
		||||
 | 
			
		||||
@ -129,7 +129,7 @@
 | 
			
		||||
           </tr>
 | 
			
		||||
           <tr class="opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600">
 | 
			
		||||
            <td class="py-3 px-6 bold">Swap Type</td>
 | 
			
		||||
            <td class="py-3 px-6">{{ data.swap_type }}</td>
 | 
			
		||||
            <td class="py-3 px-6">{{ data.swap_type }}{% if data.reverse == true %} (Reversed){% endif %}</td>
 | 
			
		||||
           </tr>
 | 
			
		||||
           <tr class="opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600">
 | 
			
		||||
            <td class="py-3 px-6 bold">{% if data.sent %}You Send{% else %}You Get{% endif %}</td>
 | 
			
		||||
 | 
			
		||||
@ -585,7 +585,8 @@ def page_offer(self, url_split, post_string):
 | 
			
		||||
        'automation_strat_id': -1,
 | 
			
		||||
        'is_expired': offer.expire_at <= now,
 | 
			
		||||
        'active_ind': offer.active_ind,
 | 
			
		||||
        'swap_type': strSwapDesc(offer.swap_type)
 | 
			
		||||
        'swap_type': strSwapDesc(offer.swap_type),
 | 
			
		||||
        'reverse': offer.bid_reversed
 | 
			
		||||
    }
 | 
			
		||||
    data.update(extend_data)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user