|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import type { HookLogType, HookType } from 'nocodb-sdk' |
|
|
|
|
import { extractSdkResponseErrorMsg, onBeforeMount, parseProp, timeAgo, useApi } from '#imports' |
|
|
|
|
import { extractSdkResponseErrorMsg, onBeforeMount, parseProp, timeAgo, useApi, useGlobal } from '#imports' |
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
|
hook: HookType |
|
|
|
@ -14,11 +14,13 @@ const hookLogs = ref<HookLogType[]>([])
|
|
|
|
|
|
|
|
|
|
const activeKey = ref() |
|
|
|
|
|
|
|
|
|
const { appInfo } = useGlobal() |
|
|
|
|
|
|
|
|
|
let totalRows = $ref(0) |
|
|
|
|
|
|
|
|
|
const currentPage = $ref(1) |
|
|
|
|
|
|
|
|
|
const currentLimit = $ref(25) |
|
|
|
|
const currentLimit = $ref(10) |
|
|
|
|
|
|
|
|
|
async function loadHookLogs(page = currentPage, limit = currentLimit) { |
|
|
|
|
try { |
|
|
|
@ -42,7 +44,24 @@ onBeforeMount(async () => {
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|
<a-skeleton v-if="isLoading" /> |
|
|
|
|
<a-empty v-else-if="!hookLogs.length" /> |
|
|
|
|
<div v-else> |
|
|
|
|
<a-card class="!mb-[20px]" :body-style="{ padding: '10px' }"> |
|
|
|
|
<span v-if="appInfo.automationLogLevel === 'OFF'"> |
|
|
|
|
The NC_AUTOMATION_LOG_LEVEL is set to “OFF”, no logs will be displayed. |
|
|
|
|
</span> |
|
|
|
|
<span v-if="appInfo.automationLogLevel === 'ERROR'"> |
|
|
|
|
The NC_AUTOMATION_LOG_LEVEL is set to “ERROR”, only error logs will be displayed. |
|
|
|
|
</span> |
|
|
|
|
<span v-if="appInfo.automationLogLevel === 'ALL'"> |
|
|
|
|
The NC_AUTOMATION_LOG_LEVEL is set to “ALL”, both error and success logs will be displayed. |
|
|
|
|
</span> |
|
|
|
|
<span> |
|
|
|
|
<!-- TODO: update the link --> |
|
|
|
|
For additional configuration options, please refer the documentation <a href="#" target="_blank">here</a>. |
|
|
|
|
</span> |
|
|
|
|
</a-card> |
|
|
|
|
|
|
|
|
|
<a-empty v-if="!hookLogs.length" /> |
|
|
|
|
<a-layout v-else> |
|
|
|
|
<a-layout-content> |
|
|
|
|
<a-collapse v-model:activeKey="activeKey" class="nc-hook-log-collapse"> |
|
|
|
@ -107,7 +126,6 @@ onBeforeMount(async () => {
|
|
|
|
|
<a-layout-footer class="!bg-white text-center"> |
|
|
|
|
<a-pagination |
|
|
|
|
v-model:current="currentPage" |
|
|
|
|
style="width: calc(100% - 50px)" |
|
|
|
|
:page-size="currentLimit" |
|
|
|
|
:total="totalRows" |
|
|
|
|
show-less-items |
|
|
|
@ -115,6 +133,7 @@ onBeforeMount(async () => {
|
|
|
|
|
/> |
|
|
|
|
</a-layout-footer> |
|
|
|
|
</a-layout> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|