@namespace AntSK.Pages.Setting.AIModel
@page "/modelmanager/modeldown/detail/{ModelName}/{ModelPath}"
@using AntSK.Services.Auth
@inherits AuthComponentBase
@using Microsoft.AspNetCore.Authorization
@using AntSK.Domain.Domain.Model.hfmirror;
    using AntSK.Domain.Domain.Model.hfmirror
@attribute [Authorize(Roles = "AntSKAdmin")]


<div>
    <PageContainer Title="模型下载">
        <ChildContent>
            <div class="standardList">
                <Card Class="listCard"
                      Title="模型列表"
                      Style="margin-top: 24px;"
                      BodyStyle="padding: 0 32px 40px 32px">
                    <Extra>

                    </Extra>
                    <ChildContent>
                        <AntList TItem="HfModelDetail"
                                 DataSource="modelList"
                                 ItemLayout="ListItemLayout.Horizontal">
                            <ListItem Actions="new[] {
                            down(()=> Down(context.Path))
                             }" Style="width:100%">
                                <div class="listContent" style="width:100%">
                                    <div class="listContentItem" style="width:20%">
                                        <b>名称</b>
                                        <p>@context.Name</p>
                                    </div>
                                    <div class="listContentItem" style="width:20%">
                                        <b>文件大小</b>
                                        <p>@context.Size</p>
                                    </div>
                                    <div class="listContentItem" style="width:20%">
                                        <b>更新时间</b>
                                        <p>@context.Time</p>
                                    </div>
                                </div>
                            </ListItem>
                        </AntList>
                    </ChildContent>
                </Card>
            </div>
        </ChildContent>
    </PageContainer>
</div>

@code
{
    RenderFragment down(Action clickAction) =>@<a key="down" @onclick="@clickAction">下载</a>;
}