mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.3 KiB
129 lines
3.3 KiB
3 years ago
|
<template>
|
||
|
<div class="h-100" style="overflow: auto">
|
||
2 years ago
|
<v-toolbar height="30" class="elevation-0">
|
||
3 years ago
|
<v-spacer />
|
||
2 years ago
|
<v-btn small outlined @click="loadAudits">
|
||
3 years ago
|
<v-icon small class="mr-2">
|
||
|
refresh
|
||
|
</v-icon>
|
||
3 years ago
|
<!-- Reload -->
|
||
|
{{ $t('general.reload') }}
|
||
3 years ago
|
</v-btn>
|
||
|
</v-toolbar>
|
||
3 years ago
|
<v-container class="h-100 d-flex flex-column">
|
||
3 years ago
|
<v-simple-table
|
||
|
v-if="audits"
|
||
|
dense
|
||
|
style="max-width: 1000px; overflow: auto"
|
||
|
class="mx-auto flex-grow-1"
|
||
|
>
|
||
3 years ago
|
<thead>
|
||
3 years ago
|
<tr>
|
||
|
<th class="caption">
|
||
3 years ago
|
<!--Operation Type-->
|
||
|
{{ $t('labels.operationType') }}
|
||
3 years ago
|
</th>
|
||
|
<th class="caption">
|
||
3 years ago
|
<!---->
|
||
|
{{ $t('labels.operationSubType') }}
|
||
3 years ago
|
</th>
|
||
|
<th class="caption">
|
||
3 years ago
|
<!--Description-->
|
||
|
{{ $t('labels.description') }}
|
||
3 years ago
|
</th>
|
||
|
<th class="caption">
|
||
3 years ago
|
<!--User-->
|
||
|
{{ $t('objects.user') }}
|
||
3 years ago
|
</th>
|
||
|
<!-- <th class="caption">Ip</th>-->
|
||
|
<th class="caption">
|
||
3 years ago
|
<!--Created-->
|
||
|
{{ $t('labels.created') }}
|
||
3 years ago
|
</th>
|
||
|
</tr>
|
||
3 years ago
|
</thead>
|
||
|
<tbody>
|
||
3 years ago
|
<tr v-for="(audit,i) in audits" :key="i">
|
||
|
<td class="caption">
|
||
|
{{ audit.op_type }}
|
||
|
</td>
|
||
|
<td class="caption">
|
||
|
{{ audit.op_sub_type }}
|
||
|
</td>
|
||
|
<td class="caption">
|
||
|
{{ audit.description }}
|
||
|
</td>
|
||
|
<td class="caption">
|
||
2 years ago
|
{{ audit.user == null ? 'Shared base' : audit.user }}
|
||
3 years ago
|
</td>
|
||
|
<!-- <td class="caption">-->
|
||
|
<!-- {{ audit.ip }}-->
|
||
|
<!-- </td>-->
|
||
|
<td class="caption">
|
||
|
<v-tooltip bottom>
|
||
|
<template #activator="{on}">
|
||
|
<span v-on="on">{{ calculateDiff(audit.created_at) }}</span>
|
||
|
</template>
|
||
|
<span class="caption">{{ audit.created_at }}</span>
|
||
|
</v-tooltip>
|
||
|
</td>
|
||
|
</tr>
|
||
3 years ago
|
</tbody>
|
||
|
</v-simple-table>
|
||
|
<v-pagination
|
||
|
v-model="page"
|
||
|
:length="Math.ceil(count / limit)"
|
||
|
:total-visible="8"
|
||
3 years ago
|
@input="loadAudits"
|
||
|
/>
|
||
3 years ago
|
</v-container>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
3 years ago
|
import dayjs from 'dayjs'
|
||
3 years ago
|
|
||
|
const relativeTime = require('dayjs/plugin/relativeTime')
|
||
|
const utc = require('dayjs/plugin/utc')
|
||
|
dayjs.extend(utc)
|
||
|
dayjs.extend(relativeTime)
|
||
|
|
||
|
export default {
|
||
3 years ago
|
name: 'Audit',
|
||
3 years ago
|
data: () => ({
|
||
|
audits: null,
|
||
|
count: 0,
|
||
|
limit: 25,
|
||
|
page: 1
|
||
|
}),
|
||
3 years ago
|
created() {
|
||
3 years ago
|
this.loadAudits()
|
||
3 years ago
|
},
|
||
|
methods: {
|
||
3 years ago
|
async loadAudits() {
|
||
2 years ago
|
// const { list, count } = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcAuditList', {
|
||
|
// limit: this.limit,
|
||
|
// offset: this.limit * (this.page - 1)
|
||
|
// }])
|
||
|
const {
|
||
|
list, pageInfo
|
||
|
} = (await this.$api.project.auditList(
|
||
|
this.$store.state.project.projectId, {
|
||
|
limit: this.limit,
|
||
|
offset: this.limit * (this.page - 1)
|
||
|
}))
|
||
|
|
||
3 years ago
|
this.audits = list
|
||
2 years ago
|
this.count = pageInfo.totalRows
|
||
3 years ago
|
},
|
||
3 years ago
|
calculateDiff(date) {
|
||
3 years ago
|
return dayjs.utc(date).fromNow()
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
|
||
|
</style>
|