3765d4d476
Add optional auto logoff of stuck sessions on RDG flap and direct RDP failure. Hide the RDS break button on old flap 302 when the user later reconnects or the workstation session is closed. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
2.4 KiB
Python
41 lines
2.4 KiB
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import Boolean, DateTime, String, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.database import Base
|
|
|
|
UI_SETTINGS_ROW_ID = 1
|
|
|
|
|
|
class UiSettings(Base):
|
|
"""Singleton: глобальные настройки интерфейса SAC."""
|
|
|
|
__tablename__ = "ui_settings"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
show_sidebar_system_stats: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
|
|
win_admin_user: Mapped[str | None] = mapped_column(String(256), nullable=True)
|
|
win_admin_password: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
linux_admin_user: Mapped[str | None] = mapped_column(String(128), nullable=True)
|
|
linux_admin_password: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
agent_update_mode: Mapped[str] = mapped_column(String(16), default="gpo", nullable=False)
|
|
agent_update_fallback_enabled: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
|
|
agent_update_fallback_minutes: Mapped[int] = mapped_column(default=15, nullable=False)
|
|
agent_recommended_rdp_version: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
|
agent_recommended_ssh_version: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
|
agent_min_rdp_version: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
|
agent_min_ssh_version: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
|
win_agent_update_script: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
agent_rdp_git_repo_url: Mapped[str | None] = mapped_column(String(512), nullable=True)
|
|
agent_ssh_git_repo_url: Mapped[str | None] = mapped_column(String(512), nullable=True)
|
|
agent_git_branch: Mapped[str] = mapped_column(String(64), default="main", nullable=False)
|
|
agent_git_rdp_version: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
|
agent_git_ssh_version: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
|
agent_git_fetched_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
|
|
login_ip_whitelist: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
login_sync_fail2ban: Mapped[bool] = mapped_column(default=False, server_default="false", nullable=False)
|
|
auto_rdp_flap_disconnect: Mapped[bool] = mapped_column(
|
|
Boolean, default=False, server_default="false", nullable=False
|
|
)
|