' . esc_html__( 'Please connect to AI service to view logs.', 'wpforo' ) . '

'; return; } // Get all boards and determine current board $boards = WPF()->board->get_boards(); $current_boardid = isset( $_GET['boardid'] ) ? intval( $_GET['boardid'] ) : 0; // Validate boardid exists $valid_boardids = array_column( $boards, 'boardid' ); if ( ! in_array( $current_boardid, $valid_boardids ) ) { $current_boardid = 0; // Default to main board } // Switch to the selected board context if ( $current_boardid > 0 ) { WPF()->change_board( $current_boardid ); } // Render board sub-tabs if multiple boards exist if ( count( $boards ) > 1 ) : // Find current board title $current_board_title = __( 'Board', 'wpforo' ); foreach ( $boards as $board ) { if ( isset( $board['boardid'] ) && (int) $board['boardid'] === $current_boardid ) { $current_board_title = isset( $board['settings']['title'] ) ? esc_html( $board['settings']['title'] ) : ( isset( $board['title'] ) ? esc_html( $board['title'] ) : $current_board_title ); break; } } ?>
'wpforo-ai', 'tab' => 'ai_logs', 'boardid' => $board_id, ], admin_url( 'admin.php' ) ); $active_class = ( $current_boardid === $board_id ) ? 'active' : ''; ?>
ai_logs->get_per_page(); // Get initial logs $initial_logs = WPF()->ai_logs->get_logs( [ 'limit' => $per_page, 'offset' => 0, 'orderby' => 'created', 'order' => 'DESC', ] ); $total_logs = WPF()->ai_logs->get_logs_count( [] ); // Create nonce for AJAX $nonce = wp_create_nonce( 'wpforo_ai_logs_nonce' ); ?>

()

ai_client ) && WPF()->ai_client->is_feature_available( 'ai_assistant_chatbot' ) ) : ?>

$per_page ) : ?>
1

' . esc_html( wp_trim_words( $log['error_message'], 15 ) ) . ''; } ?> 0 ) : ?> - 0 ) : ?> (ms)