html-admin-header-skeleton.php
3 weeks ago
html-admin-page-addons.php
1 year ago
html-admin-page-builder.php
4 months ago
html-admin-page-dashboard.php
2 years ago
html-admin-page-entries-view.php
3 weeks ago
html-admin-page-export.php
1 year ago
html-admin-page-form-migrator.php
2 years ago
html-admin-page-form-templates.php
4 months ago
html-admin-page-import.php
1 year ago
html-admin-page-payments.php
3 weeks ago
html-admin-page-setting.php
2 years ago
html-admin-page-smart-smtp-setup.php
3 weeks ago
html-admin-page-tools-logs.php
2 months ago
html-admin-page-tools.php
3 months ago
html-admin-settings.php
3 weeks ago
html-deactivation-popup.php
3 years ago
html-notice-allow-usage.php
2 months ago
html-notice-custom.php
3 months ago
html-notice-email-failed-notice.php
3 months ago
html-notice-php-deprecation.php
3 months ago
html-notice-review.php
3 months ago
html-notice-survey.php
3 months ago
html-notice-update.php
3 months ago
html-notice-updated.php
3 months ago
html-notice-updating.php
3 months ago
html-admin-page-tools-logs.php
90 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Page - Status Logs |
| 4 | * |
| 5 | * @package EverestForms/Admin/Logs |
| 6 | */ |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; |
| 9 | ?> |
| 10 | |
| 11 | <?php if ( $logs ) : ?> |
| 12 | |
| 13 | |
| 14 | <!-- Log Selection Dropdown --> |
| 15 | <div id="log-viewer-select" |
| 16 | style="margin-bottom: 24px; padding: 0 0 24px; border-bottom: 1px solid #DCDCDC; flex-wrap: wrap; gap: 12px;"> |
| 17 | <form action="<?php echo esc_url( admin_url( 'admin.php?page=evf-tools&tab=logs' ) ); ?>" method="post" |
| 18 | style="display: flex; gap: 10px; align-items: center;"> |
| 19 | <select name="log_file" |
| 20 | style="max-width: 700px; width: 100%; min-height: 38px; line-height: 20px; padding: 8px 14px; color: #383838; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;"> |
| 21 | <?php foreach ( $logs as $log_key => $log_file ) : ?> |
| 22 | <?php |
| 23 | $timestamp = filemtime( EVF_LOG_DIR . $log_file ); |
| 24 | $date = sprintf( __( '%1$s at %2$s', 'everest-forms' ), date_i18n( evf_date_format(), $timestamp ), date_i18n( evf_time_format(), $timestamp ) ); |
| 25 | ?> |
| 26 | <option value="<?php echo esc_attr( $log_key ); ?>" |
| 27 | <?php selected( sanitize_title( $viewed_log ), $log_key ); ?>> |
| 28 | <?php echo esc_html( $log_file ); ?> (<?php echo esc_html( $date ); ?>) |
| 29 | </option> |
| 30 | <?php endforeach; ?> |
| 31 | </select> |
| 32 | <button type="submit" class="button button-primary" |
| 33 | style="background: #7545BB; color: #fff; border-color: #7545BB; font-size: 14px; line-height: 20px; font-weight: 500; padding: 8px 16px;"> |
| 34 | <?php esc_html_e( 'Apply', 'everest-forms' ); ?> |
| 35 | </button> |
| 36 | </form> |
| 37 | </div> |
| 38 | |
| 39 | <!-- Top Toolbar --> |
| 40 | <div id="log-viewer-toolbar" |
| 41 | style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px;"> |
| 42 | <div class="alignleft" style="font-size: 16px; font-weight: 500;"> |
| 43 | <?php echo esc_html( $viewed_log ); ?> |
| 44 | </div> |
| 45 | <div class="alignright" style="display: flex; gap: 10px; flex-wrap: wrap;"> |
| 46 | <?php if ( ! empty( $viewed_log ) ) : ?> |
| 47 | <!-- Copy Log Button --> |
| 48 | <button type="button" id="evf-copy-log-btn" class="button button-secondary" |
| 49 | style="border-color: #475BB2; color: #475BB2; font-size: 14px; line-height: 20px; padding: 8px 14px; font-weight: 500;"> |
| 50 | <?php esc_html_e( 'Copy Log', 'everest-forms' ); ?> |
| 51 | </button> |
| 52 | <!-- Download Log Button --> |
| 53 | <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle_download' => sanitize_title( $viewed_log ) ), admin_url( 'admin.php?page=evf-tools&tab=logs' ) ), 'download_log' ) ); ?>" |
| 54 | class="button button-secondary" |
| 55 | style="border-color: #7545BB; color: #7545BB; font-size: 14px; line-height: 20px; padding: 8px 14px; font-weight: 500;"> |
| 56 | <?php esc_html_e( 'Download Log', 'everest-forms' ); ?> |
| 57 | </a> |
| 58 | <?php endif; ?> |
| 59 | <!-- Delete All Logs Button --> |
| 60 | <?php if ( 1 < count( $logs ) ) : ?> |
| 61 | <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle_all' => 'delete-all-logs' ), admin_url( 'admin.php?page=evf-tools&tab=logs' ) ), 'remove_all_logs' ) ); ?>" |
| 62 | class="button button-secondary" style="border-color: #F25656; background: #F25656; color: #ffffff; font-size: 14px; line-height: 20px; padding: 8px 14px; font-weight: 500;"> |
| 63 | <?php esc_html_e( 'Delete All Logs', 'everest-forms' ); ?> |
| 64 | </a> |
| 65 | <?php endif; ?> |
| 66 | <!-- Delete Log Button --> |
| 67 | <?php if ( ! empty( $viewed_log ) ) : ?> |
| 68 | <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => sanitize_title( $viewed_log ) ), admin_url( 'admin.php?page=evf-tools&tab=logs' ) ), 'remove_log' ) ); ?>" |
| 69 | class="button button-secondary" style="border-color: #475BB2; color: #475BB2; font-size: 14px; line-height: 20px; padding: 8px 14px; font-weight: 500;"> |
| 70 | <?php esc_html_e( 'Delete Log', 'everest-forms' ); ?> |
| 71 | </a> |
| 72 | <?php endif; ?> |
| 73 | </div> |
| 74 | </div> |
| 75 | |
| 76 | <!-- Log Viewer Content --> |
| 77 | <div id="log-viewer" |
| 78 | style="border: 1px solid #ddd; padding: 15px; border-radius: 4px; background: #ffffff; font-size: 13px;"> |
| 79 | <pre id="evf-log-content" |
| 80 | style="white-space: pre-wrap; word-wrap: break-word; margin: 0;"><?php echo esc_html( file_get_contents( EVF_LOG_DIR . $viewed_log ) ); ?></pre> |
| 81 | </div> |
| 82 | |
| 83 | <?php else : ?> |
| 84 | <!-- No Logs Found --> |
| 85 | <div class="notice notice-warning inline" |
| 86 | style="padding: 15px; border-left: 4px solid #ffba00; background: #fff;"> |
| 87 | <p><?php esc_html_e( 'There are currently no logs to view.', 'everest-forms' ); ?></p> |
| 88 | </div> |
| 89 | <?php endif; ?> |
| 90 |