Skip to content

Commit 857f988

Browse files
fix: style
1 parent 0316afa commit 857f988

File tree

17 files changed

+219
-251
lines changed

17 files changed

+219
-251
lines changed

ui/src/components/ai-chat/component/answer-content/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ const emit = defineEmits([
100100
])
101101
102102
const showAvatar = computed(() => {
103-
return user.isEnterprise() ? props.application.show_avatar : true
103+
return (user.isEE() || user.isPE())? props.application.show_avatar : true
104104
})
105105
const showUserAvatar = computed(() => {
106-
return user.isEnterprise() ? props.application.show_user_avatar : true
106+
return user.isEE() || user.isPE() ? props.application.show_user_avatar : true
107107
})
108108
const chatMessage = (question: string, type: 'old' | 'new', other_params_data?: any) => {
109109
if (type === 'old') {

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div class="ai-chat__operate p-16">
3-
<slot name="operateBefore" />
43
<div class="operate-textarea">
54
<el-scrollbar max-height="136">
65
<div
@@ -170,13 +169,7 @@
170169
v-model="inputValue"
171170
:autosize="{ minRows: 1, maxRows: isMobile ? 4 : 10 }"
172171
type="textarea"
173-
:placeholder="
174-
recorderStatus === 'START'
175-
? `${$t('chat.inputPlaceholder.speaking')}...`
176-
: recorderStatus === 'TRANSCRIBING'
177-
? `${$t('chat.inputPlaceholder.recorderLoading')}...`
178-
: $t('chat.inputPlaceholder.default')
179-
"
172+
:placeholder="inputPlaceholder"
180173
:maxlength="100000"
181174
@keydown.enter="sendChatHandle($event)"
182175
@paste="handlePaste"
@@ -294,6 +287,7 @@
294287
</template>
295288
<script setup lang="ts">
296289
import { ref, computed, onMounted, nextTick, watch, type Ref } from 'vue'
290+
import { t } from '@/locales'
297291
import Recorder from 'recorder-core'
298292
import TouchChat from './TouchChat.vue'
299293
import applicationApi from '@/api/application/application'
@@ -305,7 +299,7 @@ import bus from '@/bus'
305299
import 'recorder-core/src/engine/mp3'
306300
import 'recorder-core/src/engine/mp3-engine'
307301
import { MsgWarning } from '@/utils/message'
308-
import { t } from '@/locales'
302+
import { debounce } from 'lodash'
309303
import chatAPI from '@/api/chat/chat'
310304
const router = useRouter()
311305
const route = useRoute()
@@ -353,6 +347,14 @@ const localLoading = computed({
353347
},
354348
})
355349
350+
const inputPlaceholder = computed(() => {
351+
return recorderStatus.value === 'START'
352+
? `${t('chat.inputPlaceholder.speaking')}...`
353+
: recorderStatus.value === 'TRANSCRIBING'
354+
? `${t('chat.inputPlaceholder.recorderLoading')}...`
355+
: `${t('chat.inputPlaceholder.default')}`
356+
})
357+
356358
const upload = ref()
357359
358360
const imageExtensions = ['JPG', 'JPEG', 'PNG', 'GIF', 'BMP']
@@ -800,7 +802,6 @@ function mouseenter(row: any) {
800802
function mouseleave() {
801803
showDelete.value = ''
802804
}
803-
804805
onMounted(() => {
805806
bus.on('chat-input', (message: string) => {
806807
inputValue.value = message

ui/src/components/ai-chat/component/knowledge-source-component/ParagraphCard.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
</el-text>
4040
</el-card>
4141
<div class="flex align-center border-t" style="padding: 12px 0 8px">
42-
<el-avatar class="mr-8 avatar-blue" shape="square" :size="18">
43-
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
44-
</el-avatar>
42+
<KnowledgeIcon :type="data?.knowledge_type" :size="18" class="mr-8" />
4543
<span class="ellipsis-1 break-all" :title="data?.knowledge_name">
4644
{{ data?.knowledge_name || '-' }}
4745
</span>

ui/src/components/ai-chat/component/prologue-content/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ const props = defineProps<{
3838
const { user } = useStore()
3939
4040
const showAvatar = computed(() => {
41-
return user.isEnterprise() ? props.application.show_avatar : true
41+
return (user.isEE() || user.isPE()) ? props.application.show_avatar : true
4242
})
4343
const showUserAvatar = computed(() => {
44-
return user.isEnterprise() ? props.application.show_user_avatar : true
44+
return user.isEE() || user.isPE() ? props.application.show_user_avatar : true
4545
})
4646
4747
const toQuickQuestion = (match: string, offset: number, input: string) => {

ui/src/components/ai-chat/component/question-content/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const props = defineProps<{
109109
const { user } = useStore()
110110
111111
const showAvatar = computed(() => {
112-
return user.isEnterprise() ? props.application.show_user_avatar : true
112+
return user.isEE() || user.isPE() ? props.application.show_user_avatar : true
113113
})
114114
115115
const document_list = computed(() => {

ui/src/stores/modules/application.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const useApplicationStore = defineStore('application', {
2525
async asyncGetAccessToken(id: string, loading?: Ref<boolean>) {
2626
return new Promise((resolve, reject) => {
2727
const user = useUserStore()
28-
if (user.isEnterprise()) {
28+
if (user.isEE() || user.isPE()) {
2929
applicationXpackApi
3030
.getAccessToken(id, loading)
3131
.then((data) => {

ui/src/styles/element-plus.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@
215215
}
216216
}
217217

218+
@media only screen and (max-width: 768px) {
219+
.el-dialog {
220+
width: 90% !important;
221+
}
222+
}
223+
218224
// el-form
219225

220226
.el-form {

ui/src/views/application-overview/component/EditAvatarDialog.vue

Lines changed: 0 additions & 138 deletions
This file was deleted.

ui/src/views/application-overview/index.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@
195195
:api-input-params="mapToUrlParams(apiInputParams)"
196196
/>
197197
<APIKeyDialog ref="APIKeyDialogRef"/>
198-
<EditAvatarDialog ref="EditAvatarDialogRef" @refresh="refreshIcon"/>
199198

200199
<!-- 社区版访问限制 -->
201200
<component :is="currentLimitDialog" ref="LimitDialogRef" @refresh="refresh"/>
@@ -212,7 +211,6 @@ import LimitDialog from './component/LimitDialog.vue'
212211
import XPackLimitDrawer from './xpack-component/XPackLimitDrawer.vue'
213212
import DisplaySettingDialog from './component/DisplaySettingDialog.vue'
214213
import XPackDisplaySettingDialog from './xpack-component/XPackDisplaySettingDialog.vue'
215-
import EditAvatarDialog from './component/EditAvatarDialog.vue'
216214
import StatisticsCharts from './component/StatisticsCharts.vue'
217215
import applicationApi from '@/api/application/application'
218216
import {nowDate, beforeDay} from '@/utils/time'
@@ -244,7 +242,6 @@ const apiUrl = window.location.origin + '/doc/chat/'
244242
245243
const baseUrl = window.location.origin + '/api/application/'
246244
247-
const EditAvatarDialogRef = ref()
248245
const APIKeyDialogRef = ref()
249246
const EmbedDialogRef = ref()
250247
@@ -345,10 +342,6 @@ function openLimitDialog() {
345342
})
346343
}
347344
348-
function openEditAvatar() {
349-
EditAvatarDialogRef.value.open(detail.value)
350-
}
351-
352345
function changeDayHandle(val: number | string) {
353346
if (val !== 'other') {
354347
daterange.value.start_time = beforeDay(val)

ui/src/views/application-overview/xpack-component/XPackLimitDrawer.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@
3434
v-if="form.authentication"
3535
v-model="form.authentication_value.type"
3636
class="card__radio"
37+
@change="(val: string) => val === 'password' && refreshAuthentication()"
3738
>
3839
<el-card
3940
shadow="never"
4041
class="mb-16"
41-
:class="form.authentication_value.type === 'password' ? 'active' : ''"
42+
:class="form.authentication_value?.type === 'password' ? 'active' : ''"
4243
>
4344
<el-radio value="password" size="large">
4445
<p class="mb-4 lighter">
@@ -160,7 +161,9 @@ const form = ref<any>({
160161
access_num: 0,
161162
white_active: true,
162163
white_list: '',
163-
authentication_value: {},
164+
authentication_value: {
165+
type: 'password',
166+
},
164167
authentication: false,
165168
})
166169
@@ -190,7 +193,12 @@ const open = (data: any) => {
190193
form.value.access_num = data.access_num
191194
form.value.white_active = data.white_active
192195
form.value.white_list = data.white_list?.length ? data.white_list?.join('\n') : ''
193-
form.value.authentication_value = data.authentication_value
196+
form.value.authentication_value = data.authentication_value || {
197+
type: 'password',
198+
}
199+
if (form.value.authentication_value.type === 'password') {
200+
refreshAuthentication()
201+
}
194202
form.value.authentication = data.authentication
195203
dialogVisible.value = true
196204
applicationApi.getChatUserAuthType().then((ok) => {

0 commit comments

Comments
 (0)