From f2203a3496823bad3f5d930f2702bfff6c84b3e8 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Mon, 24 Jun 2024 08:28:53 +0000 Subject: [PATCH] fix(nc-gui): audit tab overflow issue --- .../nc-gui/components/workspace/AuditLogs.vue | 16 +++++++++++----- packages/nc-gui/pages/account/index.vue | 2 +- packages/nc-gui/pages/account/index/[page].vue | 2 +- packages/nocodb-sdk/src/lib/globals.ts | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/nc-gui/components/workspace/AuditLogs.vue b/packages/nc-gui/components/workspace/AuditLogs.vue index 02e9d66b21..bd20e6444b 100644 --- a/packages/nc-gui/components/workspace/AuditLogs.vue +++ b/packages/nc-gui/components/workspace/AuditLogs.vue @@ -14,7 +14,12 @@ interface Props { const props = defineProps() -const allowedAuditOperationTypes = [AuditOperationTypes.DATA, AuditOperationTypes.TABLE, AuditOperationTypes.TABLE_COLUMN] +const allowedAuditOperationTypes = [ + AuditOperationTypes.DATA, + AuditOperationTypes.TABLE, + AuditOperationTypes.TABLE_COLUMN, + ...(!isEeUI ? [AuditOperationTypes.AUTHENTICATION] : []), +] const { isUIAllowed } = useRoles() @@ -224,7 +229,7 @@ const handleUpdateDateRange = (range?: AuditLogsDateRange, label?: string) => { break case AuditLogsDateRange.PastWeek: 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 case AuditLogsDateRange.PastMonth: auditLogsQuery.value.startDate = now.subtract(1, 'month').startOf('month').format('YYYY-MM-DD') @@ -302,15 +307,16 @@ watch( onMounted(async () => { if (props.baseId) { auditLogsQuery.value.baseId = props.baseId - } else { - await loadProjects() - await loadOrgUsers() } if (props.sourceId) { auditLogsQuery.value.sourceId = props.sourceId } + if (!props.baseId && !isEeUI) { + await Promise.allSettled([loadProjects(), loadOrgUsers()]) + } + if (audits.value === null && appInfo.value.auditEnabled) { await loadAudits(currentPage.value, currentLimit.value, false) } diff --git a/packages/nc-gui/pages/account/index.vue b/packages/nc-gui/pages/account/index.vue index 4eaead7436..f0a218e439 100644 --- a/packages/nc-gui/pages/account/index.vue +++ b/packages/nc-gui/pages/account/index.vue @@ -157,7 +157,7 @@ const logout = async () => { -
+
diff --git a/packages/nc-gui/pages/account/index/[page].vue b/packages/nc-gui/pages/account/index/[page].vue index f8da442ed0..78e97618d4 100644 --- a/packages/nc-gui/pages/account/index/[page].vue +++ b/packages/nc-gui/pages/account/index/[page].vue @@ -5,7 +5,7 @@ const { appInfo } = useGlobal()