-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Set display history #3937
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 |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| <el-menu | ||
| :default-active="currentChatId" | ||
| :collapse="isPcCollapse" | ||
| collapse-transition | ||
| :collapse-transition="false" | ||
| popper-class="chat-pc-popper" | ||
| class="h-full" | ||
| > | ||
|
|
@@ -37,7 +37,11 @@ | |
| <AppIcon iconName="app-create-chat"></AppIcon> | ||
| <span class="ml-4">{{ $t('chat.createChat') }}</span> | ||
| </el-button> | ||
| <div v-show="!isPcCollapse" class="flex-between p-8 pb-0 color-secondary mt-8"> | ||
| <div | ||
| v-show="!isPcCollapse" | ||
| class="flex-between p-8 pb-0 color-secondary mt-8" | ||
| v-if="applicationDetail.show_history || hasPermission(EditionConst.IS_CE, 'OR')" | ||
| > | ||
| <span>{{ $t('chat.history') }}</span> | ||
| <el-tooltip effect="dark" :content="$t('chat.clearChat')" placement="right"> | ||
| <el-button text @click.stop="clearChat"> | ||
|
|
@@ -46,7 +50,11 @@ | |
| </el-tooltip> | ||
| </div> | ||
| </div> | ||
| <div v-show="!isPcCollapse" class="left-height"> | ||
| <div | ||
| v-show="!isPcCollapse" | ||
| class="left-height" | ||
| v-if="applicationDetail.show_history || hasPermission(EditionConst.IS_CE, 'OR')" | ||
| > | ||
| <el-scrollbar> | ||
| <div class="p-16 pt-0"> | ||
| <common-list | ||
|
|
@@ -103,7 +111,7 @@ | |
| <template #title>{{ $t('chat.createChat') }}</template> | ||
| </el-menu-item> | ||
|
|
||
| <el-sub-menu v-show="isPcCollapse" index="2"> | ||
| <el-sub-menu v-show="isPcCollapse" index="2" v-if="applicationDetail.show_history || hasPermission(EditionConst.IS_CE, 'OR')"> | ||
| <template #title> | ||
| <AppIcon iconName="app-history-outlined" /> | ||
| </template> | ||
|
|
@@ -163,6 +171,8 @@ | |
| import { ref } from 'vue' | ||
| import { isAppIcon } from '@/utils/common' | ||
| import EditTitleDialog from './EditTitleDialog.vue' | ||
| import { EditionConst } from '@/utils/permission/data' | ||
| import { hasPermission } from '@/utils/permission/index' | ||
| const props = defineProps<{ | ||
| applicationDetail: any | ||
| chatLogData: any[] | ||
|
Contributor
Author
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. This code appears to be modifying an Echarts-based component in a Vue application with multiple conditional statements related to whether or not the device is in desktop mode ( Irregularities and Suggestions:
Overall, this code should function correctly, however refining it would make it more maintainable and efficient. <template>
<div v-show="!isPcCollapse">
<ElScrollbar when-scroll="auto" class="">
<CommonList
v-if="applicationDetail.show_history || shouldShowHistoryList()"
>
<!-- List content here -->
</ CommonList>
ElScrollbar>
<div class="" v-if="applicationDetail.show_history || shouldShowHistoryList()">
...
</ div>
</div>Make sure you replace |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,18 +11,16 @@ | |
| class="mcp-config-dialog" | ||
| > | ||
| <el-form label-width="auto" label-position="top"> | ||
| <el-form-item> | ||
| <el-form-item @mouseenter.stop="showIcon = true" @mouseleave.stop="showIcon = false"> | ||
| <el-input | ||
| type="textarea" | ||
| v-model="mcp_servers" | ||
| rows="8" | ||
| disabled | ||
| class="config-textarea" | ||
| @mouseenter.stop="showIcon = true" | ||
| @mouseleave.stop="showIcon = false" | ||
| ></el-input> | ||
| <el-button circle class="copy-icon" v-if="showIcon" @click="copyClick(mcp_servers)"> | ||
| <AppIcon iconName="app-copy" class="color-secondary"/> | ||
| <el-button circle class="copy-icon" v-show="showIcon" @click.stop="copyClick(mcp_servers)"> | ||
| <AppIcon iconName="app-copy" class="color-secondary" /> | ||
| </el-button> | ||
| </el-form-item> | ||
| </el-form> | ||
|
Contributor
Author
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 after modifications -->
<cl<|fim_suffix|>ntent="">In summary:
|
||
|
|
||
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 provided code snippet has a few improvements to make it more efficient and robust:
v-showinstead ofv-ifin the conditional rendering to avoid unnecessary component re-renders whenitem?.document_namechanges but the source file ID/url remains empty.Add this at the top of your script or data section:
This change ensures that the image icon is not displayed unless either the document name is an image type or there's no associated file URL/source file ID. Also, remove unnecessary space between elements inside
.flex-between.