Files
threshold-ui/ui/admin/app/components/form/host-set/add-hosts/index.hbs
T
2024-12-04 14:16:05 -08:00

66 lines
1.7 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
{{#if this.hasAvailableHosts}}
<Rose::Form
class='full-width'
@onSubmit={{fn this.submit @submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
as |form|
>
<form.actions
@submitText={{t 'actions.add-hosts'}}
@cancelText={{t 'actions.cancel'}}
/>
<Hds::Table
@model={{this.filteredHosts}}
@columns={{array
(hash label=(t 'form.id.label'))
(hash label=(t 'form.name.label'))
(hash label=(t 'form.type.label'))
}}
@valign='middle'
>
<:body as |B|>
<B.Tr>
<B.Td>
<Hds::Form::Checkbox::Field
{{on 'change' (fn this.toggleHost B.data.id)}}
as |F|
>
<F.Label>{{B.data.id}}</F.Label>
<F.HelperText>{{B.data.description}}</F.HelperText>
</Hds::Form::Checkbox::Field>
</B.Td>
<B.Td>{{B.data.name}}</B.Td>
<B.Td><Hds::Badge @text={{B.data.type}} /></B.Td>
</B.Tr>
</:body>
</Hds::Table>
</Rose::Form>
{{/if}}
{{#unless this.hasAvailableHosts}}
<Rose::Layout::Centered>
<Hds::ApplicationState as |A|>
<A.Header
@title={{t 'resources.host-set.host.messages.add-none.title'}}
/>
<A.Body
@text={{t 'resources.host-set.host.messages.add-none.description'}}
/>
<A.Footer as |F|>
<F.LinkStandalone
@icon='arrow-left'
@text={{t 'actions.back'}}
@route='scopes.scope.host-catalogs.host-catalog.host-sets.host-set.hosts'
/>
</A.Footer>
</Hds::ApplicationState>
</Rose::Layout::Centered>
{{/unless}}