refactor(gui): linting

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
This commit is contained in:
Pranav C
2021-07-19 16:30:37 +05:30
parent f9508c2d44
commit fa00be39b8
303 changed files with 34924 additions and 31761 deletions

View File

@@ -1,69 +1,81 @@
<template>
<div class="h-100" style="overflow: auto">
<v-toolbar height="30">
<v-spacer/>
<v-spacer />
<v-btn x-small outlined @click="loadAudits">
<v-icon small class="mr-2">refresh</v-icon>
<v-icon small class="mr-2">
refresh
</v-icon>
Reload
</v-btn>
</v-toolbar>
<v-container class="h-100 d-flex flex-column">
<v-simple-table dense v-if="audits" style="max-width: 1000px; overflow: auto" class="mx-auto flex-grow-1"
v-slot:default>
<v-simple-table
v-if="audits"
dense
style="max-width: 1000px; overflow: auto"
class="mx-auto flex-grow-1"
>
<thead>
<tr>
<th class="caption">
Operation Type
</th>
<th class="caption">
Operation Sub Type
</th>
<th class="caption">Description</th>
<th class="caption">User</th>
<!-- <th class="caption">Ip</th>-->
<th class="caption">Created</th>
</tr>
<tr>
<th class="caption">
Operation Type
</th>
<th class="caption">
Operation Sub Type
</th>
<th class="caption">
Description
</th>
<th class="caption">
User
</th>
<!-- <th class="caption">Ip</th>-->
<th class="caption">
Created
</th>
</tr>
</thead>
<tbody>
<tr v-for="audit in audits">
<td class="caption">
{{ audit.op_type }}
</td>
<td class="caption">
{{ audit.op_sub_type }}
</td>
<td class="caption">
{{ audit.description }}
</td>
<td class="caption">
{{ audit.user }}
</td>
<!-- <td class="caption">-->
<!-- {{ audit.ip }}-->
<!-- </td>-->
<td class="caption">
<v-tooltip bottom>
<template v-slot:activator="{on}">
<span v-on="on">{{ calculateDiff(audit.created_at) }}</span>
</template>
<span class="caption">{{ audit.created_at }}</span>
</v-tooltip>
</td>
</tr>
<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">
{{ audit.user }}
</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>
</tbody>
</v-simple-table>
<v-pagination
v-model="page"
:length="Math.ceil(count / limit)"
:total-visible="8"
@input="loadAudits"></v-pagination>
@input="loadAudits"
/>
</v-container>
</div>
</template>
<script>
import dayjs from 'dayjs';
import dayjs from 'dayjs'
const relativeTime = require('dayjs/plugin/relativeTime')
const utc = require('dayjs/plugin/utc')
@@ -71,26 +83,26 @@ dayjs.extend(utc)
dayjs.extend(relativeTime)
export default {
name: "audit",
name: 'Audit',
data: () => ({
audits: null,
count: 0,
limit: 25,
page: 1
}),
created() {
this.loadAudits();
created () {
this.loadAudits()
},
methods: {
async loadAudits() {
const {list, count} = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcAuditList', {
async loadAudits () {
const { list, count } = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcAuditList', {
limit: this.limit,
offset: this.limit * (this.page - 1),
}]);
this.audits = list;
this.count = count;
offset: this.limit * (this.page - 1)
}])
this.audits = list
this.count = count
},
calculateDiff(date) {
calculateDiff (date) {
return dayjs.utc(date).fromNow()
}
}