{% extends "base.html" %} {% block content %}

Connected Systems Studio

{% if error %} {% endif %} {% if success %} {% endif %}
Studio Scope

Connected Systems Studio now supports saved connections, secure credential separation, connection testing, natural-language queries, and request traces.

Use the selected connection to ask high-level questions and inspect the exact SQL, REST request, or ESQL QD generated.

Saved Connections
Private and org-shared connections you can access.
New Connection
{% if connections %} {% else %}

No saved connections yet.

{% endif %} {% if selected_connection_id %}
{% endif %}
Selected Connection
{% if selected_connection %}

Name: {{ selected_connection.name }}

Type: {{ selected_connection.system_type }}

Auth: {{ selected_connection.auth_type }}

Target: {{ selected_connection.base_url or selected_connection.resource_path or "n/a" }}

OpenAPI Spec: {{ selected_connection.openapi_spec_url or "n/a" }}

Org: {{ selected_connection.org_id or "n/a" }}

Has credentials: {{ "yes" if selected_connection.has_credentials else "no" }}

Credential Backend: {{ selected_connection.credential_backend or "none" }}

Sharing: {{ selected_connection.sharing_scope }}

Manage Access: {{ "owner/publisher" if can_manage_selected else "read-only" }}

{% if health_summary %}

Health: {{ health_summary.status }}

Retry Recommended: {{ "yes" if health_summary.retry_recommended else "no" }}

{% endif %} {% else %}

Select a saved connection to inspect it.

{% endif %}
{% if usage_summary %}
Governance Summary
Total Connections: {{ usage_summary.total_connections }}
Org Shared: {{ usage_summary.org_shared_connections }}
Saved Recipes: {{ usage_summary.saved_recipes }}
Total Queries: {{ usage_summary.total_queries }}
Failed Queries: {{ usage_summary.failed_queries }}
Unhealthy: {{ usage_summary.unhealthy_connections }}
Shared publishing: {{ "enabled for this user" if can_publish_shared_assets else "restricted to configured publisher IDs" }}
{% endif %}
Quick Examples
  • `Elastic REST`: `https://demo1:9250/my_cluster`
  • `Elastic ESQL`: same endpoint, QD can issue read-only ESQL
  • `OpenSearch`: `https://search.example.com`
  • `SQLite`: `/tmp/events.sqlite`
  • `Postgres`: `postgresql://user:pass@db.example.com:5432/appdb`
  • `GitLab API`: `https://gitlab.example.com`
  • `Generic REST`: `https://api.example.com`
Natural-Language Setup
QD will extract a connection draft, show a preview, and wait for explicit save confirmation.
{% if interpreted_setup %}
Interpreted Draft Preview

Intent: {{ interpreted_setup.interpreted_intent }}

Name: {{ interpreted_setup.draft.name }}

Type: {{ interpreted_setup.draft.system_type }}

Base URL: {{ interpreted_setup.draft.base_url or "n/a" }}

Path: {{ interpreted_setup.draft.resource_path or "n/a" }}

Default Index: {{ interpreted_setup.draft.default_index or "n/a" }}

Auth: {{ interpreted_setup.credential_summary.auth_type }}

Username: {{ interpreted_setup.credential_summary.username or "n/a" }}

Password detected: {{ "yes" if interpreted_setup.credential_summary.has_password else "no" }}

Token detected: {{ "yes" if interpreted_setup.credential_summary.has_token else "no" }}

API key detected: {{ "yes" if interpreted_setup.credential_summary.has_api_key else "no" }}

{% if interpreted_setup.warnings %}
    {% for item in interpreted_setup.warnings %}
  • {{ item }}
  • {% endfor %}
{% endif %}
{% else %}

This mode is designed for demo-style setup. Parsed drafts are not persisted until you click Save Connection below.

{% endif %}
Query Workspace
{% if selected_connection %}
Active Connection
{{ selected_connection.name }}
{{ selected_connection.system_type }} | {{ selected_connection.base_url or selected_connection.resource_path or "No target configured" }}
Org: {{ selected_connection.org_id or "n/a" }}
Auth: {{ selected_connection.auth_type }}
Last test: {{ selected_connection.last_test_status or "not run" }}
QD will translate the request into SQL, REST, or ESQL depending on the active connection type.
{% if openapi_operations %}
OpenAPI Operations
Route-aware planning is enabled from the configured OpenAPI specification.
{% for item in openapi_operations[:10] %}
{{ item.operation_id }} {{ item.method }}
{{ item.path }}
{{ item.summary or item.description or "No description provided." }}
{% endfor %}
{% endif %}
Connection Health
{% if health_summary %}

Status: {{ health_summary.status }}

Last Test: {{ health_summary.last_test_at or "never" }}

Retry Recommended: {{ "yes" if health_summary.retry_recommended else "no" }}

{% else %}

No health information is available for the selected connection yet.

{% endif %}
Save Query As Recipe
Org-shared recipes are limited to configured publisher IDs.
{% if recipes %}
Recipes
{% for recipe in recipes %}
{{ recipe.title }}
{% if recipe.source == "saved" %} Saved {{ recipe.sharing_scope }} {% endif %}

{{ recipe.description }}

{{ recipe.question }}
{% if recipe.source == "saved" and recipe.can_manage %}
{% endif %}
{% endfor %}
{% endif %} {% if is_elastic_connection %}
Elastic Explorer
Flagship demo helpers for the selected Elastic connection.
Default index: {{ selected_connection.default_index or "*" }}
{% if indices_result %} {% if indices_result.ok %}
Discovered {{ indices_result.indices | length }} indices.
{% for item in indices_result.indices[:12] %} {% endfor %}
Index Health Status Docs Store Size
{{ item.index }} {{ item.health or "n/a" }} {{ item.status or "n/a" }} {{ item.docs_count or "n/a" }} {{ item.store_size or "n/a" }}
{% else %}
{{ indices_result.error }}
{% endif %} {% else %}

Use index discovery to inspect the cluster before asking higher-level operational questions.

{% endif %}
{% endif %}
Answer
{% if query_result %}

{{ query_result.answer }}

{% if query_result.result %}
Raw Result Preview
{{ query_result.result | tojson(indent=2) }}
{% endif %} {% else %}

Run a question to see a human-readable answer here.

{% endif %}
Request Trace
{% if query_result %}

Intent: {{ query_result.trace.intent }}

Planner: {{ query_result.trace.planner_source }}

Tool: {{ query_result.trace.tool_name }}

Execution: {{ query_result.trace.execution_ms }} ms

{% if query_result.trace.operation_name %}

Operation: {{ query_result.trace.operation_name }}

{% endif %} {% if query_result.trace.method %}

Method: {{ query_result.trace.method }}

{% endif %} {% if query_result.trace.url %}

URL: {{ query_result.trace.url }}

{% endif %} {% if query_result.trace.sql %}

SQL

{{ query_result.trace.sql }}
{% endif %} {% if query_result.trace.esql %}

ESQL

{{ query_result.trace.esql }}
{% endif %} {% if query_result.trace.request_body %}

Request Body

{{ query_result.trace.request_body | tojson(indent=2) }}
{% endif %} {% if query_result.trace.query_params %}

Query Params

{{ query_result.trace.query_params | tojson(indent=2) }}
{% endif %} {% if query_result.trace.response_preview %}

Response Preview

{{ query_result.trace.response_preview | tojson(indent=2) }}
{% endif %} {% else %}

The trace panel will show the generated request and result preview after you run a query.

{% endif %}
Recent Query History
{% if history_items %} {% for item in history_items %}
{{ item.question }} {{ item.status }}
{{ item.completed_at }}
{{ item.final_answer }}
{% endfor %} {% else %}

No query history yet for this connection.

{% endif %}
Audit Trail
{% if audit_items %} {% for item in audit_items %}
{{ item.action }} {{ item.status }}
{{ item.created_at }}
{% if item.detail %}
Detail
{{ item.detail | tojson(indent=2) }}
{% endif %}
{% endfor %} {% else %}

No audit events yet for this connection.

{% endif %}
{% else %}

Select or save a connection first.

The query workspace uses the active saved connection and keeps the generated request trace visible for demos.

{% endif %}
{% if usage_summary and usage_summary["items"] %}
Connection Usage Overview
{% for item in usage_summary["items"] %} {% endfor %}
Name Scope Queries Recipes Failures Last Query
{{ item.name }} {{ item.sharing_scope }} {{ item.query_count }} {{ item.recipe_count }} {{ item.failed_query_count }} {{ item.last_query_at or "never" }}
{% endif %}
Connection Editor{% if mode == 'edit' %}: Edit Saved Connection{% else %}: New Connection{% endif %}
Used only for Generic REST connections to discover operations and improve route planning.
Org-shared publishing is restricted to configured publisher IDs.
Do not put secrets or Authorization headers here.
Use for safe, reusable query defaults only.
Clear Form {% if selected_connection_id and can_manage_selected %} {% endif %}
{% if selected_connection_id and not can_manage_selected %}
This connection is read-only for your current user.
{% endif %}
Credential Management
{% if selected_connection_id %}

Rotate or replace the stored credentials for the selected connection without changing the rest of its metadata. The secret stays in the configured backend and is never rendered back after save.

{% if not can_manage_selected %}
Only the owner or a permitted shared publisher can rotate or clear credentials.
{% endif %}
{% else %}

Select a saved connection before rotating or clearing credentials.

{% endif %}
Connection Test Result
{% if test_result %}
{{ test_result | tojson(indent=2) }}
{% else %}

Run Test Connection to validate the current draft or selected saved connection.

{% endif %}
{% endblock %}