Skip to content

Commit

Permalink
Add Activities to Dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Oct 6, 2024
1 parent 38a8e5a commit eb98a6c
Show file tree
Hide file tree
Showing 8 changed files with 598 additions and 477 deletions.
42 changes: 42 additions & 0 deletions app/assets/views/Dashboard/DashboardActivities.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script lang="ts" setup>
import moment from 'moment'
</script>

<template>
<UFCardBox title="Latest Activities">
<UFSprunjeTable dataUrl="/api/activities" :defaultSorts="{ occurred_at: 'desc' }" no-pagination>
<template #header>
<UFSprunjeHeader>Activity Time</UFSprunjeHeader>
<UFSprunjeHeader>User</UFSprunjeHeader>
<UFSprunjeHeader>Description</UFSprunjeHeader>
</template>

<template #body="{ item }">
<UFSprunjeColumn>
<div>{{ moment(item.occurred_at).format('dddd') }}</div>
<div>{{ moment(item.occurred_at).format('MMM Do, YYYY h:mm a') }}</div>
</UFSprunjeColumn>
<UFSprunjeColumn>
<strong>
<RouterLink
:to="{
name: 'admin.user',
params: { user_name: item.user.user_name }
}">
{{ item.user.full_name }} ({{ item.user.user_name }})
</RouterLink>
</strong>
<div class="uk-text-meta">{{ item.user.email }}</div>
</UFSprunjeColumn>
<UFSprunjeColumn>
<div>
{{ item.ip_address }}
</div>
<div>
<i>{{ item.description }}</i>
</div>
</UFSprunjeColumn>
</template>
</UFSprunjeTable>
</UFCardBox>
</template>
3 changes: 2 additions & 1 deletion app/assets/views/DashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useDashboardApi } from '../composable/dashboard'
import DashboardStats from './Dashboard/DashboardStats.vue'
import DashboardRecentUsers from './Dashboard/DashboardRecentUsers.vue'
import DashboardSystemInfo from './Dashboard/DashboardSystemInfo.vue'
import DashboardActivities from './Dashboard/DashboardActivities.vue'
const dashboard = useDashboardApi()
dashboard.load()
Expand Down Expand Up @@ -30,7 +31,7 @@ dashboard.load()
</div>
</div>
<div>
<UFCardBox title="Activities"></UFCardBox>
<DashboardActivities />
</div>
</div>
</template>
6 changes: 0 additions & 6 deletions dist/DashboardView-CDywR_mi.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions dist/DashboardView-CWbg9J12.cjs

Large diffs are not rendered by default.

Loading

0 comments on commit eb98a6c

Please sign in to comment.