Files
threshold-ui/ui/admin/app/templates/scopes/scope/targets/target/host-sources.hbs
T
Carlos Alcaide Corvo f002e14673 [Admin UI] Adopt HDS::Copy::Snippet (#2141)
* refactor: 💡 Adopt HDS copy snippet

Adopt HDS copy snippet and delete usage of Copyable custom component
within Admin UI.
2024-02-16 02:19:43 -08:00

110 lines
3.1 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{page-title (t 'resources.target.host-source.title_plural')}}
<Breadcrumbs::Item
@text={{t 'resources.target.host-source.title_plural'}}
@route='scopes.scope.targets.target.host-sources'
/>
<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<Breadcrumbs::Container />
</page.breadcrumbs>
<page.header>
<Targets::Target::Header @model={{@model}} />
</page.header>
<page.navigation>
<Targets::Target::Nav @model={{@model}} />
</page.navigation>
<page.actions>
<Targets::Target::Actions @model={{@model}} />
</page.actions>
<page.body>
{{#if @model.hostSets}}
<Hds::Table
@model={{@model.hostSets}}
@columns={{array
(hash label=(t 'form.name.label'))
(hash label=(t 'form.type.label'))
(hash label=(t 'form.id.label'))
(hash label=(t 'titles.actions'))
}}
@valign='middle'
>
<:body as |B|>
<B.Tr>
<B.Td>
{{#if (can 'read host-set' B.data.model)}}
<LinkTo
@route='scopes.scope.host-catalogs.host-catalog.host-sets.host-set'
@models={{array B.data.model.host_catalog_id B.data.model.id}}
>
{{B.data.model.displayName}}
</LinkTo>
{{else}}
{{B.data.model.displayName}}
{{/if}}
<p>{{B.data.model.description}}</p>
</B.Td>
<B.Td>
<HostCatalogTypeBadge @model={{B.data.model}} />
</B.Td>
<B.Td>
<Hds::Copy::Snippet
@textToCopy={{B.data.model.id}}
@color='secondary'
/>
</B.Td>
<B.Td>
{{#if (can 'removeHostSources target' @model)}}
<Hds::Dropdown as |dd|>
<dd.ToggleIcon
@icon='more-horizontal'
@text={{t 'actions.manage'}}
@hasChevron={{false}}
/>
<dd.Interactive
@color='critical'
@text={{t 'actions.remove'}}
{{on
'click'
(route-action 'removeHostSource' @model B.data.model)
}}
/>
</Hds::Dropdown>
{{/if}}
</B.Td>
</B.Tr>
</:body>
</Hds::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.target.host-source.messages.welcome.title'}}
as |message|
>
<message.description>
{{t 'resources.target.host-source.messages.welcome.description'}}
</message.description>
<message.link @route='scopes.scope.targets.target.add-host-sources'>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'resources.target.actions.add-host-sources'}}
</message.link>
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>