-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,60 @@ | ||
<script setup> | ||
import { ref } from 'vue' | ||
import axios from 'axios' | ||
import moment from 'moment' | ||
// TODO : Change to pinia (non-persisting) to avoid reactivity issues | ||
// TODO : Use an interface for the data, maybe rework the API | ||
// TODO : Reenable typescript | ||
const data = ref({}) | ||
axios.get('/api/activities?size=10&page=0&sorts%5Boccurred_at%5D=desc') | ||
.then((response) => { | ||
data.value = response.data | ||
}) | ||
.catch((err) => { | ||
console.error(err) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<h3 class="uk-margin-remove">Activities</h3> | ||
<p class="uk-text-meta uk-margin-remove-top">A listing of user activities.</p> | ||
|
||
<UFCardBox> | ||
<template #header> | ||
<font-awesome-icon icon="list-check" /> Activities | ||
</template> | ||
<table class="uk-table uk-table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Activity Time</th> | ||
<th>User</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr v-for="row in data.rows" :key="row.id"> | ||
<td> | ||
<div>{{ moment(row.occurred_at).format('dddd')}}</div> | ||
<div>{{ moment(row.occurred_at).format('MMM Do, YYYY h:mm a')}}</div> | ||
</td> | ||
<td> | ||
<strong> | ||
<RouterLink :to="{ name: 'admin.user', params: { user_name: row.user.user_name } }"> | ||
{{row.user.full_name}} ({{row.user.user_name}}) | ||
</RouterLink> | ||
</strong> | ||
<div class="uk-text-meta">{{row.user.email}}</div> | ||
</td> | ||
<td> | ||
<div> | ||
{{row.ip_address}} | ||
</div> | ||
<div> | ||
<i>{{row.description}}</i> | ||
</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</UFCardBox> | ||
</template> | ||
</template> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters