-
Notifications
You must be signed in to change notification settings - Fork 2.2k
perf: Cancel automatic closure of debugging dialog #2248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ export default { | |
only20history: '僅顯示最近 20 條對話', | ||
question_count: '條提問', | ||
exportRecords: '導出聊天記錄', | ||
chatId: '對話ID', | ||
chatId: '對話 ID', | ||
userInput: '用戶輸入', | ||
quote: '引用', | ||
download: '點擊下載文件', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code looks mostly correct. However, there's a small grammatical issue in the translation of "chatID": Original:
Suggested correction (more natural English):
This change makes the text more standard and clear, especially for non-native speakers. If you don't require users to see |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,9 @@ | |
</el-button> | ||
</div> | ||
<div v-else> | ||
<el-button icon="Plus" @click="showPopover = !showPopover"> {{ $t('views.applicationWorkflow.setting.addComponent') }} </el-button> | ||
<el-button icon="Plus" @click="showPopover = !showPopover"> | ||
{{ $t('views.applicationWorkflow.setting.addComponent') }} | ||
</el-button> | ||
<el-button @click="clickShowDebug" :disabled="showDebug"> | ||
<AppIcon iconName="app-play-outlined" class="mr-4"></AppIcon> | ||
{{ $t('views.applicationWorkflow.setting.debug') }}</el-button | ||
|
@@ -36,7 +38,9 @@ | |
<AppIcon iconName="app-save-outlined" class="mr-4"></AppIcon> | ||
{{ $t('common.save') }} | ||
</el-button> | ||
<el-button type="primary" @click="publicHandle"> {{ $t('views.applicationWorkflow.setting.public') }} </el-button> | ||
<el-button type="primary" @click="publicHandle"> | ||
{{ $t('views.applicationWorkflow.setting.public') }} | ||
</el-button> | ||
|
||
<el-dropdown trigger="click"> | ||
<el-button text @click.stop class="ml-8 mt-4"> | ||
|
@@ -77,12 +81,7 @@ | |
</div> | ||
<!-- 调试 --> | ||
<el-collapse-transition> | ||
<div | ||
v-click-outside="clickoutsideDebug" | ||
class="workflow-debug-container" | ||
:class="enlarge ? 'enlarge' : ''" | ||
v-if="showDebug" | ||
> | ||
<div class="workflow-debug-container" :class="enlarge ? 'enlarge' : ''" v-if="showDebug"> | ||
<div class="workflow-debug-header" :class="!isDefaultTheme ? 'custom-header' : ''"> | ||
<div class="flex-between"> | ||
<div class="flex align-center"> | ||
|
@@ -268,10 +267,18 @@ async function publicHandle() { | |
const node = res.node | ||
const err_message = res.errMessage | ||
if (typeof err_message == 'string') { | ||
MsgError(res.node.properties?.stepName + ` ${t('views.applicationWorkflow.node').toLowerCase()} ` + err_message.toLowerCase()) | ||
MsgError( | ||
res.node.properties?.stepName + | ||
` ${t('views.applicationWorkflow.node').toLowerCase()} ` + | ||
err_message.toLowerCase() | ||
) | ||
} else { | ||
const keys = Object.keys(err_message) | ||
MsgError(node.properties?.stepName + ` ${t('views.applicationWorkflow.node').toLowerCase()} ` + err_message[keys[0]]?.[0]?.message.toLowerCase()) | ||
MsgError( | ||
node.properties?.stepName + | ||
` ${t('views.applicationWorkflow.node').toLowerCase()} ` + | ||
err_message[keys[0]]?.[0]?.message.toLowerCase() | ||
) | ||
} | ||
}) | ||
} | ||
|
@@ -300,18 +307,24 @@ const clickShowDebug = () => { | |
const node = res.node | ||
const err_message = res.errMessage | ||
if (typeof err_message == 'string') { | ||
MsgError(res.node.properties?.stepName + ` ${t('views.applicationWorkflow.node')},` + err_message) | ||
MsgError( | ||
res.node.properties?.stepName + ` ${t('views.applicationWorkflow.node')},` + err_message | ||
) | ||
} else { | ||
const keys = Object.keys(err_message) | ||
MsgError(node.properties?.stepName + ` ${t('views.applicationWorkflow.node')},` + err_message[keys[0]]?.[0]?.message) | ||
MsgError( | ||
node.properties?.stepName + | ||
` ${t('views.applicationWorkflow.node')},` + | ||
err_message[keys[0]]?.[0]?.message | ||
) | ||
} | ||
}) | ||
} | ||
function clickoutsideDebug(e: any) { | ||
if (workflowMainRef.value && e && e.target && workflowMainRef.value.contains(e?.target)) { | ||
showDebug.value = false | ||
} | ||
} | ||
// function clickoutsideDebug(e: any) { | ||
// if (workflowMainRef.value && e && e.target && workflowMainRef.value.contains(e?.target)) { | ||
// showDebug.value = false | ||
// } | ||
// } | ||
|
||
function getGraphData() { | ||
return workflowRef.value?.getGraphData() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThe provided code appears to be part of an application that manages workflow settings, includes buttons and collapsible elements for adding components, debugging nodes, and setting visibility or publication status. Here's a review highlighting any irregularities, potential issues, or optimization suggestions: Irregularities/Potential Issues
Optimization Suggestions
These adjustments should lead to cleaner, more efficient code, improving readability and potentially performance. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code appears to be well-formatted and clear with no major discrepancies or inconsistencies. There is one suggestion for improving readability:
In line 6, "对话ID" could potentially be clearer in context if it were changed to "会话 ID". This ensures that the phrase accurately reflects its meaning as a reference to an identifier for a conversation.
Overall, the code looks good, but this minor suggestion can help clarify the text better.