mirror of https://github.com/status-im/consul.git
prettify peer/initiate form
This commit is contained in:
parent
1bdad89026
commit
44c7614b3b
|
@ -1,54 +1,43 @@
|
|||
<div
|
||||
class={{class-map
|
||||
'consul-peer-form-initiate'
|
||||
}}
|
||||
...attributes
|
||||
>
|
||||
<div class={{class-map "consul-peer-form-initiate"}} ...attributes>
|
||||
<DataWriter
|
||||
@sink={{uri
|
||||
'/${partition}/${nspace}/${dc}/peer'
|
||||
"/${partition}/${nspace}/${dc}/peer"
|
||||
(hash
|
||||
partition=(or @item.Partition '')
|
||||
nspace=(or @item.Namespace '')
|
||||
dc=(or @item.Datacenter '')
|
||||
partition=(or @item.Partition "")
|
||||
nspace=(or @item.Namespace "")
|
||||
dc=(or @item.Datacenter "")
|
||||
)
|
||||
}}
|
||||
@type={{'peer'}}
|
||||
@label={{'peer'}}
|
||||
@type={{"peer"}}
|
||||
@label={{"peer"}}
|
||||
@onchange={{fn (optional @onsubmit) @item}}
|
||||
as |writer|>
|
||||
<BlockSlot @name="error" as |after error|>
|
||||
<Notice
|
||||
@type="error"
|
||||
role="alert"
|
||||
as |notice|>
|
||||
<notice.Body>
|
||||
<p>
|
||||
<strong>Error</strong><br />
|
||||
{{error.message}}
|
||||
</p>
|
||||
</notice.Body>
|
||||
</Notice>
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="content">
|
||||
{{#let
|
||||
(unique-id)
|
||||
as |id|}}
|
||||
<form
|
||||
id={{id}}
|
||||
{{on 'submit' (fn writer.persist @item)}}
|
||||
>
|
||||
{{yield (hash
|
||||
Fieldsets=(component "consul/peer/form/initiate/fieldsets"
|
||||
item=@item
|
||||
as |writer|
|
||||
>
|
||||
<BlockSlot @name="error" as |after error|>
|
||||
<Notice @type="error" role="alert" as |notice|>
|
||||
<notice.Body>
|
||||
<p>
|
||||
<strong>Error</strong><br />
|
||||
{{error.message}}
|
||||
</p>
|
||||
</notice.Body>
|
||||
</Notice>
|
||||
</BlockSlot>
|
||||
<BlockSlot @name="content">
|
||||
{{#let (unique-id) as |id|}}
|
||||
<form id={{id}} {{on "submit" (fn writer.persist @item)}}>
|
||||
{{yield
|
||||
(hash
|
||||
Fieldsets=(component
|
||||
"consul/peer/form/initiate/fieldsets" item=@item
|
||||
)
|
||||
Actions=(component
|
||||
"consul/peer/form/initiate/actions" item=@item id=id
|
||||
)
|
||||
)
|
||||
Actions=(component "consul/peer/form/initiate/actions"
|
||||
item=@item
|
||||
id=id
|
||||
)
|
||||
)}}
|
||||
}}
|
||||
</form>
|
||||
{{/let}}
|
||||
{{/let}}
|
||||
</BlockSlot>
|
||||
</DataWriter>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue