<?php
/** @var \App\Assets $assets */
$assets
    ->load('clipboard')
    ->addInlineJs($this->fetch('partials/log_viewer.js'), 99);
?>

<div class="modal fade" id="modal-log-view" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="modal-log-view-label"><?= __('Log Viewer') ?></h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
            </div>
            <div class="modal-body">
                <div class="custom-control custom-switch pb-3">
                    <input class="custom-control-input" id="modal-log-autoscroll" type="checkbox" checked>
                    <span class="custom-control-track"></span>
                    <label class="custom-control-label" for="modal-log-autoscroll"><?= __(
                            'Automatically scroll to the bottom of the log'
                        ) ?></label>
                </div>

                <textarea class="form-control log-viewer" id="modal-log-view-contents" spellcheck="false" readonly>Loading...</textarea>
                <div class="buttons pt-2">
                    <button class="btn btn-copy btn-primary btn-sm" data-clipboard-target="#modal-log-view-contents">
                        <i class="material-icons">file_copy</i> <?=__('Copy to Clipboard')?>
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
