@@ -6,6 +6,8 @@ import { useLayoutStore } from '@/renderer/store/layout'
66import { v4 as uuidv4 } from ' uuid'
77import { getApiToken , listenStdioProgress , removeListenStdioProgress } from ' @/renderer/utils'
88import LogoAvatar from ' @/renderer/components/common/LogoAvatar.vue'
9+ import ConfigJsonCard from ' @/renderer/components/common/ConfigJsonCard.vue'
10+
911import type { ChatbotConfig } from ' @/types/llm'
1012
1113const layoutStore = useLayoutStore ()
@@ -25,8 +27,7 @@ interface Emits {
2527 (_e : ' batch:token' , _apiCli : string , _apiKey : string ): void
2628}
2729
28- // const props =
29- defineProps <Props >()
30+ const props = defineProps <Props >()
3031const emit = defineEmits <Emits >()
3132const handleUpdate = <K extends keyof ChatbotConfig >(key : K , value : ChatbotConfig [K ]) => {
3233 emit (' update:config' , { [key ]: value } as Partial <ChatbotConfig >)
@@ -45,6 +46,21 @@ watch(apiDialog, (_val) => {
4546 stderr .value .length = 0
4647})
4748
49+ watch (
50+ () => props .config .enableExtraBody ,
51+ async (val ) => {
52+ if (val ) {
53+ domExtraBody .value ?.scrollIntoView ({
54+ behavior: ' smooth' ,
55+ block: ' center'
56+ })
57+ }
58+ },
59+ { flush: ' post' }
60+ )
61+
62+ const domExtraBody = ref <HTMLElement | null >(null )
63+
4864const handleGetApiToken = async (cli : string ): Promise <void > => {
4965 const handleProgress = (_event : Event , progress : string ) => {
5066 stdout .value .push (progress )
@@ -344,15 +360,33 @@ const validateNumberRange = (min: number, max: number) => {
344360 <v-btn-toggle
345361 class =" mt-0"
346362 color =" secondary"
363+ v-tooltip:top =" $t('setting.enable-thinking-tip')"
347364 :model-value =" config.enableThinking"
348365 variant =" plain"
349366 @update:model-value =" (v) => handleUpdate('enableThinking', v)"
350367 >
351368 <v-btn v-for =" level in ENABLE_THINKING" :key =" level" >{{ level }}</v-btn >
352369 </v-btn-toggle >
353370 </v-field >
371+ <v-switch
372+ min-width =" 200px"
373+ class =" ml-4"
374+ :label =" $t('setting.enable-extra-body')"
375+ color =" secondary"
376+ base-color =" primary"
377+ hide-details
378+ inset
379+ :model-value =" config.enableExtraBody"
380+ @update:model-value =" (v) => handleUpdate('enableExtraBody', Boolean(v))"
381+ ></v-switch >
354382 </v-card-text >
355383 </v-card >
384+ <div ref =" domExtraBody" >
385+ <v-card v-if =" config.enableExtraBody" class =" mx-auto mt-4" :title =" $t('setting.extra-body')" >
386+ <v-divider ></v-divider >
387+ <ConfigJsonCard v-model =" config.extraBody" clearable rows =" 1" > </ConfigJsonCard >
388+ </v-card >
389+ </div >
356390</template >
357391<style scoped>
358392.cursor-pointer {
0 commit comments