<?php
    if ( ! defined( 'ABSPATH' ) ) exit;
?>
<div class="cloud-s3-admin-page" id="conf-page-cloud-s3">
    <div class="container">
        <?php 
            include 'cloud-s3-sidebar.php'; 
            $connection_status = cloudS3Class::getConnectionStatus();
        ?>
        <div class="content">
                <h2><?php echo esc_html__('Status','cloud-s3-storage'); ?></h2>
                <?php if(!$connection_status) { ?>
                    <h3><?php echo esc_html__('Visit the configuration page to start using your plugin!','cloud-s3-storage'); ?></h3>
                    <a href="<?php echo admin_url('admin.php?page=cloud-s3-configure');?>"><?php echo esc_html__('Configure', 'cloud-s3-storage'); ?> <b>Cloud S3 Storage</b></a>
                <?php } elseif(CloudS3StorageDB::getMissingImagesPercentage() > 0) { ?>
                    <h3><?php echo esc_html__('We are registering images, statistics will be available in a few minutes','cloud-s3-storage'); ?></h3>
                <?php } else { ?>
                <ul>
                    <li><?php echo esc_html__('Keys entered','cloud-s3-storage'); ?>: <b><span id="ajx-key">...</span></b></li>
                    <li><?php echo esc_html__('Hybrid mode','cloud-s3-storage'); ?>: <b><span id="ajx-ibrid">...</span></b></li>
                    <li><?php echo esc_html__('Connection','cloud-s3-storage'); ?>: <b><span id="ajx-status">...</span></b></li>
                    <li><?php echo esc_html__('Mode','cloud-s3-storage'); ?>: <b><span id="ajx-mode">...</span></b></li>
                </ul>
                <ul>
                    <li><?php echo esc_html__('Total media','cloud-s3-storage'); ?>: <b><span id="ajx-media-count">...</span></b></li>
                    <li><?php echo esc_html__('Media to move to S3','cloud-s3-storage'); ?>: <b><span id="image-not-converted-count">...</span></b> <?php echo esc_html__('out of', 'cloud-s3-storage'); ?> <b><span id="image-like-mode-count">...</span></b></li>
                    <li><?php echo esc_html__('Media hosted on S3','cloud-s3-storage'); ?>: <b><span id="ajx-s3-count">...</span></b></li>
                </ul>
                <?php } ?>

                <?php if($connection_status) { ?>
                <ul>
                    <li><?php echo esc_html__('Your WordPress installation currently allows','cloud-s3-storage'); ?>: <b><span id="ajx-mime-type">...</span></b></li>
                </ul>
                <ul>
                    <li><?php echo esc_html__("You have excluded",'cloud-s3-storage'); ?>: <b><span id="ajx-mime-out">...</span></b></li>
                </ul>
                <?php /* if($enable_link_test && CloudS3StorageDB::getMissingImagesPercentage()==0) { ?>
                <h3><?php echo esc_html__('URL for cron job','cloud-s3-storage'); ?></h3>
                <ul>
                    <li><?php echo esc_html__('Index URL','cloud-s3-storage'); ?>: <b><span id="ajx-url-index">...</span></b></li>
                    <li><?php echo esc_html__('Delete media URL','cloud-s3-storage'); ?>: <b><span id="ajx-url-delete">...</span></b></li>
                    <li><?php echo esc_html__('Rollback URL','cloud-s3-storage'); ?>: <b><span id="ajx-url-rollback">...</span></b></li>
                </ul>
                <?php } */?>
                <a href="<?php echo esc_url( rest_url( 'cloud-s3-storage/v1/rollback-image/' ) ); ?>" class="rollback"><?php echo esc_html__('Rollback Images','cloud-s3-storage'); ?></a>
                <?php } ?>
            </div>
    </div>
</div>