Browse Source

feat(nc-gui): revise call log display logic

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
505c8f84d7
  1. 11
      packages/nc-gui/components/webhook/CallLog.vue

11
packages/nc-gui/components/webhook/CallLog.vue

@ -22,6 +22,10 @@ const currentPage = $ref(1)
const currentLimit = $ref(10) const currentLimit = $ref(10)
const showLogs = computed(
() => !(appInfo.value.automationLogLevel === 'OFF' || (appInfo.value.automationLogLevel === 'ALL' && !appInfo.value.ee)),
)
async function loadHookLogs(page = currentPage, limit = currentLimit) { async function loadHookLogs(page = currentPage, limit = currentLimit) {
try { try {
// cater empty records // cater empty records
@ -38,7 +42,9 @@ async function loadHookLogs(page = currentPage, limit = currentLimit) {
} }
onBeforeMount(async () => { onBeforeMount(async () => {
if (showLogs.value) {
await loadHookLogs(currentPage, currentLimit) await loadHookLogs(currentPage, currentLimit)
}
}) })
</script> </script>
@ -53,14 +59,18 @@ onBeforeMount(async () => {
The NC_AUTOMATION_LOG_LEVEL is set to ERROR, only error logs will be displayed. The NC_AUTOMATION_LOG_LEVEL is set to ERROR, only error logs will be displayed.
</span> </span>
<span v-if="appInfo.automationLogLevel === 'ALL'"> <span v-if="appInfo.automationLogLevel === 'ALL'">
<span v-if="appInfo.ee">
The NC_AUTOMATION_LOG_LEVEL is set to ALL, both error and success logs will be displayed. The NC_AUTOMATION_LOG_LEVEL is set to ALL, both error and success logs will be displayed.
</span> </span>
<span v-else> Upgrade to Enterprise Edition to show all the logs. </span>
</span>
<span> <span>
<!-- TODO: update the link --> <!-- TODO: update the link -->
For additional configuration options, please refer the documentation <a href="#" target="_blank">here</a>. For additional configuration options, please refer the documentation <a href="#" target="_blank">here</a>.
</span> </span>
</a-card> </a-card>
<div v-if="showLogs">
<a-empty v-if="!hookLogs.length" /> <a-empty v-if="!hookLogs.length" />
<a-layout v-else> <a-layout v-else>
<a-layout-content> <a-layout-content>
@ -134,6 +144,7 @@ onBeforeMount(async () => {
</a-layout-footer> </a-layout-footer>
</a-layout> </a-layout>
</div> </div>
</div>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

Loading…
Cancel
Save