Files
CyberPanel/serverLogs/templates/serverLogs/ftplogs.html
2025-06-15 01:10:08 +05:00

515 lines
12 KiB
HTML

{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "FTP Logs - CyberPanel" %}{% endblock %}
{% block header_scripts %}
<style>
.modern-container {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
}
.page-header {
text-align: center;
margin-bottom: 3rem;
padding: 3rem 0;
background: linear-gradient(135deg, #667eea 0%, #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;
}
.log-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: 700px;
margin: 0 auto;
line-height: 1.6;
}
.log-viewer-panel {
background: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
border: 1px solid #e8e9ff;
overflow: hidden;
animation: fadeInUp 0.5s ease-out;
}
.panel-header {
background: #1e293b;
color: white;
padding: 1rem 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #334155;
}
.panel-title {
font-size: 1rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.75rem;
color: #e2e8f0;
}
.panel-icon {
width: 32px;
height: 32px;
background: #334155;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #64748b;
}
.log-stats {
display: flex;
align-items: center;
gap: 1.5rem;
}
.stat-item {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.875rem;
color: #94a3b8;
}
.stat-value {
color: #e2e8f0;
font-weight: 600;
}
.log-controls {
background: #f8f9ff;
padding: 1rem 1.5rem;
border-bottom: 1px solid #e8e9ff;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 1rem;
}
.control-group {
display: flex;
align-items: center;
gap: 1rem;
}
.search-box {
position: relative;
min-width: 300px;
}
.search-input {
width: 100%;
padding: 0.5rem 1rem 0.5rem 2.5rem;
border: 1px solid #e8e9ff;
border-radius: 8px;
font-size: 0.875rem;
transition: all 0.3s ease;
}
.search-input:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.search-icon {
position: absolute;
left: 0.75rem;
top: 50%;
transform: translateY(-50%);
color: #94a3b8;
font-size: 0.875rem;
}
.log-content {
background: #1e293b;
padding: 1.5rem;
min-height: 600px;
max-height: 700px;
overflow-y: auto;
position: relative;
}
.log-textarea {
width: 100%;
background: transparent;
color: #8b5cf6;
font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
font-size: 0.875rem;
line-height: 1.6;
border: none;
outline: none;
resize: none;
min-height: 550px;
}
.log-textarea::placeholder {
color: #475569;
}
.log-line-numbers {
position: absolute;
left: 0;
top: 1.5rem;
width: 50px;
text-align: right;
color: #475569;
font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
font-size: 0.875rem;
line-height: 1.6;
user-select: none;
padding-right: 1rem;
border-right: 1px solid #334155;
}
.log-content-wrapper {
padding-left: 60px;
}
.action-bar {
background: #f8f9ff;
padding: 1.5rem;
border-top: 1px solid #e8e9ff;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.btn {
padding: 0.625rem 1.5rem;
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: #667eea;
color: white;
}
.btn-primary:hover {
background: #5a67d8;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-danger {
background: #ef4444;
color: white;
}
.btn-danger:hover {
background: #dc2626;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-secondary {
background: #64748b;
color: white;
}
.btn-secondary:hover {
background: #475569;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}
.loading-spinner {
width: 20px;
height: 20px;
border: 2px solid #f3f3f3;
border-top: 2px solid #667eea;
border-radius: 50%;
animation: spin 1s linear infinite;
display: inline-block;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.alert {
padding: 1rem 1.5rem;
border-radius: 8px;
margin: 1rem 1.5rem;
display: flex;
align-items: center;
gap: 0.75rem;
animation: fadeInUp 0.3s ease-out;
}
.alert-success {
background: #d1fae5;
color: #065f46;
border: 1px solid #a7f3d0;
}
.alert-danger {
background: #fee2e2;
color: #991b1b;
border: 1px solid #fecaca;
}
.alert-icon {
font-size: 1.25rem;
}
.empty-state {
text-align: center;
padding: 4rem 2rem;
color: #64748b;
}
.empty-icon {
font-size: 4rem;
color: #94a3b8;
margin-bottom: 1rem;
}
.empty-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 0.5rem;
color: #475569;
}
.empty-text {
font-size: 0.875rem;
color: #64748b;
}
/* Custom Scrollbar */
.log-content::-webkit-scrollbar {
width: 8px;
}
.log-content::-webkit-scrollbar-track {
background: #334155;
border-radius: 4px;
}
.log-content::-webkit-scrollbar-thumb {
background: #64748b;
border-radius: 4px;
}
.log-content::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* Log Level Colors */
.log-error { color: #ef4444; }
.log-warning { color: #f59e0b; }
.log-info { color: #3b82f6; }
.log-debug { color: #8b5cf6; }
.log-success { color: #10b981; }
/* Responsive */
@media (max-width: 768px) {
.modern-container {
padding: 1rem;
}
.page-title {
font-size: 2rem;
}
.log-controls {
flex-direction: column;
align-items: stretch;
}
.search-box {
min-width: 100%;
}
.control-group {
flex-direction: column;
align-items: stretch;
width: 100%;
}
.action-bar {
flex-direction: column;
gap: 0.5rem;
}
.btn {
width: 100%;
justify-content: center;
}
}
</style>
{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="modern-container" ng-controller="readFTPLogs">
<!-- Page Header -->
<div class="page-header">
<div class="header-content">
<div class="page-title">
<div class="log-icon">
<i class="fas fa-server fa-2x"></i>
</div>
{% trans "FTP Logs" %}
</div>
<p class="page-subtitle">
{% trans "Track FTP server activity including file transfers, login attempts, and user sessions for security monitoring." %}
</p>
</div>
</div>
<!-- Log Viewer Panel -->
<div class="log-viewer-panel">
<!-- Panel Header -->
<div class="panel-header">
<div class="panel-title">
<div class="panel-icon">
<i class="fas fa-terminal"></i>
</div>
{% trans "FTP Log Viewer" %}
</div>
<div class="log-stats">
<div class="stat-item">
<span>{% trans "Showing:" %}</span>
<span class="stat-value">{% trans "Last 50 lines" %}</span>
</div>
<div ng-hide="logFileLoading" class="stat-item">
<i class="fas fa-check-circle" style="color: #10b981;"></i>
<span>{% trans "Live" %}</span>
</div>
<div ng-show="!logFileLoading" class="loading-spinner"></div>
</div>
</div>
<!-- Log Content -->
<div class="log-content">
<div class="log-content-wrapper">
<textarea ng-model="logsData"
class="log-textarea"
readonly
placeholder="{% trans 'FTP log entries will appear here...' %}"></textarea>
</div>
</div>
<!-- Success/Error Messages -->
<div ng-hide="logsFeteched" class="alert alert-success">
<i class="fas fa-check-circle alert-icon"></i>
<span>{% trans "Last 50 lines fetched successfully" %}</span>
</div>
<div ng-hide="couldNotFetchLogs" class="alert alert-danger">
<i class="fas fa-exclamation-circle alert-icon"></i>
<span>{% trans "Could not fetch logs. Use the command line to view the log file." %}</span>
</div>
<!-- Action Bar -->
<div class="action-bar">
<button type="button"
ng-click="fetchLogs()"
class="btn btn-primary">
<i class="fas fa-sync-alt"></i>
{% trans "Refresh Logs" %}
</button>
<button type="button"
ng-click="clearLogs()"
class="btn btn-danger">
<i class="fas fa-trash-alt"></i>
{% trans "Clear Logs" %}
</button>
</div>
</div>
</div>
{% endblock %}