<?php $__env->startSection('title', 'Websites'); ?>

<?php $__env->startSection('content'); ?>
    <section class="hero">
        <div class="footer-actions">
            <div>
                <p class="eyebrow">Fleet Management</p>
                <h1>Manage remote Laravel websites through secured agents.</h1>
                <p class="muted">Every connection stores encrypted keys, tracks agent health, and keeps actions in the audit trail.</p>
            </div>

            <a class="button primary" href="<?php echo e(route('websites.create')); ?>">Add Website</a>
        </div>
    </section>

    <section class="card">
        <form method="get" class="form-grid" style="grid-template-columns: 2fr 1fr auto;">
            <label>
                <span>Search</span>
                <input class="field" type="search" name="search" value="<?php echo e($filters['search'] ?? ''); ?>" placeholder="Website name or domain">
            </label>

            <label>
                <span>Status</span>
                <select class="field" name="status">
                    <option value="">Any status</option>
                    <?php $__currentLoopData = ['online', 'offline', 'degraded', 'disabled', 'pending']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($status); ?>" <?php if(($filters['status'] ?? '') === $status): echo 'selected'; endif; ?>><?php echo e(str($status)->headline()); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </label>

            <div style="display: flex; align-items: end;">
                <button class="button secondary" type="submit">Filter</button>
            </div>
        </form>
    </section>

    <section class="card">
        <div class="table-wrap">
            <table>
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Domain</th>
                        <th>Status</th>
                        <th>Last Seen</th>
                        <th>Health</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $websites; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $website): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td>
                                <strong><?php echo e($website->name); ?></strong>
                                <div class="muted"><?php echo e($website->api_endpoint); ?></div>
                            </td>
                            <td><?php echo e($website->domain); ?></td>
                            <td><?php if (isset($component)) { $__componentOriginal8c81617a70e11bcf247c4db924ab1b62 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal8c81617a70e11bcf247c4db924ab1b62 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.status-badge','data' => ['value' => $website->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('status-badge'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($website->status)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal8c81617a70e11bcf247c4db924ab1b62)): ?>
<?php $attributes = $__attributesOriginal8c81617a70e11bcf247c4db924ab1b62; ?>
<?php unset($__attributesOriginal8c81617a70e11bcf247c4db924ab1b62); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8c81617a70e11bcf247c4db924ab1b62)): ?>
<?php $component = $__componentOriginal8c81617a70e11bcf247c4db924ab1b62; ?>
<?php unset($__componentOriginal8c81617a70e11bcf247c4db924ab1b62); ?>
<?php endif; ?></td>
                            <td><?php echo e($website->last_seen_at?->diffForHumans() ?? 'Never'); ?></td>
                            <td><?php if (isset($component)) { $__componentOriginal8c81617a70e11bcf247c4db924ab1b62 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal8c81617a70e11bcf247c4db924ab1b62 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.status-badge','data' => ['value' => $website->health_status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('status-badge'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($website->health_status)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal8c81617a70e11bcf247c4db924ab1b62)): ?>
<?php $attributes = $__attributesOriginal8c81617a70e11bcf247c4db924ab1b62; ?>
<?php unset($__attributesOriginal8c81617a70e11bcf247c4db924ab1b62); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8c81617a70e11bcf247c4db924ab1b62)): ?>
<?php $component = $__componentOriginal8c81617a70e11bcf247c4db924ab1b62; ?>
<?php unset($__componentOriginal8c81617a70e11bcf247c4db924ab1b62); ?>
<?php endif; ?></td>
                            <td>
                                <div class="inline-actions">
                                    <a class="button ghost" href="<?php echo e(route('websites.show', $website)); ?>">Open</a>
                                    <a class="button ghost" href="<?php echo e(route('websites.edit', $website)); ?>">Edit</a>

                                    <form class="inline-form" method="post" action="<?php echo e(route('websites.toggle-status', $website)); ?>">
                                        <?php echo csrf_field(); ?>
                                        <button class="button ghost" type="submit"><?php echo e($website->status === 'disabled' ? 'Enable' : 'Disable'); ?></button>
                                    </form>

                                    <form class="inline-form" method="post" action="<?php echo e(route('websites.destroy', $website)); ?>" onsubmit="return confirm('Delete this website from the control center?')">
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('delete'); ?>
                                        <button class="button danger" type="submit">Delete</button>
                                    </form>

                                    <form class="inline-form" method="post" action="<?php echo e(route('websites.sync', $website)); ?>">
                                        <?php echo csrf_field(); ?>
                                        <button class="button secondary" type="submit">Sync</button>
                                    </form>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="6">
                                <div class="empty-state">
                                    <p class="eyebrow">No websites yet</p>
                                    <h1>Start by registering the first remote property.</h1>
                                    <a class="button primary" href="<?php echo e(route('websites.create')); ?>">Create Website</a>
                                </div>
                            </td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

        <?php echo e($websites->links()); ?>

    </section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.panel', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\contol\resources\views/websites/index.blade.php ENDPATH**/ ?>