@@ -1192,7 +1192,7 @@ const VALID_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/webp']
11921192// Paste image.
11931193async function handlePasteImage(event : ClipboardEvent ) {
11941194 // Check if image upload is enabled.
1195- if (! currentChatRoom .value ?.imageUploadEnabled ) {
1195+ if (currentChatRoom .value ?.imageUploadEnabled === false ) {
11961196 ms .warning (t (' chat.imageUploadDisabled' ) || ' 图片上传功能已关闭' , {
11971197 duration: 2000 ,
11981198 })
@@ -1300,14 +1300,9 @@ onUnmounted(() => {
13001300 <div class =" flex flex-col w-full h-full" >
13011301 <HeaderComponent
13021302 v-if =" isMobile "
1303- :using-context =" currentChatRoom ?.usingContext "
13041303 :show-prompt =" showPrompt "
1305- :search-enabled =" currentChatRoom ?.searchEnabled "
1306- :think-enabled =" currentChatRoom ?.thinkEnabled "
1304+ :using-context =" currentChatRoom ?.usingContext "
13071305 @export =" handleExport "
1308- @toggle-using-context =" handleToggleUsingContext "
1309- @toggle-search-enabled =" handleToggleSearchEnabled "
1310- @toggle-think-enabled =" handleToggleThinkEnabled "
13111306 @toggle-show-prompt =" showPrompt = true "
13121307 />
13131308 <main class =" flex-1 overflow-hidden" >
@@ -1386,13 +1381,49 @@ onUnmounted(() => {
13861381 </NSpace >
13871382 </div >
13881383
1389- <div class =" flex items-center space-x-2" >
1390- <div v-if =" currentChatRoom?.imageUploadEnabled" >
1384+ <div
1385+ v-if =" isMobile"
1386+ class =" grid grid-cols-3 justify-items-center gap-[clamp(0.125rem,1vw,0.5rem)]"
1387+ >
1388+ <HoverButton
1389+ class="w-full flex justify-center"
1390+ :class =" { ' text-[#2f9e44]' : currentChatRoom ?.searchEnabled , ' text-[#c92a2a]' : ! currentChatRoom ?.searchEnabled } "
1391+ @click =" handleToggleSearchEnabled "
1392+ >
1393+ <span class =" w-full text-[11px] flex items-center justify-center gap-[clamp(0.125rem,0.6vw,0.375rem)] text-center leading-tight" >
1394+ <IconMdiWeb class="text-[12px]" />
1395+ <span class =" text-[11px] font-semibold tracking-tight" >{{ currentChatRoom?.searchEnabled ? t('chat.searchEnabled') : t('chat.searchDisabled') }}</span >
1396+ </span >
1397+ </HoverButton >
1398+ <HoverButton
1399+ class="w-full flex justify-center"
1400+ :class =" { ' text-[#2f9e44]' : currentChatRoom ?.thinkEnabled , ' text-[#c92a2a]' : ! currentChatRoom ?.thinkEnabled } "
1401+ @click =" handleToggleThinkEnabled "
1402+ >
1403+ <span class =" w-full text-[11px] flex items-center justify-center gap-[clamp(0.125rem,0.6vw,0.375rem)] text-center leading-tight" >
1404+ <IconMdiLightbulbOutline class="text-[12px]" />
1405+ <span class =" text-[11px] font-semibold tracking-tight" >{{ currentChatRoom?.thinkEnabled ? t('chat.thinkEnabled') : t('chat.thinkDisabled') }}</span >
1406+ </span >
1407+ </HoverButton >
1408+ <HoverButton
1409+ class="w-full flex justify-center"
1410+ :class =" { ' text-[#2f9e44]' : currentChatRoom ?.usingContext , ' text-[#c92a2a]' : ! currentChatRoom ?.usingContext } "
1411+ @click =" handleToggleUsingContext "
1412+ >
1413+ <span class =" w-full text-[11px] flex items-center justify-center gap-[clamp(0.125rem,0.6vw,0.375rem)] text-center leading-tight" >
1414+ <IconRiChatHistoryLine class="text-[12px]" />
1415+ <span class =" text-[11px] font-semibold tracking-tight" >{{ currentChatRoom?.usingContext ? t('chat.showOnContext') : t('chat.showOffContext') }}</span >
1416+ </span >
1417+ </HoverButton >
1418+ </div >
1419+ <div class =" flex items-center" :class =" [isMobile ? 'flex-wrap gap-2' : 'space-x-2']" >
1420+ <div v-if =" currentChatRoom" >
13911421 <NUpload
13921422 action="/api/upload-image"
13931423 list-type="image"
13941424 class="flex items-center justify-center h-10 transition hover:bg-neutral-100 dark:hover :bg- [#414755 ]"
13951425 style =" flex-flow :row nowrap ;min-width :2.5em ;padding :.5em ;border-radius :.5em ;"
1426+ :disabled =" currentChatRoom ?.imageUploadEnabled === false "
13961427 :headers =" uploadHeaders "
13971428 :show-file-list =" false "
13981429 :multiple =" true "
@@ -1421,7 +1452,7 @@ onUnmounted(() => {
14211452 </span >
14221453 </HoverButton >
14231454 <NSelect
1424- style =" width : 250px "
1455+ : style =" { width: isMobile ? ' 100% ' : ' 250px' } "
14251456 :value =" currentChatRoom ?.chatModel "
14261457 :options =" chatModelOptions "
14271458 :disabled =" !! authStore .session ?.auth && ! authStore .token && ! authStore .session ?.authProxyEnabled "
@@ -1432,36 +1463,36 @@ onUnmounted(() => {
14321463 v-if =" ! isMobile "
14331464 :tooltip =" currentChatRoom ?.searchEnabled ? t (' chat.clickTurnOffSearch' ) : t (' chat.clickTurnOnSearch' )"
14341465 :tooltip-help =" t (' chat.searchHelp' )"
1435- :class =" { ' text-[#4b9e5f ]' : currentChatRoom ?.searchEnabled , ' text-[#a8071a ]' : ! currentChatRoom ?.searchEnabled } "
1466+ :class =" { ' text-[#2f9e44 ]' : currentChatRoom ?.searchEnabled , ' text-[#c92a2a ]' : ! currentChatRoom ?.searchEnabled } "
14361467 @click =" handleToggleSearchEnabled "
14371468 >
1438- <span class =" text-xl flex items-center" >
1439- <IconMdiWeb />
1440- <span class =" ml-1 text-sm " >{{ currentChatRoom?.searchEnabled ? t('chat.searchEnabled') : t('chat.searchDisabled') }}</span >
1469+ <span class =" text-sm flex items-center gap-1 " >
1470+ <IconMdiWeb class="text-base" />
1471+ <span class =" text-xs font-bold tracking-wide " >{{ currentChatRoom?.searchEnabled ? t('chat.searchEnabled') : t('chat.searchDisabled') }}</span >
14411472 </span >
14421473 </HoverButton >
14431474 <HoverButton
14441475 v-if =" ! isMobile "
14451476 :tooltip =" currentChatRoom ?.thinkEnabled ? t (' chat.clickTurnOffThink' ) : t (' chat.clickTurnOnThink' )"
14461477 :tooltip-help =" t (' chat.thinkHelp' )"
1447- :class =" { ' text-[#4b9e5f ]' : currentChatRoom ?.thinkEnabled , ' text-[#a8071a ]' : ! currentChatRoom ?.thinkEnabled } "
1478+ :class =" { ' text-[#2f9e44 ]' : currentChatRoom ?.thinkEnabled , ' text-[#c92a2a ]' : ! currentChatRoom ?.thinkEnabled } "
14481479 @click =" handleToggleThinkEnabled "
14491480 >
1450- <span class =" text-xl flex items-center" >
1451- <IconMdiLightbulbOutline />
1452- <span class =" ml-1 text-sm " >{{ currentChatRoom?.thinkEnabled ? t('chat.thinkEnabled') : t('chat.thinkDisabled') }}</span >
1481+ <span class =" text-sm flex items-center gap-1 " >
1482+ <IconMdiLightbulbOutline class="text-base" />
1483+ <span class =" text-xs font-bold tracking-wide " >{{ currentChatRoom?.thinkEnabled ? t('chat.thinkEnabled') : t('chat.thinkDisabled') }}</span >
14531484 </span >
14541485 </HoverButton >
14551486 <HoverButton
14561487 v-if =" ! isMobile "
14571488 :tooltip =" currentChatRoom ?.usingContext ? t (' chat.clickTurnOffContext' ) : t (' chat.clickTurnOnContext' )"
14581489 :tooltip-help =" t (' chat.contextHelp' )"
1459- :class =" { ' text-[#4b9e5f ]' : currentChatRoom ?.usingContext , ' text-[#a8071a ]' : ! currentChatRoom ?.usingContext } "
1490+ :class =" { ' text-[#2f9e44 ]' : currentChatRoom ?.usingContext , ' text-[#c92a2a ]' : ! currentChatRoom ?.usingContext } "
14601491 @click =" handleToggleUsingContext "
14611492 >
1462- <span class =" text-xl flex items-center" >
1463- <IconRiChatHistoryLine />
1464- <span class =" ml-1 text-sm " >{{ currentChatRoom?.usingContext ? t('chat.showOnContext') : t('chat.showOffContext') }}</span >
1493+ <span class =" text-sm flex items-center gap-1 " >
1494+ <IconRiChatHistoryLine class="text-base" />
1495+ <span class =" text-xs font-bold tracking-wide " >{{ currentChatRoom?.usingContext ? t('chat.showOnContext') : t('chat.showOffContext') }}</span >
14651496 </span >
14661497 </HoverButton >
14671498 <NSlider
0 commit comments