@extends('admin.layouts.master')
@section('title', __('cron_job_setting'))
@section('content')
    <div class="container-fluid">
        <div class="row justify-content-md-center">
            <div class="col-lg-6 col-md-8">
                <div class="card h-100 ">
                    <div class="card-header">
                        <h5>{{ __('cron_job_setting') }}</h5>
                    </div>
                    <div class="card-body">
                        <div class="mb-4">
                            <div class="mb-4">
                                <p> {{__("Insert the following line to your system's crontab.")}} </p>
                                <p> {{__("Please note, below timings for running the cron jobs are the recommended, you can change it if you want.")}} </p>
                            </div>
                        </div>
                        <label for="cron_command" class="form-label">{{ __('cron_command') }}</label>
                        <div class="input-group">
                            <input type="url" value="wget -q -O- {{ url('cron') . '/' . get_config('cron_key') }}" readonly
                                name="webhook_callback_url" class="form-control" placeholder="{{ __('cron_command') }}"
                                aria-label="{{ __('cron_command') }}" aria-describedby="cron_command">
                            <span class="input-group-text copy-text" id="cron_command"><i class="la la-copy"></i></span>
                        </div>
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
@push('js')
    <script>
        $(document).ready(function() {
            $('.copy-text').click(function() {
                var inputField = $(this).closest('.input-group').find('input');
                inputField.select();
                document.execCommand("copy");
                toastr.success("{{ __('copied') }}");
            });
        });
    </script>
@endpush
