6 Commits

Author SHA1 Message Date
ayang
f02b8bb28a v0.2.0 2025-03-07 17:38:43 +08:00
ayangweb
e68e8f7954 refactor: optimized theme switching (#270) 2025-03-07 17:38:05 +08:00
ayangweb
18b6e1cbc9 chore: fallback version (#269) 2025-03-07 17:17:43 +08:00
Medcl
062e2873b4 fix: typo (#268)
* v0.2.0

* fix: typo

---------

Co-authored-by: ayang <473033518@qq.com>
2025-03-07 17:14:20 +08:00
Medcl
e75f4ce187 chore: update release notes (#267)
* chore: update release notes

* fix typo

* chore: update docs
2025-03-07 17:09:11 +08:00
BiggerRain
dbbc87523d fix: ws link (#266) 2025-03-07 15:50:43 +08:00
17 changed files with 73 additions and 23 deletions

View File

@@ -0,0 +1,20 @@
---
weight: 10
title: "Windows"
asciinema: true
---
# Windows
## Download Coco AI
Goto [https://coco.rs/](https://coco.rs/)
## Install Wizard
{{% load-img "/img/windows/1.png" "" %}}
{{% load-img "/img/windows/2.png" "" %}}
{{% load-img "/img/windows/3.png" "" %}}
{{% load-img "/img/windows/4.png" "" %}}
{{% load-img "/img/windows/5.jpeg" "" %}}

View File

@@ -11,15 +11,30 @@ Information about release notes of Coco Server is provided here.
### Features
### Breaking changes
### Bug fix
### Improvements
## 0.2.0 (2025-03-07)
### Features
- Add timeout to fusion search #174
- Add api to disable or enable server #185
- Networked search supports selection of data sources #209
- Add deepthink and knowledge search options to RAG based chat
- Support i18n, add Chinese language support
- Support Windows platform
- etc.
### Breaking changes
### Bug fix
- Fix to access deeplink for linux #148
- etc.
### Improvements
@@ -32,9 +47,15 @@ Information about release notes of Coco Server is provided here.
- Refactor: the display of search results and the logic of creating new chats #207
- Refactor: AI conversation rendering logic #216
- Refresh all server's info on purpose, get the actual health info #225
- Improve chat message display
- Improve application search, support macOS/Windows and Linux
- Display the version of the server in the settings page
- Allow to switch between different data sources in networked search
- Allow to switch servers in the settings page
- etc.
## 0.1.0 (2015-02-16)
## 0.1.0 (2025-02-16)
### Features

BIN
docs/static/img/windows/1.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

BIN
docs/static/img/windows/2.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

BIN
docs/static/img/windows/3.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

BIN
docs/static/img/windows/4.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

BIN
docs/static/img/windows/5.jpeg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -1,7 +1,7 @@
{
"name": "coco",
"private": true,
"version": "0.2.0-rc.1",
"version": "0.2.0",
"type": "module",
"scripts": {
"dev": "vite",

2
src-tauri/Cargo.lock generated
View File

@@ -733,7 +733,7 @@ dependencies = [
[[package]]
name = "coco"
version = "0.2.0-rc.1"
version = "0.2.0"
dependencies = [
"applications",
"async-trait",

View File

@@ -1,6 +1,6 @@
[package]
name = "coco"
version = "0.2.0-rc.1"
version = "0.2.0"
description = "Search, connect, collaborate all in one place."
authors = ["INFINI Labs"]
edition = "2021"

View File

@@ -81,7 +81,7 @@ export function ChatHeader({
);
if (currentServiceExists) {
switchServer(currentServiceExists, true);
switchServer(currentServiceExists);
} else {
switchServer(enabledServers[enabledServers.length - 1]);
}
@@ -117,7 +117,7 @@ export function ChatHeader({
}
};
const switchServer = async (server: IServer, isCurrent: boolean = false) => {
const switchServer = async (server: IServer) => {
if (!server) return;
try {
// Switch UI first, then switch server connection
@@ -132,10 +132,8 @@ export function ChatHeader({
}
setIsLogin(true);
//
if (!(isCurrent && connected)) {
await disconnect();
reconnect && reconnect(server);
}
await disconnect();
reconnect && reconnect(server);
} catch (error) {
console.error("switchServer:", error);
}

View File

@@ -8,9 +8,9 @@ import { useThemeStore } from "@/stores/themeStore";
const ConnectPrompt = () => {
const { t } = useTranslation();
const activeTheme = useThemeStore((state) => state.activeTheme);
const isDark = useThemeStore((state) => state.isDark);
const logo = activeTheme === "dark" ? LoginDark : LoginLight;
const logo = isDark ? LoginDark : LoginLight;
const handleConnect = async () => {
emit("open_settings", "connect");

View File

@@ -20,7 +20,7 @@ interface DataSourceItemProps {
export function DataSourceItem({ name, connector }: DataSourceItemProps) {
// const isConnected = true;
const activeTheme = useThemeStore((state) => state.activeTheme);
const isDark = useThemeStore((state) => state.isDark);
const connector_data = useConnectStore((state) => state.connector_data);
const endpoint_http = useAppStore((state) => state.endpoint_http);
@@ -42,9 +42,7 @@ export function DataSourceItem({ name, connector }: DataSourceItemProps) {
const icons = connectorSource?.icon;
if (!icons) {
return activeTheme === "dark"
? source_default_dark_img
: source_default_img;
return isDark ? source_default_dark_img : source_default_img;
}
if (icons?.startsWith("http://") || icons?.startsWith("https://")) {

View File

@@ -8,9 +8,9 @@ import { useThemeStore } from "@/stores/themeStore";
export default function AboutView() {
const { t } = useTranslation();
const activeTheme = useThemeStore((state) => state.activeTheme);
const isDark = useThemeStore((state) => state.isDark);
const logo = activeTheme === "dark" ? logoDark : logoLight;
const logo = isDark ? logoDark : logoLight;
return (
<div className="flex justify-center items-center flex-col h-[calc(100vh-170px)]">

View File

@@ -18,6 +18,8 @@ export default function Layout() {
const activeTheme = useThemeStore((state) => state.activeTheme);
const setTheme = useThemeStore((state) => state.setTheme);
const isDark = useThemeStore((state) => state.isDark);
const setIsDark = useThemeStore((state) => state.setIsDark);
function updateBodyClass(path: string) {
const body = document.body;
@@ -34,10 +36,9 @@ export default function Layout() {
});
appWindow.onThemeChanged(({ payload }) => {
console.log("onThemeChanged", payload);
if (activeTheme !== "auto") return;
setTheme(payload);
setIsDark(payload === "dark");
});
});
@@ -46,11 +47,19 @@ export default function Layout() {
await appWindow.setTheme(nextTheme);
const root = window.document.documentElement;
root.className = nextTheme ?? "light";
root.dataset.theme = nextTheme ?? "light";
nextTheme = nextTheme ?? (await appWindow.theme());
setIsDark(nextTheme === "dark");
}, [activeTheme]);
useEffect(() => {
const theme = isDark ? "dark" : "light";
const root = window.document.documentElement;
root.className = theme;
root.dataset.theme = theme;
}, [isDark]);
useEffect(() => {
updateBodyClass(location.pathname);
}, [location.pathname]);

View File

@@ -9,6 +9,8 @@ export type IThemeStore = {
themes: AppTheme[];
activeTheme: AppTheme;
setTheme: (theme: AppTheme) => void;
isDark: boolean;
setIsDark: (isDark: boolean) => void;
};
export const useThemeStore = create<IThemeStore>()(
@@ -17,6 +19,8 @@ export const useThemeStore = create<IThemeStore>()(
themes: ["dark", "light", "auto"],
activeTheme: "auto",
setTheme: (activeTheme: AppTheme) => set(() => ({ activeTheme })),
isDark: false,
setIsDark: (isDark: boolean) => set(() => ({ isDark })),
}),
{
name: "active-theme",