{{define "plans"}}

{{icon "profile"}}场景配置列表

{{icon "apply"}}新建场景 {{if .SelectedProfile}} 编辑
{{end}}
{{range .AssetProfiles}} {{else}} {{end}}
场景配置 描述 视频通道
{{.Name}} {{if .Description}}{{.Description}}{{else}}-{{end}} {{len .Instances}}
还没有场景配置
{{if .AssetProfileEditor}} {{if .AssetProfileEditing}}
{{end}}

{{icon "profile"}}场景配置{{if .AssetProfileEditor.Name}} · {{.AssetProfileEditor.Name}}{{end}}

{{if .AssetProfileEditing}} 编辑模式 正在编辑场景配置 {{else}} 查看模式 当前内容为只读,点击“编辑”后进入表单模式。 {{end}}
{{if .AssetProfileEditing}} {{icon "close"}}取消 {{end}}
{{if .AssetProfileEditing}}
{{else}}
场景名称{{if .AssetProfileEditor.Name}}{{.AssetProfileEditor.Name}}{{else}}-{{end}}
业务名称{{if .AssetProfileEditor.BusinessName}}{{.AssetProfileEditor.BusinessName}}{{else}}-{{end}}
调试参数{{if .AssetProfileEditor.OverlayName}}{{.AssetProfileEditor.OverlayName}}{{else}}不使用{{end}}
站点名{{if .AssetProfileEditor.SiteName}}{{.AssetProfileEditor.SiteName}}{{else}}-{{end}}
描述{{if .AssetProfileEditor.Description}}{{.AssetProfileEditor.Description}}{{else}}-{{end}}
{{end}}

{{icon "device"}}视频通道

{{len .AssetProfileEditor.Instances}} 路 {{if .AssetProfileEditing}} {{end}}
{{range $i, $inst := .AssetProfileEditor.Instances}} {{$template := index $.AssetTemplateMap $inst.Template}} {{end}}
通道 模板 输入绑定 服务绑定 输出绑定
{{$inst.Name}} {{if $inst.Delete}}待删除{{else}}{{$inst.Template}}{{end}} {{if $inst.Delete}}-{{else}} {{if $template.Slots.Inputs}} {{range $slot := $template.Slots.Inputs}}
{{$slot.Description}} {{if inputBindingRef $inst.InputBindings $slot.Name}}{{inputBindingRef $inst.InputBindings $slot.Name}}{{else}}-{{end}}
{{end}} {{else}}-{{end}} {{end}}
{{if $inst.Delete}}-{{else}} {{if $template.Slots.Services}} {{range $slot := $template.Slots.Services}}
{{$slot.Description}} {{if serviceBindingRef $inst.ServiceBindings $slot.Name}}{{serviceBindingRef $inst.ServiceBindings $slot.Name}}{{else}}-{{end}}
{{end}} {{else}}-{{end}} {{end}}
{{if $inst.Delete}}-{{else}} {{if $template.Slots.Outputs}} {{range $slot := $template.Slots.Outputs}}
{{$slot.Description}} {{if outputBindingValue $inst.OutputBindings $slot.Name "publish_hls_path"}} {{outputBindingValue $inst.OutputBindings $slot.Name "publish_hls_path"}} {{else if outputBindingValue $inst.OutputBindings $slot.Name "publish_rtsp_path"}} {{outputBindingValue $inst.OutputBindings $slot.Name "publish_rtsp_port"}} {{outputBindingValue $inst.OutputBindings $slot.Name "publish_rtsp_path"}} {{else}}-{{end}}
{{end}} {{else}}-{{end}} {{end}}
{{if $.AssetProfileEditing}} {{end}}
{{if .AssetProfileEditor.Instances}}

{{icon "device"}}通道详情{{if gt (len .AssetProfileEditor.Instances) 0}}{{with index .AssetProfileEditor.Instances .ActiveInstanceIndex}}{{if .Name}} · {{.Name}}{{end}}{{end}}{{end}}

{{if .AssetProfileEditing}} 编辑模式 当前通道的修改会在点击“保存场景配置”后统一生效。 {{else}} 查看模式 当前通道详情为只读展示。 {{end}}
{{range $i, $inst := .AssetProfileEditor.Instances}} {{$template := index $.AssetTemplateMap $inst.Template}}
{{if $.AssetProfileEditing}}
{{range $slot := $template.Slots.Inputs}} {{end}} {{range $slot := $template.Slots.Services}} {{end}} {{range $slot := $template.Slots.Outputs}} {{end}}
{{else}}
通道名{{$inst.Name}}
通道显示名{{if $inst.DisplayName}}{{$inst.DisplayName}}{{else}}-{{end}}
模板{{$inst.Template}}
{{range $slot := $template.Slots.Inputs}}
{{$slot.Description}} {{if inputBindingRef $inst.InputBindings $slot.Name}}{{inputBindingRef $inst.InputBindings $slot.Name}}{{else}}-{{end}}
{{end}} {{range $slot := $template.Slots.Services}}
{{$slot.Description}} {{if serviceBindingRef $inst.ServiceBindings $slot.Name}}{{serviceBindingRef $inst.ServiceBindings $slot.Name}}{{else}}-{{end}}
{{end}} {{range $slot := $template.Slots.Outputs}}
{{$slot.Description}} RTSP 端口 {{if outputBindingValue $inst.OutputBindings $slot.Name "publish_rtsp_port"}}{{outputBindingValue $inst.OutputBindings $slot.Name "publish_rtsp_port"}}{{else}}-{{end}}
{{end}}
{{end}}
{{end}}
{{end}} {{if .AssetProfileEditing}}
{{end}}
{{icon "tech"}}原始 JSON
{{json .AssetProfileEditor.Raw}}
{{end}} {{if .Error}}
{{.Error}}
{{end}} {{end}}