From e118543b2e8484c7d4b1a912c84ff071d6ee295d Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 16 Apr 2026 00:18:45 -0400 Subject: [PATCH] feat(dashboard): use public_base_url helper for share link generation --- roundtable/dashboard/routes.py | 3 +++ roundtable/templates/dashboard/share_created.html | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/roundtable/dashboard/routes.py b/roundtable/dashboard/routes.py index b5ccfb0..36afebe 100644 --- a/roundtable/dashboard/routes.py +++ b/roundtable/dashboard/routes.py @@ -11,6 +11,7 @@ from roundtable.models.users import UserRole from roundtable.models.hosts import Host from roundtable.models.monitors import PingResult, DnsResult from roundtable.models.dashboard import Dashboard, DashboardWidget, DashboardShareToken +from roundtable.core.settings import public_base_url from roundtable.core.widgets import get_available_widgets, WIDGET_REGISTRY dashboard_bp = Blueprint("dashboard", __name__) @@ -522,12 +523,14 @@ async def create_share_token(dash_id: int): result = await db.execute(select(Dashboard).where(Dashboard.id == dash_id)) dash = result.scalar_one_or_none() + share_url = f"{public_base_url(request)}/share/{raw_token}" return await render_template( "dashboard/share_created.html", dashboard=dash, raw_token=raw_token, label=label, expires_at=expires_at, + share_url=share_url, ) diff --git a/roundtable/templates/dashboard/share_created.html b/roundtable/templates/dashboard/share_created.html index aaf59b2..e5ffeb9 100644 --- a/roundtable/templates/dashboard/share_created.html +++ b/roundtable/templates/dashboard/share_created.html @@ -9,7 +9,6 @@ Copy this link now — it cannot be shown again - {% set share_url = request.host_url.rstrip('/') + '/share/' + raw_token %}