Browse Source

fix(nc-gui): audit tab overflow issue

pull/8836/head
Ramesh Mane 5 months ago
parent
commit
f2203a3496
  1. 16
      packages/nc-gui/components/workspace/AuditLogs.vue
  2. 2
      packages/nc-gui/pages/account/index.vue
  3. 2
      packages/nc-gui/pages/account/index/[page].vue
  4. 2
      packages/nocodb-sdk/src/lib/globals.ts

16
packages/nc-gui/components/workspace/AuditLogs.vue

@ -14,7 +14,12 @@ interface Props {
const props = defineProps<Props>() const props = defineProps<Props>()
const allowedAuditOperationTypes = [AuditOperationTypes.DATA, AuditOperationTypes.TABLE, AuditOperationTypes.TABLE_COLUMN] const allowedAuditOperationTypes = [
AuditOperationTypes.DATA,
AuditOperationTypes.TABLE,
AuditOperationTypes.TABLE_COLUMN,
...(!isEeUI ? [AuditOperationTypes.AUTHENTICATION] : []),
]
const { isUIAllowed } = useRoles() const { isUIAllowed } = useRoles()
@ -224,7 +229,7 @@ const handleUpdateDateRange = (range?: AuditLogsDateRange, label?: string) => {
break break
case AuditLogsDateRange.PastWeek: case AuditLogsDateRange.PastWeek:
auditLogsQuery.value.startDate = now.subtract(1, 'week').startOf('day').format('YYYY-MM-DD') auditLogsQuery.value.startDate = now.subtract(1, 'week').startOf('day').format('YYYY-MM-DD')
auditLogsQuery.value.endDate = now.format('YYYY-MM-DD HH:mm:ss') auditLogsQuery.value.endDate = now.subtract(1, 'week').endOf('day').format('YYYY-MM-DD')
break break
case AuditLogsDateRange.PastMonth: case AuditLogsDateRange.PastMonth:
auditLogsQuery.value.startDate = now.subtract(1, 'month').startOf('month').format('YYYY-MM-DD') auditLogsQuery.value.startDate = now.subtract(1, 'month').startOf('month').format('YYYY-MM-DD')
@ -302,15 +307,16 @@ watch(
onMounted(async () => { onMounted(async () => {
if (props.baseId) { if (props.baseId) {
auditLogsQuery.value.baseId = props.baseId auditLogsQuery.value.baseId = props.baseId
} else {
await loadProjects()
await loadOrgUsers()
} }
if (props.sourceId) { if (props.sourceId) {
auditLogsQuery.value.sourceId = props.sourceId auditLogsQuery.value.sourceId = props.sourceId
} }
if (!props.baseId && !isEeUI) {
await Promise.allSettled([loadProjects(), loadOrgUsers()])
}
if (audits.value === null && appInfo.value.auditEnabled) { if (audits.value === null && appInfo.value.auditEnabled) {
await loadAudits(currentPage.value, currentLimit.value, false) await loadAudits(currentPage.value, currentLimit.value, false)
} }

2
packages/nc-gui/pages/account/index.vue

@ -157,7 +157,7 @@ const logout = async () => {
<!-- Sub Tabs --> <!-- Sub Tabs -->
<div class="flex flex-col w-full ml-65"> <div class="flex flex-col w-full pl-65">
<div class="flex flex-row p-3 items-center h-14"> <div class="flex flex-row p-3 items-center h-14">
<div class="flex-1" /> <div class="flex-1" />

2
packages/nc-gui/pages/account/index/[page].vue

@ -5,7 +5,7 @@ const { appInfo } = useGlobal()
<template> <template>
<div> <div>
<AccountToken v-if="$route.params.page === 'tokens'" /> <AccountToken v-if="$route.params.page === 'tokens'" />
<div v-else-if="$route.params.page === 'audit'" class="h-[calc(100vh_-_4rem)] w-full"> <div v-else-if="$route.params.page === 'audit'" class="h-[calc(100vh_-_4rem)] w-full px-6">
<WorkspaceAuditLogs /> <WorkspaceAuditLogs />
</div> </div>
<AccountProfile v-else-if="$route.params.page === 'profile'" /> <AccountProfile v-else-if="$route.params.page === 'profile'" />

2
packages/nocodb-sdk/src/lib/globals.ts

@ -38,9 +38,9 @@ export enum AuditOperationTypes {
TABLE = 'TABLE', TABLE = 'TABLE',
VIEW = 'VIEW', VIEW = 'VIEW',
META = 'META', META = 'META',
TABLE_COLUMN = 'TABLE_COLUMN',
WEBHOOKS = 'WEBHOOKS', WEBHOOKS = 'WEBHOOKS',
AUTHENTICATION = 'AUTHENTICATION', AUTHENTICATION = 'AUTHENTICATION',
TABLE_COLUMN = 'TABLE_COLUMN',
ORG_USER = 'ORG_USER', ORG_USER = 'ORG_USER',
} }

Loading…
Cancel
Save