@page "/admin/session"
@attribute [Authorize]
@attribute [RolePermission]
@inherits ComponentDefault
@using ThingsGateway.Admin.Application
@namespace ThingsGateway.Admin.Razor



<div class="h-100">
    <AdminTable @ref=table TItem="SessionOutput"
        AutoGenerateColumns="true"
        ShowAdvancedSearch=false
                AllowResizing="true"
                IsFixedHeader=true
                IsMultipleSelect=false
                ShowSearch="false"
                SearchModel=SearchModel
                ShowExtendButtons=true
                ShowExtendDeleteButton=false
                ShowExtendEditButton=false
                ShowDefaultButtons=false
                ExtendButtonColumnWidth=320
                OnQueryAsync="OnQueryAsync"
                IsPagination=true>

        <RowButtonTemplate>
            
            <TableCellPopConfirmButton  IsShow=@AuthorizeButton("强退会话") Text="@Localizer[nameof(SessionService.ExitSession)]" Size="Size.ExtraSmall" Color=Color.Warning Icon="fa fa-sign-out" OnConfirm="@(async()=>
{
await SessionService.ExitSession(context.Id);
await InvokeAsync(table.QueryAsync);
await ToastService.Default();
})" />
            <TableCellButton Size="Size.ExtraSmall" Icon="fa fa-list" Text="@Localizer[ nameof(VerificatInfo)]" OnClick="()=>ShowVerificatList(context)" />
        </RowButtonTemplate>
    </AdminTable>
</div>

@code {
    [NotNull]
    AdminTable<SessionOutput>? table { get; set; }
}
