Files
threshold-ui/ui/desktop/app/templates/scopes/scope/projects/targets.hbs
T
hashicorp-copywrite[bot]andCameron Perera 3d610427d0 [COMPLIANCE] Add Copyright and License Headers (#1617)
* [COMPLIANCE] Add Copyright and License Headers

* chore: 🤖 update Copyright headers to satisfy our lint rules

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
2023-03-01 09:39:41 -06:00

169 lines
6.4 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{page-title (t 'resources.target.title_plural')}}
{{#each @model as |target|}}
{{#each target.sessions as |session|}}
{{#if session.started_desktop_client}}
{{#unless session.acknowledged}}
<DialogDetail
@heading={{concat
(t 'resources.target.messages.connection-details.title')
': '
target.id
}}
@notificationStyle='success'
@notification={{t
'resources.target.messages.connection-success.title'
}}
@dismiss={{route-action 'acknowledge' session}}
@dismissButtonText={{t 'actions.ok'}}
>
<:body>
<h3>
{{t 'resources.target.messages.proxy_url.title'}}
({{t (concat 'resources.target.types.' target.type)}})
</h3>
<p>
<Copyable
@text={{session.proxy}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{session.proxy}}</code>
</Copyable>
</p>
{{#if session.credentials}}
<Rose::Separator />
<h3>{{t 'resources.session.credential.title_plural'}}</h3>
{{#each session.credentials as |credential|}}
<Card
@heading='{{t "resources.session.credential.title"}}
{{if
credential.source.name
(concat " (" credential.source.name ")")
}}'
@icon='flight-icons/svg/key-16'
>
<:header>
<Rose::Dropdown
@text={{t
'resources.session.credential.credential_source.title'
}}
@style='condensed'
@dropdownRight={{true}}
@ignoreClickInside={{true}}
as |dropdown|
>
<dropdown.key-value>
<:key>{{t 'form.id.label'}}</:key>
<:value>
<Copyable
@text={{credential.source.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{credential.source.id}}</code>
</Copyable>
</:value>
</dropdown.key-value>
<dropdown.key-value>
<:key>{{t 'form.type.label'}}</:key>
<:value>{{credential.source.type}}</:value>
</dropdown.key-value>
{{#if credential.source.name}}
<dropdown.key-value>
<:key>{{t 'form.name.label'}}</:key>
<:value>{{credential.source.name}}</:value>
</dropdown.key-value>
{{/if}}
{{#if credential.source.description}}
<dropdown.key-value>
<:key>{{t 'form.description.label'}}</:key>
<:value>{{credential.source.description}}</:value>
</dropdown.key-value>
{{/if}}
</Rose::Dropdown>
</:header>
<:body>
{{#if credential.secrets}}
<Rose::Table @style='condensed' as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell @shrink={{true}}>{{t
'form.key.label'
}}</row.headerCell>
<row.headerCell colspan='2'>{{t
'form.value.label'
}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each credential.secrets as |secret|}}
<body.row as |row|>
<row.headerCell
@shrink={{true}}
>{{secret.key}}</row.headerCell>
<row.cell colspan='2'>
<HiddenSecret @secret={{secret.value}} />
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{/if}}
</:body>
<:footer>
<Reveal
@textWhenOpen={{t
'resources.session.credential.actions.raw-api.hide'
}}
@textWhenClose={{t
'resources.session.credential.actions.raw-api.show'
}}
>
<Rose::CodeEditor
@codeValue={{raw-json credential.rawCredential}}
as |c|
>
<c.fieldEditor
class='rose-autosize'
@options={{hash
mode='application/json'
readOnly=true
lineNumbers=false
cursorBlinkRate=-1
styleActiveLine=false
autoRefresh=true
}}
/>
</Rose::CodeEditor>
</Reveal>
</:footer>
</Card>
{{/each}}
{{/if}}
</:body>
<:footer>
<div>
<Rose::Button
@style='secondary'
{{on 'click' (route-action 'acknowledge' session)}}
>
{{t 'actions.close'}}
</Rose::Button>
</div>
</:footer>
</DialogDetail>
{{/unless}}
{{/if}}
{{/each}}
{{/each}}
{{outlet}}