mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 02:00:46 +08:00
feat(ume): real-time current alarms via WebSocket subscription
Add WS consumer, persisted subscription store, manual subscribe/cancel APIs, and UI controls; extend sync and tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
21f7cfba41
commit
4f8735a83f
13 changed files with 1171 additions and 22 deletions
|
|
@ -199,6 +199,19 @@ class UmeAlarmHistory(Base):
|
|||
raw_json: Mapped[str] = mapped_column(Text, default="{}")
|
||||
|
||||
|
||||
class UmeAlarmSubscription(Base):
|
||||
"""Persisted UME ALARM notification subscription (manual establish/cancel)."""
|
||||
|
||||
__tablename__ = "ume_alarm_subscription"
|
||||
|
||||
cache_key: Mapped[str] = mapped_column(String(64), primary_key=True, default="default")
|
||||
subscription_id: Mapped[str] = mapped_column(String(128), default="", index=True)
|
||||
wss_uri: Mapped[str] = mapped_column(Text, default="")
|
||||
topic: Mapped[str] = mapped_column(String(64), default="ALARM")
|
||||
established_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow, index=True)
|
||||
|
||||
|
||||
class UmeTokenCache(Base):
|
||||
__tablename__ = "ume_token_cache"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue