Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/views/knowledge-workflow/component/DebugDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:close-on-press-escape="false"
>
<div style="height: calc(100% - 57px)" v-loading="loading">
<keep-alive :key="key" :include="['data_source', 'knowledge_base']">
<keep-alive :key="key" :include="['DataSource', 'KnowledgeBase']">
<component
ref="ActionRef"
:is="ak[active]"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your code, there are two potential issues that need to be addressed:

  1. Variable Name Consistency: The variable key is used with a capital letter (@Key in the template) but it should be consistently used as lower case (key in :key="key"). This consistency can help avoid syntax errors and improve legibility.

  2. Component Case Sensitivity: The component names 'DataSource', 'KnowledgeBase', and their references in ak[active] have inconsistent casing which might cause runtime issues depending on your environment’s case sensitivity settings.

To optimize the code:

  • Ensure you keep all instance variables consistent (e.g., using lowercase for key).
  • Maintain consistent naming conventions throughout the codebase.

Here's the corrected version of your code snippet:

<template>
  <el-container class="full-height">
    <el-header height="48px" @click.native.prevent.stop="">
      <!-- Header content -->
    </el-header>

    <el-main :style="{ maxHeight: 'calc(100vh - 96px)', overflow: 'auto' }">
      <keep-alive :key="key" :include="['dataSource', 'knowledge_base']">
        <component
          ref="actionRef"
          :is="ak[active]"
          :close-on-press-escape="false"
        />
      </keep-alive>
    </el-main>

    <el-footer>Footer</el-footer>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      isLoading: false,
      key: Math.random().toString(),
      ak: {},
      active: ''
    };
  },
  methods: {
    // Method definitions
  }
};
</script>

Make sure to adjust this example to fit within your project structure and integrate the rest of your logic accordingly.

Expand Down
Loading