
<?php $__env->startSection('title', 'Backups | ' . $order->name); ?>

<?php if(settings('encrypted::pterodactyl::api_admin_key', false)): ?>
    <?php ($create_allowed = count($backups) < $server['feature_limits']['backups']); ?>
    <?php $__env->startSection('content'); ?>

        <div class="container mx-auto ">
            <div class="relative overflow-x-auto overflow-y-auto shadow-md sm:rounded-lg" style="height: 80vh;">
                <table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
                    <thead class="dark:bg-gray-700">
                    <tr>
                        <th class="px-4 py-2 text-left text-gray-600 dark:text-gray-300 whitespace-nowrap">
                            <?php echo __('client.backups'); ?> <?php echo e(count($backups)); ?>/<?php echo e($server['feature_limits']['backups']); ?></th>
                        <th class="px-4 py-2 text-left text-gray-600 dark:text-gray-300 whitespace-nowrap"><?php echo __('client.status'); ?></th>
                        <th class="px-4 py-2 text-left text-gray-600 dark:text-gray-300 whitespace-nowrap"><?php echo __('client.size'); ?></th>
                        <th class="px-4 py-2 text-left text-gray-600 dark:text-gray-300 whitespace-nowrap"><?php echo __('client.date'); ?></th>
                        <th class="px-4 py-2 text-left text-gray-600 dark:text-gray-300 text-end whitespace-nowrap">
                            <button type="submit" data-modal-target="create-modal" data-modal-toggle="create-modal"
                                    class="bg-green-500 hover:bg-green-700 text-white font-bold py-0.5 px-2 text-sm rounded"
                                    <?php if(!$create_allowed): ?> disabled <?php endif; ?>>
                                <?php echo __('admin.create'); ?>

                            </button>
                        </th>
                    </tr>
                    </thead>
                    <tbody class="bg-white dark:bg-gray-600">
                    <?php $__currentLoopData = $backups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $backup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr class="border-b dark:border-gray-700">
                            <td class="px-4 py-2 dark:text-gray-300 whitespace-nowrap"><?php echo e($backup['attributes']['name']); ?></td>
                            <td class="px-4 py-2 dark:text-gray-300 whitespace-nowrap">
                                <?php if($backup['attributes']['is_successful']): ?>
                                    <span
                                            class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">
                                   <?php echo __('client.successful'); ?>

                                </span>
                                <?php else: ?>
                                    <span
                                            class="bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300">
                                    <?php echo __('client.failed'); ?>

                                </span>
                                <?php endif; ?>
                            </td>
                            <td class="px-4 py-2 dark:text-gray-300 whitespace-nowrap"><?php echo e(bytesToHuman($backup['attributes']['bytes'])); ?></td>
                            <td class="px-4 py-2 dark:text-gray-300 whitespace-nowrap"><?php echo e(now()::parse($backup['attributes']['completed_at'])->diffForHumans()); ?></td>
                            <td class="px-4 py-2 text-end">
                                <a href="<?php echo e(route('pterodactyl.backups.lock', ['order' => $order->id,'server' => $server['identifier'], 'backup' => $backup['attributes']['uuid']])); ?>"
                                   class="font-bold text-white py-2 px-3 text-sm rounded mr-1 inline-flex items-center justify-center
                                   <?php if($backup['attributes']['is_locked']): ?> bg-yellow-500 hover:bg-yellow-700 <?php else: ?> bg-green-500 hover:bg-green-700 <?php endif; ?>">
                                    <?php if($backup['attributes']['is_locked']): ?>
                                        <i class="bx bxs-lock"></i>
                                    <?php else: ?>
                                        <i class="bx bxs-lock-open"></i>
                                    <?php endif; ?>
                                </a>
                                <a href="<?php echo e(route('pterodactyl.backups.download', ['order' => $order->id,'server' => $server['identifier'], 'backup' => $backup['attributes']['uuid']])); ?>"
                                   class="bg-blue-500 hover:bg-blue-700 font-bold text-white py-2 px-3 text-sm rounded mr-1 inline-flex items-center justify-center">
                                    <i class="bx bxs-download"></i>
                                </a>
                                <a data-modal-target="confirm-restore<?php echo e($backup['attributes']['uuid']); ?>"
                                   data-modal-toggle="confirm-restore<?php echo e($backup['attributes']['uuid']); ?>"
                                   class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-3 text-sm rounded mr-1 inline-flex items-center justify-center">
                                    <i class="bx bxs-archive-out"></i>
                                </a>
                                <a data-modal-target="confirm-modal<?php echo e($backup['attributes']['uuid']); ?>"
                                   <?php if(!$backup['attributes']['is_locked']): ?> disabled
                                   data-modal-toggle="confirm-modal<?php echo e($backup['attributes']['uuid']); ?>"
                                   <?php endif; ?>
                                   class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-3 text-sm rounded inline-flex items-center justify-center">
                                    <i class="bx bxs-trash"></i>
                                </a>
                            </td>
                        </tr>
                        <?php echo $__env->make(Theme::serviceView('pterodactyl','modals.confirm-restore-backup'), ['backup' => $backup], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php echo $__env->make(Theme::serviceView('pterodactyl','modals.confirm-delete-backup'), ['backup' => $backup], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
        </div>

        <?php echo $__env->make(Theme::serviceView('pterodactyl','modals.create-backup'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <?php $__env->stopSection(); ?>
<?php endif; ?>

<?php echo $__env->make(Theme::path('orders.master'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/wemx/app/Services/Pterodactyl/Resources/views/client/tailwind/backups.blade.php ENDPATH**/ ?>