mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 11:37:47 +01:00
style: web styles
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
handleNetworkError,
|
||||
} from "./tools";
|
||||
|
||||
type Fn = (data: FcResponse<any>) => unknown;
|
||||
type Fn = (data: FcResponse<unknown>) => unknown;
|
||||
|
||||
interface IAnyObj {
|
||||
[index: string]: unknown;
|
||||
@@ -85,8 +85,26 @@ export const Get = <T>(
|
||||
new Promise((resolve) => {
|
||||
const appStore = JSON.parse(localStorage.getItem("app-store") || "{}");
|
||||
|
||||
let baseURL = appStore.state?.endpoint_http;
|
||||
if (!baseURL || baseURL === "undefined") {
|
||||
// In Vite dev, prefer using the proxy by keeping requests relative
|
||||
const isDev = (import.meta as any).env?.DEV === true;
|
||||
const PROXY_PREFIXES: readonly string[] = [
|
||||
"account",
|
||||
"chat",
|
||||
"query",
|
||||
"connector",
|
||||
"integration",
|
||||
"assistant",
|
||||
"datasource",
|
||||
"settings",
|
||||
"mcp_server",
|
||||
];
|
||||
const shouldProxy =
|
||||
isDev &&
|
||||
url.startsWith("/") &&
|
||||
PROXY_PREFIXES.some((p) => url.startsWith(`/${p}`));
|
||||
|
||||
let baseURL: string = appStore.state?.endpoint_http as string;
|
||||
if (!baseURL || baseURL === "undefined" || shouldProxy) {
|
||||
baseURL = "";
|
||||
}
|
||||
|
||||
@@ -117,8 +135,25 @@ export const Post = <T>(
|
||||
return new Promise((resolve) => {
|
||||
const appStore = JSON.parse(localStorage.getItem("app-store") || "{}");
|
||||
|
||||
let baseURL = appStore.state?.endpoint_http;
|
||||
if (!baseURL || baseURL === "undefined") {
|
||||
const isDev = (import.meta as any).env?.DEV === true;
|
||||
const PROXY_PREFIXES: readonly string[] = [
|
||||
"account",
|
||||
"chat",
|
||||
"query",
|
||||
"connector",
|
||||
"integration",
|
||||
"assistant",
|
||||
"datasource",
|
||||
"settings",
|
||||
"mcp_server",
|
||||
];
|
||||
const shouldProxy =
|
||||
isDev &&
|
||||
url.startsWith("/") &&
|
||||
PROXY_PREFIXES.some((p) => url.startsWith(`/${p}`));
|
||||
|
||||
let baseURL: string = appStore.state?.endpoint_http as string;
|
||||
if (!baseURL || baseURL === "undefined" || shouldProxy) {
|
||||
baseURL = "";
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ const Copyright = () => {
|
||||
const renderLogo = () => {
|
||||
return (
|
||||
<a href="https://coco.rs/" target="_blank">
|
||||
<img src={isDark ? logoDark : logoLight} alt="Logo" className="h-4" />
|
||||
<img src={isDark ? logoDark : logoLight} alt="Logo" className="h-4!" />
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -117,7 +117,7 @@ export default function Footer({ setIsPinnedWeb }: FooterProps) {
|
||||
<div
|
||||
data-tauri-drag-region={isTauri}
|
||||
className={clsx(
|
||||
"px-4 z-999 mx-px h-8 absolute bottom-0 left-0 right-0 border-t border-gray-200 dark:border-gray-700 flex items-center justify-between rounded-[6px] rounded-t-none",
|
||||
"px-4 z-999 mx-px h-8 absolute bottom-0 left-0 right-0 border-t! border-gray-200 dark:border-gray-700 flex items-center justify-between rounded-[6px] rounded-t-none",
|
||||
{
|
||||
"overflow-hidden": isTauri,
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ const Item: FC<ItemProps> = (props) => {
|
||||
<SettingsInput
|
||||
defaultValue={alias}
|
||||
placeholder={t("settings.extensions.hints.addAlias")}
|
||||
className="!w-[90%] !h-6 !border-transparent rounded-[4px]"
|
||||
className="w-[90%]! h-6! border-transparent! rounded-[4px]"
|
||||
onChange={(value) => {
|
||||
handleChange(String(value));
|
||||
}}
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
DropdownMenuContent,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import platformAdapter from "@/utils/platformAdapter";
|
||||
import { useAppStore } from "@/stores/appStore";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -44,7 +44,7 @@ function WebApp({
|
||||
width = 680,
|
||||
height = WINDOW_CENTER_BASELINE_HEIGHT,
|
||||
headers = {
|
||||
"X-API-TOKEN": "d4si4m94d9v22546mrcg5u3m5vpb25dpi4ibl8iumpum80d90zepo9bhk1wayqu6lh9kccu2tnbckhk65s3w",
|
||||
"X-API-TOKEN": "",
|
||||
"APP-INTEGRATION-ID": "",
|
||||
},
|
||||
serverUrl = "",
|
||||
@@ -125,7 +125,7 @@ function WebApp({
|
||||
return (
|
||||
<div
|
||||
id="searchChat-container"
|
||||
className={`coco-container relative ${theme} border border-(--border) rounded-xl`}
|
||||
className={`coco-container relative ${theme} border! border-(--border) rounded-xl`}
|
||||
data-theme={theme}
|
||||
style={{
|
||||
maxWidth: `${width}px`,
|
||||
|
||||
@@ -455,7 +455,6 @@ body,
|
||||
:before,
|
||||
:after {
|
||||
box-sizing: border-box;
|
||||
border-width: 0;
|
||||
border-style: solid;
|
||||
}
|
||||
:before,
|
||||
|
||||
@@ -43,6 +43,11 @@ export default defineConfig({
|
||||
ignored: ["**/src-tauri/**"],
|
||||
},
|
||||
proxy: {
|
||||
"/account": {
|
||||
target: process.env.COCO_SERVER_URL,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
"/chat": {
|
||||
target: process.env.COCO_SERVER_URL,
|
||||
changeOrigin: true,
|
||||
|
||||
Reference in New Issue
Block a user