\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/yedekledb24/DatabaseBackupMasterv8/__pycache__/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/yedekledb24/DatabaseBackupMasterv8/__pycache__/routes.cpython-310.pyc |
o
��g�@ � @ sP d dl Z d dlZd dlZd dlmZmZmZmZmZm Z m
Z
d dlmZ d dl
mZ d dlmZmZ d dlmZmZmZmZ d dlmZmZmZmZ d dlmZmZmZmZm Z m!Z! d d l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) d d
l*m+Z+m,Z, d dl-m.Z.m/Z/ d dl0m1Z1m2Z2 d d
l3m4Z4 d dl5m6Z7m8Z9 d dl5m:Z;m<Z<m=Z= zd dl>m6Z?m8Z@ d dl>m:ZAmBZBmCZC dZDW n eEy� dZDY nw e�Fd�edd� ��ZGe�Fd�edd� ��ZHejFddgd�edd� ��ZIejFddgd�edd � ��ZJe�Fd!�ed"d#� ��ZKe�Fd$�ed%d&� ��ZLejFd'dgd�ed(d)� ��ZMejFd*dgd�ed+d,� ��ZNe�Fd-�ed.d/� ��ZOe�Fd0�ed1d2� ��ZPejFd3dgd�ed4d5� ��ZQejFd6d7dgd�ed8d9� ��ZRejFd:dgd�ed;d<� ��ZSejFd=dgd�ed>d?� ��ZTejFd@dgd�edAdB� ��ZUe�FdC�edDdE� ��ZVejFdFdgd�edGdH� ��ZWe�FdI�edJdK� ��ZXejFdLdgd�edMdN� ��ZYejFdOdgd�edPdQ� ��ZZejFdRdgd�edSdT� ��Z[ejFdUdgd�edVdW� ��Z\e�FdX�dYdZ� �Z]e�Fd[�d\d]� �Z^e�Fd^�d_d`� �Z_ejFdad7dgd�dbdc� �Z`e�Fdd�dedf� �Zae�Fdg�edhdi� ��ZbejFdjdgd�edkdl� ��ZcejFdmdgd�edndo� ��ZdejFdpdgd�edqdr� ��Zedsdt� Zfe�Fdu�edvdw� ��Zge�Fdx�edydz� ��Zhe�Fd{�ed|d}� ��Zie�Fd~�edd�� ��Zje�Fd��ed�d�� ��ZkejFd�dgd�ed�d�� ��ZlejFd�dgd�ed�d�� ��ZmejFd�dgd�ed�d�� ��ZndS )�� N)�render_template�request�redirect�url_for�flash�jsonify�session)�SQLAlchemyError)�text)�_�
get_locale)�
login_user�logout_user�current_user�login_required)�app�db�logger�mail)�DatabaseConnection�
StorageTarget� BackupJob� BackupLog�SmtpSettings�User)�DatabaseConnectionForm�StorageTargetForm�
BackupJobForm�SmtpSettingsForm� LoginForm�RegistrationForm�EncryptionKeyForm)�test_database_connection�
run_backup)�test_storage_connection�get_storage_space)�schedule_backup_job�remove_scheduled_job)�restore_from_backup)�get_top_queries�get_database_stats)�get_table_stats�enable_pg_stat_statements�pg_stat_statements_enabled)r+ �enable_performance_schema�performance_schema_enabledTF�/c
C s: t j�t j�� ��d��� } tj�� }tj�� }t j�� }t jj
dd��� }t jj
dd��� }g }|D ]W}z&t|�\}} | dkrF|| d nd}
|
dk }|�
|j|j|| |
|d�� W q3 ty� } z#t�d�|jt|��� |�
|j|jdddd t|�d
�� W Y d}~q3d}~ww td| t|�t|�t|�|||d
�S )z1Render the dashboard page with backup statistics.�
�success)�status�failedr �d )�id�name�
free_space�total_space�percent_free�warning�&Error getting storage space for {}: {}T)r6 r7 r8 r9 r: r; �errorNzdashboard.html)�recent_logs�db_count�
storage_count� job_count�
success_count�failed_count�storage_info)r �query�order_by� timestamp�desc�limit�allr r r � filter_by�countr% �appendr6 r7 � Exceptionr r= �format�strr �len)
r>