{{define "asset_template"}}
{{template "asset_tabs" .}}
{{if .AssetTemplate}}
<div class="card">
  <div class="section-title">
    <div>
      <h2 class="title-with-icon">{{icon "template"}}<span>{{.AssetTemplate.Name}}</span></h2>
    </div>
    <a class="btn secondary" href="/ui/assets/templates">返回模板列表</a>
  </div>
  <div class="info-list">
    <div><span>模板名</span><strong class="mono">{{.AssetTemplate.Name}}</strong></div>
    <div><span>来源文件</span><strong class="mono">{{if .AssetTemplate.Source}}{{.AssetTemplate.Source}}{{else}}-{{end}}</strong></div>
    <div><span>节点数</span><strong>{{.AssetTemplate.NodeCount}}</strong></div>
    <div><span>连线数</span><strong>{{.AssetTemplate.EdgeCount}}</strong></div>
    <div><span>输入槽位</span><strong>{{len .AssetTemplate.Slots.Inputs}}</strong></div>
    <div><span>服务槽位</span><strong>{{len .AssetTemplate.Slots.Services}}</strong></div>
    <div><span>输出槽位</span><strong>{{len .AssetTemplate.Slots.Outputs}}</strong></div>
    <div class="full"><span>描述</span><strong>{{if .AssetTemplate.Description}}{{.AssetTemplate.Description}}{{else}}-{{end}}</strong></div>
    <div class="full"><span>路径</span><strong class="mono">{{.AssetTemplate.Path}}</strong></div>
  </div>
</div>

{{if .AssetTemplate.AdvancedParams}}
<details class="card collapsible">
  <summary class="title-with-icon">{{icon "tech"}}<span>高级设置</span></summary>
  <pre>{{json .AssetTemplate.AdvancedParams}}</pre>
</details>
{{end}}

<details class="card collapsible">
  <summary class="title-with-icon">{{icon "tech"}}<span>原始 JSON</span></summary>
  <pre>{{json .AssetTemplate.Raw}}</pre>
</details>
{{end}}
{{if .Error}}<div class="error">{{.Error}}</div>{{end}}
{{template "asset_tabs_end" .}}
{{end}}
