<%@ page title="" language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="RCC_Exchange_MailboxDevices, MachSol.MachPanel.Web" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Content" Runat="Server">
    
    <script type="module">

        import { createApp } from 'vue'
        import MailboxDevices from '/Components/Exchange/MailboxDevices.js?v=3.9'
        import { getLabelText } from '/Components/Common/utils.js?v=3.9'

        createApp({
            data() {
                return {
                    readOnly: <%= Helper.ReadOnlyRole %>,
                    isLoggedInAsReseller: <%= Helper.IsLoggedInAsReseller.ToString().ToLower() %>,
                    isLoggedInAsCustomer: <%= Helper.IsLoggedInAsCustomer.ToString().ToLower() %>,
                    showCustomerNumber: <%= Helper.ShowCustomerNumber.ToString().ToLower() %>,
                    customerId: '<%= IIF(Helper.IsLoggedInAsCustomer, Session("CustomerId"), 0) %>',
                    lastSuccessSyncFromDate: <%= Newtonsoft.Json.JsonConvert.SerializeObject(LastSuccessSyncFromDate) %>,
                    lastSuccessSyncToDate: <%= Newtonsoft.Json.JsonConvert.SerializeObject(LastSuccessSyncToDate) %>,
                    sortPreference: <%= Newtonsoft.Json.JsonConvert.SerializeObject(InitialSortPreference) %>,
                }
            },
            methods: {
                getLabelText
            },
            created: function () {
                let urlParams = new URLSearchParams(window.location.search);
                
                if (urlParams.has('IA')) {
                    if (urlParams.get('IA') == 1)
                        displayErrorMsg(Error(this.getLabelText('SPT002054')));
                    else if (urlParams.get('IA') == 2)
                        displayErrorMsg(Error(this.getLabelText('strVPSMoveIsInProcess')));
                }
            },
            components: {
                MailboxDevices
            },
            template: `

<MailboxDevices :readOnly="readOnly" :isLoggedInAsCustomer="isLoggedInAsCustomer" :isLoggedInAsReseller="isLoggedInAsReseller" :showCustomerNumber="showCustomerNumber"
    :lastSuccessSyncFromDate="lastSuccessSyncFromDate" :lastSuccessSyncToDate="lastSuccessSyncToDate" :customerId="customerId" :sortPreference="sortPreference" />
`
        }).mount('#app')

    </script>

    <div id="app">
    </div>

</asp:Content>

