Add 3x-ui v3.5.0 API panel connection and client management

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-25 21:59:31 +03:00
co-authored by Cursor
parent cd106b68bc
commit b67e7b80ba
10 changed files with 826 additions and 3 deletions
+20
View File
@@ -90,3 +90,23 @@ class VpnClient(Base):
)
server: Mapped[VpnServer] = relationship(back_populates="clients")
class XuiPanel(Base):
"""Remote 3x-ui panel connection (API v3.5.0)."""
__tablename__ = "xui_panels"
id: Mapped[int] = mapped_column(Integer, primary_key=True)
name: Mapped[str] = mapped_column(String(120))
base_url: Mapped[str] = mapped_column(String(512))
username: Mapped[str | None] = mapped_column(String(128), nullable=True)
password: Mapped[str | None] = mapped_column(Text, nullable=True)
api_token: Mapped[str | None] = mapped_column(Text, nullable=True)
verify_ssl: Mapped[bool] = mapped_column(Boolean, default=True)
is_reachable: Mapped[bool] = mapped_column(Boolean, default=False)
last_error: Mapped[str | None] = mapped_column(Text, nullable=True)
panel_info: Mapped[str | None] = mapped_column(Text, nullable=True)
last_checked: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
is_enabled: Mapped[bool] = mapped_column(Boolean, default=True)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())