92 lines
3.7 KiB
Plaintext
92 lines
3.7 KiB
Plaintext
@*
|
||
//------------------------------------------------------------------------------
|
||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||
// QQ群:605534569
|
||
//------------------------------------------------------------------------------
|
||
*@
|
||
|
||
@page "/gatewayconfig/driverdebug"
|
||
@namespace ThingsGateway.Blazor
|
||
@using System.Linq.Expressions;
|
||
@using BlazorComponent;
|
||
@using Furion.DataValidation;
|
||
@using Mapster;
|
||
@using Masa.Blazor.Presets;
|
||
@using System.IO;
|
||
@using Masa.Blazor;
|
||
@using Microsoft.AspNetCore.Authorization;
|
||
@using ThingsGateway.Admin.Blazor.Core;
|
||
@using ThingsGateway.Admin.Blazor;
|
||
@using ThingsGateway.Admin.Core;
|
||
@using ThingsGateway.Application;
|
||
@inject IVariableService VariableService
|
||
@attribute [Authorize]
|
||
@inherits BaseComponentBase
|
||
@inject UserResoures UserResoures
|
||
@inject ICollectDeviceService CollectDeviceService
|
||
@layout MainLayout
|
||
|
||
<MRow NoGutters>
|
||
<MCol Md=@(IsShowTreeView?3:0)>
|
||
<MCard Show=IsShowTreeView Style=@($"height: calc(100vh - {BlazorResourceConst.DefaultHeight}px);border-radius:0px;")>
|
||
<MCardTitle>
|
||
<MTextField Dense Style="max-width:200px;" HideDetails=@("auto") Class="mx-2 my-1" @bind-Value="_searchName" Outlined Label=@typeof(CollectDevice).GetDescription(nameof(CollectDevice.PluginId)) />
|
||
</MCardTitle>
|
||
<MTreeview Style=@($"height: calc(100vh - {BlazorResourceConst.DefaultHeight+200}px);overflow-y:auto") Dense TItem="DriverPluginCategory"
|
||
TKey="long" OpenOnClick ActiveChanged=@((async a=>
|
||
{
|
||
if(this.SearchModel.PluginId!= a.FirstOrDefault()&&a.Count>0)
|
||
{
|
||
this.SearchModel.PluginId= a.FirstOrDefault();
|
||
await ImportVaiableAsync(this.SearchModel.PluginId);
|
||
}
|
||
}) )
|
||
Items="DriverPlugins" ItemText="r=>r.Name" ItemChildren="r=>r.Children"
|
||
Search="@_searchName"
|
||
Activatable ItemKey=@(r=>r.Id)>
|
||
<LabelContent>
|
||
<span title=@context.Item.Name>
|
||
@context.Item.Name
|
||
</span>
|
||
</LabelContent>
|
||
<LabelContent>
|
||
<span title=@context.Item.Name>
|
||
@context.Item.Name
|
||
</span>
|
||
</LabelContent>
|
||
</MTreeview>
|
||
</MCard>
|
||
</MCol>
|
||
<MCol Md=@(IsShowTreeView?9:12)>
|
||
<MCard Style=@($"height: calc(100vh - {BlazorResourceConst.DefaultHeight}px);border-radius:0px;")>
|
||
<MCard Class="mb-3 pa-2 text-h6" Elevation="0" Flat Rounded="false">
|
||
<MRow Align="AlignTypes.Center" Class="mt-1">
|
||
<MButton Class="mx-1" OnClick=@(async() =>
|
||
{
|
||
IsShowTreeView=!IsShowTreeView;
|
||
}
|
||
) Color="primary" Icon>
|
||
<MIcon>mdi-menu</MIcon>
|
||
</MButton>
|
||
<MLabel>
|
||
@_importRef?.ToString()
|
||
</MLabel>
|
||
</MRow>
|
||
</MCard>
|
||
@if (_importRender != null)
|
||
{
|
||
@_importRender
|
||
}
|
||
</MCard>
|
||
|
||
</MCol>
|
||
|
||
</MRow>
|
||
|
||
|