mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-05 03:40:48 +01:00
349 lines
10 KiB
HTML
349 lines
10 KiB
HTML
{% extends "baseTemplate/index.html" %}
|
|
{% load i18n %}
|
|
{% load static %}
|
|
{% block title %}{% trans "Manage SSL - CyberPanel" %}{% endblock %}
|
|
|
|
{% block header_scripts %}
|
|
<style>
|
|
/* SSL Management Page Specific Styles */
|
|
.ssl-wrapper {
|
|
background: transparent;
|
|
padding: 20px;
|
|
}
|
|
|
|
.ssl-container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.ssl-section {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 25px;
|
|
margin-bottom: 25px;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|
border: 1px solid #e8e9ff;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
color: #2f3640;
|
|
margin-bottom: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.section-title::before {
|
|
content: '';
|
|
width: 4px;
|
|
height: 24px;
|
|
background: #5b5fcf;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.ssl-docs-link {
|
|
background: #f8f9ff;
|
|
border: 1px solid #e8e9ff;
|
|
color: #5b5fcf;
|
|
padding: 6px 14px;
|
|
border-radius: 6px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
text-decoration: none;
|
|
transition: all 0.2s ease;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.ssl-docs-link:hover {
|
|
background: #5b5fcf;
|
|
color: white;
|
|
border-color: #5b5fcf;
|
|
box-shadow: 0 2px 4px rgba(91,95,207,0.3);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.ssl-description {
|
|
color: #8893a7;
|
|
font-size: 14px;
|
|
margin-bottom: 25px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.form-container {
|
|
background: #fafbff;
|
|
border: 1px solid #e8e9ff;
|
|
border-radius: 8px;
|
|
padding: 25px;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-label {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: #2f3640;
|
|
margin-bottom: 8px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
display: block;
|
|
}
|
|
|
|
.form-control {
|
|
width: 100%;
|
|
padding: 12px 16px;
|
|
border: 1px solid #e8e9ff;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
color: #2f3640;
|
|
background: white;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.form-control:focus {
|
|
outline: none;
|
|
border-color: #5b5fcf;
|
|
box-shadow: 0 0 0 3px rgba(91,95,207,0.1);
|
|
}
|
|
|
|
.btn-primary {
|
|
background: #5b5fcf;
|
|
border: 1px solid #5b5fcf;
|
|
color: white;
|
|
padding: 12px 24px;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #4b4fbf;
|
|
border-color: #4b4fbf;
|
|
box-shadow: 0 3px 8px rgba(91,95,207,0.3);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.btn-primary:disabled {
|
|
background: #94a3b8;
|
|
border-color: #94a3b8;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.ssl-details-card {
|
|
background: #f0f9ff;
|
|
border: 1px solid #bae6fd;
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.ssl-details-card h4 {
|
|
font-size: 14px;
|
|
font-weight: 700;
|
|
color: #0c4a6e;
|
|
margin-bottom: 15px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.ssl-detail-item {
|
|
margin-bottom: 10px;
|
|
font-size: 14px;
|
|
color: #64748b;
|
|
}
|
|
|
|
.ssl-detail-item strong {
|
|
color: #2f3640;
|
|
font-weight: 600;
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.ssl-status {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 4px 12px;
|
|
border-radius: 6px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.ssl-status.active {
|
|
background: #d1fae5;
|
|
color: #065f46;
|
|
}
|
|
|
|
.ssl-status.inactive {
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
}
|
|
|
|
.alert {
|
|
padding: 15px;
|
|
border-radius: 8px;
|
|
margin-bottom: 20px;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.alert-success {
|
|
background: #f0f9ff;
|
|
border: 1px solid #bae6fd;
|
|
color: #0c4a6e;
|
|
}
|
|
|
|
.alert-danger {
|
|
background: #fef2f2;
|
|
border: 1px solid #fecaca;
|
|
color: #991b1b;
|
|
}
|
|
|
|
.loading-spinner {
|
|
width: 16px;
|
|
height: 16px;
|
|
margin-left: 8px;
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 768px) {
|
|
.ssl-wrapper {
|
|
padding: 15px;
|
|
}
|
|
|
|
.ssl-section {
|
|
padding: 20px;
|
|
}
|
|
|
|
.form-container {
|
|
padding: 20px;
|
|
}
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="ssl-wrapper">
|
|
<div class="ssl-container" ng-controller="sslIssueCtrl">
|
|
<!-- Header Section -->
|
|
<div class="ssl-section">
|
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; flex-wrap: wrap; gap: 15px;">
|
|
<h2 class="section-title">MANAGE SSL</h2>
|
|
<a href="http://go.cyberpanel.net/ssl-docs" target="_blank" class="ssl-docs-link">
|
|
<i class="fas fa-book"></i>
|
|
{% trans "SSL Docs" %}
|
|
</a>
|
|
</div>
|
|
<p class="ssl-description">{% trans "This page can be used to issue Let's Encrypt SSL for existing websites on server." %}</p>
|
|
</div>
|
|
|
|
<!-- SSL Management Section -->
|
|
<div class="ssl-section">
|
|
<h3 class="section-title">
|
|
SSL CERTIFICATE MANAGEMENT
|
|
<img ng-hide="manageSSLLoading" src="{% static 'images/loading.gif' %}" class="loading-spinner">
|
|
</h3>
|
|
|
|
<div class="form-container">
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">{% trans "Select Website" %}</label>
|
|
<select ng-change="showbtn()" ng-model="virtualHost" class="form-control">
|
|
<option value="">-- Select a website --</option>
|
|
{% for items in websiteList %}
|
|
<option>{{ items }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<!-- SSL Details Card -->
|
|
<div ng-if="sslDetails" class="ssl-details-card">
|
|
<h4>
|
|
<i class="fas fa-shield-alt" style="margin-right: 8px;"></i>
|
|
SSL CERTIFICATE STATUS
|
|
</h4>
|
|
<div ng-if="sslDetails.hasSSL">
|
|
<div class="ssl-detail-item">
|
|
<strong>Status:</strong>
|
|
<span class="ssl-status active">
|
|
<i class="fas fa-check-circle"></i>
|
|
Active
|
|
</span>
|
|
</div>
|
|
<div class="ssl-detail-item">
|
|
<strong>Issued By:</strong> {$ sslDetails.authority $}
|
|
</div>
|
|
<div class="ssl-detail-item">
|
|
<strong>Expiry Date:</strong> {$ sslDetails.expiryDate $}
|
|
</div>
|
|
<div class="ssl-detail-item">
|
|
<strong>Days Remaining:</strong>
|
|
<span style="color: #16a34a; font-weight: 600;">{$ sslDetails.days $} days</span>
|
|
</div>
|
|
</div>
|
|
<div ng-if="!sslDetails.hasSSL">
|
|
<div class="ssl-detail-item">
|
|
<strong>Status:</strong>
|
|
<span class="ssl-status inactive">
|
|
<i class="fas fa-exclamation-circle"></i>
|
|
No SSL Certificate
|
|
</span>
|
|
</div>
|
|
<div ng-if="sslDetails.error_message" class="ssl-detail-item" style="color: #dc2626;">
|
|
<strong>Error:</strong> {$ sslDetails.error_message $}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div ng-hide="issueSSLBtn" class="form-group">
|
|
<button type="button" ng-click="issueSSL()" class="btn-primary">
|
|
<i class="fas fa-lock"></i>
|
|
{% trans "Issue SSL" %}
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Success/Error Messages -->
|
|
<div ng-hide="canNotIssue" class="alert alert-danger">
|
|
<i class="fas fa-exclamation-triangle" style="margin-right: 8px;"></i>
|
|
<strong>{% trans "Cannot issue SSL." %}</strong> {% trans "Error message:" %} {$ errorMessage $}
|
|
</div>
|
|
|
|
<div ng-hide="sslIssued" class="alert alert-success">
|
|
<i class="fas fa-check-circle" style="margin-right: 8px;"></i>
|
|
<strong>{% trans "SSL Issued Successfully!" %}</strong><br>
|
|
{% trans "SSL Issued for" %} <strong>{$ sslDomain $}</strong>
|
|
</div>
|
|
|
|
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
|
<i class="fas fa-exclamation-triangle" style="margin-right: 8px;"></i>
|
|
<strong>{% trans "Connection Error" %}</strong><br>
|
|
{% trans "Could not connect to server. Please refresh this page." %}
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block footer_scripts %}
|
|
<script src="{% static 'manageSSL/manageSSL.js' %}"></script>
|
|
{% endblock %}
|