feat: Show info messages when resources are empty
This commit is contained in:
4 files changed
+177
-132
No files matched your search
@@ -195,6 +195,9 @@ target:
|
||||
messages:
|
||||
welcome:
|
||||
title: Welcome to Targets
|
||||
none:
|
||||
title: No Targets Available
|
||||
description: No Targets to display yet. Contact your Boundary admin if you don't see a Target you expect access to.
|
||||
actions:
|
||||
create: New Target
|
||||
delete: Delete Target
|
||||
|
||||
@@ -7,73 +7,87 @@
|
||||
</page.header>
|
||||
|
||||
<page.body>
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t "form.name.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.id.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.type.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "resources.project.title"}}</row.headerCell>
|
||||
<row.headerCell />
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model as |model|}}
|
||||
<body.row as |row|>
|
||||
<row.headerCell>
|
||||
<Rose::Icon
|
||||
class={{concat "session-status-" (if model.target.isActive 'active' 'canceled')}}
|
||||
@name="app-icons/action-session"
|
||||
@size="medium"
|
||||
title={{if model.target.isActive (t 'states.active')}}
|
||||
/>
|
||||
<LinkTo
|
||||
@route="scopes.scope.projects.targets.target"
|
||||
@model={{model.target.id}}
|
||||
>
|
||||
{{model.target.displayName}}
|
||||
</LinkTo>
|
||||
<p>{{model.target.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{model.target.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{model.target.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
{{#if model.target.type}}
|
||||
<Rose::Badge>
|
||||
{{t (concat "resources.target.types." model.target.type)}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<div>
|
||||
{{#if @model}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t "form.name.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.id.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.type.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "resources.project.title"}}</row.headerCell>
|
||||
<row.headerCell />
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model as |model|}}
|
||||
<body.row as |row|>
|
||||
<row.headerCell>
|
||||
<Rose::Icon
|
||||
class={{concat "session-status-" (if model.target.isActive 'active' 'canceled')}}
|
||||
@name="app-icons/action-session"
|
||||
@size="medium"
|
||||
title={{if model.target.isActive (t 'states.active')}}
|
||||
/>
|
||||
<LinkTo
|
||||
@route="scopes.scope.projects.targets.target"
|
||||
@model={{model.target.id}}
|
||||
>
|
||||
{{model.target.displayName}}
|
||||
</LinkTo>
|
||||
<p>{{model.target.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{model.project.id}}
|
||||
@text={{model.target.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{model.project.id}}</code>
|
||||
<code>{{model.target.id}}</code>
|
||||
</Copyable>
|
||||
</div>
|
||||
<Rose::Badge @style='informational'>
|
||||
{{model.project.name}}
|
||||
</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Button @style="secondary" {{on "click" (route-action "connect" model.target)}}>
|
||||
{{t "resources.session.actions.connect"}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
{{#if model.target.type}}
|
||||
<Rose::Badge>
|
||||
{{t (concat "resources.target.types." model.target.type)}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<div>
|
||||
<Copyable
|
||||
@text={{model.project.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{model.project.id}}</code>
|
||||
</Copyable>
|
||||
</div>
|
||||
<Rose::Badge @style='informational'>
|
||||
{{model.project.name}}
|
||||
</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Button @style="secondary" {{on "click" (route-action "connect" model.target)}}>
|
||||
{{t "resources.session.actions.connect"}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
{{else}}
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t "resources.target.messages.none.title"}} as |message|>
|
||||
<message.description>
|
||||
{{t "resources.target.messages.none.description"}}
|
||||
</message.description>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
{{/if}}
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
@@ -1,32 +1,46 @@
|
||||
{{page-title (t "resources.host-set.title_plural")}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.body as |body|>
|
||||
{{#each @model.hosts as |host|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
{{host.displayName}}
|
||||
<p>{{host.description}}</p>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{host.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{host.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>{{host.attributes.address}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t (concat 'resources.host.types.' host.type)}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Button @style="secondary" {{on "click" (route-action "connect" @model.target host)}}>
|
||||
{{t "resources.session.actions.connect"}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
{{#if @model.hosts}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.body as |body|>
|
||||
{{#each @model.hosts as |host|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
{{host.displayName}}
|
||||
<p>{{host.description}}</p>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{host.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{host.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>{{host.attributes.address}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t (concat 'resources.host.types.' host.type)}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Button @style="secondary" {{on "click" (route-action "connect" @model.target host)}}>
|
||||
{{t "resources.session.actions.connect"}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
{{else}}
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t "resources.host.messages.none.title"}} as |message|>
|
||||
<message.description>
|
||||
{{t "resources.host.messages.none.description"}}
|
||||
</message.description>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
{{/if}}
|
||||
@@ -1,40 +1,54 @@
|
||||
<Rose::Table as |table|>
|
||||
<table.body as |body|>
|
||||
{{!--
|
||||
TODO: sort these via the controller so that active and pending appear first
|
||||
similar to the way the sessions routes are sorted.
|
||||
--}}
|
||||
{{#each @model.target.sessions as |session|}}
|
||||
<body.row as |row|>
|
||||
<row.cell class="nowrap">
|
||||
<Rose::Icon
|
||||
class={{concat "session-status-" session.status}}
|
||||
@name="app-icons/action-session"
|
||||
@size="medium" />
|
||||
<Copyable
|
||||
@text={{session.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{session.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<time datetime={{format-date-iso session.created_time}}>
|
||||
{{format-date-iso-human session.created_time}}
|
||||
</time>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{session.status}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
{{#if session.isCancelable}}
|
||||
<Rose::Button @style="secondary" {{on "click" (route-action "cancelSession" session)}}>
|
||||
{{t "actions.cancel"}}
|
||||
</Rose::Button>
|
||||
{{/if}}
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
{{#if @model.target.sessions}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.body as |body|>
|
||||
{{!--
|
||||
TODO: sort these via the controller so that active and pending appear first
|
||||
similar to the way the sessions routes are sorted.
|
||||
--}}
|
||||
{{#each @model.target.sessions as |session|}}
|
||||
<body.row as |row|>
|
||||
<row.cell class="nowrap">
|
||||
<Rose::Icon
|
||||
class={{concat "session-status-" session.status}}
|
||||
@name="app-icons/action-session"
|
||||
@size="medium" />
|
||||
<Copyable
|
||||
@text={{session.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{session.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<time datetime={{format-date-iso session.created_time}}>
|
||||
{{format-date-iso-human session.created_time}}
|
||||
</time>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{session.status}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
{{#if session.isCancelable}}
|
||||
<Rose::Button @style="secondary" {{on "click" (route-action "cancelSession" session)}}>
|
||||
{{t "actions.cancel"}}
|
||||
</Rose::Button>
|
||||
{{/if}}
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
{{else}}
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t "resources.session.messages.none.title"}} as |message|>
|
||||
<message.description>
|
||||
{{t "resources.session.messages.none.description"}}
|
||||
</message.description>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
{{/if}}
|
||||
Reference in new issue
Block a user