<?php
return [
    '@class' => 'Grav\\Common\\File\\CompiledYamlFile',
    'filename' => '/var/www/incms-scrape/steeger-grav/system/blueprints/config/scheduler.yaml',
    'modified' => 1793546196,
    'size' => 39040,
    'data' => [
        'title' => 'PLUGIN_ADMIN.SCHEDULER',
        'form' => [
            'validation' => 'loose',
            'fields' => [
                'scheduler_tabs' => [
                    'type' => 'tabs',
                    'active' => 1,
                    'fields' => [
                        'status_tab' => [
                            'type' => 'tab',
                            'title' => 'PLUGIN_ADMIN.SCHEDULER_STATUS',
                            'fields' => [
                                'status_title' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_STATUS',
                                    'underline' => true
                                ],
                                'status' => [
                                    'type' => 'cronstatus',
                                    'validate' => [
                                        'type' => 'commalist'
                                    ]
                                ],
                                'modern_health' => [
                                    'type' => 'display',
                                    'label' => 'PLUGIN_ADMIN.SCHEDULER_HEALTH_STATUS',
                                    'content' => '<div id="scheduler-health-status">
    <div class="text-muted">Loading...</div>
</div>
<script>
(function() {
    function renderHealthStatus() {
        var data = window.schedulerHealthData;
        var statusEl = document.getElementById(\'scheduler-health-status\');
        if (!statusEl || !data) return;

        var statusColor = \'#6c757d\';
        var statusLabel = data.status || \'unknown\';
        if (data.status === \'healthy\') statusColor = \'#28a745\';
        else if (data.status === \'warning\') statusColor = \'#ffc107\';
        else if (data.status === \'critical\') statusColor = \'#dc3545\';

        var html = \'<div style="display: flex; flex-direction: column; gap: 1rem;">\';

        // Status card
        html += \'<div style="display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%); border-radius: 6px; border: 1px solid #e9ecef; box-shadow: 0 1px 3px rgba(0,0,0,0.05);">\';
        html += \'<span style="font-weight: 500; color: #495057;">Status:</span>\';
        html += \'<span style="background: \' + statusColor + \'; color: white; padding: 0.375rem 0.75rem; font-size: 0.875rem; font-weight: 500; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.025em;">\' + statusLabel + \'</span>\';
        html += \'</div>\';

        // Info grid
        html += \'<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;">\';

        // Last run card
        html += \'<div style="background: white; border: 1px solid #e9ecef; border-radius: 6px; padding: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">\';
        html += \'<div style="color: #6c757d; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem;">Last Run</div>\';
        if (data.last_run) {
            var age = data.last_run_age;
            var ageText = \'just now\';
            if (age > 86400) {
                ageText = Math.floor(age / 86400) + \' day(s) ago\';
            } else if (age > 3600) {
                ageText = Math.floor(age / 3600) + \' hour(s) ago\';
            } else if (age > 60) {
                ageText = Math.floor(age / 60) + \' minute(s) ago\';
            } else if (age > 0) {
                ageText = age + \' second(s) ago\';
            }
            html += \'<div style="font-size: 1rem; color: #212529; font-weight: 500;">\' + ageText + \'</div>\';
        } else {
            html += \'<div style="font-size: 1rem; color: #6c757d;">Never</div>\';
        }
        html += \'</div>\';

        // Jobs count card
        html += \'<div style="background: white; border: 1px solid #e9ecef; border-radius: 6px; padding: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">\';
        html += \'<div style="color: #6c757d; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem;">Scheduled Jobs</div>\';
        html += \'<div style="font-size: 1rem; color: #212529; font-weight: 500;">\' + (data.scheduled_jobs || 0) + \'</div>\';
        html += \'</div>\';

        html += \'</div>\'; // Close grid

        // Queue size
        if (data.queue_size !== undefined) {
            html += \'<div style="background: white; border: 1px solid #e9ecef; border-radius: 6px; padding: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">\';
            html += \'<span style="color: #6c757d; font-size: 0.875rem;">Queue Size: </span>\';
            html += \'<span style="font-weight: 500;">\' + data.queue_size + \'</span>\';
            html += \'</div>\';
        }

        // Failed jobs warning
        if (data.failed_jobs_24h > 0) {
            html += \'<div style="background: #fff5f5; border: 1px solid #feb2b2; border-radius: 6px; padding: 0.75rem; color: #c53030;">\';
            html += \'<strong>Failed Jobs (24h):</strong> \' + data.failed_jobs_24h;
            html += \'</div>\';
        }

        html += \'</div>\';
        statusEl.innerHTML = html;
    }

    if (document.readyState === \'loading\') {
        document.addEventListener(\'DOMContentLoaded\', renderHealthStatus);
    } else {
        renderHealthStatus();
    }
})();
</script>
',
                                    'markdown' => false
                                ],
                                'trigger_methods' => [
                                    'type' => 'display',
                                    'label' => 'PLUGIN_ADMIN.SCHEDULER_ACTIVE_TRIGGERS',
                                    'content' => '<div id="scheduler-triggers">
    <div class="text-muted">Loading...</div>
</div>
<script>
(function() {
    function goToWebhookConfig() {
        // Find the "Advanced Features" tab and click it
        var tabs = document.querySelectorAll(\'.tabs-nav a\');
        for (var i = 0; i < tabs.length; i++) {
            if (tabs[i].textContent.trim() === \'Advanced Features\') {
                tabs[i].click();
                // Scroll to "Webhook Configuration" section heading after tab switch
                setTimeout(function() {
                    var headings = document.querySelectorAll(\'h1\');
                    for (var j = 0; j < headings.length; j++) {
                        if (headings[j].textContent.trim() === \'Webhook Configuration\') {
                            headings[j].scrollIntoView({ behavior: \'smooth\', block: \'start\' });
                            return;
                        }
                    }
                }, 150);
                return;
            }
        }
    }
    // Expose globally for onclick handlers
    window.goToWebhookConfig = goToWebhookConfig;

    function renderTriggers() {
        var data = window.schedulerHealthData;
        var triggersEl = document.getElementById(\'scheduler-triggers\');
        if (!triggersEl || !data) return;

        // Check cron status from the main status field
        var cronReady = false;
        var statusDiv = document.querySelector(\'.cronstatus-status\');
        if (statusDiv) {
            var statusText = statusDiv.textContent || statusDiv.innerText;
            cronReady = statusText.includes(\'Ready\');
        }

        var html = \'<div style="display: flex; flex-direction: column; gap: 0.5rem;">\';

        // Cron trigger card
        var cronIcon = cronReady ? \'<i class="fa fa-check-circle" style="color: #28a745;"></i>\' : \'<i class="fa fa-times-circle" style="color: #6c757d;"></i>\';
        var cronStatus = cronReady ? \'Active\' : \'Not Configured\';
        var cronStatusColor = cronReady ? \'#28a745\' : \'#6c757d\';
        var cardBg = cronReady ? \'#f8f9fa\' : \'#fff\';

        html += \'<div style="display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: \' + cardBg + \'; border: 1px solid #e9ecef; border-radius: 4px;">\';
        html += \'<div style="display: flex; align-items: center; gap: 0.75rem;">\';
        html += \'<span style="font-size: 1.25rem; line-height: 1;">\' + cronIcon + \'</span>\';
        html += \'<span style="font-weight: 500; color: #212529; font-size: 1rem;">Cron:</span>\';
        html += \'</div>\';
        html += \'<span style="background: \' + cronStatusColor + \'; color: white; padding: 0.25rem 0.75rem; font-size: 0.875rem; font-weight: 500; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.025em;">\' + cronStatus + \'</span>\';
        html += \'</div>\';

        // Webhook trigger card
        if (data.webhook_enabled) {
            html += \'<div style="display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 4px;">\';
            html += \'<div style="display: flex; align-items: center; gap: 0.75rem;">\';
            html += \'<span style="font-size: 1.25rem; line-height: 1;"><i class="fa fa-check-circle" style="color: #28a745;"></i></span>\';
            html += \'<span style="font-weight: 500; color: #212529; font-size: 1rem;">Webhook:</span>\';
            html += \'</div>\';
            html += \'<span style="background: #28a745; color: white; padding: 0.25rem 0.75rem; font-size: 0.875rem; font-weight: 500; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.025em;">ACTIVE</span>\';
            html += \'</div>\';
        } else {
            html += \'<div onclick="goToWebhookConfig()" style="display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: #fff; border: 1px solid #e9ecef; border-radius: 4px; cursor: pointer;" title="Click to configure webhooks">\';
            html += \'<div style="display: flex; align-items: center; gap: 0.75rem;">\';
            html += \'<span style="font-size: 1.25rem; line-height: 1;"><i class="fa fa-minus-circle" style="color: #ffc107;"></i></span>\';
            html += \'<span style="font-weight: 500; color: #212529; font-size: 1rem;">Webhook:</span>\';
            html += \'</div>\';
            html += \'<span style="background: #ffc107; color: #212529; padding: 0.25rem 0.75rem; font-size: 0.875rem; font-weight: 500; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.025em;">DISABLED</span>\';
            html += \'</div>\';
        }

        html += \'</div>\';

        if (!cronReady && !data.webhook_enabled) {
            html += \'<div class="alert alert-warning" style="margin-top: 1rem; cursor: pointer;" onclick="goToWebhookConfig()">\';
            html += \'<i class="fa fa-exclamation-triangle"></i> No triggers active! \';
            html += \'<a onclick="goToWebhookConfig(); event.stopPropagation();" style="cursor: pointer; text-decoration: underline;">Enable webhooks</a>\';
            html += \' or configure cron.</div>\';
        }

        triggersEl.innerHTML = html;
    }

    if (document.readyState === \'loading\') {
        document.addEventListener(\'DOMContentLoaded\', renderTriggers);
    } else {
        renderTriggers();
    }
})();
</script>
',
                                    'markdown' => false
                                ]
                            ]
                        ],
                        'jobs_tab' => [
                            'type' => 'tab',
                            'title' => 'PLUGIN_ADMIN.SCHEDULER_JOBS',
                            'fields' => [
                                'jobs_title' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_JOBS',
                                    'underline' => true
                                ],
                                'custom_jobs' => [
                                    'type' => 'list',
                                    'style' => 'vertical',
                                    'label' => NULL,
                                    'classes' => 'cron-job-list compact',
                                    'key' => 'id',
                                    'fields' => [
                                        '.id' => [
                                            'type' => 'key',
                                            'label' => 'PLUGIN_ADMIN.ID',
                                            'placeholder' => 'e.g. clear-cache',
                                            'validate' => [
                                                'required' => true,
                                                'pattern' => '[a-zа-я0-9_\\-]+',
                                                'max' => 20,
                                                'message' => 'ID must be lowercase with dashes/underscores only and less than 20 characters'
                                            ]
                                        ],
                                        '.command' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.COMMAND',
                                            'placeholder' => 'e.g. bin/grav',
                                            'validate' => [
                                                'required' => true
                                            ]
                                        ],
                                        '.args' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.EXTRA_ARGUMENTS',
                                            'placeholder' => 'e.g. cache'
                                        ],
                                        '.at' => [
                                            'type' => 'text',
                                            'wrapper_classes' => 'cron-selector',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_RUNAT',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_RUNAT_HELP',
                                            'default' => '* * * * *',
                                            'validate' => [
                                                'required' => true
                                            ]
                                        ],
                                        '.output' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_OUTPUT',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_OUTPUT_HELP',
                                            'placeholder' => 'e.g. logs/clear-cache.out'
                                        ],
                                        '.output_mode' => [
                                            'type' => 'select',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_OUTPUT_TYPE',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_OUTPUT_TYPE_HELP',
                                            'default' => 'append',
                                            'options' => [
                                                'append' => 'Append',
                                                'overwrite' => 'Overwrite'
                                            ]
                                        ],
                                        '.email' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_EMAIL',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_EMAIL_HELP',
                                            'placeholder' => 'e.g. notifications@yoursite.com'
                                        ]
                                    ]
                                ]
                            ]
                        ],
                        'modern_tab' => [
                            'type' => 'tab',
                            'title' => 'PLUGIN_ADMIN.SCHEDULER_ADVANCED_FEATURES',
                            'fields' => [
                                'workers_section' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_WORKER_CONFIG',
                                    'underline' => true,
                                    'fields' => [
                                        'modern.workers' => [
                                            'type' => 'number',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_CONCURRENT_WORKERS',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_CONCURRENT_WORKERS_HELP',
                                            'default' => 4,
                                            'size' => 'x-small',
                                            'append' => 'workers',
                                            'validate' => [
                                                'type' => 'int',
                                                'min' => 1,
                                                'max' => 10
                                            ]
                                        ]
                                    ]
                                ],
                                'retry_section' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_RETRY_CONFIG',
                                    'underline' => true,
                                    'fields' => [
                                        'modern.retry.enabled' => [
                                            'type' => 'toggle',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_RETRY_ENABLED',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_RETRY_ENABLED_HELP',
                                            'highlight' => 1,
                                            'default' => 1,
                                            'options' => [
                                                1 => 'PLUGIN_ADMIN.ENABLED',
                                                0 => 'PLUGIN_ADMIN.DISABLED'
                                            ],
                                            'validate' => [
                                                'type' => 'bool'
                                            ]
                                        ],
                                        'modern.retry.max_attempts' => [
                                            'type' => 'number',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_RETRY_MAX_ATTEMPTS',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_RETRY_MAX_ATTEMPTS_HELP',
                                            'default' => 3,
                                            'size' => 'x-small',
                                            'append' => 'retries',
                                            'validate' => [
                                                'type' => 'int',
                                                'min' => 1,
                                                'max' => 10
                                            ]
                                        ],
                                        'modern.retry.backoff' => [
                                            'type' => 'select',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_RETRY_BACKOFF',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_RETRY_BACKOFF_HELP',
                                            'default' => 'exponential',
                                            'options' => [
                                                'linear' => 'Linear (fixed delay)',
                                                'exponential' => 'Exponential (increasing delay)'
                                            ]
                                        ]
                                    ]
                                ],
                                'queue_section' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_QUEUE_CONFIG',
                                    'underline' => true,
                                    'fields' => [
                                        'modern.queue.path' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_QUEUE_PATH',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_QUEUE_PATH_HELP',
                                            'default' => 'user-data://scheduler/queue',
                                            'placeholder' => 'user-data://scheduler/queue'
                                        ],
                                        'modern.queue.max_size' => [
                                            'type' => 'number',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_QUEUE_MAX_SIZE',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_QUEUE_MAX_SIZE_HELP',
                                            'default' => 1000,
                                            'size' => 'x-small',
                                            'append' => 'jobs',
                                            'validate' => [
                                                'type' => 'int',
                                                'min' => 100,
                                                'max' => 10000
                                            ]
                                        ]
                                    ]
                                ],
                                'history_section' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_HISTORY',
                                    'underline' => true,
                                    'fields' => [
                                        'modern.history.enabled' => [
                                            'type' => 'toggle',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_HISTORY_ENABLED',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_HISTORY_ENABLED_HELP',
                                            'highlight' => 1,
                                            'default' => 1,
                                            'options' => [
                                                1 => 'PLUGIN_ADMIN.ENABLED',
                                                0 => 'PLUGIN_ADMIN.DISABLED'
                                            ],
                                            'validate' => [
                                                'type' => 'bool'
                                            ]
                                        ],
                                        'modern.history.retention_days' => [
                                            'type' => 'number',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_HISTORY_RETENTION',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_HISTORY_RETENTION_HELP',
                                            'default' => 30,
                                            'size' => 'x-small',
                                            'append' => 'days',
                                            'validate' => [
                                                'type' => 'int',
                                                'min' => 1,
                                                'max' => 365
                                            ]
                                        ]
                                    ]
                                ],
                                'webhook_section' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_WEBHOOK_CONFIG',
                                    'underline' => true,
                                    'fields' => [
                                        'webhook_plugin_status' => [
                                            'type' => 'webhook-status',
                                            'label' => NULL
                                        ],
                                        'modern.webhook.enabled' => [
                                            'type' => 'toggle',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_WEBHOOK_ENABLED',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_WEBHOOK_ENABLED_HELP',
                                            'highlight' => 0,
                                            'default' => 0,
                                            'options' => [
                                                1 => 'PLUGIN_ADMIN.ENABLED',
                                                0 => 'PLUGIN_ADMIN.DISABLED'
                                            ],
                                            'validate' => [
                                                'type' => 'bool'
                                            ]
                                        ],
                                        'modern.webhook.token' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_WEBHOOK_TOKEN',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_WEBHOOK_TOKEN_HELP',
                                            'placeholder' => 'Click Generate to create a secure token',
                                            'autocomplete' => 'off'
                                        ],
                                        'webhook_token_generate' => [
                                            'type' => 'display',
                                            'label' => NULL,
                                            'content' => '<div style="margin-top: -10px; margin-bottom: 15px;">
    <button type="button" class="button button-primary" onclick="generateWebhookToken()">
        <i class="fa fa-refresh"></i> Generate Token
    </button>
</div>
<script>
function generateWebhookToken() {
    try {
        // Generate token
        const array = new Uint8Array(32);
        crypto.getRandomValues(array);
        const token = Array.from(array, byte => byte.toString(16).padStart(2, \'0\')).join(\'\');
        
        // Try multiple selectors to find the field
        let field = document.querySelector(\'[name="data[scheduler][modern][webhook][token]"]\');
        if (!field) {
            field = document.querySelector(\'input[name*="webhook][token"]\');
        }
        if (!field) {
            field = document.getElementById(\'scheduler-modern-webhook-token\');
        }
        if (!field) {
            // Look for any text input in the webhook section
            const webhookSection = document.querySelector(\'.webhook_section\');
            if (webhookSection) {
                const inputs = webhookSection.querySelectorAll(\'input[type="text"]\');
                // Find the token field by checking for the placeholder
                for (let input of inputs) {
                    if (input.placeholder && input.placeholder.includes(\'Generate\')) {
                        field = input;
                        break;
                    }
                }
            }
        }
        
        if (field) {
            field.value = token;
            field.dispatchEvent(new Event(\'change\', { bubbles: true }));
            field.dispatchEvent(new Event(\'input\', { bubbles: true }));
            // Flash the field to show it was updated
            field.style.backgroundColor = \'#d4edda\';
            setTimeout(function() {
                field.style.backgroundColor = \'\';
            }, 500);
            // Also try to trigger Grav\'s form change detection
            if (window.jQuery) {
                jQuery(field).trigger(\'change\');
            }
        } else {
            // Log more debugging info
            console.error(\'Token field not found. Looking for input fields...\');
            console.log(\'All inputs:\', document.querySelectorAll(\'input[type="text"]\'));
            alert(\'Could not find the token field. Please ensure you are in the Advanced Features tab and the Webhook Configuration section is visible.\');
        }
    } catch (e) {
        console.error(\'Error generating token:\', e);
        alert(\'Error generating token: \' + e.message);
    }
}
</script>
',
                                            'markdown' => false
                                        ],
                                        'modern.webhook.path' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_WEBHOOK_PATH',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_WEBHOOK_PATH_HELP',
                                            'default' => '/scheduler/webhook',
                                            'placeholder' => '/scheduler/webhook'
                                        ]
                                    ]
                                ],
                                'health_section' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_HEALTH_CHECK_CONFIG',
                                    'underline' => true,
                                    'fields' => [
                                        'modern.health.enabled' => [
                                            'type' => 'toggle',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_HEALTH_CHECK_ENABLED',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_HEALTH_CHECK_ENABLED_HELP',
                                            'highlight' => 1,
                                            'default' => 1,
                                            'options' => [
                                                1 => 'PLUGIN_ADMIN.ENABLED',
                                                0 => 'PLUGIN_ADMIN.DISABLED'
                                            ],
                                            'validate' => [
                                                'type' => 'bool'
                                            ]
                                        ],
                                        'modern.health.path' => [
                                            'type' => 'text',
                                            'label' => 'PLUGIN_ADMIN.SCHEDULER_HEALTH_CHECK_PATH',
                                            'help' => 'PLUGIN_ADMIN.SCHEDULER_HEALTH_CHECK_PATH_HELP',
                                            'default' => '/scheduler/health',
                                            'placeholder' => '/scheduler/health'
                                        ]
                                    ]
                                ],
                                'webhook_usage' => [
                                    'type' => 'section',
                                    'title' => 'PLUGIN_ADMIN.SCHEDULER_USAGE_EXAMPLES',
                                    'underline' => true,
                                    'fields' => [
                                        'webhook_examples' => [
                                            'type' => 'display',
                                            'label' => NULL,
                                            'content' => '<script src="{{ url(\'plugin://admin/themes/grav/js/clipboard-helper.js\') }}"></script>
<div class="webhook-examples">
    <script>
    // Initialize webhook commands when page loads
    document.addEventListener(\'DOMContentLoaded\', function() {
        if (typeof GravClipboard !== \'undefined\') {
            GravClipboard.initWebhookCommands();
        }
    });
    </script>
    
    <div class="alert alert-info">
        <h4>How to use webhooks:</h4>
        
        <div style="margin-bottom: 1rem;">
            <label style="display: block; margin-bottom: 0.25rem; font-weight: 500;">Trigger all due jobs (respects schedule):</label>
            <div class="form-input-wrapper form-input-addon-wrapper">
                <textarea id="webhook-all-cmd" readonly rows="2" style="font-family: monospace; background: #f5f5f5; resize: none;">Loading...</textarea>
                <div class="form-input-addon form-input-append" style="cursor: pointer;" onclick="GravClipboard.copy(this)"><i class="fa fa-copy"></i> Copy</div>
            </div>
        </div>
        
        <div style="margin-bottom: 1rem;">
            <label style="display: block; margin-bottom: 0.25rem; font-weight: 500;">Force-run specific job (ignores schedule):</label>
            <div class="form-input-wrapper form-input-addon-wrapper">
                <textarea id="webhook-job-cmd" readonly rows="2" style="font-family: monospace; background: #f5f5f5; resize: none;">Loading...</textarea>
                <div class="form-input-addon form-input-append" style="cursor: pointer;" onclick="GravClipboard.copy(this)"><i class="fa fa-copy"></i> Copy</div>
            </div>
        </div>
        
        <div style="margin-bottom: 1rem;">
            <label style="display: block; margin-bottom: 0.25rem; font-weight: 500;">Check health status:</label>
            <div class="form-input-wrapper form-input-addon-wrapper">
                <input type="text" id="webhook-health-cmd" readonly value="Loading..." style="font-family: monospace; background: #f5f5f5;">
                <div class="form-input-addon form-input-append" style="cursor: pointer;" onclick="GravClipboard.copy(this)"><i class="fa fa-copy"></i> Copy</div>
            </div>
        </div>
        
        <div style="margin-top: 1rem;">
            <p><strong>GitHub Actions example:</strong></p>
            <pre>- name: Trigger Scheduler
  run: |
    curl -X POST ${{ secrets.SITE_URL }}/scheduler/webhook \\
      -H "Authorization: Bearer ${{ secrets.WEBHOOK_TOKEN }}"</pre>
        </div>
    </div>
</div>
',
                                            'markdown' => false
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ]
    ]
];
