Files
haproxy-dashboard/templates/certificate_manager.html
Mateusz Gruszczyński addb21bc3e rewrite
2025-11-04 09:56:37 +01:00

116 lines
4.7 KiB
HTML

{% extends "base.html" %}
{% block title %}HAProxy • Certificate Manager{% endblock %}
{% block breadcrumb %}
<nav aria-label="breadcrumb" class="mb-3">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url_for('main.index') }}"><i class="bi bi-house"></i></a></li>
<li class="breadcrumb-item active">SSL Certificates</li>
</ol>
</nav>
{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h2><i class="bi bi-shield-lock"></i> SSL Certificates</h2>
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#uploadModal">
<i class="bi bi-cloud-upload"></i> Upload Certificate
</button>
</div>
<!-- Certificates Table -->
<div class="card">
<div class="card-header bg-dark">
<h5 class="mb-0"><i class="bi bi-list-check"></i> Certificates List</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover" id="certsTable">
<thead class="table-light">
<tr>
<th>Name</th>
<th>Common Name (CN)</th>
<th>Expires</th>
<th>Used By</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="certsList">
<tr><td colspan="6" class="text-center text-muted py-4">Loading...</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Upload Modal -->
<div class="modal fade" id="uploadModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title">Upload SSL Certificate</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form id="uploadForm" enctype="multipart/form-data">
<div class="mb-3">
<label class="form-label">Certificate Name *</label>
<input type="text" class="form-control" id="cert_name" required>
<small class="text-muted">e.g., example-com-2025</small>
</div>
<div class="mb-3">
<label class="form-label">PEM Certificate File * <i class="bi bi-info-circle" title="Combined certificate + key in PEM format"></i></label>
<input type="file" class="form-control" id="cert_file" accept=".pem,.crt,.cert,.key" required>
<small class="text-muted">
Supported formats: PEM (combined cert+key), .crt, .cert, .key
</small>
</div>
<div class="alert alert-info">
<i class="bi bi-info-circle"></i>
<strong>Supported Formats:</strong>
<ul class="mb-0 mt-2">
<li>Single file with both certificate and private key (PEM)</li>
<li>PKCS#12 (.p12) - will be converted</li>
<li>Separate .crt and .key files - upload combined</li>
</ul>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="uploadBtn">Upload</button>
</div>
</div>
</div>
</div>
<!-- Certificate Details Modal -->
<div class="modal fade" id="detailsModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header bg-info text-white">
<h5 class="modal-title">Certificate Details: <span id="detailsName"></span></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div id="detailsContent"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="exportBtn">
<i class="bi bi-download"></i> Export PEM
</button>
</div>
</div>
</div>
</div>
<script src="{{ url_for('static', filename='js/cert_manager.js') }}"></script>
{% endblock %}