{% extends 'base.html' %} {% load static %} {% block title %}{{ data_source.name }} - Data Source Details{% endblock %} {% block content %}
Connection Status
{% if data_source.status == 'active' %}
Connected
{% elif data_source.status == 'error' %}
Connection Error
{% elif data_source.status == 'syncing' %}
Syncing
{% else %}
Disconnected
{% endif %}
{{ data_source.last_test|default:"Never tested" }}
{{ data_source.response_time|default:"N/A" }}
{% if data_source.last_sync %} {{ data_source.last_sync|timesince }} ago {% else %} Never synced {% endif %}
{{ data_source.record_count|default:"0"|floatformat:0 }}
{% if data_source.last_error %}
Last Error

{{ data_source.last_error }}

{{ data_source.error_timestamp|timesince }} ago
{% endif %}
Data Preview
{% if data_source.sample_data %}
{% for column in data_source.columns %} {% endfor %} {% for row in data_source.sample_data %} {% for value in row %} {% endfor %} {% endfor %}
{{ column.name }}
{{ value|truncatechars:50 }}
{% else %}
No Data Available

Connect and sync the data source to see preview.

{% endif %}
Sync History
{% if data_source.sync_history %}
{% for sync in data_source.sync_history %}
{% if sync.status == 'success' %} {% elif sync.status == 'error' %} {% else %} {% endif %}
{{ sync.get_status_display }}

{{ sync.message }}

{{ sync.timestamp|timesince }} ago
{{ sync.records_processed }} records
{% endfor %}
{% else %}
No Sync History

Sync history will appear here after the first synchronization.

{% endif %}
Basic Information
{{ data_source.name }}
{{ data_source.get_source_type_display }}
{{ data_source.description|default:"No description provided" }}
{{ data_source.created_by|default:"System" }}
{{ data_source.created_at|date:"M d, Y H:i" }}
{{ data_source.updated_at|date:"M d, Y H:i" }}
Configuration
{% if data_source.source_type == 'database' %}
{{ data_source.db_type|default:"Not specified" }}
{{ data_source.host|default:"Not specified" }}
{{ data_source.database|default:"Not specified" }}
{% elif data_source.source_type == 'api' %}
{{ data_source.api_url|default:"Not specified" }}
{{ data_source.auth_type|default:"None" }}
{% elif data_source.source_type == 'file' %}
{{ data_source.file_path|default:"Not specified" }}
{{ data_source.file_format|default:"Not specified" }}
{% endif %}
{{ data_source.get_sync_frequency_display|default:"Manual" }}
{% if data_source.auto_sync %}Enabled{% else %}Disabled{% endif %}
Statistics
{{ data_source.total_syncs|default:"0" }}
Total Syncs
{{ data_source.successful_syncs|default:"0" }}
Successful
{{ data_source.failed_syncs|default:"0" }}
Failed
{{ data_source.avg_sync_time|default:"0" }}s
Avg Time
Actions
Edit Configuration
Delete Source
{% endblock %}