mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-01 05:09:43 +01:00
570 lines
16 KiB
HTML
570 lines
16 KiB
HTML
{% extends "baseTemplate/index.html" %}
|
|
{% load i18n %}
|
|
{% block title %}{% trans "Delete Website - CyberPanel" %}{% endblock %}
|
|
|
|
{% block header_scripts %}
|
|
<style>
|
|
/* Modern page styles matching new design */
|
|
.page-wrapper {
|
|
background: transparent;
|
|
padding: 20px;
|
|
}
|
|
|
|
.page-container {
|
|
max-width: 900px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.page-header {
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.page-title {
|
|
font-size: 28px;
|
|
font-weight: 700;
|
|
color: var(--text-primary, #2f3640);
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.page-subtitle {
|
|
font-size: 14px;
|
|
color: var(--text-secondary, #8893a7);
|
|
}
|
|
|
|
/* Card styles */
|
|
.content-card {
|
|
background: var(--bg-secondary, white);
|
|
border-radius: 12px;
|
|
padding: 30px;
|
|
box-shadow: 0 2px 8px var(--shadow-color, rgba(0,0,0,0.08));
|
|
border: 1px solid var(--border-color, #e8e9ff);
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.card-title {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--text-primary, #2f3640);
|
|
margin-bottom: 25px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.card-title::before {
|
|
content: '';
|
|
width: 4px;
|
|
height: 24px;
|
|
background: var(--danger-color, #dc3545);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
/* Form styles */
|
|
.form-group {
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--text-secondary, #64748b);
|
|
margin-bottom: 8px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.form-control {
|
|
width: 100%;
|
|
padding: 10px 14px;
|
|
border: 1px solid var(--border-color, #e8e9ff);
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
color: var(--text-primary, #2f3640);
|
|
background: var(--bg-secondary, white);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
/* Specific styling for select elements to fix Windows visibility issues */
|
|
select.form-control {
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
appearance: none;
|
|
background-color: var(--bg-secondary, white);
|
|
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
|
|
background-repeat: no-repeat;
|
|
background-position: right 10px center;
|
|
background-size: 20px;
|
|
padding-right: 40px;
|
|
color: var(--text-primary, #2f3640) !important;
|
|
font-size: 14px !important;
|
|
line-height: 1.5;
|
|
height: auto;
|
|
min-height: 42px;
|
|
}
|
|
|
|
/* Ensure option text is visible */
|
|
select.form-control option {
|
|
color: var(--text-primary, #2f3640);
|
|
background-color: var(--bg-secondary, white);
|
|
padding: 8px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* Fix for Windows high contrast mode */
|
|
@media screen and (-ms-high-contrast: active) {
|
|
select.form-control {
|
|
border: 2px solid;
|
|
}
|
|
select.form-control option {
|
|
background: var(--bg-secondary, white);
|
|
color: var(--text-primary, black);
|
|
}
|
|
}
|
|
|
|
.form-control:hover {
|
|
border-color: var(--danger-color, #dc3545);
|
|
}
|
|
|
|
.form-control:focus {
|
|
outline: none;
|
|
border-color: var(--danger-color, #dc3545);
|
|
box-shadow: 0 0 0 3px var(--danger-shadow, rgba(220,53,69,0.1));
|
|
}
|
|
|
|
/* Specific focus styles for select */
|
|
select.form-control:focus {
|
|
background-color: var(--bg-secondary, white);
|
|
color: var(--text-primary, #2f3640);
|
|
}
|
|
|
|
/* Website selector card */
|
|
.website-selector-card {
|
|
background: var(--bg-secondary, #fff5f5);
|
|
border: 1px solid var(--border-color, #ffdddd);
|
|
border-radius: 10px;
|
|
padding: 20px;
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.website-selector-label {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: #64748b;
|
|
margin-bottom: 10px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
/* Website details card */
|
|
.website-details-card {
|
|
background: var(--bg-hover, #f8f9ff);
|
|
border: 1px solid var(--border-color, #e8e9ff);
|
|
border-radius: 10px;
|
|
padding: 20px;
|
|
margin-bottom: 25px;
|
|
display: none;
|
|
}
|
|
|
|
.detail-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 12px 0;
|
|
border-bottom: 1px solid var(--border-color, #e8e9ff);
|
|
}
|
|
|
|
.detail-row:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.detail-label {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: #64748b;
|
|
}
|
|
|
|
.detail-value {
|
|
font-size: 14px;
|
|
color: var(--text-primary, #2f3640);
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Warning box */
|
|
.warning-box {
|
|
background: var(--warning-bg, #fff3e0);
|
|
border: 1px solid var(--warning-border, #ffe0b2);
|
|
border-radius: 10px;
|
|
padding: 20px;
|
|
margin-bottom: 25px;
|
|
display: flex;
|
|
align-items: start;
|
|
gap: 15px;
|
|
}
|
|
|
|
.warning-icon {
|
|
color: var(--warning-color, #ff9800);
|
|
font-size: 24px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.warning-content {
|
|
flex: 1;
|
|
}
|
|
|
|
.warning-title {
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
color: var(--text-primary, #2f3640);
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.warning-text {
|
|
font-size: 14px;
|
|
color: #64748b;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.warning-list {
|
|
margin-top: 12px;
|
|
padding-left: 20px;
|
|
}
|
|
|
|
.warning-list li {
|
|
font-size: 13px;
|
|
color: #64748b;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
/* Button styles */
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 12px 24px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.btn-danger {
|
|
background: var(--danger-color, #dc3545);
|
|
color: white;
|
|
}
|
|
|
|
.btn-danger:hover {
|
|
background: var(--danger-hover, #c82333);
|
|
box-shadow: 0 4px 12px rgba(220,53,69,0.3);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.btn-danger:disabled {
|
|
background: #ccc;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: var(--bg-hover, #f8f9ff);
|
|
color: var(--accent-color, #5b5fcf);
|
|
border: 1px solid var(--border-color, #e8e9ff);
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: #eef0ff;
|
|
border-color: var(--accent-color, #5b5fcf);
|
|
}
|
|
|
|
/* Confirmation section */
|
|
.confirmation-section {
|
|
background: var(--danger-bg, #ffebee);
|
|
border: 1px solid var(--danger-border, #ffcdd2);
|
|
border-radius: 10px;
|
|
padding: 25px;
|
|
margin-top: 25px;
|
|
text-align: center;
|
|
display: none;
|
|
}
|
|
|
|
.confirmation-icon {
|
|
font-size: 48px;
|
|
color: var(--danger-color, #dc3545);
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.confirmation-title {
|
|
font-size: 20px;
|
|
font-weight: 700;
|
|
color: var(--text-primary, #2f3640);
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.confirmation-text {
|
|
font-size: 14px;
|
|
color: #64748b;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.confirmation-website {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--danger-color, #dc3545);
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.confirmation-buttons {
|
|
display: flex;
|
|
gap: 12px;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* Alert styles */
|
|
.alert {
|
|
padding: 16px 20px;
|
|
border-radius: 10px;
|
|
margin-bottom: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
animation: fadeIn 0.3s ease-out;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(-10px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.alert-danger {
|
|
background: var(--danger-bg, #ffebee);
|
|
border: 1px solid var(--danger-border, #ffcdd2);
|
|
color: var(--danger-text, #c62828);
|
|
}
|
|
|
|
.alert-success {
|
|
background: var(--success-bg, #e8f5e9);
|
|
border: 1px solid var(--success-border, #c8e6c9);
|
|
color: var(--success-text, #2e7d32);
|
|
}
|
|
|
|
/* Loading spinner */
|
|
.loading-spinner {
|
|
display: inline-block;
|
|
width: 16px;
|
|
height: 16px;
|
|
border: 2px solid #f3f3f3;
|
|
border-top: 2px solid var(--danger-color, #dc3545);
|
|
border-radius: 50%;
|
|
animation: spin 1s linear infinite;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
/* Button container */
|
|
.button-container {
|
|
margin-top: 30px;
|
|
padding-top: 30px;
|
|
border-top: 1px solid var(--border-color, #e8e9ff);
|
|
}
|
|
|
|
/* Hide elements by default */
|
|
#deleteLoading {
|
|
display: none;
|
|
}
|
|
|
|
#deleteWebsiteButton {
|
|
display: none;
|
|
}
|
|
|
|
#websiteDeleteFailure {
|
|
display: none;
|
|
}
|
|
|
|
#websiteDeleteSuccess {
|
|
display: none;
|
|
}
|
|
|
|
/* Additional Windows-specific fixes */
|
|
@supports (-ms-ime-align: auto) {
|
|
/* Edge/IE specific styles */
|
|
select.form-control {
|
|
color: var(--text-primary, #2f3640) !important;
|
|
background-color: var(--bg-secondary, white) !important;
|
|
}
|
|
}
|
|
|
|
/* Fix for Firefox on Windows */
|
|
@-moz-document url-prefix() {
|
|
select.form-control {
|
|
color: var(--text-primary, #2f3640) !important;
|
|
text-shadow: none;
|
|
}
|
|
}
|
|
|
|
/* Ensure selected option is always visible */
|
|
select.form-control::-ms-value {
|
|
color: var(--text-primary, #2f3640);
|
|
background-color: var(--bg-secondary, white);
|
|
}
|
|
|
|
/* Fix for Chrome on Windows */
|
|
select.form-control:not(:focus):not(:hover) {
|
|
color: var(--text-primary, #2f3640) !important;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.content-card {
|
|
padding: 20px;
|
|
}
|
|
|
|
.confirmation-buttons {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.btn {
|
|
width: 100%;
|
|
justify-content: center;
|
|
}
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
{% load static %}
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
|
|
<div class="page-wrapper" ng-controller="deleteWebsiteControl">
|
|
<div class="page-container">
|
|
<div class="page-header">
|
|
<h1 class="page-title">{% trans "Delete Website" %}</h1>
|
|
<p class="page-subtitle">{% trans "Permanently remove a website from your server" %}</p>
|
|
</div>
|
|
|
|
<div class="content-card">
|
|
<h2 class="card-title">
|
|
{% trans "Website Selection" %}
|
|
<span id="deleteLoading" class="loading-spinner"></span>
|
|
</h2>
|
|
|
|
<div class="website-selector-card">
|
|
<label class="website-selector-label">{% trans "Select Website to Delete" %}</label>
|
|
<select ng-change="fetchDetails()" ng-model="websiteToBeDeleted" class="form-control">
|
|
<option value="">-- {% trans "Select a website" %} --</option>
|
|
{% for items in websiteList %}
|
|
<option>{{ items }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="website-details-card" ng-show="websiteToBeDeleted">
|
|
<div class="detail-row">
|
|
<span class="detail-label">{% trans "Domain" %}</span>
|
|
<span class="detail-value">{$ websiteToBeDeleted $}</span>
|
|
</div>
|
|
<div class="detail-row" ng-show="websiteDetails.package">
|
|
<span class="detail-label">{% trans "Package" %}</span>
|
|
<span class="detail-value">{$ websiteDetails.package $}</span>
|
|
</div>
|
|
<div class="detail-row" ng-show="websiteDetails.owner">
|
|
<span class="detail-label">{% trans "Owner" %}</span>
|
|
<span class="detail-value">{$ websiteDetails.owner $}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="warning-box">
|
|
<i class="fas fa-exclamation-triangle warning-icon"></i>
|
|
<div class="warning-content">
|
|
<div class="warning-title">{% trans "Warning: This action cannot be undone!" %}</div>
|
|
<div class="warning-text">
|
|
{% trans "Deleting a website will permanently remove:" %}
|
|
</div>
|
|
<ul class="warning-list">
|
|
<li>{% trans "All website files and directories" %}</li>
|
|
<li>{% trans "Associated databases" %}</li>
|
|
<li>{% trans "Email accounts and data" %}</li>
|
|
<li>{% trans "DNS records" %}</li>
|
|
<li>{% trans "SSL certificates" %}</li>
|
|
<li>{% trans "Backup configurations" %}</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="button-container">
|
|
<button type="button" ng-click="deleteWebsite()" class="btn btn-danger" ng-disabled="!websiteToBeDeleted">
|
|
<i class="fas fa-trash"></i>
|
|
{% trans "Delete Website" %}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Confirmation Section -->
|
|
<div class="content-card confirmation-section" id="deleteWebsiteButton">
|
|
<i class="fas fa-exclamation-circle confirmation-icon"></i>
|
|
<h3 class="confirmation-title">{% trans "Are you absolutely sure?" %}</h3>
|
|
<p class="confirmation-text">
|
|
{% trans "This action will permanently delete the website and all associated data." %}
|
|
</p>
|
|
<div class="confirmation-website">{$ websiteToBeDeleted $}</div>
|
|
|
|
<div class="confirmation-buttons">
|
|
<button type="button" ng-click="cancelDelete()" class="btn btn-secondary">
|
|
<i class="fas fa-times"></i>
|
|
{% trans "Cancel" %}
|
|
</button>
|
|
<button type="button" ng-click="deleteWebsiteFinal()" class="btn btn-danger">
|
|
<i class="fas fa-trash"></i>
|
|
{% trans "Yes, Delete Website" %}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Alert Messages -->
|
|
<div id="websiteDeleteFailure" class="alert alert-danger">
|
|
<i class="fas fa-exclamation-circle"></i>
|
|
<span>{% trans "Cannot delete website. Error message:" %} {$ errorMessage $}</span>
|
|
</div>
|
|
|
|
<div id="websiteDeleteSuccess" class="alert alert-success">
|
|
<i class="fas fa-check-circle"></i>
|
|
<span>{% trans "Website" %} <strong>{$ deletedWebsite $}</strong> {% trans "successfully deleted." %}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block footer_scripts %}
|
|
<script>
|
|
// Add cancel functionality to the Angular controller
|
|
$(document).ready(function() {
|
|
var scope = angular.element($('[ng-controller="deleteWebsiteControl"]')).scope();
|
|
if (scope) {
|
|
scope.cancelDelete = function() {
|
|
$('#deleteWebsiteButton').fadeOut();
|
|
};
|
|
|
|
// Enhance fetchDetails to show the details card
|
|
var originalFetchDetails = scope.fetchDetails;
|
|
scope.fetchDetails = function() {
|
|
if (originalFetchDetails) {
|
|
originalFetchDetails();
|
|
}
|
|
if (scope.websiteToBeDeleted) {
|
|
$('.website-details-card').fadeIn();
|
|
} else {
|
|
$('.website-details-card').fadeOut();
|
|
}
|
|
};
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|