@page "/gateway/plugindebug"
@namespace ThingsGateway.Gateway.Razor
@using System.Linq.Expressions;
@using System.IO;
@using Microsoft.AspNetCore.Authorization;

@using ThingsGateway.Admin.Razor;
@using ThingsGateway.Admin.Application;
@using ThingsGateway.Gateway.Application;
@using ThingsGateway.Extension

@attribute [Authorize]
@inherits ComponentDefault
@attribute [RolePermission]

<div class="listtree-view h-100">
    <Split Basis="20%" ShowBarHandle=false>
        <FirstPaneTemplate>
            <ContextMenuZone title="Right click operation">
                <TreeView TItem="PluginInfo" Items="PluginTreeViewItems" ClickToggleNode IsVirtualize="true" OnTreeItemClick="OnClick" @ref=treeView />
                <ContextMenu>
                    <ContextMenuItem Text=@Localizer["New"] OnClick="NewPluginRender"></ContextMenuItem>
                    <ContextMenuItem Text=@Localizer["NewWinbox"] OnClick="NewPluginWinboxRender"></ContextMenuItem>
                </ContextMenu>
            </ContextMenuZone>
        </FirstPaneTemplate>
        <SecondPaneTemplate>
            <Tab ShowClose @ref=tab>

            </Tab>
        </SecondPaneTemplate>
    </Split>
</div>

@code {
    Tab tab;
    TreeView<PluginInfo> treeView;
}
