feat: create ssh type target in admin-ui (#1027)

* feat: 🎸 create ssh type target in admin-UI
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2022-03-31 15:34:24 -07:00
1 parent a7bcc0c332
commit 9fae8f2a9f
7 files changed
+261 -163

No files matched your search

@@ -17,9 +17,26 @@
<page.actions>
{{#if (can 'create model' this.scope collection='targets')}}
{{#if @model}}
<Rose::LinkButton @route='scopes.scope.targets.new' @style='primary'>{{t
'titles.new'
}}</Rose::LinkButton>
<Rose::Dropdown
@text={{t 'titles.new'}}
@dropdownRight={{true}}
as |dropdown|
>
<dropdown.link
@route='scopes.scope.targets.new'
@query={{hash type='tcp'}}
>
{{t 'resources.target.types.tcp'}}
</dropdown.link>
{{#if (feature-flag 'ssh-target')}}
<dropdown.link
@route='scopes.scope.targets.new'
@query={{hash type='ssh'}}
>
{{t 'resources.target.types.ssh'}}
</dropdown.link>
{{/if}}
</Rose::Dropdown>
{{/if}}
{{/if}}
</page.actions>
@@ -37,37 +54,74 @@
</table.header>
<table.body as |body|>
{{#each @model as |target|}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' target)}}
<LinkTo
@route='scopes.scope.targets.target'
@model={{target.id}}
>
{{#if (feature-flag 'ssh-target')}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' target)}}
<LinkTo
@route='scopes.scope.targets.target'
@model={{target.id}}
>
{{target.displayName}}
</LinkTo>
{{else}}
{{target.displayName}}
</LinkTo>
{{else}}
{{target.displayName}}
{{/if}}
<p>{{target.description}}</p>
</row.headerCell>
<row.cell>
{{#if target.type}}
<Rose::Badge>
{{t (concat 'resources.target.types.' target.type)}}
</Rose::Badge>
{{/if}}
</row.cell>
<row.cell>
<Copyable
@text={{target.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{target.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/if}}
<p>{{target.description}}</p>
</row.headerCell>
<row.cell>
{{#if target.type}}
<Rose::Badge>
{{t (concat 'resources.target.types.' target.type)}}
</Rose::Badge>
{{/if}}
</row.cell>
<row.cell>
<Copyable
@text={{target.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{target.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{else}}
{{#if target.isTCP}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' target)}}
<LinkTo
@route='scopes.scope.targets.target'
@model={{target.id}}
>
{{target.displayName}}
</LinkTo>
{{else}}
{{target.displayName}}
{{/if}}
<p>{{target.description}}</p>
</row.headerCell>
<row.cell>
{{#if target.type}}
<Rose::Badge>
{{t (concat 'resources.target.types.' target.type)}}
</Rose::Badge>
{{/if}}
</row.cell>
<row.cell>
<Copyable
@text={{target.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{target.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/if}}
{{/if}}
{{/each}}
</table.body>
</Rose::Table>