- Site model: add waiter_domain and last_seen_local_ip columns - HeartbeatRequest: accept optional local_ip field from local backend - HeartbeatResponse: return waiter_domain to local backend - heartbeat router: persist local_ip on each check-in - SiteDetailPage: show Public IP / Local IP separately, add Waiter Domain card with inline edit modal Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
1002 B
Python
24 lines
1002 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from database import Base
|
|
|
|
|
|
class Site(Base):
|
|
__tablename__ = "sites"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
site_id = Column(String, unique=True, nullable=False, index=True)
|
|
name = Column(String, nullable=False)
|
|
owner_name = Column(String, nullable=False)
|
|
contact_email = Column(String, nullable=False)
|
|
secret_key_hash = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
is_locked = Column(Boolean, default=False)
|
|
lock_reason = Column(String, nullable=True)
|
|
license_expires_at = Column(DateTime(timezone=True), nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
last_seen_at = Column(DateTime(timezone=True), nullable=True)
|
|
last_seen_ip = Column(String, nullable=True)
|
|
last_seen_local_ip = Column(String, nullable=True)
|
|
waiter_domain = Column(String, nullable=True)
|