diff --git a/.env b/.env index f12d7e00..12c95ae6 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -COCO_SERVER_URL=https://coco.infini.cloud #http://localhost:9000 +COCO_SERVER_URL=http://localhost:9000 https://coco.infini.cloud #http://localhost:9000 -COCO_WEBSOCKET_URL=wss://coco.infini.cloud/ws #ws://localhost:9000/ws \ No newline at end of file +COCO_WEBSOCKET_URL=ws://localhost:9000/ws wss://coco.infini.cloud/ws #ws://localhost:9000/ws \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 8c8a4a81..fa31a480 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,6 +11,7 @@ "dtolnay", "dyld", "elif", + "errmsg", "fullscreen", "headlessui", "Icdbb", diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md index 874a991c..f8aec805 100644 --- a/docs/content.en/docs/release-notes/_index.md +++ b/docs/content.en/docs/release-notes/_index.md @@ -17,10 +17,12 @@ Information about release notes of Coco Server is provided here. - feat: add shortcuts to most icon buttons #334 - feat: add font icon for search list #342 - feat: add a border to the main window in Windows 10 #343 +- feat: mobile terminal adaptation about style #348 ### Bug fix - fix: fixed the problem of not being able to search in secondary directories #338 +- fix: active shadow setting #354 ### Improvements @@ -38,7 +40,6 @@ Information about release notes of Coco Server is provided here. - feat: support multi websocket connections #314 - feat: add support for embeddable web widget #277 -- feat: mobile terminal adaptation about style #348 ### Bug fix diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 2abf0765..18adb906 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -29,6 +29,7 @@ "core:window:allow-set-focus", "core:window:allow-set-always-on-top", "core:window:deny-internal-toggle-maximize", + "core:window:allow-set-shadow", "core:app:allow-set-app-theme", "shell:default", "http:default", diff --git a/src/api/axiosRequest.ts b/src/api/axiosRequest.ts index 55beb08f..5360864d 100644 --- a/src/api/axiosRequest.ts +++ b/src/api/axiosRequest.ts @@ -50,10 +50,9 @@ export const Get = ( // console.log("baseURL", appStore.state?.endpoint_http) let baseURL = appStore.state?.endpoint_http; - const isDev = import.meta.env.DEV; axios - .get(isDev ? url : baseURL + url, { params }) + .get(baseURL + url, { params }) .then((result) => { let res: FcResponse; if (clearFn !== undefined) { @@ -79,10 +78,9 @@ export const Post = ( // console.log("baseURL", appStore.state?.endpoint_http) let baseURL = appStore.state?.endpoint_http; - const isDev = import.meta.env.DEV; axios - .post(isDev ? url : baseURL + url, data, { + .post(baseURL + url, data, { params, headers, } as any) diff --git a/src/components/Assistant/Chat.tsx b/src/components/Assistant/Chat.tsx index 49ca712c..c6322c33 100644 --- a/src/components/Assistant/Chat.tsx +++ b/src/components/Assistant/Chat.tsx @@ -58,7 +58,7 @@ const ChatAI = memo( clearChatPage, isChatPage = false, getFileUrl, - showChatHistory = true, + showChatHistory, }, ref ) => { @@ -166,7 +166,8 @@ const ChatAI = memo( isDeepThinkActive, sourceDataIds, changeInput, - websocketSessionId + websocketSessionId, + showChatHistory ); const { dealMsg, messageTimeoutRef } = useMessageHandler( diff --git a/src/components/ChatMessage/FetchSource.tsx b/src/components/ChatMessage/FetchSource.tsx index 844fe2ff..b55eaaa2 100644 --- a/src/components/ChatMessage/FetchSource.tsx +++ b/src/components/ChatMessage/FetchSource.tsx @@ -10,6 +10,7 @@ import { useTranslation } from "react-i18next"; import { OpenURLWithBrowser } from "@/utils/index"; import type { IChunkData } from "@/components/Assistant/types"; import RetrieveIcon from "@/icons/Retrieve"; +import { useAppStore } from "@/stores/appStore"; interface FetchSourceProps { Detail?: any; @@ -34,8 +35,14 @@ interface ISourceData { url: string; } -export const FetchSource = ({ Detail, ChunkData, loading }: FetchSourceProps) => { +export const FetchSource = ({ + Detail, + ChunkData, + loading, +}: FetchSourceProps) => { const { t } = useTranslation(); + const isTauri = useAppStore((state) => state.isTauri); + const [isSourceExpanded, setIsSourceExpanded] = useState(false); const [total, setTotal] = useState(0); @@ -51,7 +58,7 @@ export const FetchSource = ({ Detail, ChunkData, loading }: FetchSourceProps) => useEffect(() => { if (!ChunkData?.message_chunk) return; - if (!loading) { + if (!loading) { try { const match = ChunkData.message_chunk.match( // /\u003cPayload total=(\d+)\u003e/ @@ -130,7 +137,11 @@ export const FetchSource = ({ Detail, ChunkData, loading }: FetchSourceProps) => {item.title || item.category} -
+
{item.source?.name} diff --git a/src/components/Common/UI/Footer.tsx b/src/components/Common/UI/Footer.tsx index a341bc37..fc9d36c4 100644 --- a/src/components/Common/UI/Footer.tsx +++ b/src/components/Common/UI/Footer.tsx @@ -99,7 +99,9 @@ export default function Footer({ )} -
+
{t("search.footer.select")}: diff --git a/src/components/Common/UI/NoResults.tsx b/src/components/Common/UI/NoResults.tsx index 3a54e8a1..0359bb31 100644 --- a/src/components/Common/UI/NoResults.tsx +++ b/src/components/Common/UI/NoResults.tsx @@ -4,10 +4,12 @@ import { useTranslation } from "react-i18next"; import { isMac } from "@/utils/platform"; import { useShortcutsStore } from "@/stores/shortcutsStore"; import noDataImg from "@/assets/coconut-tree.png"; +import { useAppStore } from "@/stores/appStore"; export const NoResults = () => { const { t } = useTranslation(); + const isTauri = useAppStore((state) => state.isTauri); const modeSwitch = useShortcutsStore((state) => state.modeSwitch); return ( @@ -19,7 +21,7 @@ export const NoResults = () => {
{t("search.main.noResults")}
-
+
{t("search.main.askCoco")} {isMac ? ( diff --git a/src/components/Search/ListRight.tsx b/src/components/Search/ListRight.tsx index a4defc20..3f1d267e 100644 --- a/src/components/Search/ListRight.tsx +++ b/src/components/Search/ListRight.tsx @@ -1,5 +1,6 @@ import TypeIcon from "@/components/Common/Icons/TypeIcon"; import RichIcon from "@/components/Common/Icons/RichIcon"; +import { useAppStore } from "@/stores/appStore"; interface ListRightProps { item: any; @@ -16,8 +17,14 @@ export default function ListRight({ currentIndex, goToTwoPage, }: ListRightProps) { + const isTauri = useAppStore((state) => state.isTauri); + return ( -
+
{item?.rich_categories ? null : (
= ({ }) => { const { t } = useTranslation(); + const isTauri = useAppStore((state) => state.isTauri); + return (
@@ -24,7 +28,7 @@ export const SearchHeader: React.FC = ({ {t('search.header.results')}
-
+