File: //proc/676643/root/usr/local/CyberCP/serverLogs/templates/serverLogs/serverMail.html
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Server Mail - CyberPanel" %}{% endblock %}
{% block header_scripts %}
<style>
.modern-container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
.page-header {
text-align: center;
margin-bottom: 3rem;
padding: 3rem 0;
background: linear-gradient(135deg, var(--accent-color, #667eea) 0%, var(--accent-dark, #764ba2) 100%);
border-radius: 20px;
animation: fadeInDown 0.5s ease-out;
position: relative;
overflow: hidden;
color: white;
}
.page-header::before {
content: '';
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
animation: rotate 30s linear infinite;
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.header-content {
position: relative;
z-index: 1;
}
.page-title {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.mail-icon {
width: 60px;
height: 60px;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.page-subtitle {
font-size: 1.125rem;
color: rgba(255, 255, 255, 0.9);
max-width: 600px;
margin: 0 auto;
}
.docs-link {
margin-top: 1rem;
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
padding: 0.5rem 1.5rem;
border-radius: 20px;
color: white;
text-decoration: none;
font-size: 0.875rem;
transition: all 0.3s ease;
}
.docs-link:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
color: white;
text-decoration: none;
}
.mail-config-panel {
background: var(--bg-primary, white);
border-radius: 16px;
box-shadow: 0 1px 3px var(--shadow-light, rgba(0,0,0,0.05)), 0 10px 40px var(--shadow-color, rgba(0,0,0,0.08));
border: 1px solid var(--border-color, #e8e9ff);
overflow: hidden;
animation: fadeInUp 0.5s ease-out;
}
.panel-header {
background: linear-gradient(135deg, var(--accent-color, #667eea) 0%, var(--accent-dark, #764ba2) 100%);
color: white;
padding: 1.5rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.panel-title {
font-size: 1.25rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.75rem;
}
.panel-icon {
width: 32px;
height: 32px;
background: var(--accent-bg, rgba(255,255,255,0.2));
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
}
.form-section {
padding: 2rem;
}
.form-row {
display: grid;
grid-template-columns: 200px 1fr;
align-items: center;
gap: 1rem;
margin-bottom: 1.5rem;
}
.form-label {
font-weight: 500;
color: var(--text-muted, #64748b);
font-size: 0.875rem;
text-align: right;
}
.form-control {
padding: 0.75rem 1rem;
border: 1px solid var(--border-color, #e8e9ff);
border-radius: 8px;
font-size: 0.875rem;
transition: all 0.3s ease;
background: var(--bg-primary, #fff);
color: var(--text-primary, #1e293b);
width: 100%;
max-width: 400px;
}
.form-control:focus {
outline: none;
border-color: var(--accent-color, #667eea);
box-shadow: 0 0 0 3px var(--accent-shadow-light, rgba(102, 126, 234, 0.1));
}
.select-control {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: var(--bg-primary, white) !important;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%235b5fcf' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 0.5rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
padding-right: 2.5rem;
color: var(--text-primary, #1e293b) !important;
font-size: 0.875rem !important;
line-height: 1.5;
}
/* Ensure option text is visible */
.select-control option {
color: var(--text-primary, #1e293b);
background-color: var(--bg-primary, white);
padding: 8px;
font-size: 0.875rem;
}
/* Fix for Windows high contrast mode */
@media screen and (-ms-high-contrast: active) {
.select-control {
border: 2px solid;
}
.select-control option {
background: var(--bg-primary, white);
color: var(--text-primary, black);
}
}
/* Specific focus styles for select */
.select-control:focus {
background-color: var(--bg-primary, white);
color: var(--text-primary, #1e293b);
}
.mailer-type-selector {
background: var(--bg-secondary, #f8f9ff);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
border: 1px solid var(--border-color, #e8e9ff);
}
.smtp-fields {
background: var(--bg-secondary, #fafbff);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
border: 1px solid var(--border-color, #e8e9ff);
animation: fadeInUp 0.3s ease-out;
}
.section-header {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border-light, #e8e9ff);
}
.section-icon {
width: 32px;
height: 32px;
background: var(--accent-light, #f3e8ff);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: var(--accent-color, #667eea);
}
.section-title {
font-size: 1rem;
font-weight: 600;
color: var(--text-primary, #1e293b);
}
.action-buttons {
display: flex;
gap: 1rem;
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid var(--border-light, #e8e9ff);
justify-content: center;
}
.btn {
padding: 0.75rem 2rem;
border-radius: 8px;
font-weight: 500;
font-size: 0.875rem;
cursor: pointer;
transition: all 0.3s ease;
border: none;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.btn-primary {
background: linear-gradient(135deg, var(--accent-color, #667eea) 0%, var(--accent-dark, #764ba2) 100%);
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px var(--accent-shadow, rgba(102, 126, 234, 0.3));
}
.loading-spinner {
width: 20px;
height: 20px;
border: 2px solid var(--border-color, #f3f3f3);
border-top: 2px solid var(--accent-color, #667eea);
border-radius: 50%;
animation: spin 1s linear infinite;
display: inline-block;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.info-box {
background: var(--info-light, #eff6ff);
border: 1px solid var(--info-border-color, #bfdbfe);
border-radius: 8px;
padding: 1rem 1.5rem;
margin-bottom: 1.5rem;
display: flex;
align-items: center;
gap: 0.75rem;
}
.info-icon {
color: var(--info-color, #3b82f6);
font-size: 1.25rem;
flex-shrink: 0;
}
.info-text {
font-size: 0.875rem;
color: var(--info-text-color, #1e40af);
line-height: 1.6;
}
/* Status Indicator */
.status-indicator {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.875rem;
padding: 0.375rem 0.75rem;
border-radius: 20px;
background: var(--bg-secondary, #f8f9ff);
border: 1px solid var(--border-color, #e8e9ff);
color: var(--text-primary, #1e293b);
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--success-color, #10b981);
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}
70% {
box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
}
}
/* Responsive */
@media (max-width: 768px) {
.modern-container {
padding: 1rem;
}
.page-title {
font-size: 2rem;
}
.form-row {
grid-template-columns: 1fr;
gap: 0.5rem;
}
.form-label {
text-align: left;
}
.form-control {
max-width: 100%;
}
}
</style>
{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="modern-container" ng-controller="serverMail">
<!-- Page Header -->
<div class="page-header">
<div class="header-content">
<div class="page-title">
<div class="mail-icon">
<i class="fas fa-envelope fa-2x"></i>
</div>
{% trans "Server Mail Configuration" %}
</div>
<p class="page-subtitle">
{% trans "Configure how CyberPanel sends notifications and error emails" %}
</p>
<a href="https://go.cyberpanel.net/serverMail" target="_blank" class="docs-link">
<i class="fas fa-book"></i>
{% trans "Mail Documentation" %}
</a>
</div>
</div>
<!-- Mail Configuration Panel -->
<div class="mail-config-panel">
<div class="panel-header">
<div class="panel-title">
<div class="panel-icon">
<i class="fas fa-cog"></i>
</div>
{% trans "SMTP Configuration" %}
</div>
<div class="status-indicator" ng-hide="cyberPanelLoading">
<span class="status-dot"></span>
<span>{% trans "Ready" %}</span>
</div>
<div ng-show="cyberPanelLoading" class="loading-spinner"></div>
</div>
<div class="form-section">
<!-- Info Box -->
<div class="info-box">
<i class="fas fa-info-circle info-icon"></i>
<div class="info-text">
{% trans "Configure your mail settings below. Choose between the default mail system or configure custom SMTP settings for better deliverability." %}
</div>
</div>
<!-- Mailer Type Selection -->
<div class="mailer-type-selector">
<div class="section-header">
<div class="section-icon">
<i class="fas fa-paper-plane"></i>
</div>
<h3 class="section-title">{% trans "Mail Delivery Method" %}</h3>
</div>
<div class="form-row">
<label class="form-label">{% trans "Mailer Type" %}</label>
<div>
<select ng-change="mailerSettings()"
ng-model="mailer"
class="form-control select-control">
<option value="Default">{% trans "Default (System Mail)" %}</option>
<option value="SMTP">{% trans "SMTP (Custom Server)" %}</option>
</select>
</div>
</div>
</div>
<!-- SMTP Configuration Fields -->
<div ng-hide="installationDetailsForm" class="smtp-fields">
<div class="section-header">
<div class="section-icon">
<i class="fas fa-server"></i>
</div>
<h3 class="section-title">{% trans "SMTP Server Details" %}</h3>
</div>
<div class="form-row">
<label class="form-label">{% trans "SMTP Host" %}</label>
<div>
<input type="text"
class="form-control"
ng-model="smtpHost"
ng-init="smtpHost='{{ smtpHost }}'"
placeholder="smtp.example.com"
required>
</div>
</div>
<div class="form-row">
<label class="form-label">{% trans "Port" %}</label>
<div>
<input type="text"
class="form-control"
ng-model="smtpPort"
ng-init="smtpPort='{{ smtpPort }}'"
placeholder="587 (TLS) or 465 (SSL)"
required>
</div>
</div>
<div class="form-row">
<label class="form-label">{% trans "Username" %}</label>
<div>
<input type="text"
class="form-control"
ng-model="smtpUserName"
ng-init="smtpUserName='{{ smtpUserName }}'"
placeholder="your-email@example.com"
required>
</div>
</div>
<div class="form-row">
<label class="form-label">{% trans "Password" %}</label>
<div>
<input type="password"
class="form-control"
ng-model="smtpPassword"
ng-init="smtpPassword='{{ smtpPassword }}'"
placeholder="••••••••"
required>
</div>
</div>
</div>
<!-- Action Buttons -->
<div class="action-buttons">
<button type="button"
ng-click="saveSMTPSettings()"
class="btn btn-primary">
<i class="fas fa-save"></i>
{% trans "Save Configuration" %}
</button>
</div>
</div>
</div>
</div>
{% endblock %}