ui: Move to angle brackets for ember components (#7321)

* Modify templates with codemods angle brackets

* ui: Fix up problem with intention filter action attribute

Co-authored-by: Kenia <19161242+kaxcode@users.noreply.github.com>
This commit is contained in:
John Cowen 2020-02-19 19:26:38 +00:00 committed by John Cowen
parent 4be566e545
commit aea3d00a9d
80 changed files with 867 additions and 1038 deletions

View File

@ -13,7 +13,7 @@ const createCounter = function(prop) {
const countAction = createCounter('Action'); const countAction = createCounter('Action');
export default Controller.extend(WithSearching, WithFiltering, WithEventSource, { export default Controller.extend(WithSearching, WithFiltering, WithEventSource, {
queryParams: { queryParams: {
action: { currentFilter: {
as: 'action', as: 'action',
}, },
s: { s: {
@ -44,7 +44,7 @@ export default Controller.extend(WithSearching, WithFiltering, WithEventSource,
}; };
}); });
}), }),
filter: function(item, { s = '', action = '' }) { filter: function(item, { s = '', currentFilter = '' }) {
return action === '' || get(item, 'Action') === action; return currentFilter === '' || get(item, 'Action') === currentFilter;
}, },
}); });

View File

@ -7,6 +7,9 @@ import WithIntentionActions from 'consul-ui/mixins/intention/with-actions';
export default Route.extend(WithIntentionActions, { export default Route.extend(WithIntentionActions, {
repo: service('repository/intention'), repo: service('repository/intention'),
queryParams: { queryParams: {
currentFilter: {
as: 'action',
},
s: { s: {
as: 'filter', as: 'filter',
replace: true, replace: true,

View File

@ -1,13 +1,13 @@
{{head-layout}} <HeadLayout />
{{title 'Consul' separator=' - '}} {{title 'Consul' separator=' - '}}
{{#if (not loading)}} {{#if (not loading)}}
{{outlet}} {{outlet}}
{{else}} {{else}}
{{#hashicorp-consul id="wrapper" permissions=permissions dcs=dcs dc=dc nspaces=nspaces nspace=nspace}} <HashicorpConsul @id="wrapper" @permissions={{permissions}} @dcs={{dcs}} @dc={{dc}} @nspaces={{nspaces}} @nspace={{nspace}}>
{{#app-view class="loading show"}} <AppView @class="loading show">
{{#block-slot name='content'}} <BlockSlot @name="content">
{{partial 'consul-loading'}} {{partial 'consul-loading'}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>
{{/hashicorp-consul}} </HashicorpConsul>
{{/if}} {{/if}}

View File

@ -1,4 +1,4 @@
{{!<form>}} {{!<form>}}
{{freetext-filter searchable=searchable value=search placeholder="Search by name/token"}} <FreetextFilter @searchable={{searchable}} @value={{search}} @placeholder="Search by name/token" />
{{radio-group keyboardAccess=true name="type" value=type items=filters onchange=(action onchange)}} <RadioGroup @keyboardAccess={{true}} @name="type" @value={{type}} @items={{filters}} @onchange={{action onchange}} />
{{!</form>}} {{!</form>}}

View File

@ -2,38 +2,38 @@
{{#if (not loading)}} {{#if (not loading)}}
<header> <header>
{{#each flashMessages.queue as |flash|}} {{#each flashMessages.queue as |flash|}}
{{#flash-message flash=flash as |component flash|}} <FlashMessage @flash={{flash}} as |component flash|>
{{! flashes automatically ucfirst the type }} {{! flashes automatically ucfirst the type }}
<p data-notification class="{{lowercase component.flashType}} notification-{{lowercase flash.action}}"> <p data-notification class="{{lowercase component.flashType}} notification-{{lowercase flash.action}}">
<strong> <strong>
{{component.flashType}}! {{component.flashType}}!
</strong> </strong>
{{#yield-slot name='notification' params=(block-params (lowercase component.flashType) (lowercase flash.action) flash.item )}}{{yield}}{{/yield-slot}} <YieldSlot @name="notification" @params={{block-params (lowercase component.flashType) (lowercase flash.action) flash.item}}>{{yield}}</YieldSlot>
</p> </p>
{{/flash-message}} </FlashMessage>
{{/each}} {{/each}}
<div> <div>
<div class="actions"> <div class="actions">
{{#if authorized}} {{#if authorized}}
{{#yield-slot name='actions'}}{{yield}}{{/yield-slot}} <YieldSlot @name="actions">{{yield}}</YieldSlot>
{{/if}} {{/if}}
</div> </div>
<div> <div>
{{#if authorized}} {{#if authorized}}
<nav aria-label="Breadcrumb"> <nav aria-label="Breadcrumb">
{{#yield-slot name='breadcrumbs'}}{{yield}}{{/yield-slot}} <YieldSlot @name="breadcrumbs">{{yield}}</YieldSlot>
</nav> </nav>
{{/if}} {{/if}}
{{#yield-slot name='header'}}{{yield}}{{/yield-slot}} <YieldSlot @name="header">{{yield}}</YieldSlot>
</div> </div>
</div> </div>
{{#if authorized}} {{#if authorized}}
{{#yield-slot name='toolbar'}} <YieldSlot @name="toolbar">
<input type="checkbox" id="toolbar-toggle" /> <input type="checkbox" id="toolbar-toggle" />
{{yield}} {{yield}}
{{/yield-slot}} </YieldSlot>
{{/if}} {{/if}}
</header> </header>
{{/if}} {{/if}}
@ -42,11 +42,11 @@
{{partial 'consul-loading'}} {{partial 'consul-loading'}}
{{else}} {{else}}
{{#if (not enabled) }} {{#if (not enabled) }}
{{#yield-slot name='disabled'}}{{yield}}{{/yield-slot}} <YieldSlot @name="disabled">{{yield}}</YieldSlot>
{{else if (not authorized)}} {{else if (not authorized)}}
{{#yield-slot name='authorization'}}{{yield}}{{/yield-slot}} <YieldSlot @name="authorization">{{yield}}</YieldSlot>
{{else}} {{else}}
{{#yield-slot name='content'}}{{yield}}{{/yield-slot}} <YieldSlot @name="content">{{yield}}</YieldSlot>
{{/if}} {{/if}}
{{/if}} {{/if}}
</div> </div>

View File

@ -1,9 +1,4 @@
{{!<form>}} {{!<form>}}
{{freetext-filter searchable=searchable value=search placeholder="Search"}} <FreetextFilter @searchable={{searchable}} @value={{search}} @placeholder="Search" />
{{radio-group keyboardAccess=true name="status" value=status items=(array <RadioGroup @keyboardAccess={{true}} @name="status" @value={{status}} @items={{array (hash label="All (Any Status)" value="") (hash label="Critical Checks" value="critical") (hash label="Warning Checks" value="warning") (hash label="Passing Checks" value="passing")}} @onchange={{action onchange}} />
(hash label='All (Any Status)' value='' )
(hash label='Critical Checks' value='critical')
(hash label='Warning Checks' value='warning')
(hash label='Passing Checks' value='passing')
) onchange=(action onchange)}}
{{!</form>}} {{!</form>}}

View File

@ -1,6 +1,6 @@
{{yield}} {{yield}}
{{#if (gt items.length 0)}} {{#if (gt items.length 0)}}
{{#yield-slot name='set' params=(block-params items)}}{{yield}}{{/yield-slot}} <YieldSlot @name="set" @params={{block-params items}}>{{yield}}</YieldSlot>
{{else}} {{else}}
{{#yield-slot name='empty'}}{{yield}}{{/yield-slot}} <YieldSlot @name="empty">{{yield}}</YieldSlot>
{{/if}} {{/if}}

View File

@ -1,21 +1,13 @@
{{yield}} {{yield}}
{{#yield-slot name='create'}}{{yield}}{{/yield-slot}} <YieldSlot @name="create">{{yield}}</YieldSlot>
<label class="type-text"> <label class="type-text">
<span>{{#yield-slot name='label'}}{{yield}}{{/yield-slot}}</span> <span><YieldSlot @name="label">{{yield}}</YieldSlot></span>
{{#power-select <PowerSelect @onopen={{action "open"}} @search={{action "search"}} @options={{options}} @loadingMessage="Loading..." @searchMessage="No possible options" @searchPlaceholder={{placeholder}} @onchange={{action "change" "items[]" items}} as |item|>
onopen=(action 'open') <YieldSlot @name="option" @params={{block-params item}}>{{yield}}</YieldSlot>
search=(action 'search') </PowerSelect>
options=options
loadingMessage="Loading..."
searchMessage="No possible options"
searchPlaceholder=placeholder
onchange=(action 'change' 'items[]' items) as |item|
}}
{{#yield-slot name='option' params=(block-params item)}}{{yield}}{{/yield-slot}}
{{/power-select}}
</label> </label>
{{#if (gt items.length 0)}} {{#if (gt items.length 0)}}
{{#yield-slot name='set'}}{{yield}}{{/yield-slot}} <YieldSlot @name="set">{{yield}}</YieldSlot>
{{else}} {{else}}
{{/if}} {{/if}}

View File

@ -1,18 +1,7 @@
{{ivy-codemirror <IvyCodemirror @value={{value}} @name={{name}} @class={{class}} @options={{options}} @valueUpdated={{action onkeyup}} />
value=value
name=name
class=class
options=options
valueUpdated=(action onkeyup)
}}
<pre><code>{{yield}}</code></pre> <pre><code>{{yield}}</code></pre>
{{#if (and (not readonly) (not syntax))}} {{#if (and (not readonly) (not syntax))}}
{{#power-select <PowerSelect @onchange={{action "change"}} @selected={{mode}} @searchEnabled={{false}} @options={{modes}} as |mode|>
onchange=(action 'change')
selected=mode
searchEnabled=false
options=modes as |mode|
}}
{{mode.name}} {{mode.name}}
{{/power-select}} </PowerSelect>
{{/if}} {{/if}}

View File

@ -1,11 +1,11 @@
{{yield}} {{yield}}
{{#yield-slot name='action' params=(block-params confirm cancel)}} <YieldSlot @name="action" @params={{block-params confirm cancel}}>
{{#if (or permanent (not confirming))}} {{#if (or permanent (not confirming))}}
{{yield}} {{yield}}
{{/if}} {{/if}}
{{/yield-slot}} </YieldSlot>
{{#yield-slot name='dialog' params=(block-params execute cancel message actionName)}} <YieldSlot @name="dialog" @params={{block-params execute cancel message actionName}}>
{{#if confirming }} {{#if confirming }}
{{yield}} {{yield}}
{{/if}} {{/if}}
{{/yield-slot}} </YieldSlot>

View File

@ -1,6 +1,6 @@
{{#if (gt items.length 0)}} {{#if (gt items.length 0)}}
{{#tabular-collection items=items as |item index|}} <TabularCollection @items={{items}} as |item index|>
{{#block-slot name='header'}} <BlockSlot @name="header">
<th style={{remainingWidth}}>Service</th> <th style={{remainingWidth}}>Service</th>
<th style={{totalWidth}}> <th style={{totalWidth}}>
Health Checks Health Checks
@ -9,8 +9,8 @@
</span> </span>
</th> </th>
<th style={{remainingWidth}}>Tags</th> <th style={{remainingWidth}}>Tags</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-service={{item.Name}} style={{remainingWidth}}> <td data-test-service={{item.Name}} style={{remainingWidth}}>
<a href={{href-to routeName item.Name}}> <a href={{href-to routeName item.Name}}>
{{#let (service/external-source item) as |externalSource| }} {{#let (service/external-source item) as |externalSource| }}
@ -24,14 +24,11 @@
</a> </a>
</td> </td>
<td style={{totalWidth}}> <td style={{totalWidth}}>
{{healthcheck-info <HealthcheckInfo @passing={{item.ChecksPassing}} @warning={{item.ChecksWarning}} @critical={{item.ChecksCritical}} @passingWidth={{passingWidth}} @warningWidth={{warningWidth}} @criticalWidth={{criticalWidth}} />
passing=item.ChecksPassing warning=item.ChecksWarning critical=item.ChecksCritical
passingWidth=passingWidth warningWidth=warningWidth criticalWidth=criticalWidth
}}
</td> </td>
<td style={{remainingWidth}}> <td style={{remainingWidth}}>
{{tag-list items=item.Tags}} <TagList @items={{item.Tags}} />
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/if}} {{/if}}

View File

@ -1,15 +1,15 @@
{{#feedback-dialog type='inline'}} <FeedbackDialog @type="inline">
{{#block-slot name='action' as |success error|}} <BlockSlot @name="action" as |success error|>
{{#copy-button success=(action success) error=(action error) clipboardText=copy title=(concat 'Copy ' name ' to the clipboard')}}{{#if hasBlock }}{{yield}}{{else}}{{value}}{{/if}}{{/copy-button}} <CopyButton @success={{action success}} @error={{action error}} @clipboardText={{copy}} @title={{concat "Copy " name " to the clipboard"}}>{{#if hasBlock }}{{yield}}{{else}}{{value}}{{/if}}</CopyButton>
{{/block-slot}} </BlockSlot>
{{#block-slot name='success' as |transition|}} <BlockSlot @name="success" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Copied {{name}}! Copied {{name}}!
</p> </p>
{{/block-slot}} </BlockSlot>
{{#block-slot name='error' as |transition|}} <BlockSlot @name="error" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Sorry, something went wrong! Sorry, something went wrong!
</p> </p>
{{/block-slot}} </BlockSlot>
{{/feedback-dialog}} </FeedbackDialog>

View File

@ -28,7 +28,7 @@
</header> </header>
<div role="group"> <div role="group">
{{#each routes as |item|}} {{#each routes as |item|}}
{{route-card item=item onclick=(action 'click')}} <RouteCard @item={{item}} @onclick={{action "click"}} />
{{/each}} {{/each}}
</div> </div>
</div> </div>
@ -43,7 +43,7 @@
</header> </header>
<div role="group"> <div role="group">
{{#each (sort-by 'Name' splitters) as |item|}} {{#each (sort-by 'Name' splitters) as |item|}}
{{splitter-card item=item onclick=(action 'click')}} <SplitterCard @item={{item}} @onclick={{action "click"}} />
{{/each}} {{/each}}
</div> </div>
</div> </div>
@ -58,7 +58,7 @@
</header> </header>
<div role="group"> <div role="group">
{{#each (sort-by 'Name' resolvers) as |item|}} {{#each (sort-by 'Name' resolvers) as |item|}}
{{resolver-card item=item onclick=(action 'click')}} <ResolverCard @item={{item}} @onclick={{action "click"}} />
{{/each}} {{/each}}
</div> </div>
</div> </div>

View File

@ -1,9 +1,9 @@
{{yield}} {{yield}}
{{#if (eq state 'success') }} {{#if (eq state 'success') }}
{{#yield-slot name='success' params=(block-params transition)}}{{yield}}{{/yield-slot}} <YieldSlot @name="success" @params={{block-params transition}}>{{yield}}</YieldSlot>
{{else if (eq state 'error') }} {{else if (eq state 'error') }}
{{#yield-slot name='error' params=(block-params transition)}}{{yield}}{{/yield-slot}} <YieldSlot @name="error" @params={{block-params transition}}>{{yield}}</YieldSlot>
{{/if}} {{/if}}
{{#if (or permanent (eq state 'ready')) }} {{#if (or permanent (eq state 'ready')) }}
{{#yield-slot name='action' params=(block-params success error)}}{{yield}}{{message}}{{/yield-slot}} <YieldSlot @name="action" @params={{block-params success error}}>{{yield}}{{message}}</YieldSlot>
{{/if}} {{/if}}

View File

@ -16,18 +16,18 @@
{{#if (and (eq nspaces.length 1) (not canManageNspaces)) }} {{#if (and (eq nspaces.length 1) (not canManageNspaces)) }}
<span data-test-nspace-selected={{nspace.Name}}>{{nspace.Name}}</span> <span data-test-nspace-selected={{nspace.Name}}>{{nspace.Name}}</span>
{{ else }} {{ else }}
{{#popover-menu position='left'}} <PopoverMenu @position="left">
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
{{nspace.Name}} {{nspace.Name}}
{{/block-slot}} </BlockSlot>
{{#if (is-href 'dc.nspaces')}} {{#if (is-href 'dc.nspaces')}}
{{#block-slot name='header'}} <BlockSlot @name="header">
<p> <p>
Namespaces themselves are not namespaced, so switching will not change the current view. Namespaces themselves are not namespaced, so switching will not change the current view.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/if}} {{/if}}
{{#block-slot name='menu'}} <BlockSlot @name="menu">
<li role="separator"> <li role="separator">
Namespaces Namespaces
</li> </li>
@ -42,8 +42,8 @@
<a tabindex="-1" role="menuitem" href={{href-to 'dc.nspaces' dc.Name}}>Manage namespaces</a> <a tabindex="-1" role="menuitem" href={{href-to 'dc.nspaces' dc.Name}}>Manage namespaces</a>
</li> </li>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/if}} {{/if}}
</li> </li>
{{/if}} {{/if}}
@ -51,11 +51,11 @@
{{#if (or (not dcs) (eq dcs.length 1)) }} {{#if (or (not dcs) (eq dcs.length 1)) }}
<span data-test-datacenter-selected={{dc.Name}}>{{dc.Name}}</span> <span data-test-datacenter-selected={{dc.Name}}>{{dc.Name}}</span>
{{ else }} {{ else }}
{{#popover-menu position='left'}} <PopoverMenu @position="left">
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
{{dc.Name}} {{dc.Name}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu'}} <BlockSlot @name="menu">
<li role="separator"> <li role="separator">
Datacenters Datacenters
</li> </li>
@ -64,8 +64,8 @@
<a tabindex="-1" role="menuitem" href={{href-mut (hash dc=item.Name)}}>{{item.Name}}</a> <a tabindex="-1" role="menuitem" href={{href-mut (hash dc=item.Name)}}>{{item.Name}}</a>
</li> </li>
{{/each}} {{/each}}
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/if}} {{/if}}
</li> </li>
@ -90,11 +90,11 @@
<nav> <nav>
<ul> <ul>
<li data-test-main-nav-docs> <li data-test-main-nav-docs>
{{#popover-menu position='right'}} <PopoverMenu @position="right">
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
Help Help
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu'}} <BlockSlot @name="menu">
<li role="none" class="docs-link"> <li role="none" class="docs-link">
<a tabindex="-1" role="menuitem" href={{env 'CONSUL_DOCS_URL'}} rel="noopener noreferrer" target="_blank">Documentation</a> <a tabindex="-1" role="menuitem" href={{env 'CONSUL_DOCS_URL'}} rel="noopener noreferrer" target="_blank">Documentation</a>
</li> </li>
@ -105,8 +105,8 @@
<li role="none" class="feedback-link"> <li role="none" class="feedback-link">
<a tabindex="-1" role="menuitem" href={{env 'CONSUL_REPO_ISSUES_URL'}} target="_blank" rel="noopener noreferrer">Provide Feedback</a> <a tabindex="-1" role="menuitem" href={{env 'CONSUL_REPO_ISSUES_URL'}} target="_blank" rel="noopener noreferrer">Provide Feedback</a>
</li> </li>
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
</li> </li>
<li data-test-main-nav-settings class={{if (is-href 'settings') 'is-active'}}> <li data-test-main-nav-settings class={{if (is-href 'settings') 'is-active'}}>
<a href={{href-to 'settings'}}>Settings</a> <a href={{href-to 'settings'}}>Settings</a>
@ -124,4 +124,4 @@
<a data-test-footer-docs href="{{env 'CONSUL_DOCS_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a> <a data-test-footer-docs href="{{env 'CONSUL_DOCS_URL'}}" rel="help noopener noreferrer" target="_blank">Documentation</a>
{{{concat '<!-- ' (env 'CONSUL_GIT_SHA') '-->'}}} {{{concat '<!-- ' (env 'CONSUL_GIT_SHA') '-->'}}}
</footer> </footer>
{{modal-layer}} <ModalLayer />

View File

@ -2,8 +2,8 @@
<span title="No Healthchecks" class="zero">0</span> <span title="No Healthchecks" class="zero">0</span>
{{else}} {{else}}
<dl class="healthcheck-info"> <dl class="healthcheck-info">
{{healthcheck-status width=passingWidth name='passing' value=passing}} <HealthcheckStatus @width={{passingWidth}} @name="passing" @value={{passing}} />
{{healthcheck-status width=warningWidth name='warning' value=warning}} <HealthcheckStatus @width={{warningWidth}} @name="warning" @value={{warning}} />
{{healthcheck-status width=criticalWidth name='critical' value=critical}} <HealthcheckStatus @width={{criticalWidth}} @name="critical" @value={{critical}} />
</dl> </dl>
{{/if}} {{/if}}

View File

@ -1,15 +1,11 @@
<ul data-test-healthchecks> <ul data-test-healthchecks>
{{#each (sort-by (action 'sortChecksByImportance') items) as |item| }} {{#each (sort-by (action 'sortChecksByImportance') items) as |item| }}
{{! TODO: this component and its child should be moved to a single component }} {{! TODO: this component and its child should be moved to a single component }}
{{#healthcheck-output <HealthcheckOutput @data-test-node-healthcheck={{item.Name}} @class={{item.Status}} @tagName="li">
data-test-node-healthcheck=item.Name <BlockSlot @name="header">
class=item.Status
tagName='li'
}}
{{#block-slot name='header'}}
<h3>{{item.Name}}</h3> <h3>{{item.Name}}</h3>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
<dl> <dl>
<dt>ServiceName</dt> <dt>ServiceName</dt>
<dd>{{or item.ServiceName '-'}}</dd> <dd>{{or item.ServiceName '-'}}</dd>
@ -36,25 +32,25 @@
<dt>Output</dt> <dt>Output</dt>
<dd> <dd>
<pre><code>{{item.Output}}</code></pre> <pre><code>{{item.Output}}</code></pre>
{{#feedback-dialog type='inline'}} <FeedbackDialog @type="inline">
{{#block-slot name='action' as |success error|}} <BlockSlot @name="action" as |success error|>
{{copy-button success=(action success) error=(action error) clipboardText=item.Output title='copy output to clipboard'}} <CopyButton @success={{action success}} @error={{action error}} @clipboardText={{item.Output}} @title="copy output to clipboard" />
{{/block-slot}} </BlockSlot>
{{#block-slot name='success' as |transition|}} <BlockSlot @name="success" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Copied output! Copied output!
</p> </p>
{{/block-slot}} </BlockSlot>
{{#block-slot name='error' as |transition|}} <BlockSlot @name="error" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Sorry, something went wrong! Sorry, something went wrong!
</p> </p>
{{/block-slot}} </BlockSlot>
{{/feedback-dialog}} </FeedbackDialog>
</dd> </dd>
{{/if}} {{/if}}
</dl> </dl>
{{/block-slot}} </BlockSlot>
{{/healthcheck-output}} </HealthcheckOutput>
{{/each}} {{/each}}
</ul> </ul>

View File

@ -2,7 +2,7 @@
{{yield}} {{yield}}
<div> <div>
<header> <header>
{{#yield-slot name='header'}}{{yield}}{{/yield-slot}} <YieldSlot @name="header">{{yield}}</YieldSlot>
</header> </header>
{{#yield-slot name='content'}}{{yield}}{{/yield-slot}} <YieldSlot @name="content">{{yield}}</YieldSlot>
</div> </div>

View File

@ -1,19 +1,19 @@
{{#stats-card}} <StatsCard>
{{#block-slot name='icon'}}{{yield}}{{/block-slot}} <BlockSlot @name="icon">{{yield}}</BlockSlot>
{{#block-slot name='mini-stat'}} <BlockSlot @name="mini-stat">
{{#if (eq checks.length 0)}} {{#if (eq checks.length 0)}}
<span class="zero" data-tooltip="This node has no registered healthchecks">{{checks.length}}</span> <span class="zero" data-tooltip="This node has no registered healthchecks">{{checks.length}}</span>
{{else if (eq checks.length healthy.length)}} {{else if (eq checks.length healthy.length)}}
<span class="non-zero" data-tooltip={{concat 'All ' healthy.length ' ' (pluralize healthy.length 'check' without-count=true) ' passing'}}>{{healthy.length}}</span> <span class="non-zero" data-tooltip={{concat 'All ' healthy.length ' ' (pluralize healthy.length 'check' without-count=true) ' passing'}}>{{healthy.length}}</span>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<a href={{href}}> <a href={{href}}>
<strong>{{name}}</strong> <strong>{{name}}</strong>
<span>{{address}}</span> <span>{{address}}</span>
</a> </a>
{{/block-slot}} </BlockSlot>
{{#block-slot name='body'}} <BlockSlot @name="body">
{{#if (not-eq checks.length healthy.length)}} {{#if (not-eq checks.length healthy.length)}}
<ul> <ul>
{{#each unhealthy as |item|}} {{#each unhealthy as |item|}}
@ -34,5 +34,5 @@
{{/if}} {{/if}}
</ul> </ul>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/stats-card}} </StatsCard>

View File

@ -1,4 +1,4 @@
{{!<form>}} {{!<form>}}
{{freetext-filter searchable=searchable value=search placeholder="Search by Source or Destination"}} <FreetextFilter @searchable={{searchable}} @value={{search}} @placeholder="Search by Source or Destination" />
{{radio-group keyboardAccess=true name="action" value=action items=filters onchange=(action onchange)}} <RadioGroup @keyboardAccess={{true}} @name="currentFilter" @value={{selected}} @items={{filters}} @onchange={{action onchange}} />
{{!</form>}} {{!</form>}}

View File

@ -1,6 +1,6 @@
{{#ember-native-scrollable tagName='ul' content-size=_contentSize scroll-left=_scrollLeft scroll-top=_scrollTop scrollChange=(action "scrollChange") clientSizeChange=(action "clientSizeChange")}} <EmberNativeScrollable @tagName="ul" @content-size={{_contentSize}} @scroll-left={{_scrollLeft}} @scroll-top={{_scrollTop}} @scrollChange={{action "scrollChange"}} @clientSizeChange={{action "clientSizeChange"}}>
<li></li> <li></li>
{{~#each _cells as |cell|~}} {{~#each _cells as |cell|~}}
<li style={{{cell.style}}}>{{yield cell.item cell.index }}</li> <li style={{{cell.style}}}>{{yield cell.item cell.index }}</li>
{{~/each~}} {{~/each~}}
{{/ember-native-scrollable}} </EmberNativeScrollable>

View File

@ -6,13 +6,13 @@
<div> <div>
<header> <header>
<label for="modal_close">Close</label> <label for="modal_close">Close</label>
{{#yield-slot name='header'}}{{yield}}{{/yield-slot}} <YieldSlot @name="header">{{yield}}</YieldSlot>
</header> </header>
<div> <div>
{{#yield-slot name='body'}}{{yield}}{{/yield-slot}} <YieldSlot @name="body">{{yield}}</YieldSlot>
</div> </div>
<footer> <footer>
{{#yield-slot name='actions' params=(block-params (action 'close'))}}{{yield}}{{/yield-slot}} <YieldSlot @name="actions" @params={{block-params (action "close")}}>{{yield}}</YieldSlot>
</footer> </footer>
</div> </div>
</div> </div>

View File

@ -35,14 +35,14 @@
<label class="type-text" data-test-rules> <label class="type-text" data-test-rules>
<span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> <span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span>
{{#if (eq item.template '') }} {{#if (eq item.template '') }}
{{code-editor syntax='hcl' class=(if item.error.Rules 'error') name=(concat name '[Rules]') value=item.Rules onkeyup=(action 'change' (concat name '[Rules]'))}} <CodeEditor @syntax="hcl" @class={{if item.error.Rules "error"}} @name={{concat name "[Rules]"}} @value={{item.Rules}} @onkeyup={{action "change" (concat name "[Rules]")}} />
{{#if item.error.Rules}} {{#if item.error.Rules}}
<strong>{{item.error.Rules.validation}}</strong> <strong>{{item.error.Rules.validation}}</strong>
{{/if}} {{/if}}
{{else}} {{else}}
{{#code-editor readonly=true name=(concat name '[Rules]') syntax='hcl' oninput=(action 'change' (concat name '[Rules]'))}} <CodeEditor @readonly={{true}} @name={{concat name "[Rules]"}} @syntax="hcl" @oninput={{action "change" (concat name "[Rules]")}}>
{{~component 'service-identity' name=item.Name~}} {{~component 'service-identity' name=item.Name~}}
{{/code-editor}} </CodeEditor>
{{/if}} {{/if}}
</label> </label>
<div class="type-toggle"> <div class="type-toggle">

View File

@ -1,9 +1,9 @@
{{#child-selector repo=repo dc=dc nspace=nspace type="policy" placeholder="Search for policy" items=items}} <ChildSelector @repo={{repo}} @dc={{dc}} @nspace={{nspace}} @type="policy" @placeholder="Search for policy" @items={{items}}>
{{yield}} {{yield}}
{{#block-slot name='label'}} <BlockSlot @name="label">
Apply an existing policy Apply an existing policy
{{/block-slot}} </BlockSlot>
{{#block-slot name='create'}} <BlockSlot @name="create">
{{#yield-slot name='trigger'}} {{#yield-slot name='trigger'}}
{{yield}} {{yield}}
{{else}} {{else}}
@ -13,13 +13,13 @@
{{!TODO: potentially call trigger something else}} {{!TODO: potentially call trigger something else}}
{{!the modal has to go here so that if you provide a slot to trigger it doesn't get rendered}} {{!the modal has to go here so that if you provide a slot to trigger it doesn't get rendered}}
{{#modal-dialog data-test-policy-form onopen=(action 'open') name="new-policy-toggle"}} {{#modal-dialog data-test-policy-form onopen=(action 'open') name="new-policy-toggle"}}
{{#block-slot name='header'}} <BlockSlot @name="header">
<h2>New Policy</h2> <h2>New Policy</h2>
{{/block-slot}} </BlockSlot>
{{#block-slot name='body'}} <BlockSlot @name="body">
{{policy-form form=form dc=dc allowServiceIdentity=allowServiceIdentity}} <PolicyForm @form={{form}} @dc={{dc}} @allowServiceIdentity={{allowServiceIdentity}} />
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |close|}} <BlockSlot @name="actions" as |close|>
<button type="submit" {{action 'save' item items (queue (action close) (action 'reset'))}} disabled={{if (or item.isSaving item.isPristine item.isInvalid) 'disabled'}}> <button type="submit" {{action 'save' item items (queue (action close) (action 'reset'))}} disabled={{if (or item.isSaving item.isPristine item.isInvalid) 'disabled'}}>
{{#if item.isSaving }} {{#if item.isSaving }}
<div class="progress indeterminate"></div> <div class="progress indeterminate"></div>
@ -27,24 +27,24 @@
<span>Create and apply</span> <span>Create and apply</span>
</button> </button>
<button type="reset" disabled={{if item.isSaving 'disabled'}} {{action (queue (action close) (action 'reset'))}}>Cancel</button> <button type="reset" disabled={{if item.isSaving 'disabled'}} {{action (queue (action close) (action 'reset'))}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/modal-dialog}} {{/modal-dialog}}
{{/yield-slot}} {{/yield-slot}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='option' as |option|}} <BlockSlot @name="option" as |option|>
{{option.Name}} {{option.Name}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='set'}} <BlockSlot @name="set">
{{#tabular-details {{#tabular-details
data-test-policies data-test-policies
onchange=(action 'loadItem') onchange=(action 'loadItem')
items=(sort-by 'CreateTime:desc' 'Name:asc' items) as |item index| items=(sort-by 'CreateTime:desc' 'Name:asc' items) as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Name</th> <th>Name</th>
<th>Datacenters</th> <th>Datacenters</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td class={{policy/typeof item}}> <td class={{policy/typeof item}}>
{{#if item.ID }} {{#if item.ID }}
<a href={{href-to 'dc.acls.policies.edit' item.ID}}>{{item.Name}}</a> <a href={{href-to 'dc.acls.policies.edit' item.ID}}>{{item.Name}}</a>
@ -55,35 +55,35 @@
<td> <td>
{{if (not item.isSaving) (join ', ' (policy/datacenters item)) 'Saving...'}} {{if (not item.isSaving) (join ', ' (policy/datacenters item)) 'Saving...'}}
</td> </td>
{{/block-slot}} </BlockSlot>
{{#block-slot name='details'}} <BlockSlot @name="details">
<label class="type-text"> <label class="type-text">
<span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> <span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span>
{{#if (eq item.template '')}} {{#if (eq item.template '')}}
{{code-editor syntax='hcl' readonly=true value=item.Rules}} <CodeEditor @syntax="hcl" @readonly={{true}} @value={{item.Rules}} />
{{else}} {{else}}
{{#code-editor syntax='hcl' readonly=true}} <CodeEditor @syntax="hcl" @readonly={{true}}>
{{~component 'service-identity' name=item.Name~}} {{~component 'service-identity' name=item.Name~}}
{{/code-editor}} </CodeEditor>
{{/if}} {{/if}}
</label> </label>
<div> <div>
{{#confirmation-dialog message='Are you sure you want to remove this policy from this token?'}} <ConfirmationDialog @message="Are you sure you want to remove this policy from this token?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button data-test-delete type="button" class="type-delete" {{action confirm 'remove' item items}}>Remove</button> <button data-test-delete type="button" class="type-delete" {{action confirm 'remove' item items}}>Remove</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
<p> <p>
{{message}} {{message}}
</p> </p>
<button type="button" class="type-delete" {{action execute}}>Confirm remove</button> <button type="button" class="type-delete" {{action execute}}>Confirm remove</button>
<button type="button" class="type-cancel" {{action cancel}}>Cancel</button> <button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
</div> </div>
{{/block-slot}} </BlockSlot>
{{/tabular-details}} {{/tabular-details}}
{{/block-slot}} </BlockSlot>
{{/child-selector}} </ChildSelector>

View File

@ -1,12 +1,12 @@
{{yield (concat 'popover-menu-' guid)}} {{yield (concat 'popover-menu-' guid)}}
{{#aria-menu keyboardAccess=keyboardAccess as |change keypress ariaLabelledBy ariaControls ariaExpanded keypressClick|}} <AriaMenu @keyboardAccess={{keyboardAccess}} as |change keypress ariaLabelledBy ariaControls ariaExpanded keypressClick|>
{{#toggle-button checked=ariaExpanded onchange=(queue change (action 'change')) as |click|}} <ToggleButton @checked={{ariaExpanded}} @onchange={{queue change (action "change")}} as |click|>
<button type="button" aria-haspopup="menu" onkeydown={{keypress}} onclick={{click}} id={{ariaLabelledBy}} aria-controls={{ariaControls}}> <button type="button" aria-haspopup="menu" onkeydown={{keypress}} onclick={{click}} id={{ariaLabelledBy}} aria-controls={{ariaControls}}>
{{#yield-slot name='trigger'}} <YieldSlot @name="trigger">
{{yield}} {{yield}}
{{/yield-slot}} </YieldSlot>
</button> </button>
{{/toggle-button}} </ToggleButton>
<div class={{position}}> <div class={{position}}>
<input type="checkbox" id={{concat 'popover-menu-' guid '-'}} /> <input type="checkbox" id={{concat 'popover-menu-' guid '-'}} />
{{#each submenus as |sub|}} {{#each submenus as |sub|}}
@ -19,9 +19,9 @@
{{else}} {{else}}
{{/yield-slot}} {{/yield-slot}}
<ul role="menu" id={{ariaControls}} aria-labelledby={{ariaLabelledBy}} aria-expanded={{ariaExpanded}}> <ul role="menu" id={{ariaControls}} aria-labelledby={{ariaLabelledBy}} aria-expanded={{ariaExpanded}}>
{{#yield-slot name='menu' params=(block-params (concat 'popover-menu-' guid '-') send keypressClick) }} <YieldSlot @name="menu" @params={{block-params (concat "popover-menu-" guid "-") send keypressClick}}>
{{yield}} {{yield}}
{{/yield-slot}} </YieldSlot>
</ul> </ul>
</div> </div>
{{/aria-menu}} </AriaMenu>

View File

@ -21,6 +21,6 @@
{{#yield-slot name='policy' params=(block-params item)}} {{#yield-slot name='policy' params=(block-params item)}}
{{yield}} {{yield}}
{{else}} {{else}}
{{policy-selector dc=dc nspace=nspace items=item.Policies}} <PolicySelector @dc={{dc}} @nspace={{nspace}} @items={{item.Policies}} />
{{/yield-slot}} {{/yield-slot}}
</fieldset> </fieldset>

View File

@ -1,33 +1,33 @@
{{#modal-dialog data-test-role-form onclose=(action (mut state) 'role') name="new-role-toggle"}} {{#modal-dialog data-test-role-form onclose=(action (mut state) 'role') name="new-role-toggle"}}
{{#block-slot name='header'}} <BlockSlot @name="header">
{{#if (eq state 'role')}} {{#if (eq state 'role')}}
<h2>New Role</h2> <h2>New Role</h2>
{{else}} {{else}}
<h2>New Policy</h2> <h2>New Policy</h2>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='body'}} <BlockSlot @name="body">
<input id="{{name}}_state_role" type="radio" name="{{name}}[state]" value="role" checked={{if (eq state 'role') 'checked'}} onchange={{action 'change'}} /> <input id="{{name}}_state_role" type="radio" name="{{name}}[state]" value="role" checked={{if (eq state 'role') 'checked'}} onchange={{action 'change'}} />
{{#role-form form=form dc=dc nspace=nspace}} <RoleForm @form={{form}} @dc={{dc}} @nspace={{nspace}}>
{{#block-slot name='policy'}} <BlockSlot @name="policy">
{{#policy-selector source=source dc=dc nspace=nspace items=item.Policies}} <PolicySelector @source={{source}} @dc={{dc}} @nspace={{nspace}} @items={{item.Policies}}>
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
<label for="{{name}}_state_policy" data-test-create-policy class="type-dialog"> <label for="{{name}}_state_policy" data-test-create-policy class="type-dialog">
<span>Create new policy</span> <span>Create new policy</span>
</label> </label>
{{/block-slot}} </BlockSlot>
{{/policy-selector}} </PolicySelector>
{{/block-slot}} </BlockSlot>
{{/role-form}} </RoleForm>
<input id="{{name}}_state_policy" type="radio" name="{{name}}[state]" value="policy" checked={{if (eq state 'policy') 'checked'}} onchange={{action 'change'}} /> <input id="{{name}}_state_policy" type="radio" name="{{name}}[state]" value="policy" checked={{if (eq state 'policy') 'checked'}} onchange={{action 'change'}} />
{{policy-form data-test-policy-form name="role[policy]" form=policyForm dc=dc}} {{policy-form data-test-policy-form name="role[policy]" form=policyForm dc=dc}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |close|}} <BlockSlot @name="actions" as |close|>
{{#if (eq state 'role')}} {{#if (eq state 'role')}}
<button type="submit" {{action 'save' item items (queue (action close) (action 'reset'))}} disabled={{if (or item.isSaving item.isPristine item.isInvalid) 'disabled'}}> <button type="submit" {{action 'save' item items (queue (action close) (action 'reset'))}} disabled={{if (or item.isSaving item.isPristine item.isInvalid) 'disabled'}}>
@ -47,46 +47,46 @@
<button type="reset" disabled={{if policy.isSaving 'disabled'}} {{action (mut state) 'role'}}>Cancel</button> <button type="reset" disabled={{if policy.isSaving 'disabled'}} {{action (mut state) 'role'}}>Cancel</button>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/modal-dialog}} {{/modal-dialog}}
{{#child-selector repo=repo dc=dc nspace=nspace type="role" placeholder="Search for role" items=items}} <ChildSelector @repo={{repo}} @dc={{dc}} @nspace={{nspace}} @type="role" @placeholder="Search for role" @items={{items}}>
{{#block-slot name='label'}} <BlockSlot @name="label">
Apply an existing role Apply an existing role
{{/block-slot}} </BlockSlot>
{{#block-slot name='create'}} <BlockSlot @name="create">
<label class="type-dialog" for="new-role-toggle"> <label class="type-dialog" for="new-role-toggle">
<span>Create new role</span> <span>Create new role</span>
</label> </label>
{{/block-slot}} </BlockSlot>
{{#block-slot name='option' as |option|}} <BlockSlot @name="option" as |option|>
{{option.Name}} {{option.Name}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='set'}} <BlockSlot @name="set">
{{#tabular-collection {{#tabular-collection
data-test-roles data-test-roles
rows=5 rows=5
items=(sort-by 'CreateTime:desc' 'Name:asc' items) as |item index| items=(sort-by 'CreateTime:desc' 'Name:asc' items) as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Name</th> <th>Name</th>
<th>Description</th> <th>Description</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td> <td>
<a href={{href-to 'dc.acls.roles.edit' item.ID}}>{{item.Name}}</a> <a href={{href-to 'dc.acls.roles.edit' item.ID}}>{{item.Name}}</a>
</td> </td>
<td> <td>
{{item.Description}} {{item.Description}}
</td> </td>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu expanded=(if (eq checked index) true false) onchange=(action change index) keyboardAccess=false}} <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}}>
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
<li role="none"> <li role="none">
<a role="menuitem" tabindex="-1" href={{href-to 'dc.acls.roles.edit' item.ID}}>Edit</a> <a role="menuitem" tabindex="-1" href={{href-to 'dc.acls.roles.edit' item.ID}}>Edit</a>
</li> </li>
@ -113,9 +113,9 @@
</div> </div>
</div> </div>
</li> </li>
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{/block-slot}} </BlockSlot>
{{/child-selector}} </ChildSelector>

View File

@ -1,9 +1,9 @@
{{yield}} {{yield}}
<div class="stats-card"> <div class="stats-card">
<header> <header>
{{#yield-slot name='mini-stat'}}{{yield}}{{/yield-slot}} <YieldSlot @name="mini-stat">{{yield}}</YieldSlot>
{{#yield-slot name='header'}}{{yield}}{{/yield-slot}} <YieldSlot @name="header">{{yield}}</YieldSlot>
{{#yield-slot name='icon'}}{{yield}}{{/yield-slot}} <YieldSlot @name="icon">{{yield}}</YieldSlot>
</header> </header>
{{#yield-slot name='body'}}{{yield}}{{/yield-slot}} <YieldSlot @name="body">{{yield}}</YieldSlot>
</div> </div>

View File

@ -1,27 +1,27 @@
{{yield}} {{yield}}
{{#if hasCaption}} {{#if hasCaption}}
<caption>{{#yield-slot name='caption'}}{{yield}}{{/yield-slot}}</caption> <caption><YieldSlot @name="caption">{{yield}}</YieldSlot></caption>
{{/if}} {{/if}}
<thead> <thead>
<tr> <tr>
{{#yield-slot name='header'}}{{yield}}{{/yield-slot}} <YieldSlot @name="header">{{yield}}</YieldSlot>
{{#if hasActions }} {{#if hasActions }}
<th class="actions">Actions</th> <th class="actions">Actions</th>
{{/if}} {{/if}}
</tr> </tr>
</thead> </thead>
{{#ember-native-scrollable tagName='tbody' content-size=_contentSize scroll-left=_scrollLeft scroll-top=_scrollTop scrollChange=(action 'scrollChange') clientSizeChange=(action "clientSizeChange")}} <EmberNativeScrollable @tagName="tbody" @content-size={{_contentSize}} @scroll-left={{_scrollLeft}} @scroll-top={{_scrollTop}} @scrollChange={{action "scrollChange"}} @clientSizeChange={{action "clientSizeChange"}}>
<tr></tr> <tr></tr>
{{~#each _cells as |cell index|~}} {{~#each _cells as |cell index|~}}
<tr data-test-tabular-row style={{{cell.style}}} onclick={{action 'click'}}> <tr data-test-tabular-row style={{{cell.style}}} onclick={{action 'click'}}>
{{#yield-slot name='row'}}{{yield cell.item index}}{{/yield-slot}} <YieldSlot @name="row">{{yield cell.item index}}</YieldSlot>
{{#if hasActions }} {{#if hasActions }}
<td class="actions"> <td class="actions">
{{#yield-slot name='actions' params=(block-params (concat cell.index) (action 'change') checked)}} <YieldSlot @name="actions" @params={{block-params (concat cell.index) (action "change") checked}}>
{{yield cell.item index}} {{yield cell.item index}}
{{/yield-slot}} </YieldSlot>
</td> </td>
{{/if}} {{/if}}
</tr> </tr>
{{~/each~}} {{~/each~}}
{{/ember-native-scrollable}} </EmberNativeScrollable>

View File

@ -2,14 +2,14 @@
<table class="with-details has-actions"> <table class="with-details has-actions">
<thead> <thead>
<tr> <tr>
{{#yield-slot name='header'}}{{yield}}{{/yield-slot}} <YieldSlot @name="header">{{yield}}</YieldSlot>
<th class="actions">Actions</th> <th class="actions">Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#each items as |item index|}} {{#each items as |item index|}}
<tr data-test-tabular-row onclick={{action 'click'}}> <tr data-test-tabular-row onclick={{action 'click'}}>
{{#yield-slot name='row'}}{{yield item index}}{{/yield-slot}} <YieldSlot @name="row">{{yield item index}}</YieldSlot>
<td class="actions"> <td class="actions">
<label for={{concat inputId index}}><span>Show details</span></label> <label for={{concat inputId index}}><span>Show details</span></label>
</td> </td>
@ -20,9 +20,9 @@
<div> <div>
<label for={{concat inputId index}}><span>Hide details</span></label> <label for={{concat inputId index}}><span>Hide details</span></label>
<div> <div>
{{#yield-slot name='details'}} <YieldSlot @name="details">
{{yield item index}} {{yield item index}}
{{/yield-slot}} </YieldSlot>
</div> </div>
</div> </div>
</td> </td>

View File

@ -7,14 +7,14 @@
items=(sort-by 'AccessorID:asc' items) as |item index| items=(sort-by 'AccessorID:asc' items) as |item index|
}} }}
{{#if caption}} {{#if caption}}
{{#block-slot name='caption'}}{{caption}}{{/block-slot}} <BlockSlot @name="caption">{{caption}}</BlockSlot>
{{/if}} {{/if}}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>AccessorID</th> <th>AccessorID</th>
<th>Scope</th> <th>Scope</th>
<th>Description</th> <th>Description</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-token="{{item.AccessorID}}"> <td data-test-token="{{item.AccessorID}}">
<a href={{href-to 'dc.acls.tokens.edit' item.AccessorID}} target={{or target ''}}>{{truncate item.AccessorID 8 false}}</a> <a href={{href-to 'dc.acls.tokens.edit' item.AccessorID}} target={{or target ''}}>{{truncate item.AccessorID 8 false}}</a>
</td> </td>
@ -24,6 +24,6 @@
<td> <td>
<p>{{item.Description}}</p> <p>{{item.Description}}</p>
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{/if}} {{/if}}

View File

@ -1,3 +1,3 @@
{{#hashicorp-consul id="wrapper" permissions=permissions dcs=dcs dc=dc nspaces=nspaces nspace=nspace}} <HashicorpConsul @id="wrapper" @permissions={{permissions}} @dcs={{dcs}} @dc={{dc}} @nspaces={{nspaces}} @nspace={{nspace}}>
{{outlet}} {{outlet}}
{{/hashicorp-consul}} </HashicorpConsul>

View File

@ -5,7 +5,7 @@
<fieldset> <fieldset>
<label class="type-text"> <label class="type-text">
<span>SecretID or Token</span> <span>SecretID or Token</span>
{{input type='password' value=secret name="secret" placeholder="SecretID or Token"}} <Input @type="password" @value={{secret}} @name="secret" placeholder="SecretID or Token" />
</label> </label>
</fieldset> </fieldset>
{{! authorize is in the routes/dc/acls.js route }} {{! authorize is in the routes/dc/acls.js route }}

View File

@ -2,7 +2,7 @@
<fieldset> <fieldset>
<label class="type-text{{if item.error.Name ' has-error'}}"> <label class="type-text{{if item.error.Name ' has-error'}}">
<span>Name</span> <span>Name</span>
{{input value=item.Name name='name' autofocus='autofocus'}} <Input @value={{item.Name}} @name="name" @autofocus="autofocus" />
</label> </label>
<div role="radiogroup" class={{if item.error.Type ' has-error'}}> <div role="radiogroup" class={{if item.error.Type ' has-error'}}>
{{#each types as |type|}} {{#each types as |type|}}
@ -14,12 +14,12 @@
</div> </div>
<label class="type-text"> <label class="type-text">
<span>Policy <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> <span>Policy <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span>
{{code-editor class=(if item.error.Rules 'error') name='Rules' value=item.Rules syntax="hcl" onkeyup=(action 'change' 'Rules')}} <CodeEditor @class={{if item.error.Rules "error"}} @name="Rules" @value={{item.Rules}} @syntax="hcl" @onkeyup={{action "change" "Rules"}} />
</label> </label>
{{#if create }} {{#if create }}
<label class="type-text"> <label class="type-text">
<span>ID</span> <span>ID</span>
{{ input value=item.ID }} <Input @value={{item.ID}} />
<em>We'll generate a UUID if this field is left empty.</em> <em>We'll generate a UUID if this field is left empty.</em>
</label> </label>
{{/if}} {{/if}}
@ -31,14 +31,14 @@
{{/if}} {{/if}}
<button type="reset" {{ action "cancel" item}}>Cancel</button> <button type="reset" {{ action "cancel" item}}>Cancel</button>
{{# if (and (not create) (not-eq item.ID 'anonymous')) }} {{# if (and (not create) (not-eq item.ID 'anonymous')) }}
{{#confirmation-dialog message='Are you sure you want to delete this ACL token?'}} <ConfirmationDialog @message="Are you sure you want to delete this ACL token?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item parent}}>Delete</button> <button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
{{delete-confirmation message=message execute=execute cancel=cancel}} <DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
</div> </div>
</form> </form>

View File

@ -1,19 +1 @@
{{tab-nav <TabNav @items={{array (hash label="Tokens" href=(href-to "dc.acls.tokens") selected=(is-href "dc.acls.tokens")) (hash label="Roles" href=(href-to "dc.acls.roles") selected=(is-href "dc.acls.roles")) (hash label="Policies" href=(href-to "dc.acls.policies") selected=(is-href "dc.acls.policies"))}} />
items=(array
(hash
label='Tokens'
href=(href-to 'dc.acls.tokens')
selected=(is-href 'dc.acls.tokens')
)
(hash
label='Roles'
href=(href-to 'dc.acls.roles')
selected=(is-href 'dc.acls.roles')
)
(hash
label='Policies'
href=(href-to 'dc.acls.policies')
selected=(is-href 'dc.acls.policies')
)
)
}}

View File

@ -1,13 +1,13 @@
{{#app-view class="acl edit" loading=isLoading}} <AppView @class="acl edit" @loading={{isLoading}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/notifications'}} {{partial 'dc/acls/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.acls'}}>All Tokens</a></li> <li><a data-test-back href={{href-to 'dc.acls'}}>All Tokens</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if item.Name }} {{#if item.Name }}
{{item.Name}} {{item.Name}}
@ -15,42 +15,42 @@
New token New token
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
{{#if (not create) }} {{#if (not create) }}
{{#feedback-dialog type='inline'}} <FeedbackDialog @type="inline">
{{#block-slot name='action' as |success error|}} <BlockSlot @name="action" as |success error|>
{{#copy-button success=(action success) error=(action error) clipboardText=item.ID title='copy token ID to clipboard'}} <CopyButton @success={{action success}} @error={{action error}} @clipboardText={{item.ID}} @title="copy token ID to clipboard">
Copy token ID Copy token ID
{{/copy-button}} </CopyButton>
{{/block-slot}} </BlockSlot>
{{#block-slot name='success' as |transition|}} <BlockSlot @name="success" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Copied token ID! Copied token ID!
</p> </p>
{{/block-slot}} </BlockSlot>
{{#block-slot name='error' as |transition|}} <BlockSlot @name="error" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Sorry, something went wrong! Sorry, something went wrong!
</p> </p>
{{/block-slot}} </BlockSlot>
{{/feedback-dialog}} </FeedbackDialog>
<button type="button" {{ action "clone" item }}>Clone token</button> <button type="button" {{ action "clone" item }}>Clone token</button>
{{#confirmation-dialog message='Are you sure you want to use this ACL token?'}} <ConfirmationDialog @message="Are you sure you want to use this ACL token?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button data-test-use type="button" {{ action confirm 'use' item }}>Use token</button> <button data-test-use type="button" {{ action confirm 'use' item }}>Use token</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
<p> <p>
{{message}} {{message}}
</p> </p>
<button type="button" class="type-delete" {{action execute}}>Confirm Use</button> <button type="button" class="type-delete" {{action execute}}>Confirm Use</button>
<button type="button" class="type-cancel" {{action cancel}}>Cancel</button> <button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{ partial 'dc/acls/form'}} {{ partial 'dc/acls/form'}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,32 +1,30 @@
{{#app-view class="acl list" loading=isLoading}} <AppView @class="acl list" @loading={{isLoading}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/notifications'}} {{partial 'dc/acls/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
ACL Tokens <em>{{format-number items.length}} total</em> ACL Tokens <em>{{format-number items.length}} total</em>
</h1> </h1>
<label for="toolbar-toggle"></label> <label for="toolbar-toggle"></label>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
<a data-test-create href="{{href-to 'dc.acls.create'}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.acls.create'}}" class="type-create">Create</a>
{{/block-slot}} </BlockSlot>
{{#block-slot name='toolbar'}} <BlockSlot @name="toolbar">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
{{acl-filter searchable=searchable filters=typeFilters search=filters.s type=filters.type onchange=(action 'filter')}} <AclFilter @searchable={{searchable}} @filters={{typeFilters}} @search={{filters.s}} @type={{filters.type}} @onchange={{action "filter"}} />
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection <TabularCollection @items={{sort-by "Name:asc" filtered}} as |item index|>
items=(sort-by 'Name:asc' filtered) as |item index| <BlockSlot @name="header">
}}
{{#block-slot name='header'}}
<th>Name</th> <th>Name</th>
<th>Type</th> <th>Type</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-acl="{{item.Name}}"> <td data-test-acl="{{item.Name}}">
<a href={{href-to 'dc.acls.edit' item.ID}}>{{item.Name}}</a> <a href={{href-to 'dc.acls.edit' item.ID}}>{{item.Name}}</a>
</td> </td>
@ -37,18 +35,13 @@
<span>{{item.Type}}</span> <span>{{item.Type}}</span>
{{/if}} {{/if}}
</td> </td>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}} @submenus={{array "logout" "use" "delete"}}>
expanded=(if (eq checked index) true false) <BlockSlot @name="trigger">
onchange=(action change index)
keyboardAccess=false
submenus=(array 'logout' 'use' 'delete')
}}
{{#block-slot name='trigger'}}
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
<li role="none"> <li role="none">
<a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.acls.edit' item.ID}}>Edit</a> <a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.acls.edit' item.ID}}>Edit</a>
</li> </li>
@ -129,16 +122,16 @@
</div> </div>
</li> </li>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no ACLs. There are no ACLs.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,10 +1,10 @@
<form> <form>
{{#policy-form form=form item=item}} <PolicyForm @form={{form}} @item={{item}}>
{{!don't show template selection here, i.e. Service Identity}} {{!don't show template selection here, i.e. Service Identity}}
{{block-slot name='template'}} <BlockSlot @name="template" />
{{/policy-form}} </PolicyForm>
{{#if (not create) }} {{#if (not create) }}
{{token-list caption="Applied to the following tokens:" items=items}} <TokenList @caption="Applied to the following tokens:" @items={{items}} />
{{/if}} {{/if}}
<div> <div>
{{#if create }} {{#if create }}
@ -15,35 +15,35 @@
{{/if}} {{/if}}
<button type="reset" {{ action "cancel" item}}>Cancel</button> <button type="reset" {{ action "cancel" item}}>Cancel</button>
{{# if (not create) }} {{# if (not create) }}
{{#confirmation-dialog message='Are you sure you want to delete this Policy?'}} <ConfirmationDialog @message="Are you sure you want to delete this Policy?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button> <button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
{{#if (gt items.length 0)}} {{#if (gt items.length 0)}}
{{#modal-dialog data-test-delete-modal onclose=(action cancel)}} {{#modal-dialog data-test-delete-modal onclose=(action cancel)}}
{{#block-slot name='header'}} <BlockSlot @name="header">
<h2>Policy in Use</h2> <h2>Policy in Use</h2>
{{/block-slot}} </BlockSlot>
{{#block-slot name='body'}} <BlockSlot @name="body">
<p> <p>
This Policy is currently in use. If you choose to delete this Policy, it will be removed from the following <strong>{{items.length}} Tokens</strong>: This Policy is currently in use. If you choose to delete this Policy, it will be removed from the following <strong>{{items.length}} Tokens</strong>:
</p> </p>
{{token-list items=items target='_blank'}} <TokenList @items={{items}} @target="_blank" />
<p> <p>
This action cannot be undone. {{message}} This action cannot be undone. {{message}}
</p> </p>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |close|}} <BlockSlot @name="actions" as |close|>
<button type="button" class="type-delete" {{action execute}}>Yes, Delete</button> <button type="button" class="type-delete" {{action execute}}>Yes, Delete</button>
<button type="button" class="type-cancel" {{action close}}>Cancel</button> <button type="button" class="type-cancel" {{action close}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/modal-dialog}} {{/modal-dialog}}
{{else}} {{else}}
{{delete-confirmation message=message execute=execute cancel=cancel}} <DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
</div> </div>
</form> </form>

View File

@ -9,4 +9,4 @@
<dd>{{item.Description}}</dd> <dd>{{item.Description}}</dd>
</dl> </dl>
</div> </div>
{{token-list caption="Applied to the following tokens:" items=items}} <TokenList @caption="Applied to the following tokens:" @items={{items}} />

View File

@ -7,22 +7,22 @@
{{else}} {{else}}
{{title 'Access Controls'}} {{title 'Access Controls'}}
{{/if}} {{/if}}
{{#app-view class=(concat 'policy ' (if (or isAuthorized isEnabled) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} <AppView @class={{concat "policy " (if (or isAuthorized isEnabled) "edit" "list")}} @loading={{isLoading}} @authorized={{isAuthorized}} @enabled={{isEnabled}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/policies/notifications'}} {{partial 'dc/acls/policies/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='disabled'}} <BlockSlot @name="disabled">
{{partial 'dc/acls/disabled'}} {{partial 'dc/acls/disabled'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='authorization'}} <BlockSlot @name="authorization">
{{partial 'dc/acls/authorization'}} {{partial 'dc/acls/authorization'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.acls.policies'}}>All Policies</a></li> <li><a data-test-back href={{href-to 'dc.acls.policies'}}>All Policies</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if isAuthorized }} {{#if isAuthorized }}
{{#if create }} {{#if create }}
@ -38,12 +38,12 @@
Access Controls Access Controls
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if (eq (policy/typeof item) 'policy-management')}} {{#if (eq (policy/typeof item) 'policy-management')}}
{{ partial 'dc/acls/policies/view'}} {{ partial 'dc/acls/policies/view'}}
{{else}} {{else}}
{{ partial 'dc/acls/policies/form'}} {{ partial 'dc/acls/policies/form'}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -3,44 +3,42 @@
{{else}} {{else}}
{{title 'Access Controls'}} {{title 'Access Controls'}}
{{/if}} {{/if}}
{{#app-view class=(concat 'policy ' (if (not isAuthorized) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} <AppView @class={{concat "policy " (if (not isAuthorized) "edit" "list")}} @loading={{isLoading}} @authorized={{isAuthorized}} @enabled={{isEnabled}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/policies/notifications'}} {{partial 'dc/acls/policies/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Access Controls Access Controls
</h1> </h1>
{{#if isAuthorized }} {{#if isAuthorized }}
{{partial 'dc/acls/nav'}} {{partial 'dc/acls/nav'}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='disabled'}} <BlockSlot @name="disabled">
{{partial 'dc/acls/disabled'}} {{partial 'dc/acls/disabled'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='authorization'}} <BlockSlot @name="authorization">
{{partial 'dc/acls/authorization'}} {{partial 'dc/acls/authorization'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
<a data-test-create href="{{href-to 'dc.acls.policies.create'}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.acls.policies.create'}}" class="type-create">Create</a>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
<form class="filter-bar"> <form class="filter-bar">
{{freetext-filter searchable=searchable value=s placeholder="Search"}} <FreetextFilter @searchable={{searchable}} @value={{s}} @placeholder="Search" />
</form> </form>
{{/if}} {{/if}}
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection <TabularCollection @items={{sort-by "CreateIndex:desc" "Name:asc" filtered}} as |item index|>
items=(sort-by 'CreateIndex:desc' 'Name:asc' filtered) as |item index| <BlockSlot @name="header">
}}
{{#block-slot name='header'}}
<th>Name</th> <th>Name</th>
<th>Datacenters</th> <th>Datacenters</th>
<th>Description</th> <th>Description</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-policy="{{item.Name}}"> <td data-test-policy="{{item.Name}}">
<a href={{href-to 'dc.acls.policies.edit' item.ID}} class={{if (eq (policy/typeof item) 'policy-management') 'is-management'}}>{{item.Name}}</a> <a href={{href-to 'dc.acls.policies.edit' item.ID}} class={{if (eq (policy/typeof item) 'policy-management') 'is-management'}}>{{item.Name}}</a>
</td> </td>
@ -50,13 +48,13 @@
<td data-test-description> <td data-test-description>
<p>{{item.Description}}</p> <p>{{item.Description}}</p>
</td> </td>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu expanded=(if (eq checked index) true false) onchange=(action change index) keyboardAccess=false}} <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}}>
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
{{#if (eq (policy/typeof item) 'policy-management')}} {{#if (eq (policy/typeof item) 'policy-management')}}
<li role="none"> <li role="none">
<a role="menuitem" tabindex="-1" data-test-edit href={{href-to 'dc.acls.policies.edit' item.ID}}>View</a> <a role="menuitem" tabindex="-1" data-test-edit href={{href-to 'dc.acls.policies.edit' item.ID}}>View</a>
@ -90,16 +88,16 @@
</div> </div>
</li> </li>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no Policies. There are no Policies.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,11 +1,11 @@
<form> <form>
{{role-form form=form item=item dc=dc nspace=nspace}} <RoleForm @form={{form}} @item={{item}} @dc={{dc}} @nspace={{nspace}} />
{{#if (and (not create) (gt items.length 0))}} {{#if (and (not create) (gt items.length 0))}}
<h2>Where is this role used?</h2> <h2>Where is this role used?</h2>
<p> <p>
We're only able to show information for the primary datacenter and the current datacenter. This list may not show every case where this role is applied. We're only able to show information for the primary datacenter and the current datacenter. This list may not show every case where this role is applied.
</p> </p>
{{token-list caption="Tokens" items=items}} <TokenList @caption="Tokens" @items={{items}} />
{{/if}} {{/if}}
<div> <div>
{{#if create }} {{#if create }}
@ -16,35 +16,35 @@
{{/if}} {{/if}}
<button type="reset" {{ action "cancel" item}}>Cancel</button> <button type="reset" {{ action "cancel" item}}>Cancel</button>
{{# if (not create) }} {{# if (not create) }}
{{#confirmation-dialog message='Are you sure you want to delete this Role?'}} <ConfirmationDialog @message="Are you sure you want to delete this Role?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button> <button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
{{#if (gt items.length 0)}} {{#if (gt items.length 0)}}
{{#modal-dialog onclose=(action cancel)}} <ModalDialog @onclose={{action cancel}}>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h2>Role in Use</h2> <h2>Role in Use</h2>
{{/block-slot}} </BlockSlot>
{{#block-slot name='body'}} <BlockSlot @name="body">
<p> <p>
This Role is currently in use. If you choose to delete this Role, it will be removed from the following <strong>{{items.length}} Tokens</strong>: This Role is currently in use. If you choose to delete this Role, it will be removed from the following <strong>{{items.length}} Tokens</strong>:
</p> </p>
{{token-list items=items target='_blank'}} <TokenList @items={{items}} @target="_blank" />
<p> <p>
This action cannot be undone. {{message}} This action cannot be undone. {{message}}
</p> </p>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |close|}} <BlockSlot @name="actions" as |close|>
<button type="button" class="type-delete" {{action execute}}>Yes, Delete</button> <button type="button" class="type-delete" {{action execute}}>Yes, Delete</button>
<button type="button" class="type-cancel" {{action close}}>Cancel</button> <button type="button" class="type-cancel" {{action close}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/modal-dialog}} </ModalDialog>
{{else}} {{else}}
{{delete-confirmation message=message execute=execute cancel=cancel}} <DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
</div> </div>
</form> </form>

View File

@ -7,22 +7,22 @@
{{else}} {{else}}
{{title 'Access Controls'}} {{title 'Access Controls'}}
{{/if}} {{/if}}
{{#app-view class=(concat 'role ' (if (or isAuthorized isEnabled) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} <AppView @class={{concat "role " (if (or isAuthorized isEnabled) "edit" "list")}} @loading={{isLoading}} @authorized={{isAuthorized}} @enabled={{isEnabled}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/roles/notifications'}} {{partial 'dc/acls/roles/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='disabled'}} <BlockSlot @name="disabled">
{{partial 'dc/acls/disabled'}} {{partial 'dc/acls/disabled'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='authorization'}} <BlockSlot @name="authorization">
{{partial 'dc/acls/authorization'}} {{partial 'dc/acls/authorization'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.acls.roles'}}>All Roles</a></li> <li><a data-test-back href={{href-to 'dc.acls.roles'}}>All Roles</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if isAuthorized }} {{#if isAuthorized }}
{{#if create }} {{#if create }}
@ -34,8 +34,8 @@
Access Controls Access Controls
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{ partial 'dc/acls/roles/form'}} {{ partial 'dc/acls/roles/form'}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -3,44 +3,42 @@
{{else}} {{else}}
{{title 'Access Controls'}} {{title 'Access Controls'}}
{{/if}} {{/if}}
{{#app-view class=(concat 'role ' (if (not isAuthorized) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} <AppView @class={{concat "role " (if (not isAuthorized) "edit" "list")}} @loading={{isLoading}} @authorized={{isAuthorized}} @enabled={{isEnabled}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/roles/notifications'}} {{partial 'dc/acls/roles/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Access Controls Access Controls
</h1> </h1>
{{#if isAuthorized }} {{#if isAuthorized }}
{{partial 'dc/acls/nav'}} {{partial 'dc/acls/nav'}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='disabled'}} <BlockSlot @name="disabled">
{{partial 'dc/acls/disabled'}} {{partial 'dc/acls/disabled'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='authorization'}} <BlockSlot @name="authorization">
{{partial 'dc/acls/authorization'}} {{partial 'dc/acls/authorization'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
<a data-test-create href="{{href-to 'dc.acls.roles.create'}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.acls.roles.create'}}" class="type-create">Create</a>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
<form class="filter-bar"> <form class="filter-bar">
{{freetext-filter searchable=searchable value=s placeholder="Search"}} <FreetextFilter @searchable={{searchable}} @value={{s}} @placeholder="Search" />
</form> </form>
{{/if}} {{/if}}
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection <TabularCollection @items={{sort-by "CreateIndex:desc" "Name:asc" filtered}} as |item index|>
items=(sort-by 'CreateIndex:desc' 'Name:asc' filtered) as |item index| <BlockSlot @name="header">
}}
{{#block-slot name='header'}}
<th>Name</th> <th>Name</th>
<th>Description</th> <th>Description</th>
<th>Policies</th> <th>Policies</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-role="{{item.Name}}"> <td data-test-role="{{item.Name}}">
<a href={{href-to 'dc.acls.roles.edit' item.ID}}>{{item.Name}}</a> <a href={{href-to 'dc.acls.roles.edit' item.ID}}>{{item.Name}}</a>
</td> </td>
@ -52,13 +50,13 @@
<strong data-test-policy class={{policy/typeof item}}>{{item.Name}}</strong> <strong data-test-policy class={{policy/typeof item}}>{{item.Name}}</strong>
{{/each}} {{/each}}
</td> </td>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu expanded=(if (eq checked index) true false) onchange=(action change index) keyboardAccess=false}} <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}}>
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
<li role="none"> <li role="none">
<a role="menuitem" tabindex="-1" href={{href-to 'dc.acls.roles.edit' item.ID}}>Edit</a> <a role="menuitem" tabindex="-1" href={{href-to 'dc.acls.roles.edit' item.ID}}>Edit</a>
</li> </li>
@ -85,16 +83,16 @@
</div> </div>
</div> </div>
</li> </li>
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no Roles. There are no Roles.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,7 +1,7 @@
<fieldset> <fieldset>
<label class="type-text{{if item.error.Name ' has-error'}}"> <label class="type-text{{if item.error.Name ' has-error'}}">
<span>Name</span> <span>Name</span>
{{input value=item.Description name='name' autofocus='autofocus'}} <Input @value={{item.Description}} @name="name" @autofocus="autofocus" />
</label> </label>
{{#if false}} {{#if false}}
<div role="radiogroup" class={{if item.error.Type ' has-error'}}> <div role="radiogroup" class={{if item.error.Type ' has-error'}}>
@ -15,12 +15,12 @@
{{/if}} {{/if}}
<label class="type-text"> <label class="type-text">
<span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span> <span>Rules <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl.html#rule-specification" rel="help noopener noreferrer" target="_blank">(HCL Format)</a></span>
{{code-editor class=(if item.error.Rules 'error') name='Rules' syntax='hcl' value=item.Rules onkeyup=(action 'change' 'Rules')}} <CodeEditor @class={{if item.error.Rules "error"}} @name="Rules" @syntax="hcl" @value={{item.Rules}} @onkeyup={{action "change" "Rules"}} />
</label> </label>
{{#if create }} {{#if create }}
<label class="type-text"> <label class="type-text">
<span>ID</span> <span>ID</span>
{{ input value=item.ID }} <Input @value={{item.ID}} />
<em>We'll generate a UUID if this field is left empty.</em> <em>We'll generate a UUID if this field is left empty.</em>
</label> </label>
{{/if}} {{/if}}

View File

@ -16,9 +16,9 @@
</fieldset> </fieldset>
<fieldset id="roles"> <fieldset id="roles">
<h2>Roles</h2> <h2>Roles</h2>
{{role-selector dc=dc nspace=nspace items=item.Roles}} <RoleSelector @dc={{dc}} @nspace={{nspace}} @items={{item.Roles}} />
</fieldset> </fieldset>
<fieldset id="policies"> <fieldset id="policies">
<h2>Policies</h2> <h2>Policies</h2>
{{policy-selector dc=dc nspace=nspace items=item.Policies}} <PolicySelector @dc={{dc}} @nspace={{nspace}} @items={{item.Policies}} />
</fieldset> </fieldset>

View File

@ -14,14 +14,14 @@
{{/if}} {{/if}}
<button type="reset" {{ action "cancel" item}}>Cancel</button> <button type="reset" {{ action "cancel" item}}>Cancel</button>
{{# if (and (not create) (not (token/is-anonymous item)) (not-eq item.AccessorID token.AccessorID) ) }} {{# if (and (not create) (not (token/is-anonymous item)) (not-eq item.AccessorID token.AccessorID) ) }}
{{#confirmation-dialog message='Are you sure you want to delete this Token?'}} <ConfirmationDialog @message="Are you sure you want to delete this Token?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button> <button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
{{delete-confirmation message=message execute=execute cancel=cancel}} <DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
</div> </div>
</form> </form>

View File

@ -7,22 +7,22 @@
{{else}} {{else}}
{{title 'Access Controls'}} {{title 'Access Controls'}}
{{/if}} {{/if}}
{{#app-view class=(concat 'token ' (if (or isAuthorized isEnabled) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} <AppView @class={{concat "token " (if (or isAuthorized isEnabled) "edit" "list")}} @loading={{isLoading}} @authorized={{isAuthorized}} @enabled={{isEnabled}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/tokens/notifications'}} {{partial 'dc/acls/tokens/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='disabled'}} <BlockSlot @name="disabled">
{{partial 'dc/acls/disabled'}} {{partial 'dc/acls/disabled'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='authorization'}} <BlockSlot @name="authorization">
{{partial 'dc/acls/authorization'}} {{partial 'dc/acls/authorization'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.acls.tokens'}}>All Tokens</a></li> <li><a data-test-back href={{href-to 'dc.acls.tokens'}}>All Tokens</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if isAuthorized }} {{#if isAuthorized }}
{{#if create }} {{#if create }}
@ -34,29 +34,29 @@
Access Controls Access Controls
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
{{#if (not create)}} {{#if (not create)}}
{{#if (not-eq item.AccessorID token.AccessorID)}} {{#if (not-eq item.AccessorID token.AccessorID)}}
{{#confirmation-dialog message='Are you sure you want to use this ACL token?'}} <ConfirmationDialog @message="Are you sure you want to use this ACL token?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button data-test-use type="button" {{ action confirm 'use' item }}>Use</button> <button data-test-use type="button" {{ action confirm 'use' item }}>Use</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
<p> <p>
{{message}} {{message}}
</p> </p>
<button type="button" class="type-delete" {{action execute}}>Confirm Use</button> <button type="button" class="type-delete" {{action execute}}>Confirm Use</button>
<button type="button" class="type-cancel" {{action cancel}}>Cancel</button> <button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
{{#if (not (token/is-legacy item))}} {{#if (not (token/is-legacy item))}}
<button data-test-clone type="button" {{ action "clone" item }}>Duplicate</button> <button data-test-clone type="button" {{ action "clone" item }}>Duplicate</button>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if (token/is-legacy item)}} {{#if (token/is-legacy item)}}
<p class="notice info"><strong>Update.</strong> We have upgraded our ACL system by allowing you to create reusable policies which you can then apply to tokens. Don't worry, even though this token was written in the old style, it is still valid. However, we do recommend upgrading your old tokens to the new style. Learn how in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p> <p class="notice info"><strong>Update.</strong> We have upgraded our ACL system by allowing you to create reusable policies which you can then apply to tokens. Don't worry, even though this token was written in the old style, it is still valid. However, we do recommend upgrading your old tokens to the new style. Learn how in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p>
{{/if}} {{/if}}
@ -65,11 +65,11 @@
<dl> <dl>
<dt>AccessorID</dt> <dt>AccessorID</dt>
<dd> <dd>
{{copy-button-feedback title="Copy AccessorID to the clipboard" copy=item.AccessorID name="AccessorID"}} {{item.AccessorID}} <CopyButtonFeedback @title="Copy AccessorID to the clipboard" @copy={{item.AccessorID}} @name="AccessorID" /> {{item.AccessorID}}
</dd> </dd>
<dt>Token</dt> <dt>Token</dt>
<dd> <dd>
{{copy-button-feedback title="Copy SecretID to the clipboard" copy=item.SecretID name="Token"}} {{#secret-button}}{{item.SecretID}}{{/secret-button}} <CopyButtonFeedback @title="Copy SecretID to the clipboard" @copy={{item.SecretID}} @name="Token" /> <SecretButton>{{item.SecretID}}</SecretButton>
</dd> </dd>
{{#if (and (not (token/is-legacy item)) (not create))}} {{#if (and (not (token/is-legacy item)) (not create))}}
<dt>Scope</dt> <dt>Scope</dt>
@ -81,5 +81,5 @@
</div> </div>
{{/if}} {{/if}}
{{ partial 'dc/acls/tokens/form'}} {{ partial 'dc/acls/tokens/form'}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -3,49 +3,47 @@
{{else}} {{else}}
{{title 'Access Controls'}} {{title 'Access Controls'}}
{{/if}} {{/if}}
{{#app-view class=(concat 'token ' (if (and isEnabled (not isAuthorized)) 'edit' 'list')) loading=isLoading authorized=isAuthorized enabled=isEnabled}} <AppView @class={{concat "token " (if (and isEnabled (not isAuthorized)) "edit" "list")}} @loading={{isLoading}} @authorized={{isAuthorized}} @enabled={{isEnabled}}>
{{#block-slot name='notification' as |status type subject|}} <BlockSlot @name="notification" as |status type subject|>
{{partial 'dc/acls/tokens/notifications'}} {{partial 'dc/acls/tokens/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Access Controls Access Controls
</h1> </h1>
{{#if isAuthorized }} {{#if isAuthorized }}
{{partial 'dc/acls/nav'}} {{partial 'dc/acls/nav'}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='disabled'}} <BlockSlot @name="disabled">
{{partial 'dc/acls/disabled'}} {{partial 'dc/acls/disabled'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='authorization'}} <BlockSlot @name="authorization">
{{partial 'dc/acls/authorization'}} {{partial 'dc/acls/authorization'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
<a data-test-create href="{{href-to 'dc.acls.tokens.create'}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.acls.tokens.create'}}" class="type-create">Create</a>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
<form class="filter-bar"> <form class="filter-bar">
{{freetext-filter searchable=searchable value=s placeholder="Search"}} <FreetextFilter @searchable={{searchable}} @value={{s}} @placeholder="Search" />
</form> </form>
{{/if}} {{/if}}
{{#if (token/is-legacy items)}} {{#if (token/is-legacy items)}}
<p data-test-notification-update class="notice info"><strong>Update.</strong> We have upgraded our ACL System to allow the creation of reusable policies that can be applied to tokens. Read more about the changes and how to upgrade legacy tokens in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p> <p data-test-notification-update class="notice info"><strong>Update.</strong> We have upgraded our ACL System to allow the creation of reusable policies that can be applied to tokens. Read more about the changes and how to upgrade legacy tokens in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.</p>
{{/if}} {{/if}}
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection <TabularCollection @items={{sort-by "CreateTime:desc" filtered}} as |item index|>
items=(sort-by 'CreateTime:desc' filtered) as |item index| <BlockSlot @name="header">
}}
{{#block-slot name='header'}}
<th>Accessor ID</th> <th>Accessor ID</th>
<th>Scope</th> <th>Scope</th>
<th>Description</th> <th>Description</th>
<th>Roles &amp; Policies</th> <th>Roles &amp; Policies</th>
<th>&nbsp;</th> <th>&nbsp;</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-token="{{item.AccessorID}}" class={{if (eq item.AccessorID token.AccessorID) 'me' }}> <td data-test-token="{{item.AccessorID}}" class={{if (eq item.AccessorID token.AccessorID) 'me' }}>
<a href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>{{truncate item.AccessorID 8 false}}</a> <a href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>{{truncate item.AccessorID 8 false}}</a>
</td> </td>
@ -67,18 +65,13 @@
{{#if (eq item.AccessorID token.AccessorID)}} {{#if (eq item.AccessorID token.AccessorID)}}
<td>Your token</td> <td>Your token</td>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}} @submenus={{array "logout" "use" "delete"}}>
expanded=(if (eq checked index) true false) <BlockSlot @name="trigger">
onchange=(action change index)
keyboardAccess=false
submenus=(array 'logout' 'use' 'delete')
}}
{{#block-slot name='trigger'}}
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
<li role="none"> <li role="none">
<a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>Edit</a> <a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.acls.tokens.edit' item.AccessorID}}>Edit</a>
</li> </li>
@ -161,16 +154,16 @@
</div> </div>
</li> </li>
{{/unless}} {{/unless}}
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no Tokens. There are no Tokens.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -5,43 +5,25 @@
<h2>Source</h2> <h2>Source</h2>
<label data-test-source-element class="type-text{{if item.error.SourceName ' has-error'}}"> <label data-test-source-element class="type-text{{if item.error.SourceName ' has-error'}}">
<span>Source Service</span> <span>Source Service</span>
{{#power-select-with-create <PowerSelectWithCreate @options={{services}} @searchField="Name" @selected={{SourceName}} @searchPlaceholder="Type service name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "SourceName"}} @onchange={{action "change" "SourceName"}} as |service|>
options=services
searchField='Name'
selected=SourceName
searchPlaceholder='Type service name'
buildSuggestion=(action 'createNewLabel' "Use a future Consul Service called '{{term}}'")
showCreateWhen=(action "isUnique")
oncreate=(action 'change' 'SourceName')
onchange=(action 'change' 'SourceName') as |service|
}}
{{#if (eq service.Name '*') }} {{#if (eq service.Name '*') }}
* (All Services) * (All Services)
{{else}} {{else}}
{{service.Name}} {{service.Name}}
{{/if}} {{/if}}
{{/power-select-with-create}} </PowerSelectWithCreate>
<em>Search for an existing service, write in a future one, or write in any Service URI.</em> <em>Search for an existing service, write in a future one, or write in any Service URI.</em>
</label> </label>
{{#if (env 'CONSUL_NSPACES_ENABLED')}} {{#if (env 'CONSUL_NSPACES_ENABLED')}}
<label data-test-source-nspace class="type-text{{if item.error.SourceNS ' has-error'}}"> <label data-test-source-nspace class="type-text{{if item.error.SourceNS ' has-error'}}">
<span>Source Namespace</span> <span>Source Namespace</span>
{{#power-select-with-create <PowerSelectWithCreate @options={{nspaces}} @searchField="Name" @selected={{SourceNS}} @searchPlaceholder="Type namespace name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "SourceNS"}} @onchange={{action "change" "SourceNS"}} as |nspace|>
options=nspaces
searchField='Name'
selected=SourceNS
searchPlaceholder='Type namespace name'
buildSuggestion=(action 'createNewLabel' "Use a future Consul Namespace called '{{term}}'")
showCreateWhen=(action "isUnique")
oncreate=(action 'change' 'SourceNS')
onchange=(action 'change' 'SourceNS') as |nspace|
}}
{{#if (eq nspace.Name '*') }} {{#if (eq nspace.Name '*') }}
* (All Namespaces) * (All Namespaces)
{{else}} {{else}}
{{nspace.Name}} {{nspace.Name}}
{{/if}} {{/if}}
{{/power-select-with-create}} </PowerSelectWithCreate>
<em>Search for an existing namespace, write in a future one.</em> <em>Search for an existing namespace, write in a future one.</em>
</label> </label>
{{/if}} {{/if}}
@ -50,43 +32,25 @@
<h2>Destination</h2> <h2>Destination</h2>
<label data-test-destination-element class="type-text{{if item.error.DestinationName ' has-error'}}"> <label data-test-destination-element class="type-text{{if item.error.DestinationName ' has-error'}}">
<span>Destination Service</span> <span>Destination Service</span>
{{#power-select-with-create <PowerSelectWithCreate @options={{services}} @searchField="Name" @selected={{DestinationName}} @searchPlaceholder="Type service name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "DestinationName"}} @onchange={{action "change" "DestinationName"}} as |service|>
options=services
searchField='Name'
selected=DestinationName
searchPlaceholder='Type service name'
buildSuggestion=(action 'createNewLabel' "Use a future Consul Service called '{{term}}'")
showCreateWhen=(action "isUnique")
oncreate=(action 'change' 'DestinationName')
onchange=(action 'change' 'DestinationName') as |service|
}}
{{#if (eq service.Name '*') }} {{#if (eq service.Name '*') }}
* (All Services) * (All Services)
{{else}} {{else}}
{{service.Name}} {{service.Name}}
{{/if}} {{/if}}
{{/power-select-with-create}} </PowerSelectWithCreate>
<em>Search for an existing service or write in a future one.</em> <em>Search for an existing service or write in a future one.</em>
</label> </label>
{{#if (env 'CONSUL_NSPACES_ENABLED')}} {{#if (env 'CONSUL_NSPACES_ENABLED')}}
<label data-test-destination-nspace class="type-text{{if item.error.DestinationNS ' has-error'}}"> <label data-test-destination-nspace class="type-text{{if item.error.DestinationNS ' has-error'}}">
<span>Destination Namespace</span> <span>Destination Namespace</span>
{{#power-select-with-create <PowerSelectWithCreate @options={{nspaces}} @searchField="Name" @selected={{DestinationNS}} @searchPlaceholder="Type namespace name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "DestinationNS"}} @onchange={{action "change" "DestinationNS"}} as |nspace|>
options=nspaces
searchField='Name'
selected=DestinationNS
searchPlaceholder='Type namespace name'
buildSuggestion=(action 'createNewLabel' "Use a future Consul Namespace called '{{term}}'")
showCreateWhen=(action "isUnique")
oncreate=(action 'change' 'DestinationNS')
onchange=(action 'change' 'DestinationNS') as |nspace|
}}
{{#if (eq nspace.Name '*') }} {{#if (eq nspace.Name '*') }}
* (All Namespaces) * (All Namespaces)
{{else}} {{else}}
{{nspace.Name}} {{nspace.Name}}
{{/if}} {{/if}}
{{/power-select-with-create}} </PowerSelectWithCreate>
<em>For the destination, you may choose any namespace for which you have access.</em> <em>For the destination, you may choose any namespace for which you have access.</em>
</label> </label>
{{/if}} {{/if}}
@ -113,14 +77,14 @@
{{/if}} {{/if}}
<button type="reset" {{ action "cancel" item}}>Cancel</button> <button type="reset" {{ action "cancel" item}}>Cancel</button>
{{# if (and item.ID (not-eq item.ID 'anonymous')) }} {{# if (and item.ID (not-eq item.ID 'anonymous')) }}
{{#confirmation-dialog message='Are you sure you want to delete this Intention?'}} <ConfirmationDialog @message="Are you sure you want to delete this Intention?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button> <button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
{{delete-confirmation message=message execute=execute cancel=cancel}} <DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
</div> </div>
</form> </form>

View File

@ -4,16 +4,16 @@
{{title 'New Intention'}} {{title 'New Intention'}}
{{/if}} {{/if}}
{{#app-view class="intention edit" loading=isLoading}} <AppView @class="intention edit" @loading={{isLoading}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/intentions/notifications'}} {{partial 'dc/intentions/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.intentions'}}>All Intentions</a></li> <li><a data-test-back href={{href-to 'dc.intentions'}}>All Intentions</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if item.ID }} {{#if item.ID }}
Edit Intention Edit Intention
@ -21,29 +21,29 @@
New Intention New Intention
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
{{#if (not create) }} {{#if (not create) }}
{{#feedback-dialog type='inline'}} <FeedbackDialog @type="inline">
{{#block-slot name='action' as |success error|}} <BlockSlot @name="action" as |success error|>
{{#copy-button success=(action success) error=(action error) clipboardText=item.ID title='copy UUID to clipboard'}} <CopyButton @success={{action success}} @error={{action error}} @clipboardText={{item.ID}} @title="copy UUID to clipboard">
Copy UUID Copy UUID
{{/copy-button}} </CopyButton>
{{/block-slot}} </BlockSlot>
{{#block-slot name='success' as |transition|}} <BlockSlot @name="success" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Copied UUID! Copied UUID!
</p> </p>
{{/block-slot}} </BlockSlot>
{{#block-slot name='error' as |transition|}} <BlockSlot @name="error" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Sorry, something went wrong! Sorry, something went wrong!
</p> </p>
{{/block-slot}} </BlockSlot>
{{/feedback-dialog}} </FeedbackDialog>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{ partial 'dc/intentions/form'}} {{ partial 'dc/intentions/form'}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,37 +1,33 @@
{{title 'Intentions'}} {{title 'Intentions'}}
{{#app-view class="intention list"}} <AppView @class="intention list">
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/intentions/notifications'}} {{partial 'dc/intentions/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Intentions <em>{{format-number items.length}} total</em> Intentions <em>{{format-number items.length}} total</em>
</h1> </h1>
<label for="toolbar-toggle"></label> <label for="toolbar-toggle"></label>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
<a data-test-create href="{{href-to 'dc.intentions.create'}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.intentions.create'}}" class="type-create">Create</a>
{{/block-slot}} </BlockSlot>
{{#block-slot name='toolbar'}} <BlockSlot @name="toolbar">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
{{intention-filter searchable=searchable filters=actionFilters search=filters.s type=filters.action onchange=(action 'filter')}} <IntentionFilter @searchable={{searchable}} @selected={{currentFilter}} @filters={{actionFilters}} @search={{filters.s}} @type={{filters.action}} @onchange={{action "filter"}} />
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection <TabularCollection @route="dc.intentions.edit" @key="SourceName" @items={{filtered}} as |item index|>
route='dc.intentions.edit' <BlockSlot @name="header">
key='SourceName'
items=filtered as |item index|
}}
{{#block-slot name='header'}}
<th>Source</th> <th>Source</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>Destination</th> <th>Destination</th>
<th>Precedence</th> <th>Precedence</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td class="source" data-test-intention="{{item.ID}}"> <td class="source" data-test-intention="{{item.ID}}">
<a href={{href-to 'dc.intentions.edit' item.ID}} data-test-intention-source="{{item.SourceName}}"> <a href={{href-to 'dc.intentions.edit' item.ID}} data-test-intention-source="{{item.SourceName}}">
{{#if (eq item.SourceName '*') }} {{#if (eq item.SourceName '*') }}
@ -60,13 +56,13 @@
<td class="precedence"> <td class="precedence">
{{item.Precedence}} {{item.Precedence}}
</td> </td>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu expanded=(if (eq checked index) true false) onchange=(action change index) keyboardAccess=false}} <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}}>
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
<li role="none"> <li role="none">
<a role="menuitem" tabindex="-1" href={{href-to 'dc.intentions.edit' item.ID}}>Edit</a> <a role="menuitem" tabindex="-1" href={{href-to 'dc.intentions.edit' item.ID}}>Edit</a>
</li> </li>
@ -93,16 +89,16 @@
</div> </div>
</div> </div>
</li> </li>
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no intentions. There are no intentions.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -18,7 +18,7 @@
<label class="type-text{{if item.error.Value ' has-error'}}"> <label class="type-text{{if item.error.Value ' has-error'}}">
<span>Value</span> <span>Value</span>
{{#if json}} {{#if json}}
{{code-editor value=(atob item.Value) onkeyup=(action 'change' 'value')}} <CodeEditor @value={{atob item.Value}} @onkeyup={{action "change" "value"}} />
{{else}} {{else}}
<textarea autofocus={{not create}} name="value" oninput={{action 'change'}}>{{atob item.Value}}</textarea> <textarea autofocus={{not create}} name="value" oninput={{action 'change'}}>{{atob item.Value}}</textarea>
{{/if}} {{/if}}
@ -33,14 +33,14 @@
{{ else }} {{ else }}
<button type="submit" {{ action "update" item parent}} disabled={{if item.isInvalid 'disabled'}}>Save</button> <button type="submit" {{ action "update" item parent}} disabled={{if item.isInvalid 'disabled'}}>Save</button>
<button type="reset" {{ action "cancel" item parent}}>Cancel changes</button> <button type="reset" {{ action "cancel" item parent}}>Cancel changes</button>
{{#confirmation-dialog message='Are you sure you want to delete this key?'}} <ConfirmationDialog @message="Are you sure you want to delete this key?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button> <button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
{{delete-confirmation message=message execute=execute cancel=cancel}} <DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
</form> </form>

View File

@ -3,11 +3,11 @@
{{else}} {{else}}
{{title 'Edit Key/Value'}} {{title 'Edit Key/Value'}}
{{/if}} {{/if}}
{{#app-view class="kv edit" loading=isLoading}} <AppView @class="kv edit" @loading={{isLoading}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/kv/notifications'}} {{partial 'dc/kv/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.kv.index'}}>Key / Values</a></li> <li><a data-test-back href={{href-to 'dc.kv.index'}}>Key / Values</a></li>
{{#if (not-eq parent.Key '/')}} {{#if (not-eq parent.Key '/')}}
@ -16,8 +16,8 @@
{{/each}} {{/each}}
{{/if}} {{/if}}
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if item.Key}} {{#if item.Key}}
{{left-trim item.Key parent.Key}} {{left-trim item.Key parent.Key}}
@ -25,8 +25,8 @@
New Key / Value New Key / Value
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if session}} {{#if session}}
<p class="notice warning"> <p class="notice warning">
<strong>Warning.</strong> This KV has a lock session. You can edit KV's with lock sessions, but we recommend doing so with care, or not doing so at all. It may negatively impact the active node it's associated with. See below for more details on the Lock Session and see <a href="{{env 'CONSUL_DOCS_URL'}}/internals/sessions.html" target="_blank" rel="noopener noreferrer">our documentation</a> for more information. <strong>Warning.</strong> This KV has a lock session. You can edit KV's with lock sessions, but we recommend doing so with care, or not doing so at all. It may negatively impact the active node it's associated with. See below for more details on the Lock Session and see <a href="{{env 'CONSUL_DOCS_URL'}}/internals/sessions.html" target="_blank" rel="noopener noreferrer">our documentation</a> for more information.
@ -64,19 +64,19 @@
</dd> </dd>
{{/if}} {{/if}}
</dl> </dl>
{{#confirmation-dialog message='Are you sure you want to invalidate this session?'}} <ConfirmationDialog @message="Are you sure you want to invalidate this session?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button type="button" data-test-delete class="type-delete" {{action confirm "invalidateSession" session}}>Invalidate Session</button> <button type="button" data-test-delete class="type-delete" {{action confirm "invalidateSession" session}}>Invalidate Session</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
<p> <p>
{{message}} {{message}}
</p> </p>
<button type="button" class="type-delete" {{action execute}}>Confirm Invalidation</button> <button type="button" class="type-delete" {{action execute}}>Confirm Invalidation</button>
<button type="button" class="type-cancel" {{action cancel}}>Cancel</button> <button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
</div> </div>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,9 +1,9 @@
{{title 'Key/Value'}} {{title 'Key/Value'}}
{{#app-view class="kv list" loading=isLoading}} <AppView @class="kv list" @loading={{isLoading}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/kv/notifications'}} {{partial 'dc/kv/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
{{#if (not-eq parent.Key '/') }} {{#if (not-eq parent.Key '/') }}
<li><a href={{href-to 'dc.kv'}}>Key / Values</a></li> <li><a href={{href-to 'dc.kv'}}>Key / Values</a></li>
@ -12,8 +12,8 @@
<li><a href={{href-to 'dc.kv.folder' (join '/' (append (slice 0 (add index 1) (split parent.Key '/')) ''))}}>{{breadcrumb}}</a></li> <li><a href={{href-to 'dc.kv.folder' (join '/' (append (slice 0 (add index 1) (split parent.Key '/')) ''))}}>{{breadcrumb}}</a></li>
{{/each}} {{/each}}
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if (eq parent.Key '/')}} {{#if (eq parent.Key '/')}}
Key / Value Key / Value
@ -22,41 +22,39 @@
{{/if}} {{/if}}
</h1> </h1>
<label for="toolbar-toggle"></label> <label for="toolbar-toggle"></label>
{{/block-slot}} </BlockSlot>
{{#block-slot name='toolbar'}} <BlockSlot @name="toolbar">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
<form class="filter-bar"> <form class="filter-bar">
{{freetext-filter searchable=searchable value=s placeholder="Search by name"}} <FreetextFilter @searchable={{searchable}} @value={{s}} @placeholder="Search by name" />
</form> </form>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
{{#if (not-eq parent.Key '/') }} {{#if (not-eq parent.Key '/') }}
<a data-test-create href="{{href-to 'dc.kv.create' parent.Key}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.kv.create' parent.Key}}" class="type-create">Create</a>
{{else}} {{else}}
<a data-test-create href="{{href-to 'dc.kv.root-create'}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.kv.root-create'}}" class="type-create">Create</a>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection <TabularCollection @items={{sort-by "isFolder:desc" "Key:asc" filtered}} as |item index|>
items=(sort-by 'isFolder:desc' 'Key:asc' filtered) as |item index| <BlockSlot @name="header">
}}
{{#block-slot name='header'}}
<th>Name</th> <th>Name</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-kv={{item.Key}} class={{if item.isFolder 'folder' 'file' }}> <td data-test-kv={{item.Key}} class={{if item.isFolder 'folder' 'file' }}>
<a href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key}}>{{right-trim (left-trim item.Key parent.Key) '/'}}</a> <a href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key}}>{{right-trim (left-trim item.Key parent.Key) '/'}}</a>
</td> </td>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu expanded=(if (eq checked index) true false) onchange=(action change index) keyboardAccess=false}} <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}}>
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
<li role="none"> <li role="none">
<a data-test-edit role="menuitem" tabindex="-1" href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key}}>{{if item.isFolder 'View' 'Edit'}}</a> <a data-test-edit role="menuitem" tabindex="-1" href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key}}>{{if item.isFolder 'View' 'Edit'}}</a>
</li> </li>
@ -83,16 +81,16 @@
</div> </div>
</div> </div>
</li> </li>
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no Key / Value pairs. There are no Key / Value pairs.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,5 +1,5 @@
{{#if (gt item.Checks.length 0) }} {{#if (gt item.Checks.length 0) }}
{{healthcheck-list items=item.Checks}} <HealthcheckList @items={{item.Checks}} />
{{else}} {{else}}
<p> <p>
This node has no health checks. This node has no health checks.

View File

@ -18,5 +18,5 @@
{{format-number tomography.max maximumFractionDigits=2}}ms {{format-number tomography.max maximumFractionDigits=2}}ms
</dd> </dd>
</dl> </dl>
{{tomography-graph tomography=tomography}} <TomographyGraph @tomography={{tomography}} />

View File

@ -1,21 +1,21 @@
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
<input type="checkbox" id="toolbar-toggle" /> <input type="checkbox" id="toolbar-toggle" />
<form class="filter-bar"> <form class="filter-bar">
{{freetext-filter searchable=searchable value=s placeholder="Search by name/port"}} <FreetextFilter @searchable={{searchable}} @value={{s}} @placeholder="Search by name/port" />
</form> </form>
{{/if}} {{/if}}
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection {{#tabular-collection
data-test-services data-test-services
items=filtered as |item index| items=filtered as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Service</th> <th>Service</th>
<th>Port</th> <th>Port</th>
<th>Tags</th> <th>Tags</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-service-name="{{item.Service}}"> <td data-test-service-name="{{item.Service}}">
<a href={{href-to 'dc.services.show' item.Service}}> <a href={{href-to 'dc.services.show' item.Service}}>
{{#let (service/external-source item) as |externalSource| }} {{#let (service/external-source item) as |externalSource| }}
@ -32,14 +32,14 @@
{{item.Port}} {{item.Port}}
</td> </td>
<td data-test-service-tags> <td data-test-service-tags>
{{tag-list items=item.Tags}} <TagList @items={{item.Tags}} />
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no services. There are no services.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>

View File

@ -4,7 +4,7 @@
class="sessions" class="sessions"
items=sessions as |item index| items=sessions as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Name</th> <th>Name</th>
<th>ID</th> <th>ID</th>
<th>Delay</th> <th>Delay</th>
@ -12,8 +12,8 @@
<th>Behavior</th> <th>Behavior</th>
<th>Checks</th> <th>Checks</th>
<th>&nbsp;</th> <th>&nbsp;</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td> <td>
{{item.Name}} {{item.Name}}
</td> </td>
@ -35,20 +35,20 @@
{{/if}} {{/if}}
</td> </td>
<td> <td>
{{#confirmation-dialog message='Are you sure you want to invalidate this session?'}} <ConfirmationDialog @message="Are you sure you want to invalidate this session?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button data-test-delete type="button" class="type-delete" {{action confirm 'invalidateSession' item}}>Invalidate</button> <button data-test-delete type="button" class="type-delete" {{action confirm 'invalidateSession' item}}>Invalidate</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
<p> <p>
{{message}} {{message}}
</p> </p>
<button type="button" class="type-delete" {{action execute}}>Confirm Invalidate</button> <button type="button" class="type-delete" {{action execute}}>Confirm Invalidate</button>
<button type="button" class="type-cancel" {{ action cancel}}>Cancel</button> <button type="button" class="type-cancel" {{ action cancel}}>Cancel</button>
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{else}} {{else}}
<p> <p>

View File

@ -1,48 +1,41 @@
{{title 'Nodes'}} {{title 'Nodes'}}
{{#app-view class="node list"}} <AppView @class="node list">
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Nodes <em>{{format-number items.length}} total</em> Nodes <em>{{format-number items.length}} total</em>
</h1> </h1>
<label for="toolbar-toggle"></label> <label for="toolbar-toggle"></label>
{{/block-slot}} </BlockSlot>
{{#block-slot name='toolbar'}} <BlockSlot @name="toolbar">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
{{catalog-filter searchable=(array searchableHealthy searchableUnhealthy) search=s status=filters.status onchange=(action 'filter')}} <CatalogFilter @searchable={{array searchableHealthy searchableUnhealthy}} @search={{s}} @status={{filters.status}} @onchange={{action "filter"}} />
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if (gt unhealthy.length 0) }} {{#if (gt unhealthy.length 0) }}
<div class="unhealthy"> <div class="unhealthy">
<h2>Unhealthy Nodes</h2> <h2>Unhealthy Nodes</h2>
<div> <div>
{{! think about 2 differing views here }} {{! think about 2 differing views here }}
<ul> <ul>
{{#changeable-set dispatcher=searchableUnhealthy}} <ChangeableSet @dispatcher={{searchableUnhealthy}}>
{{#block-slot name='set' as |unhealthy|}} <BlockSlot @name="set" as |unhealthy|>
{{#each unhealthy as |item|}} {{#each unhealthy as |item|}}
{{#healthchecked-resource <HealthcheckedResource @tagName="li" @data-test-node={{item.Node}} @href={{href-to "dc.nodes.show" item.Node}} @name={{item.Node}} @address={{item.Address}} @checks={{item.Checks}}>
tagName='li' <BlockSlot @name="icon">
data-test-node=item.Node
href=(href-to 'dc.nodes.show' item.Node)
name=item.Node
address=item.Address
checks=item.Checks
}}
{{#block-slot name='icon'}}
{{#if (eq item.Address leader.Address)}} {{#if (eq item.Address leader.Address)}}
<span data-test-leader={{leader.Address}} data-tooltip="Leader">Leader</span> <span data-test-leader={{leader.Address}} data-tooltip="Leader">Leader</span>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/healthchecked-resource}} </HealthcheckedResource>
{{/each}} {{/each}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no unhealthy nodes for that search. There are no unhealthy nodes for that search.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
</ul> </ul>
</div> </div>
</div> </div>
@ -50,30 +43,24 @@
{{#if (gt healthy.length 0) }} {{#if (gt healthy.length 0) }}
<div class="healthy"> <div class="healthy">
<h2>Healthy Nodes</h2> <h2>Healthy Nodes</h2>
{{#changeable-set dispatcher=searchableHealthy}} <ChangeableSet @dispatcher={{searchableHealthy}}>
{{#block-slot name='set' as |healthy|}} <BlockSlot @name="set" as |healthy|>
{{#list-collection cellHeight=92 items=healthy as |item index|}} <ListCollection @cellHeight={{92}} @items={{healthy}} as |item index|>
{{#healthchecked-resource <HealthcheckedResource @data-test-node={{item.Node}} @href={{href-to "dc.nodes.show" item.Node}} @name={{item.Node}} @address={{item.Address}} @checks={{item.Checks}}>
data-test-node=item.Node <BlockSlot @name="icon">
href=(href-to 'dc.nodes.show' item.Node)
name=item.Node
address=item.Address
checks=item.Checks
}}
{{#block-slot name='icon'}}
{{#if (eq item.Address leader.Address)}} {{#if (eq item.Address leader.Address)}}
<span data-test-leader={{leader.Address}} data-tooltip="Leader">Leader</span> <span data-test-leader={{leader.Address}} data-tooltip="Leader">Leader</span>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/healthchecked-resource}} </HealthcheckedResource>
{{/list-collection}} </ListCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no healthy nodes for that search. There are no healthy nodes for that search.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
</div> </div>
{{/if}} {{/if}}
{{#if (and (eq healthy.length 0) (eq unhealthy.length 0)) }} {{#if (and (eq healthy.length 0) (eq unhealthy.length 0)) }}
@ -81,5 +68,5 @@
There are no nodes. There are no nodes.
</p> </p>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -4,11 +4,11 @@
data-test-metadata data-test-metadata
items=meta as |item index| items=meta as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Key</th> <th>Key</th>
<th>Value</th> <th>Value</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td> <td>
<span> <span>
{{object-at 0 item}} {{object-at 0 item}}
@ -17,7 +17,7 @@
<td> <td>
<span>{{object-at 1 item}}</span> <span>{{object-at 1 item}}</span>
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{/with}} {{/with}}
{{else}} {{else}}

View File

@ -1,52 +1,41 @@
{{title item.Node}} {{title item.Node}}
{{#app-view class="node show"}} <AppView @class="node show">
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{!TODO: Move sessions to its own folder within nodes }} {{!TODO: Move sessions to its own folder within nodes }}
{{partial 'dc/nodes/notifications'}} {{partial 'dc/nodes/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.nodes'}}>All Nodes</a></li> <li><a data-test-back href={{href-to 'dc.nodes'}}>All Nodes</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{ item.Node }} {{ item.Node }}
</h1> </h1>
<label for="toolbar-toggle"></label> <label for="toolbar-toggle"></label>
{{tab-nav <TabNav @items={{compact (array "Health Checks" "Services" (if tomography.distances "Round Trip Time" "") "Lock Sessions" "Meta Data")}} @selected={{selectedTab}} />
items=(compact </BlockSlot>
(array <BlockSlot @name="actions">
'Health Checks' <FeedbackDialog @type="inline">
'Services' <BlockSlot @name="action" as |success error|>
(if tomography.distances 'Round Trip Time' '') <CopyButton @success={{action success}} @error={{action error}} @clipboardText={{item.Address}} @title="copy IP address to clipboard">
'Lock Sessions'
'Meta Data'
)
)
selected=selectedTab
}}
{{/block-slot}}
{{#block-slot name='actions'}}
{{#feedback-dialog type='inline'}}
{{#block-slot name='action' as |success error|}}
{{#copy-button success=(action success) error=(action error) clipboardText=item.Address title='copy IP address to clipboard'}}
{{item.Address}} {{item.Address}}
{{/copy-button}} </CopyButton>
{{/block-slot}} </BlockSlot>
{{#block-slot name='success' as |transition|}} <BlockSlot @name="success" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Copied IP Address! Copied IP Address!
</p> </p>
{{/block-slot}} </BlockSlot>
{{#block-slot name='error' as |transition|}} <BlockSlot @name="error" as |transition|>
<p class={{transition}}> <p class={{transition}}>
Sorry, something went wrong! Sorry, something went wrong!
</p> </p>
{{/block-slot}} </BlockSlot>
{{/feedback-dialog}} </FeedbackDialog>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#each {{#each
(compact (compact
(array (array
@ -58,9 +47,11 @@
) )
) key="id" as |panel| ) key="id" as |panel|
}} }}
{{#tab-section id=panel.id selected=(eq (if selectedTab selectedTab '') panel.id) onchange=(action "change")}} {{#if (or (not-eq panel.id 'round-trip-time') (gt tomography.distances.length 0)) }}
<TabSection @id={{panel.id}} @selected={{eq (if selectedTab selectedTab "") panel.id}} @onchange={{action "change"}}>
{{partial panel.partial}} {{partial panel.partial}}
{{/tab-section}} </TabSection>
{{/if}}
{{/each}} {{/each}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -23,14 +23,14 @@
<p> <p>
By adding roles to this namespaces, you will apply them to all tokens created within this namespace. By adding roles to this namespaces, you will apply them to all tokens created within this namespace.
</p> </p>
{{role-selector dc=dc nspace='default' items=item.ACLs.RoleDefaults}} <RoleSelector @dc={{dc}} @nspace="default" @items={{item.ACLs.RoleDefaults}} />
</fieldset> </fieldset>
<fieldset id="policies"> <fieldset id="policies">
<h2>Policies</h2> <h2>Policies</h2>
<p> <p>
By adding policies to this namespaces, you will apply them to all tokens created within this namespace. By adding policies to this namespaces, you will apply them to all tokens created within this namespace.
</p> </p>
{{policy-selector dc=dc nspace='default' allowServiceIdentity=false items=item.ACLs.PolicyDefaults}} <PolicySelector @dc={{dc}} @nspace="default" @allowServiceIdentity={{false}} @items={{item.ACLs.PolicyDefaults}} />
</fieldset> </fieldset>
{{/if}} {{/if}}
<div> <div>
@ -41,14 +41,14 @@
{{/if}} {{/if}}
<button type="reset" {{ action "cancel" item}}>Cancel</button> <button type="reset" {{ action "cancel" item}}>Cancel</button>
{{# if (and (not create) (not-eq item.Name 'default')) }} {{# if (and (not create) (not-eq item.Name 'default')) }}
{{#confirmation-dialog message='Are you sure you want to delete this Namespace?'}} <ConfirmationDialog @message="Are you sure you want to delete this Namespace?">
{{#block-slot name='action' as |confirm|}} <BlockSlot @name="action" as |confirm|>
<button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button> <button data-test-delete type="button" class="type-delete" {{action confirm 'delete' item parent}}>Delete</button>
{{/block-slot}} </BlockSlot>
{{#block-slot name='dialog' as |execute cancel message|}} <BlockSlot @name="dialog" as |execute cancel message|>
{{delete-confirmation message=message execute=execute cancel=cancel}} <DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/block-slot}} </BlockSlot>
{{/confirmation-dialog}} </ConfirmationDialog>
{{/if}} {{/if}}
</div> </div>
</form> </form>

View File

@ -3,16 +3,16 @@
{{else}} {{else}}
{{title 'Edit Namespace'}} {{title 'Edit Namespace'}}
{{/if}} {{/if}}
{{#app-view class="nspace edit" loading=isLoading}} <AppView @class="nspace edit" @loading={{isLoading}}>
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/nspaces/notifications'}} {{partial 'dc/nspaces/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.nspaces'}}>All Namespaces</a></li> <li><a data-test-back href={{href-to 'dc.nspaces'}}>All Namespaces</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{#if create }} {{#if create }}
New Namespace New Namespace
@ -20,10 +20,10 @@
Edit {{item.Name}} Edit {{item.Name}}
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{ partial 'dc/nspaces/form'}} {{ partial 'dc/nspaces/form'}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,35 +1,33 @@
{{title 'Namespaces'}} {{title 'Namespaces'}}
{{#app-view class="nspace list" loading=isLoading}} <AppView @class="nspace list" @loading={{isLoading}}>
{{#block-slot name='notification' as |status type subject|}} <BlockSlot @name="notification" as |status type subject|>
{{partial 'dc/nspaces/notifications'}} {{partial 'dc/nspaces/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Namespaces Namespaces
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions'}} <BlockSlot @name="actions">
<a data-test-create href="{{href-to 'dc.nspaces.create'}}" class="type-create">Create</a> <a data-test-create href="{{href-to 'dc.nspaces.create'}}" class="type-create">Create</a>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
<form class="filter-bar"> <form class="filter-bar">
{{freetext-filter searchable=searchable value=s placeholder="Search"}} <FreetextFilter @searchable={{searchable}} @value={{s}} @placeholder="Search" />
</form> </form>
{{/if}} {{/if}}
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection <TabularCollection @items={{filtered}} as |item index|>
items=filtered as |item index| <BlockSlot @name="header">
}}
{{#block-slot name='header'}}
<th>Name</th> <th>Name</th>
<th>Description</th> <th>Description</th>
{{#if (env 'CONSUL_ACLS_ENABLED')}} {{#if (env 'CONSUL_ACLS_ENABLED')}}
<th>Roles &amp; Policies</th> <th>Roles &amp; Policies</th>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
{{#if item.DeletedAt}} {{#if item.DeletedAt}}
<td class="no-actions" colspan="3"> <td class="no-actions" colspan="3">
<p> <p>
@ -51,13 +49,13 @@
</td> </td>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='actions' as |index change checked|}} <BlockSlot @name="actions" as |index change checked|>
{{#popover-menu expanded=(if (eq checked index) true false) onchange=(action change index) keyboardAccess=false}} <PopoverMenu @expanded={{if (eq checked index) true false}} @onchange={{action change index}} @keyboardAccess={{false}}>
{{#block-slot name='trigger'}} <BlockSlot @name="trigger">
More More
{{/block-slot}} </BlockSlot>
{{#block-slot name='menu' as |confirm send keypressClick|}} <BlockSlot @name="menu" as |confirm send keypressClick|>
<li role="none"> <li role="none">
<a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.nspaces.edit' item.Name}}>Edit</a> <a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.nspaces.edit' item.Name}}>Edit</a>
</li> </li>
@ -86,16 +84,16 @@
</div> </div>
</li> </li>
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{/popover-menu}} </PopoverMenu>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} </TabularCollection>
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no Namespaces. There are no Namespaces.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -3,11 +3,11 @@
data-test-addresses data-test-addresses
items=(object-entries item.TaggedAddresses) as |taggedAddress index| items=(object-entries item.TaggedAddresses) as |taggedAddress index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Tag</th> <th>Tag</th>
<th>Address</th> <th>Address</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
{{#with (object-at 1 taggedAddress) as |address|}} {{#with (object-at 1 taggedAddress) as |address|}}
<td> <td>
{{object-at 0 taggedAddress}}{{#if (and (eq address.Address item.Address) (eq address.Port item.Port))}}&nbsp;<em data-test-address-default>(default)</em>{{/if}} {{object-at 0 taggedAddress}}{{#if (and (eq address.Address item.Address) (eq address.Port item.Port))}}&nbsp;<em data-test-address-default>(default)</em>{{/if}}
@ -16,7 +16,7 @@
{{address.Address}}:{{address.Port}} {{address.Address}}:{{address.Port}}
</td> </td>
{{/with}} {{/with}}
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{else}} {{else}}
<p> <p>

View File

@ -6,14 +6,14 @@
class="exposedpaths" class="exposedpaths"
items=item.Proxy.Expose.Paths as |path index| items=item.Proxy.Expose.Paths as |path index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Path</th> <th>Path</th>
<th>Protocol</th> <th>Protocol</th>
<th>Listener port</th> <th>Listener port</th>
<th>Local path port</th> <th>Local path port</th>
<th>Combined address<span><em role="tooltip">Service address, listener port, and path all combined into one URL.</em></span></th> <th>Combined address<span><em role="tooltip">Service address, listener port, and path all combined into one URL.</em></span></th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td> <td>
<span>{{path.Path}}</span> <span>{{path.Path}}</span>
</td> </td>
@ -29,5 +29,5 @@
<td> <td>
<span data-test-combined-address>{{item.Address}}:{{path.ListenerPort}}{{path.Path}}</span> <span data-test-combined-address>{{item.Address}}:{{path.ListenerPort}}{{path.Path}}</span>
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}

View File

@ -1,23 +1,23 @@
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
<input type="checkbox" id="toolbar-toggle" /> <input type="checkbox" id="toolbar-toggle" />
<form class="filter-bar"> <form class="filter-bar">
{{freetext-filter searchable=searchable value=s placeholder="Search"}} <FreetextFilter @searchable={{searchable}} @value={{s}} @placeholder="Search" />
</form> </form>
{{/if}} {{/if}}
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{#tabular-collection {{#tabular-collection
data-test-instances data-test-instances
items=filtered as |item index| items=filtered as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>ID</th> <th>ID</th>
<th>Node</th> <th>Node</th>
<th>Address</th> <th>Address</th>
<th>Node Checks</th> <th>Node Checks</th>
<th>Service Checks</th> <th>Service Checks</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td data-test-id={{item.Service.ID}}> <td data-test-id={{item.Service.ID}}>
<a href={{href-to 'dc.services.instance' item.Service.Service item.Node.Node (or item.Service.ID item.Service.Service)}}> <a href={{href-to 'dc.services.instance' item.Service.Service item.Node.Node (or item.Service.ID item.Service.Service)}}>
{{#let (service/external-source item.Service) as |externalSource| }} {{#let (service/external-source item.Service) as |externalSource| }}
@ -38,24 +38,20 @@
</td> </td>
<td> <td>
{{#with (reject-by 'ServiceID' '' item.Checks) as |checks|}} {{#with (reject-by 'ServiceID' '' item.Checks) as |checks|}}
{{healthcheck-info <HealthcheckInfo @passing={{filter-by "Status" "passing" checks}} @warning={{filter-by "Status" "warning" checks}} @critical={{filter-by "Status" "critical" checks}} />
passing=(filter-by 'Status' 'passing' checks) warning=(filter-by 'Status' 'warning' checks) critical=(filter-by 'Status' 'critical' checks)
}}
{{/with}} {{/with}}
</td> </td>
<td> <td>
{{#with (filter-by 'ServiceID' '' item.Checks) as |checks|}} {{#with (filter-by 'ServiceID' '' item.Checks) as |checks|}}
{{healthcheck-info <HealthcheckInfo @passing={{filter-by "Status" "passing" checks}} @warning={{filter-by "Status" "warning" checks}} @critical={{filter-by "Status" "critical" checks}} />
passing=(filter-by 'Status' 'passing' checks) warning=(filter-by 'Status' 'warning' checks) critical=(filter-by 'Status' 'critical' checks)
}}
{{/with}} {{/with}}
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no services. There are no services.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>

View File

@ -1,5 +1,5 @@
{{#if (gt item.NodeChecks.length 0) }} {{#if (gt item.NodeChecks.length 0) }}
{{healthcheck-list items=item.NodeChecks}} <HealthcheckList @items={{item.NodeChecks}} />
{{else}} {{else}}
<p> <p>
This instance has no node health checks. This instance has no node health checks.

View File

@ -1 +1 @@
{{discovery-chain chain=chain.Chain}} <DiscoveryChain @chain={{chain.Chain}} />

View File

@ -1,5 +1,5 @@
{{#if (gt item.ServiceChecks.length 0) }} {{#if (gt item.ServiceChecks.length 0) }}
{{healthcheck-list items=item.ServiceChecks exposed=proxy.ServiceProxy.Expose.Checks}} <HealthcheckList @items={{item.ServiceChecks}} @exposed={{proxy.ServiceProxy.Expose.Checks}} />
{{else}} {{else}}
<p> <p>
This instance has no service health checks. This instance has no service health checks.

View File

@ -1,5 +1,5 @@
{{#if (gt item.Tags.length 0) }} {{#if (gt item.Tags.length 0) }}
{{tag-list items=item.Tags}} <TagList @items={{item.Tags}} />
{{else}} {{else}}
<p> <p>
There are no tags. There are no tags.

View File

@ -3,13 +3,13 @@
data-test-upstreams data-test-upstreams
items=item.Proxy.Upstreams as |item index| items=item.Proxy.Upstreams as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Upstream</th> <th>Upstream</th>
<th>Datacenter</th> <th>Datacenter</th>
<th>Type</th> <th>Type</th>
<th>Local Bind Address</th> <th>Local Bind Address</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td> <td>
<a data-test-destination-name> <a data-test-destination-name>
{{item.DestinationName}} {{item.DestinationName}}
@ -30,7 +30,7 @@
<td data-test-local-bind-address> <td data-test-local-bind-address>
{{item.LocalBindAddress}}:{{item.LocalBindPort}} {{item.LocalBindAddress}}:{{item.LocalBindPort}}
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{else}} {{else}}
<p> <p>

View File

@ -1,35 +1,30 @@
{{title 'Services'}} {{title 'Services'}}
{{#app-view class="service list"}} <AppView @class="service list">
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/services/notifications'}} {{partial 'dc/services/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Services <em>{{format-number items.length}} total</em> Services <em>{{format-number items.length}} total</em>
</h1> </h1>
<label for="toolbar-toggle"></label> <label for="toolbar-toggle"></label>
{{/block-slot}} </BlockSlot>
{{#block-slot name='toolbar'}} <BlockSlot @name="toolbar">
{{#if (gt items.length 0) }} {{#if (gt items.length 0) }}
{{phrase-editor <PhraseEditor @placeholder="service:name tag:name status:critical search-term" @value={{slice 0 terms.length terms}} @onchange={{action (mut terms) value='target.value'}} @searchable={{searchable}} />
placeholder='service:name tag:name status:critical search-term'
value=(slice 0 terms.length terms)
onchange=(action (mut terms) value='target.value')
searchable=searchable
}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#changeable-set dispatcher=searchable}} <ChangeableSet @dispatcher={{searchable}}>
{{#block-slot name='set' as |filtered|}} <BlockSlot @name="set" as |filtered|>
{{consul-service-list routeName="dc.services.show" items=filtered}} <ConsulServiceList @routeName="dc.services.show" @items={{filtered}} />
{{/block-slot}} </BlockSlot>
{{#block-slot name='empty'}} <BlockSlot @name="empty">
<p> <p>
There are no services. There are no services.
</p> </p>
{{/block-slot}} </BlockSlot>
{{/changeable-set}} </ChangeableSet>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,16 +1,16 @@
{{title item.ID}} {{title item.ID}}
{{#app-view class="instance show"}} <AppView @class="instance show">
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/services/notifications'}} {{partial 'dc/services/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.services'}}>All Services</a></li> <li><a data-test-back href={{href-to 'dc.services'}}>All Services</a></li>
<li><a data-test-back href={{href-to 'dc.services.show'}}>Service ({{item.Service}})</a></li> <li><a data-test-back href={{href-to 'dc.services.show'}}>Service ({{item.Service}})</a></li>
<li><strong>Instance</strong></li> <li><strong>Instance</strong></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{ item.ID }} {{ item.ID }}
{{#let (service/external-source item) as |externalSource| }} {{#let (service/external-source item) as |externalSource| }}
@ -60,32 +60,9 @@
</dl> </dl>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{tab-nav <TabNav @items={{compact (array "Service Checks" "Node Checks" (if (eq item.Kind "connect-proxy") "Upstreams" "") (if (and (eq item.Kind "connect-proxy") (gt item.Proxy.Expose.Paths.length 0)) "Exposed Paths" "") (if (eq item.Kind "mesh-gateway") "Addresses" "") "Tags" "Meta Data")}} @selected={{selectedTab}} />
items=(compact
(array
'Service Checks'
'Node Checks'
(if
(eq item.Kind 'connect-proxy')
'Upstreams' ''
)
(if
(and (eq item.Kind 'connect-proxy') (gt item.Proxy.Expose.Paths.length 0))
'Exposed Paths' ''
)
(if
(eq item.Kind 'mesh-gateway')
'Addresses' ''
)
'Tags'
'Meta Data'
)
)
selected=selectedTab
}}
{{#each {{#each
(compact (compact
(array (array
@ -108,9 +85,9 @@
) )
) key="id" as |panel| ) key="id" as |panel|
}} }}
{{#tab-section id=panel.id selected=(eq (if selectedTab selectedTab '') panel.id) onchange=(action "change")}} <TabSection @id={{panel.id}} @selected={{eq (if selectedTab selectedTab "") panel.id}} @onchange={{action "change"}}>
{{partial panel.partial}} {{partial panel.partial}}
{{/tab-section}} </TabSection>
{{/each}} {{/each}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -4,11 +4,11 @@
data-test-metadata data-test-metadata
items=meta as |item index| items=meta as |item index|
}} }}
{{#block-slot name='header'}} <BlockSlot @name="header">
<th>Key</th> <th>Key</th>
<th>Value</th> <th>Value</th>
{{/block-slot}} </BlockSlot>
{{#block-slot name='row'}} <BlockSlot @name="row">
<td> <td>
<span> <span>
{{object-at 0 item}} {{object-at 0 item}}
@ -17,7 +17,7 @@
<td> <td>
<span>{{object-at 1 item}}</span> <span>{{object-at 1 item}}</span>
</td> </td>
{{/block-slot}} </BlockSlot>
{{/tabular-collection}} {{/tabular-collection}}
{{/with}} {{/with}}
{{else}} {{else}}

View File

@ -1,14 +1,14 @@
{{title item.Service.Service}} {{title item.Service.Service}}
{{#app-view class="service show"}} <AppView @class="service show">
{{#block-slot name='notification' as |status type|}} <BlockSlot @name="notification" as |status type|>
{{partial 'dc/services/notifications'}} {{partial 'dc/services/notifications'}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='breadcrumbs'}} <BlockSlot @name="breadcrumbs">
<ol> <ol>
<li><a data-test-back href={{href-to 'dc.services'}}>All Services</a></li> <li><a data-test-back href={{href-to 'dc.services'}}>All Services</a></li>
</ol> </ol>
{{/block-slot}} </BlockSlot>
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
{{item.Service.Service}} {{item.Service.Service}}
{{#let (service/external-source item.Service) as |externalSource| }} {{#let (service/external-source item.Service) as |externalSource| }}
@ -23,23 +23,14 @@
{{/if}} {{/if}}
</h1> </h1>
<label for="toolbar-toggle"></label> <label for="toolbar-toggle"></label>
{{tab-nav <TabNav @items={{compact (array "Instances" (if (not-eq chain ) "Routing" "") "Tags")}} @selected={{selectedTab}} />
items=(compact </BlockSlot>
(array <BlockSlot @name="actions">
'Instances'
(if (not-eq chain null) 'Routing' '')
'Tags'
)
)
selected=selectedTab
}}
{{/block-slot}}
{{#block-slot name='actions'}}
{{#if urls.service}} {{#if urls.service}}
{{#templated-anchor data-test-dashboard-anchor href=urls.service vars=(hash Datacenter=dc Service=(hash Name=item.Service.Service)) rel="external"}}Open Dashboard{{/templated-anchor}} {{#templated-anchor data-test-dashboard-anchor href=urls.service vars=(hash Datacenter=dc Service=(hash Name=item.Service.Service)) rel="external"}}Open Dashboard{{/templated-anchor}}
{{/if}} {{/if}}
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
{{#each {{#each
(compact (compact
(array (array
@ -49,9 +40,9 @@
) )
) key="id" as |panel| ) key="id" as |panel|
}} }}
{{#tab-section id=panel.id selected=(eq (if selectedTab selectedTab '') panel.id) onchange=(action 'change')}} <TabSection @id={{panel.id}} @selected={{eq (if selectedTab selectedTab "") panel.id}} @onchange={{action "change"}}>
{{partial panel.partial}} {{partial panel.partial}}
{{/tab-section}} </TabSection>
{{/each}} {{/each}}
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>

View File

@ -1,6 +1,6 @@
{{#hashicorp-consul id="wrapper" permissions=permissions dcs=dcs dc=dc nspaces=nspaces nspace=nspace}} <HashicorpConsul @id="wrapper" @permissions={{permissions}} @dcs={{dcs}} @dc={{dc}} @nspaces={{nspaces}} @nspace={{nspace}}>
{{#app-view class="error show"}} <AppView @class="error show">
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1 data-test-error> <h1 data-test-error>
{{#if error.status }} {{#if error.status }}
{{error.status}} ({{error.message}}) {{error.status}} ({{error.message}})
@ -8,14 +8,14 @@
{{error.message}} {{error.message}}
{{/if}} {{/if}}
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
<p> <p>
Consul returned an error. Consul returned an error.
You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs.<br /> You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs.<br />
Try looking in our <a href="{{env 'CONSUL_DOCS_URL'}}" target="_blank">documentation</a> Try looking in our <a href="{{env 'CONSUL_DOCS_URL'}}" target="_blank">documentation</a>
</p> </p>
<a data-test-home rel="home" href={{href-to 'index'}}>Go back to root</a> <a data-test-home rel="home" href={{href-to 'index'}}>Go back to root</a>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>
{{/hashicorp-consul}} </HashicorpConsul>

View File

@ -1,12 +1,12 @@
{{title "Settings"}} {{title "Settings"}}
{{#hashicorp-consul id="wrapper" permissions=permissions dcs=dcs dc=dc nspaces=nspaces nspace=nspace}} <HashicorpConsul @id="wrapper" @permissions={{permissions}} @dcs={{dcs}} @dc={{dc}} @nspaces={{nspaces}} @nspace={{nspace}}>
{{#app-view class="settings show"}} <AppView @class="settings show">
{{#block-slot name='header'}} <BlockSlot @name="header">
<h1> <h1>
Settings Settings
</h1> </h1>
{{/block-slot}} </BlockSlot>
{{#block-slot name='content'}} <BlockSlot @name="content">
<div class="notice info"> <div class="notice info">
<h3>Local Storage</h3> <h3>Local Storage</h3>
<p> <p>
@ -38,6 +38,6 @@
</fieldset> </fieldset>
{{/if}} {{/if}}
</form> </form>
{{/block-slot}} </BlockSlot>
{{/app-view}} </AppView>
{{/hashicorp-consul}} </HashicorpConsul>

View File

@ -1,7 +1,7 @@
import { triggerable } from 'ember-cli-page-object'; import { triggerable } from 'ember-cli-page-object';
import radiogroup from 'consul-ui/tests/lib/page-object/radiogroup'; import radiogroup from 'consul-ui/tests/lib/page-object/radiogroup';
export default { export default {
...radiogroup('action', ['', 'allow', 'deny']), ...radiogroup('currentFilter', ['', 'allow', 'deny']),
...{ ...{
scope: '[data-test-intention-filter]', scope: '[data-test-intention-filter]',
search: triggerable('keypress', '[name="s"]'), search: triggerable('keypress', '[name="s"]'),