mirror of
https://github.com/Sudo-JHare/FHIRFLARE-IG-Toolkit.git
synced 2025-06-15 13:09:59 +00:00
147 lines
9.5 KiB
HTML
147 lines
9.5 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="px-4 py-5 my-5 text-center">
|
|
<img class="d-block mx-auto mb-4" src="{{ url_for('static', filename='FHIRFLARE.png') }}" alt="FHIRFLARE Ig Toolkit" width="192" height="192">
|
|
<h1 class="display-5 fw-bold text-body-emphasis">Welcome to {{ site_name }}</h1>
|
|
<div class="col-lg-6 mx-auto">
|
|
<p class="lead mb-4">
|
|
This is the starting Point for your Journey through the IG's
|
|
</p>
|
|
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
|
|
<a href="{{ url_for('import_ig') }}" class="btn btn-primary btn-lg px-4 gap-3">Import IGs</a>
|
|
<a href="{{ url_for('view_igs') }}" class="btn btn-outline-secondary btn-lg px-4 disabled">Manage FHIR Packages</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container mt-4">
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h2><i class="bi bi-journal-arrow-down me-2"></i>Manage FHIR Packages</h2>
|
|
<div>
|
|
<a href="{{ url_for('import_ig') }}" class="btn btn-success"><i class="bi bi-download me-1"></i> Import More IGs</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row g-4">
|
|
<div class="col-md-6">
|
|
<div class="card h-100">
|
|
<div class="card-header"><i class="bi bi-folder-symlink me-1"></i> Downloaded Packages ({{ packages|length }})</div>
|
|
<div class="card-body">
|
|
{% if packages %}
|
|
<div class="table-responsive">
|
|
<p class="mb-2"><small><span class="badge bg-danger text-light border me-1">Risk:</span> Duplicate Dependency with Different Versions</small></p>
|
|
<table class="table table-sm table-hover">
|
|
<thead>
|
|
<tr><th>Package Name</th><th>Version</th><th>Actions</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for pkg in packages %}
|
|
{% set is_processed = (pkg.name, pkg.version) in processed_ids %}
|
|
{% set is_duplicate = pkg.name in duplicate_names and duplicate_names[pkg.name]|length > 1 %}
|
|
{% set group_color = group_colors[pkg.name] if is_duplicate else 'bg-light' %}
|
|
<tr class="{% if is_duplicate %}{{ group_color }} text-dark{% endif %}">
|
|
<td>
|
|
<code>{{ pkg.name }}</code>
|
|
{% if is_duplicate %}
|
|
<span class="badge bg-danger text-light ms-1">Duplicate</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ pkg.version }}</td>
|
|
<td>
|
|
<div class="btn-group btn-group-sm">
|
|
{% if is_processed %}
|
|
<span class="btn btn-success disabled"><i class="bi bi-check-lg"></i> Processed</span>
|
|
{% else %}
|
|
<form method="POST" action="{{ url_for('process_ig') }}" style="display:inline;">
|
|
<input type="hidden" name="filename" value="{{ pkg.filename }}">
|
|
<button type="submit" class="btn btn-outline-primary"><i class="bi bi-gear"></i> Process</button>
|
|
</form>
|
|
{% endif %}
|
|
<form method="POST" action="{{ url_for('delete_ig') }}" style="display:inline;">
|
|
<input type="hidden" name="filename" value="{{ pkg.filename }}">
|
|
<button type="submit" class="btn btn-outline-danger" onclick="return confirm('Are you sure you want to delete {{ pkg.name }}#{{ pkg.version }}?');"><i class="bi bi-trash"></i> Delete</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% if duplicate_groups %}
|
|
<p class="mt-2 small text-muted">Duplicates detected:
|
|
{% for name, versions in duplicate_groups.items() %}
|
|
{% if versions|length > 1 %}
|
|
{% set group_color = group_colors[name] if name in group_colors else 'bg-warning' %}
|
|
<span class="badge {{ group_color }} text-dark">{{ name }} ({{ versions|join(', ') }})</span>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</p>
|
|
{% else %}
|
|
<p class="mt-2 small text-muted">No duplicates detected.</p>
|
|
{% endif %}
|
|
{% else %}
|
|
<p class="text-muted">No downloaded FHIR packages found.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<div class="card h-100">
|
|
<div class="card-header"><i class="bi bi-check-circle me-1"></i> Processed Packages ({{ processed_list|length }})</div>
|
|
<div class="card-body">
|
|
{% if processed_list %}
|
|
<p class="mb-2"><small><span class="badge bg-warning text-dark border me-1">MS</span> = Contains Must Support Elements</small></p>
|
|
<div class="table-responsive">
|
|
<table class="table table-sm table-hover">
|
|
<thead>
|
|
<tr><th>Package Name</th><th>Version</th><th>Resource Types</th><th>Actions</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for processed_ig in processed_list %}
|
|
<tr>
|
|
<td>
|
|
<code>{{ processed_ig.package_name }}</code>
|
|
</td>
|
|
<td>{{ processed_ig.version }}</td>
|
|
<td>
|
|
{% set types_info = processed_ig.resource_types_info %}
|
|
{% if types_info %}<div class="d-flex flex-wrap gap-1">
|
|
{% for type_info in types_info %}
|
|
{% if type_info.must_support %}
|
|
<span class="badge bg-warning text-dark border" title="Has Must Support">{{ type_info.name }}</span>
|
|
{% else %}
|
|
<span class="badge bg-light text-dark border">{{ type_info.name }}</span>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>{% else %}<small class="text-muted">N/A</small>{% endif %}
|
|
</td>
|
|
<td>
|
|
<div class="btn-group-vertical btn-group-sm w-100">
|
|
<a href="{{ url_for('view_ig', processed_ig_id=processed_ig.id) }}" class="btn btn-outline-info w-100" title="View Details"><i class="bi bi-search"></i> View</a>
|
|
<form method="POST" action="{{ url_for('unload_ig') }}" style="display:inline;">
|
|
<input type="hidden" name="ig_id" value="{{ processed_ig.id }}">
|
|
<button type="submit" class="btn btn-outline-warning w-100 mt-1" onclick="return confirm('Are you sure you want to unload {{ processed_ig.package_name }}#{{ processed_ig.version }}?');"><i class="bi bi-x-lg"></i> Unload</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="text-muted">No packages recorded as processed yet.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
{{ super() }}
|
|
{% endblock %} |