Browse Source

Merge pull request #8543 from nocodb/nc-fix/audit-table

Nc fix/audit table
pull/8552/head
Ramesh Mane 7 months ago committed by GitHub
parent
commit
6ece1cf00a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 35
      packages/nc-gui/components/dashboard/settings/BaseAudit.vue
  2. 6
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  3. 11
      packages/nc-gui/components/dashboard/settings/Metadata.vue
  4. 6
      packages/nc-gui/components/dashboard/settings/UIAcl.vue
  5. 4
      packages/nc-gui/components/dlg/ProjectAudit.vue
  6. 11
      packages/nc-gui/components/general/Modal.vue
  7. 2
      packages/nc-gui/components/smartsheet/expanded-form/Comments.vue

35
packages/nc-gui/components/dashboard/settings/BaseAudit.vue

@ -103,7 +103,7 @@ const columns = [
</script> </script>
<template> <template>
<div class="flex flex-col gap-4 w-full"> <div class="h-full flex flex-col gap-4 w-full">
<div v-if="!appInfo.auditEnabled" class="text-red-500">Audit logs are currently disabled by administrators.</div> <div v-if="!appInfo.auditEnabled" class="text-red-500">Audit logs are currently disabled by administrators.</div>
<div class="flex flex-row justify-between items-center"> <div class="flex flex-row justify-between items-center">
<h6 class="mb-4 first-letter:capital font-bold">Audit : {{ base.title }}</h6> <h6 class="mb-4 first-letter:capital font-bold">Audit : {{ base.title }}</h6>
@ -116,20 +116,24 @@ const columns = [
</a-button> </a-button>
</div> </div>
<a-table <div class="h-[calc(100%_-_102px)] overflow-y-auto nc-scrollbar-thin">
class="nc-audit-table w-full" <a-table
size="small" class="nc-audit-table w-full"
:data-source="audits ?? []" size="small"
:columns="columns" :data-source="audits ?? []"
:pagination="false" :columns="columns"
:loading="isLoading" :pagination="false"
data-testid="audit-tab-table" :loading="isLoading"
> data-testid="audit-tab-table"
<template #emptyText> sticky
<a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" :description="$t('labels.noData')" /> bordered
</template> >
</a-table> <template #emptyText>
<div class="flex flex-row justify-center items-center"> <a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" :description="$t('labels.noData')" />
</template>
</a-table>
</div>
<div v-if="+totalRows > currentLimit" class="flex flex-row justify-center items-center">
<a-pagination <a-pagination
v-model:current="currentPage" v-model:current="currentPage"
v-model:page-size="currentLimit" v-model:page-size="currentLimit"
@ -151,6 +155,7 @@ const columns = [
font-size: unset; font-size: unset;
font-family: unset; font-family: unset;
} }
.pagination { .pagination {
.ant-select-dropdown { .ant-select-dropdown {
@apply !border-1 !border-gray-200; @apply !border-1 !border-gray-200;

6
packages/nc-gui/components/dashboard/settings/DataSources.vue

@ -303,7 +303,7 @@ const openedTab = ref('erd')
<div>{{ $t('title.auditLogs') }}</div> <div>{{ $t('title.auditLogs') }}</div>
</div> </div>
</template> </template>
<div class="p-4 h-full overflow-auto"> <div class="p-4 h-full">
<LazyDashboardSettingsBaseAudit :source-id="activeSource.id" /> <LazyDashboardSettingsBaseAudit :source-id="activeSource.id" />
</div> </div>
</a-tab-pane> </a-tab-pane>
@ -330,7 +330,7 @@ const openedTab = ref('erd')
</div> </div>
</template> </template>
<div class="pt-4 h-full overflow-auto"> <div class="pt-4 h-full">
<LazyDashboardSettingsUIAcl :source-id="activeSource.id" /> <LazyDashboardSettingsUIAcl :source-id="activeSource.id" />
</div> </div>
</a-tab-pane> </a-tab-pane>
@ -340,7 +340,7 @@ const openedTab = ref('erd')
<div>{{ $t('labels.metaSync') }}</div> <div>{{ $t('labels.metaSync') }}</div>
</div> </div>
</template> </template>
<div class="pt-4 h-full overflow-auto"> <div class="pt-4 h-full">
<LazyDashboardSettingsMetadata :source-id="activeSource.id" @source-synced="loadBases(true)" /> <LazyDashboardSettingsMetadata :source-id="activeSource.id" @source-synced="loadBases(true)" />
</div> </div>
</a-tab-pane> </a-tab-pane>

11
packages/nc-gui/components/dashboard/settings/Metadata.vue

@ -108,8 +108,8 @@ const columns = [
</script> </script>
<template> <template>
<div class="flex flex-col w-full"> <div class="h-full flex flex-col w-full">
<div class="flex flex-col"> <div class="h-full flex flex-col">
<div class="flex flex-row justify-between items-center w-full mb-4"> <div class="flex flex-row justify-between items-center w-full mb-4">
<div class="flex"> <div class="flex">
<div v-if="isDifferent"> <div v-if="isDifferent">
@ -140,9 +140,9 @@ const columns = [
</div> </div>
</a-button> </a-button>
</div> </div>
<div class="max-h-600px overflow-y-auto"> <div class="h-auto max-h-[calc(100%_-_72px)] overflow-y-auto nc-scrollbar-thin">
<a-table <a-table
class="w-full" class="nc-metasync-table w-full"
size="small" size="small"
:custom-row=" :custom-row="
(record) => ({ (record) => ({
@ -153,6 +153,7 @@ const columns = [
:columns="columns" :columns="columns"
:pagination="false" :pagination="false"
:loading="isLoading" :loading="isLoading"
sticky
bordered bordered
> >
<template #emptyText> <template #emptyText>
@ -178,3 +179,5 @@ const columns = [
</div> </div>
</div> </div>
</template> </template>
<style lang="scss" scoped></style>

6
packages/nc-gui/components/dashboard/settings/UIAcl.vue

@ -130,8 +130,8 @@ const toggleSelectAll = (role: Role) => {
</script> </script>
<template> <template>
<div class="flex flex-row w-full items-center justify-center"> <div class="h-full flex flex-row w-full items-center justify-center">
<div class="flex flex-col"> <div class="h-full flex flex-col">
<NcTooltip class="mb-4 first-letter:capital font-bold max-w-100 truncate" show-on-truncate-only> <NcTooltip class="mb-4 first-letter:capital font-bold max-w-100 truncate" show-on-truncate-only>
<template #title>{{ base.title }}</template> <template #title>{{ base.title }}</template>
<span> UI ACL : {{ base.title }} </span> <span> UI ACL : {{ base.title }} </span>
@ -159,7 +159,7 @@ const toggleSelectAll = (role: Role) => {
</div> </div>
</div> </div>
<div class="max-h-600px overflow-y-auto"> <div class="h-auto max-h-[calc(100%_-_102px)] overflow-y-auto nc-scrollbar-thin">
<a-table <a-table
class="w-full" class="w-full"
size="small" size="small"

4
packages/nc-gui/components/dlg/ProjectAudit.vue

@ -45,8 +45,8 @@ onMounted(async () => {
</script> </script>
<template> <template>
<GeneralModal v-model:visible="isOpen" size="large" class="!w-[70rem]"> <GeneralModal v-model:visible="isOpen" size="xl" class="!w-[70rem] !top-[5vh]">
<div class="p-6"> <div class="p-6 h-full">
<DashboardSettingsBaseAudit v-if="!isLoading" :source-id="activeSourceId" :base-id="baseId" :show-all-columns="false" /> <DashboardSettingsBaseAudit v-if="!isLoading" :source-id="activeSourceId" :base-id="baseId" :show-all-columns="false" />
</div> </div>
</GeneralModal> </GeneralModal>

11
packages/nc-gui/components/general/Modal.vue

@ -3,7 +3,7 @@ const props = withDefaults(
defineProps<{ defineProps<{
visible: boolean visible: boolean
width?: string | number width?: string | number
size?: 'small' | 'medium' | 'large' size?: 'small' | 'medium' | 'large' | 'xl'
destroyOnClose?: boolean destroyOnClose?: boolean
maskClosable?: boolean maskClosable?: boolean
closable?: boolean closable?: boolean
@ -40,6 +40,10 @@ const width = computed(() => {
return '80rem' return '80rem'
} }
if (props.size === 'xl') {
return '80rem'
}
return 'max(30vw, 600px)' return 'max(30vw, 600px)'
}) })
@ -55,6 +59,9 @@ const height = computed(() => {
if (props.size === 'large') { if (props.size === 'large') {
return '80vh' return '80vh'
} }
if (props.size === 'xl') {
return '90vh'
}
return 'auto' return 'auto'
}) })
@ -75,7 +82,7 @@ const visible = useVModel(props, 'visible', emits)
:mask-closable="maskClosable" :mask-closable="maskClosable"
@keydown.esc="visible = false" @keydown.esc="visible = false"
> >
<div :class="`nc-modal max-h-[${height}]`"> <div :class="`nc-modal h-[${height}] max-h-[${height}]`">
<slot /> <slot />
</div> </div>
</a-modal> </a-modal>

2
packages/nc-gui/components/smartsheet/expanded-form/Comments.vue

@ -389,7 +389,7 @@ watch(commentsWrapperEl, () => {
.ant-tabs-nav { .ant-tabs-nav {
@apply px-3; @apply px-3;
.ant-tabs-nav-list { .ant-tabs-nav-list {
@apply w-full gap-6; @apply w-[99%] mx-auto gap-6;
.ant-tabs-tab { .ant-tabs-tab {
@apply flex-1 flex items-center justify-center pt-3 pb-2.5; @apply flex-1 flex items-center justify-center pt-3 pb-2.5;

Loading…
Cancel
Save