diff --git a/app/web/router.py b/app/web/router.py index 9bf5a92..80d5030 100644 --- a/app/web/router.py +++ b/app/web/router.py @@ -883,6 +883,28 @@ async def admin_marketplaces_page( return templates.TemplateResponse(request, "admin_marketplaces.html", ctx) +@router.get("/admin/welcome", response_class=HTMLResponse) +async def admin_welcome_page( + request: Request, + user: dict = Depends(require_admin), + conn: duckdb.DuckDBPyConnection = Depends(_get_db), +): + from src.repositories.welcome_template import WelcomeTemplateRepository + from src.welcome_template import _load_default_template + + row = WelcomeTemplateRepository(conn).get() + ctx = _build_context( + request, + user=user, + current=row["content"] or "", + default_template=_load_default_template(), + updated_at=row["updated_at"], + updated_by=row["updated_by"], + is_override=row["content"] is not None, + ) + return templates.TemplateResponse(request, "admin_welcome.html", ctx) + + @router.get("/tokens", response_class=HTMLResponse) async def my_tokens_page( request: Request, diff --git a/app/web/templates/_app_header.html b/app/web/templates/_app_header.html index 5f5a4d6..52f8f47 100644 --- a/app/web/templates/_app_header.html +++ b/app/web/templates/_app_header.html @@ -14,7 +14,7 @@ Install CLI {% if session.user.is_admin %} Marketplaces - {% set _admin_active = _path.startswith('/admin/tables') or _path.startswith('/admin/tokens') or _path.startswith('/admin/users') or _path.startswith('/admin/groups') or _path.startswith('/admin/access') or _path.startswith('/admin/server-config') %} + {% set _admin_active = _path.startswith('/admin/tables') or _path.startswith('/admin/tokens') or _path.startswith('/admin/users') or _path.startswith('/admin/groups') or _path.startswith('/admin/access') or _path.startswith('/admin/server-config') or _path.startswith('/admin/welcome') %}
{% endif %} diff --git a/app/web/templates/admin_welcome.html b/app/web/templates/admin_welcome.html new file mode 100644 index 0000000..e7dc16e --- /dev/null +++ b/app/web/templates/admin_welcome.html @@ -0,0 +1,90 @@ +{% extends "base.html" %} +{% block title %}Welcome Prompt — Admin{% endblock %} +{% block content %} +
+

Analyst Welcome Prompt

+

+ This is the CLAUDE.md generated for analysts when they run + da analyst setup. Edit it to customize the onboarding + instructions for this instance. Leave empty (or click Reset to default) + to use the OSS-shipped default. +

+ + {% if is_override %} +

+ Overridden by {{ updated_by }} on + {{ updated_at.strftime("%Y-%m-%d %H:%M UTC") if updated_at else "—" }}. +

+ {% else %} +

Using shipped default.

+ {% endif %} + +

Available placeholders

+
+{{ "{{ instance.name }}" }}                 — instance display name
+{{ "{{ instance.subtitle }}" }}             — operator name
+{{ "{{ server.url }}" }}                    — full server URL
+{{ "{{ server.hostname }}" }}               — host part
+{{ "{{ sync_interval }}" }}                 — refresh cadence (instance.yaml)
+{{ "{{ data_source.type }}" }}              — keboola | bigquery | local
+{{ "{{ tables }}" }}                        — list of {name, description, query_mode}
+{{ "{{ metrics.count }}" }}, {{ "{{ metrics.categories }}" }}
+{{ "{{ marketplaces }}" }}                  — RBAC-filtered list of {slug, name, plugins[]}
+{{ "{{ user.email }}" }}, {{ "{{ user.name }}" }}, {{ "{{ user.is_admin }}" }}, {{ "{{ user.groups }}" }}
+{{ "{{ now }}" }}, {{ "{{ today }}" }}
+  
+ +
+ +
+ + + +
+
+ +
+
+ + +{% endblock %}