Browse Source

chore(gui-v2): cleanup audit tab and pass currents as default

pull/2803/head
braks 2 years ago
parent
commit
3eb04e5be8
  1. 12
      packages/nc-gui-v2/components/dashboard/settings/AuditTab.vue

12
packages/nc-gui-v2/components/dashboard/settings/AuditTab.vue

@ -2,7 +2,7 @@
import { Tooltip as ATooltip } from 'ant-design-vue' import { Tooltip as ATooltip } from 'ant-design-vue'
import type { AuditType } from 'nocodb-sdk' import type { AuditType } from 'nocodb-sdk'
import { timeAgo } from '~/utils/dateTimeUtils' import { timeAgo } from '~/utils/dateTimeUtils'
import { h, ref, useNuxtApp, useProject } from '#imports' import { h, useNuxtApp, useProject } from '#imports'
import MdiReload from '~icons/mdi/reload' import MdiReload from '~icons/mdi/reload'
interface Props { interface Props {
@ -20,10 +20,10 @@ let audits = $ref<null | Array<AuditType>>(null)
let totalRows = $ref(0) let totalRows = $ref(0)
const currentPage = ref(1) const currentPage = $ref(1)
const currentLimit = ref(25) const currentLimit = $ref(25)
async function loadAudits(page: number, limit: number) { async function loadAudits(page = currentPage, limit = currentLimit) {
try { try {
if (!project.value?.id) return if (!project.value?.id) return
@ -35,7 +35,7 @@ async function loadAudits(page: number, limit: number) {
}) })
audits = list audits = list
totalRows = 100 totalRows = pageInfo.totalRows ?? 0
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} finally { } finally {
@ -46,7 +46,7 @@ async function loadAudits(page: number, limit: number) {
onMounted(async () => { onMounted(async () => {
if (audits === null) { if (audits === null) {
await loadProject(projectId) await loadProject(projectId)
await loadAudits(currentPage.value, currentLimit.value) await loadAudits(currentPage, currentLimit)
} }
}) })

Loading…
Cancel
Save