<?php
/**
 * View: Demo Oracle — arborescence des verrous.
 *
 * Portage de modules/oracle/views/report/realtime_locks.php, sans le bouton
 * d'arret de session ni sa fenetre de confirmation.
 *
 * Variables : $baseUrl, $settings
 */
?>

<div class="page-header" style="display:flex;align-items:center;flex-wrap:wrap;gap:.75rem">
    <h1 style="margin:0">&#x1f512; <?= t('demo_oracle.locks_title') ?></h1>
    <div style="margin-left:auto;font-size:.82rem;color:var(--color-text-muted);display:flex;gap:1rem;align-items:center">
        <span><?= t('demo_oracle.sess_updated') ?>&nbsp;: <strong id="locks-updated">&mdash;</strong></span>
        <span><?= t('demo_oracle.sess_refresh') ?>&nbsp;: <strong id="locks-countdown">10</strong>s</span>
    </div>
</div>

<p style="font-size:.85rem;color:var(--color-text-muted);margin:.25rem 0 1rem">
    <?= t('demo_oracle.locks_hint') ?>
</p>

<div id="locks-error" style="display:none" class="alert alert-error"></div>

<div id="locks-empty" class="card" style="display:none">
    <p style="margin:0;color:var(--color-success)">
        &#x2713; <?= t('demo_oracle.locks_no_blocking') ?>
    </p>
</div>

<!-- Arbre des verrous (rendu cote JS) -->
<div id="locks-tree-card" class="card" style="display:none;padding:.6rem .8rem">
    <div id="locks-tree"></div>
</div>

<!-- PHP-injected config for external JS -->
<script>
window.DemoOracleReport = window.DemoOracleReport || {};
window.DemoOracleReport.realtimeLocks = {
    baseUrl: <?= json_encode($baseUrl) ?>,
    T: {
        blocker:    <?= json_encode(t('demo_oracle.locks_blocker')) ?>,
        holds:      <?= json_encode(t('demo_oracle.locks_holds_blocking')) ?>,
        blocked:    <?= json_encode(t('demo_oracle.locks_blocked')) ?>,
        blocked_by: <?= json_encode(t('demo_oracle.locks_blocked_by')) ?>,
        wait:       <?= json_encode(t('demo_oracle.locks_wait')) ?>
    }
};
</script>
<script src="/modules/demo_oracle/assets/js/report-realtime-locks.js?v=<?= filemtime(__DIR__ . '/../../assets/js/report-realtime-locks.js') ?>"></script>
