129 lines
3.2 KiB
Handlebars
129 lines
3.2 KiB
Handlebars
<Headers::H1 @title='Tasks' />
|
|
|
|
<div class='sm:flex sm:flex-nowrap'>
|
|
{{! indexUid }}
|
|
<Form::Listbox
|
|
@listboxLabel={{'Index: '}}
|
|
@value={{nu-co this.indexUid 'none'}}
|
|
@values={{map-by 'uid' @model.indexes.results}}
|
|
@onChange={{set this 'indexUid'}}
|
|
@allowClear={{true}}
|
|
/>
|
|
|
|
{{! status }}
|
|
<Form::Listbox
|
|
@listboxLabel={{'Status: '}}
|
|
@value={{nu-co this.status 'none'}}
|
|
@values={{this.taskStatuses}}
|
|
@onChange={{set this 'status'}}
|
|
@allowClear={{true}}
|
|
class='sm:ml-4 sm:flex-none'
|
|
/>
|
|
|
|
{{! status }}
|
|
<Form::Listbox
|
|
@listboxLabel={{'Type: '}}
|
|
@value={{nu-co this.type 'none'}}
|
|
@values={{this.taskTypes}}
|
|
@onChange={{set this 'type'}}
|
|
@allowClear={{true}}
|
|
class='sm:ml-4 sm:flex-none'
|
|
/>
|
|
|
|
{{! limit }}
|
|
<Form::Listbox
|
|
@listboxLabel={{'Limit: '}}
|
|
@value={{nu-co this.limit 'none'}}
|
|
@values={{array 20 50 100 500}}
|
|
@onChange={{set this 'limit'}}
|
|
class='sm:ml-4 sm:flex-none'
|
|
/>
|
|
</div>
|
|
|
|
{{#if this.tasks.results.length}}
|
|
<SimpleTable @data={{this.tasks.results}} class='w-full' as |Column data|>
|
|
<Column @prop='uid'>
|
|
<LinkTo
|
|
@route='admin.tasks.task'
|
|
@model={{data.uid}}
|
|
>{{data.uid}}</LinkTo>
|
|
</Column>
|
|
<Column @prop='indexUid'>
|
|
<LinkTo
|
|
@route='admin.indexes.item'
|
|
@model={{data.indexUid}}
|
|
>{{data.indexUid}}</LinkTo>
|
|
</Column>
|
|
<Column @prop='status'>
|
|
<Badge @label={{data.status}} @style={{data.style}} />
|
|
</Column>
|
|
<Column @prop='type' />
|
|
{{!-- <Column @prop='details'>
|
|
{{json-stringify data.details}}
|
|
</Column>
|
|
<Column @prop='error'>
|
|
{{#if data.isFailed}}
|
|
{{#if data.error.link}}
|
|
<a
|
|
href={{data.error.link}}
|
|
class='text-danger'
|
|
target='_blank'
|
|
rel='noopener noreferrer'
|
|
>{{data.error.message}}</a>
|
|
{{else}}
|
|
<span class='text-danger'>{{data.error.message}}</span>
|
|
{{/if}}
|
|
{{/if}}
|
|
</Column>
|
|
<Column @prop='duration' />
|
|
<Column @prop='enqueuedAt'>
|
|
{{date-time-format
|
|
data.enqueuedAt
|
|
year='numeric'
|
|
month='numeric'
|
|
day='numeric'
|
|
hour='numeric'
|
|
minute='numeric'
|
|
second='numeric'
|
|
}}
|
|
</Column>
|
|
<Column @prop='startedAt'>
|
|
{{date-time-format
|
|
data.startedAt
|
|
year='numeric'
|
|
month='numeric'
|
|
day='numeric'
|
|
hour='numeric'
|
|
minute='numeric'
|
|
second='numeric'
|
|
}}
|
|
</Column> --}}
|
|
<Column @prop='finishedAt'>
|
|
{{date-time-format
|
|
data.finishedAt
|
|
year='numeric'
|
|
month='numeric'
|
|
day='numeric'
|
|
hour='numeric'
|
|
minute='numeric'
|
|
second='numeric'
|
|
}}
|
|
</Column>
|
|
</SimpleTable>
|
|
|
|
{{#if this.tasks.next}}
|
|
<div class='flex justify-center'>
|
|
<Button
|
|
@text='Load more'
|
|
@onClick={{fn (set this 'from') this.tasks.next}}
|
|
@state={{if this.tasks.isLoading 'pending'}}
|
|
/>
|
|
</div>
|
|
{{/if}}
|
|
{{else if this.tasks.isLoading}}
|
|
<div class='flex justify-center py-4'>
|
|
<Icons::Loading @size={{30}} @spin={{true}}/>
|
|
</div>
|
|
{{else}}
|
|
No results found
|
|
{{/if}}
|