Skip to content

Commit

Permalink
Merge branch 'main' into moduli-e2e-organize-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
moduli authored Dec 19, 2023
2 parents a35fdaf + ade1601 commit 487aa2c
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 114 deletions.
3 changes: 2 additions & 1 deletion ui/admin/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,8 @@
}

.auth-methods-list-table,
.workers-list-table {
.workers-list-table,
.sessions-list-table {
margin-top: 1rem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,52 +22,49 @@

<page.body>
{{#if @model.hosts}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
<row.headerCell>{{t 'form.address.label'}}</row.headerCell>
</header.row>
</table.header>

<table.body as |body|>
{{#each @model.hosts as |host|}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' host)}}
<LinkTo
@route='scopes.scope.host-catalogs.host-catalog.hosts.host'
@model={{host.id}}
>
{{host.displayName}}
</LinkTo>
{{else}}
{{host.displayName}}
{{/if}}
<p>{{host.description}}</p>
</row.headerCell>
<row.cell>
<HostCatalogTypeBadge @model={{host}} />
</row.cell>
<row.cell>
<Copyable
@text={{host.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
<Hds::Table
@model={{@model.hosts}}
@columns={{array
(hash label=(t 'form.name.label'))
(hash label=(t 'form.type.label'))
(hash label=(t 'form.id.label'))
(hash label=(t 'form.address.label'))
}}
>
<:body as |B|>
<B.Tr>
<B.Td>
{{#if (can 'read model' B.data)}}
<LinkTo
@route='scopes.scope.host-catalogs.host-catalog.hosts.host'
@model={{B.data.id}}
>
<code>{{host.id}}</code>
</Copyable>
</row.cell>

<row.cell>
<code>{{host.address}}</code>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{B.data.displayName}}
</LinkTo>
{{else}}
{{B.data.displayName}}
{{/if}}
<Hds::Text::Body @tag='p'>{{B.data.description}}</Hds::Text::Body>
</B.Td>
<B.Td>
<HostCatalogTypeBadge @model={{B.data}} />
</B.Td>
<B.Td>
<Copyable
@text={{B.data.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<Hds::Text::Code>{{B.data.id}}</Hds::Text::Code>
</Copyable>
</B.Td>
<B.Td>
<Hds::Text::Code>{{B.data.address}}</Hds::Text::Code>
</B.Td>
</B.Tr>
</:body>
</Hds::Table>

{{else}}
<Rose::Layout::Centered>
Expand Down
125 changes: 56 additions & 69 deletions ui/admin/app/templates/scopes/scope/sessions/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -68,76 +68,63 @@
</Rose::Toolbar>

{{#if @model}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
<row.headerCell>{{t 'resources.user.title'}}</row.headerCell>
<row.headerCell>{{t 'resources.target.title'}}</row.headerCell>
<row.headerCell>{{t 'form.started.label'}}</row.headerCell>
<row.headerCell>{{t 'form.status.label'}}</row.headerCell>
<row.headerCell>{{t 'titles.actions'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each @model as |sessionAggregate|}}
<body.row as |row|>
<row.headerCell class='nowrap'>
<Rose::Icon
class={{concat
'session-status-'
sessionAggregate.session.status
}}
@name='flight-icons/svg/entry-point-16'
@size='medium'

<Hds::Table
@model={{@model}}
class='sessions-list-table'
@columns={{array
(hash label=(t 'form.id.label'))
(hash label=(t 'resources.user.title'))
(hash label=(t 'resources.target.title'))
(hash label=(t 'form.started.label'))
(hash label=(t 'form.status.label'))
(hash label=(t 'titles.actions'))
}}
>
<:body as |B|>
<B.Tr>
<B.Td>
<Rose::Icon
class={{concat 'session-status-' B.data.session.status}}
@name='flight-icons/svg/entry-point-16'
@size='medium'
/>
<Copyable
@text={{B.data.session.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<Hds::Text::Code>{{B.data.session.id}}</Hds::Text::Code>
</Copyable>
</B.Td>
<B.Td>
<Hds::Text::Code>{{B.data.user.id}}</Hds::Text::Code>
{{#if B.data.user.accountName}}
<br />
<Hds::Badge @text={{B.data.user.accountName}} />
{{/if}}
</B.Td>
<B.Td>{{B.data.target.displayName}}</B.Td>
<B.Td>
<time datetime={{format-date-iso B.data.session.created_time}}>
{{format-date-iso-human B.data.session.created_time}}
</time>
</B.Td>
<B.Td>
<SessionStatus @model={{B.data.session}} />
</B.Td>
<B.Td>
{{#if (can 'cancel session' B.data.session)}}
<Hds::Button
@color='secondary'
@text={{t 'actions.cancel'}}
{{on 'click' (route-action 'cancelSession' B.data.session)}}
/>
<Copyable
@text={{sessionAggregate.session.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{sessionAggregate.session.id}}</code>
</Copyable>
</row.headerCell>
<row.cell>
<code>{{sessionAggregate.user.id}}</code>
{{#if sessionAggregate.user.accountName}}
<br />
<Hds::Badge @text={{sessionAggregate.user.accountName}} />
{{/if}}
</row.cell>
<row.cell>{{sessionAggregate.target.displayName}}</row.cell>
<row.cell>
<time
datetime={{format-date-iso
sessionAggregate.session.created_time
}}
>
{{format-date-iso-human
sessionAggregate.session.created_time
}}
</time>
</row.cell>
<row.cell>
<SessionStatus @model={{sessionAggregate.session}} />
</row.cell>
<row.cell>
{{#if sessionAggregate.session.isAvailable}}
<Rose::Button
@style='secondary'
{{on
'click'
(route-action 'cancelSession' sessionAggregate.session)
}}
>
{{t 'actions.cancel'}}
</Rose::Button>
{{/if}}
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{/if}}
</B.Td>
</B.Tr>
</:body>
</Hds::Table>

{{else if
(has-resource-filter-selections 'scopes.scope.sessions' 'status')
Expand Down

0 comments on commit 487aa2c

Please sign in to comment.