Add index list to admin page
This commit is contained in:
parent
613a5cb45a
commit
aa6c77499c
2 changed files with 35 additions and 1 deletions
|
|
@ -7,7 +7,10 @@ export default class AdminIndexRoute extends Route {
|
|||
@service session;
|
||||
|
||||
async model() {
|
||||
const indexes = this.modelFor('admin');
|
||||
|
||||
return hash({
|
||||
indexes,
|
||||
health: this.meilisearch.getHealth(),
|
||||
version: this.meilisearch.getVersion(),
|
||||
stats: this.meilisearch.getStats(),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<dl class='grid grid-cols-1 md:grid-cols-2 gap-5'>
|
||||
<h2 class='text-2xl mb-4'>Stats</h2>
|
||||
<dl class='grid grid-cols-1 md:grid-cols-2 gap-5 mb-8'>
|
||||
<Stat @title='Status' @value={{capitalize @model.health.status}}>
|
||||
<:icon>
|
||||
{{#if (eq @model.health.status 'available')}}
|
||||
|
|
@ -33,3 +34,33 @@
|
|||
</:icon>
|
||||
</Stat>
|
||||
</dl>
|
||||
|
||||
<h2 class='text-2xl mb-4'>Indexes</h2>
|
||||
<RoyalTable @data={{@model.indexes}} class='w-full' as |Row data|>
|
||||
<Row as |Column|>
|
||||
<Column @name='UID' @prop='uid' />
|
||||
<Column @name='Primary key' @prop='primaryKey' />
|
||||
<Column @name='Created at' @prop='createdAt'>
|
||||
{{date-time-format
|
||||
data.createdAt
|
||||
year='numeric'
|
||||
month='numeric'
|
||||
day='numeric'
|
||||
hour='numeric'
|
||||
minute='numeric'
|
||||
second='numeric'
|
||||
}}
|
||||
</Column>
|
||||
<Column @name='Updated at' @prop='updatedAt'>
|
||||
{{date-time-format
|
||||
data.updatedAt
|
||||
year='numeric'
|
||||
month='numeric'
|
||||
day='numeric'
|
||||
hour='numeric'
|
||||
minute='numeric'
|
||||
second='numeric'
|
||||
}}
|
||||
</Column>
|
||||
</Row>
|
||||
</RoyalTable>
|
||||
|
|
|
|||
Loading…
Reference in a new issue