2025-08-12 13:33:25 +03:00

95 lines
4.7 KiB
HTML

<!-- System Health Status -->
{% if systems %}
<div class="row">
<div class="col-md-4 text-center mb-3">
<div class="bg-success bg-gradient rounded-circle d-flex align-items-center justify-content-center mx-auto mb-2" style="width: 60px; height: 60px;">
<i class="fas fa-check-circle fa-lg text-white"></i>
</div>
<h4 class="text-success mb-0">{{ healthy_systems }}</h4>
<small class="text-muted">Healthy Systems</small>
</div>
<div class="col-md-4 text-center mb-3">
<div class="bg-danger bg-gradient rounded-circle d-flex align-items-center justify-content-center mx-auto mb-2" style="width: 60px; height: 60px;">
<i class="fas fa-times-circle fa-lg text-white"></i>
</div>
<h4 class="text-danger mb-0">{{ unhealthy_systems }}</h4>
<small class="text-muted">Unhealthy Systems</small>
</div>
<div class="col-md-4 text-center mb-3">
<div class="bg-secondary bg-gradient rounded-circle d-flex align-items-center justify-content-center mx-auto mb-2" style="width: 60px; height: 60px;">
<i class="fas fa-question-circle fa-lg text-white"></i>
</div>
<h4 class="text-secondary mb-0">{{ unknown_systems }}</h4>
<small class="text-muted">Unknown Status</small>
</div>
</div>
{% if unhealthy_systems > 0 %}
<div class="alert alert-warning mt-3" role="alert">
<i class="fas fa-exclamation-triangle me-2"></i>
<strong>Attention Required:</strong> {{ unhealthy_systems }} system{{ unhealthy_systems|pluralize }}
{{ unhealthy_systems|pluralize:"is,are" }} currently unhealthy and may need maintenance.
</div>
{% endif %}
<div class="mt-4">
<h6 class="text-muted mb-3">System Details</h6>
<div class="row">
{% for system in systems|slice:":6" %}
<div class="col-lg-6 mb-3">
<div class="card border-0 shadow-sm h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-start">
<div class="d-flex align-items-center flex-grow-1">
<div class="bg-{% if system.health_status == 'HEALTHY' %}success{% elif system.health_status == 'UNHEALTHY' %}danger{% else %}secondary{% endif %} bg-gradient rounded-circle d-flex align-items-center justify-content-center me-3" style="width: 32px; height: 32px;">
<i class="fas fa-{% if system.system_type == 'ehr' %}file-medical{% elif system.system_type == 'lis' %}flask{% elif system.system_type == 'ris' %}x-ray{% else %}server{% endif %} text-white small"></i>
</div>
<div>
<div class="fw-semibold">{{ system.name }}</div>
<small class="text-muted">{{ system.get_system_type_display }}</small>
</div>
</div>
<div class="text-end">
<span class="badge bg-{% if system.health_status == 'HEALTHY' %}success{% elif system.health_status == 'UNHEALTHY' %}danger{% else %}secondary{% endif %} small">
{% if system.health_status == 'HEALTHY' %}
<i class="fas fa-check me-1"></i>Healthy
{% elif system.health_status == 'UNHEALTHY' %}
<i class="fas fa-times me-1"></i>Unhealthy
{% else %}
<i class="fas fa-question me-1"></i>Unknown
{% endif %}
</span>
{% if system.last_health_check %}
<div class="text-muted small mt-1">
{{ system.last_health_check|timesince }} ago
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% if systems|length > 6 %}
<div class="text-center mt-3">
<a href="{% url 'integration:external_system_list' %}" class="btn btn-outline-primary">
<i class="fas fa-list me-2"></i>View All {{ systems|length }} Systems
</a>
</div>
{% endif %}
</div>
{% else %}
<div class="text-center py-4">
<i class="fas fa-server fa-3x text-muted mb-3"></i>
<h6 class="text-muted">No External Systems</h6>
<p class="text-muted">External systems will appear here once configured</p>
<a href="{% url 'integration:external_system_create' %}" class="btn btn-primary">
<i class="fas fa-plus me-2"></i>Add First System
</a>
</div>
{% endif %}