mirror of https://github.com/nocodb/nocodb
109 lines
3.1 KiB
109 lines
3.1 KiB
4 years ago
|
<template>
|
||
|
<div class="h-100" style="overflow: auto">
|
||
3 years ago
|
<v-toolbar height="30" class="elevation-0">
|
||
3 years ago
|
<v-spacer />
|
||
3 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') }}
|
||
4 years ago
|
</v-btn>
|
||
|
</v-toolbar>
|
||
2 years ago
|
<v-container class="d-flex flex-column tableScroll">
|
||
3 years ago
|
<v-simple-table v-if="audits" dense style="max-width: 1000px; overflow: auto" class="mx-auto flex-grow-1">
|
||
4 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>
|
||
4 years ago
|
</thead>
|
||
|
<tbody>
|
||
3 years ago
|
<tr v-for="(audit, i) in audits" :key="i">
|
||
3 years ago
|
<td class="caption">
|
||
|
{{ audit.op_type }}
|
||
|
</td>
|
||
|
<td class="caption">
|
||
|
{{ audit.op_sub_type }}
|
||
|
</td>
|
||
|
<td class="caption">
|
||
|
{{ audit.description }}
|
||
|
</td>
|
||
|
<td class="caption">
|
||
3 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>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
3 years ago
|
<span v-on="on">{{ calculateDiff(audit.created_at) }}</span>
|
||
|
</template>
|
||
|
<span class="caption">{{ audit.created_at }}</span>
|
||
|
</v-tooltip>
|
||
|
</td>
|
||
|
</tr>
|
||
4 years ago
|
</tbody>
|
||
|
</v-simple-table>
|
||
3 years ago
|
<v-pagination v-model="page" :length="Math.ceil(count / limit)" :total-visible="8" @input="loadAudits" />
|
||
4 years ago
|
</v-container>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
3 years ago
|
import { calculateDiff } from '~/helpers';
|
||
4 years ago
|
|
||
|
export default {
|
||
3 years ago
|
name: 'Audit',
|
||
4 years ago
|
data: () => ({
|
||
|
audits: null,
|
||
|
count: 0,
|
||
|
limit: 25,
|
||
3 years ago
|
page: 1,
|
||
4 years ago
|
}),
|
||
3 years ago
|
created() {
|
||
3 years ago
|
this.loadAudits();
|
||
4 years ago
|
},
|
||
|
methods: {
|
||
3 years ago
|
async loadAudits() {
|
||
3 years ago
|
// const { list, count } = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcAuditList', {
|
||
|
// limit: this.limit,
|
||
|
// offset: this.limit * (this.page - 1)
|
||
|
// }])
|
||
3 years ago
|
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
|
|
||
3 years ago
|
this.audits = list;
|
||
|
this.count = pageInfo.totalRows;
|
||
4 years ago
|
},
|
||
3 years ago
|
calculateDiff,
|
||
|
},
|
||
|
};
|
||
4 years ago
|
</script>
|
||
|
|
||
2 years ago
|
<style scoped lang="scss">
|
||
|
.tableScroll {
|
||
|
height: calc(90vh - 150px);
|
||
|
}
|
||
|
</style>
|