feat(bridges): next generation bridge management
This commit is contained in:
parent
20fad30a06
commit
05285a4ae6
12 changed files with 329 additions and 89 deletions
|
@ -44,6 +44,15 @@ portal.register_blueprint(storage, url_prefix="/state")
|
|||
portal.register_blueprint(webhook, url_prefix="/webhook")
|
||||
|
||||
|
||||
@portal.app_template_filter("bridge_expiry")
|
||||
def calculate_bridge_expiry(b: Bridge) -> str:
|
||||
expiry = b.deprecated + timedelta(hours=b.conf.expiry_hours)
|
||||
countdown = expiry - datetime.utcnow()
|
||||
if countdown.days == 0:
|
||||
return f"{countdown.seconds // 3600} hours"
|
||||
return f"{countdown.days} days"
|
||||
|
||||
|
||||
@portal.app_template_filter("mirror_expiry")
|
||||
def calculate_mirror_expiry(s: datetime) -> str:
|
||||
expiry = s + timedelta(days=3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue