mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-08-11 00:30:12 -04:00
External links behind reverse proxies (Traefik, nginx) block iframe embedding via X-Frame-Options/CSP headers. Add a per-link boolean toggle so users can choose between iframe (default) and new-tab behavior. Keyboard shortcuts also respect the setting.
22 lines
964 B
Python
22 lines
964 B
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import Boolean, DateTime, Integer, String, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from backend.app.core.database import Base
|
|
|
|
|
|
class ExternalLink(Base):
|
|
"""External links for sidebar navigation."""
|
|
|
|
__tablename__ = "external_links"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
name: Mapped[str] = mapped_column(String(50))
|
|
url: Mapped[str] = mapped_column(String(500))
|
|
icon: Mapped[str] = mapped_column(String(50), default="link")
|
|
custom_icon: Mapped[str | None] = mapped_column(String(255), nullable=True) # Filename of uploaded icon
|
|
open_in_new_tab: Mapped[bool] = mapped_column(Boolean, default=False)
|
|
sort_order: Mapped[int] = mapped_column(Integer, default=0)
|
|
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
|
|
updated_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(), onupdate=func.now())
|