consul/ui-v2/app/components/data-form/index.hbs

40 lines
908 B
Handlebars

<DataLoader @items={{item}} @src={{concat '/' nspace '/' dc '/' type '/' src}} @onchange={{action "setData"}} @once={{true}}>
<BlockSlot @name="loaded">
<DataWriter
@sink={{concat '/' nspace '/' (or data.Datacenter dc) '/' type '/'}}
@type={{type}}
@ondelete={{action ondelete}}
@onchange={{action onsubmit}}
as |writer|>
{{#let (hash
data=data
change=(action "change")
isCreate=create
error=writer.error
disabled=writer.inflight
submit=(action writer.persist data)
delete=(action writer.delete data)
) as |api|}}
{{yield api}}
<BlockSlot @name="error">
<YieldSlot @name="error">
{{yield api}}
</YieldSlot>
</BlockSlot>
<BlockSlot @name="content">
<YieldSlot @name="form">
{{yield api}}
</YieldSlot>
</BlockSlot>
{{/let}}
</DataWriter>
</BlockSlot>
</DataLoader>