<?php
// Copyright 1999-2022. Plesk International GmbH. All rights reserved.
?>
<script type="text/javascript">
    //<![CDATA[
    Jsw.onReady(function() {

        new Jsw.Hint({
            renderTo: 'main',
            hint: <?php echo $this->jsLmsg('areaDescription'); ?>
        });

        new Jsw.List({
            renderTo: 'main',
            id: 'sites-list',
            data: <?php echo Zend_Json::encode($this->sitesList->fetchData()); ?>,
            dataUrl: '/statistics/traffic-site-select-list-data',
            columns: [{
                header: <?php echo $this->sitesList->jsLmsg('domain'); ?>,
                sortable: true,
                dataIndex: 'displayName'
            }, {
                header: '',
                renderer: function(item) {
                    return '<a href="' + item.statisticsUrl + '">[' + <?php echo $this->sitesList->jsLmsg('linkView'); ?> + ']</a>';
                }
            }]
        });

    });
    //]]>
</script>
