<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">customer_online_grid.customer_online_grid_data_source</item>
        </item>
    </argument>
    <settings>
        <spinner>customer_online_columns</spinner>
        <deps>
            <dep>customer_online_grid.customer_online_grid_data_source</dep>
        </deps>
    </settings>
    <dataSource name="customer_online_grid_data_source" component="Magento_Ui/js/grid/provider">
        <settings>
            <storageConfig>
                <param name="indexField" xsi:type="string">visitor_id</param>
            </storageConfig>
            <updateUrl path="mui/index/render"/>
        </settings>
        <aclResource>Magento_Customer::online</aclResource>
        <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="customer_online_grid_data_source">
            <settings>
                <requestFieldName>id</requestFieldName>
                <primaryFieldName>visitor_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>
    <listingToolbar name="listing_top">
        <bookmark name="bookmarks"/>
        <columnsControls name="columns_controls"/>
        <filters name="listing_filters"/>
        <paging name="listing_paging"/>
    </listingToolbar>
    <columns name="customer_online_columns">
        <column name="customer_id">
            <settings>
                <filter>textRange</filter>
                <label translate="true">ID</label>
                <sorting>asc</sorting>
            </settings>
        </column>
        <column name="firstname">
            <settings>
                <filter>text</filter>
                <label translate="true">First Name</label>
            </settings>
        </column>
        <column name="lastname">
            <settings>
                <filter>
                    text
                </filter>
                <label translate="true">Last Name</label>
            </settings>
        </column>
        <column name="email">
            <settings>
                <filter>text</filter>
                <label translate="true">Email</label>
            </settings>
        </column>
        <column name="last_visit_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
            <settings>
                <filter>dateRange</filter>
                <dataType>date</dataType>
                <label translate="true">Last Activity</label>
            </settings>
        </column>
        <column name="visitor_type" component="Magento_Ui/js/grid/columns/select">
            <settings>
                <options class="Magento\Customer\Ui\Component\Listing\Column\Online\Type\Options"/>
                <filter>select</filter>
                <dataType>select</dataType>
                <label translate="true">Type</label>
            </settings>
        </column>
    </columns>
</listing>
