mirror of
https://github.com/coaidev/coai.git
synced 2025-05-19 21:10:18 +09:00
update pwa icons
This commit is contained in:
parent
6a0bf4bebb
commit
94f714e25e
@ -14,6 +14,7 @@
|
||||
<link href="https://open.lightxi.com/fonts/Andika" rel="stylesheet">
|
||||
<link href="https://open.lightxi.com/fonts/Jetbrains-Mono" rel="stylesheet">
|
||||
<link href="https://open.lightxi.com/jsdelivr/npm/katex@0.16.0/dist/katex.min.css" rel="stylesheet">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<script src="/workbox.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
BIN
app/public/service/android-chrome-192x192.png
Normal file
BIN
app/public/service/android-chrome-192x192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
BIN
app/public/service/android-chrome-512x512.png
Normal file
BIN
app/public/service/android-chrome-512x512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
BIN
app/public/service/favicon-64x64.png
Normal file
BIN
app/public/service/favicon-64x64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
20
app/public/site.webmanifest
Normal file
20
app/public/site.webmanifest
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Chat Nio",
|
||||
"short_name": "ChatNio",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/service/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/service/android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"start_url": "/",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#0000000",
|
||||
"display": "standalone"
|
||||
}
|
@ -65,7 +65,10 @@ function FileProvider({ value, onChange }: FileProviderProps) {
|
||||
return (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<ChatAction text={t("file.upload")} className={value.length > 0 ? "active" : ""}>
|
||||
<ChatAction
|
||||
text={t("file.upload")}
|
||||
className={value.length > 0 ? "active" : ""}
|
||||
>
|
||||
<Plus className={`h-4 w-4`} />
|
||||
</ChatAction>
|
||||
</DialogTrigger>
|
||||
|
@ -1,22 +1,22 @@
|
||||
import {LightAsync as SyntaxHighlighter} from "react-syntax-highlighter";
|
||||
import {atomOneDark as style} from "react-syntax-highlighter/dist/esm/styles/hljs";
|
||||
import { LightAsync as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import { atomOneDark as style } from "react-syntax-highlighter/dist/esm/styles/hljs";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import remarkMath from "remark-math";
|
||||
import remarkBreaks from "remark-breaks";
|
||||
import rehypeKatex from "rehype-katex";
|
||||
import {parseFile} from "./plugins/file.tsx";
|
||||
import { parseFile } from "./plugins/file.tsx";
|
||||
import "@/assets/markdown/all.less";
|
||||
import {useEffect, useMemo} from "react";
|
||||
import {useDispatch} from "react-redux";
|
||||
import {openDialog as openQuotaDialog} from "@/store/quota.ts";
|
||||
import {openDialog as openSubscriptionDialog} from "@/store/subscription.ts";
|
||||
import {AppDispatch} from "@/store";
|
||||
import {Copy} from "lucide-react";
|
||||
import {copyClipboard} from "@/utils/dom.ts";
|
||||
import {useToast} from "./ui/use-toast.ts";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {parseProgressbar} from "@/components/plugins/progress.tsx";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { openDialog as openQuotaDialog } from "@/store/quota.ts";
|
||||
import { openDialog as openSubscriptionDialog } from "@/store/subscription.ts";
|
||||
import { AppDispatch } from "@/store";
|
||||
import { Copy } from "lucide-react";
|
||||
import { copyClipboard } from "@/utils/dom.ts";
|
||||
import { useToast } from "./ui/use-toast.ts";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { parseProgressbar } from "@/components/plugins/progress.tsx";
|
||||
|
||||
type MarkdownProps = {
|
||||
children: string;
|
||||
@ -125,12 +125,10 @@ function MarkdownContent({ children, className }: MarkdownProps) {
|
||||
function Markdown(props: MarkdownProps) {
|
||||
// memoize the component
|
||||
const { children, className } = props;
|
||||
return useMemo(() => (
|
||||
<MarkdownContent className={className}>{children}</MarkdownContent>
|
||||
), [
|
||||
props.children,
|
||||
props.className,
|
||||
]);
|
||||
return useMemo(
|
||||
() => <MarkdownContent className={className}>{children}</MarkdownContent>,
|
||||
[props.children, props.className],
|
||||
);
|
||||
}
|
||||
|
||||
export default Markdown;
|
||||
|
@ -43,7 +43,8 @@ function ChatInterface({ setTarget, setWorking }: ChatInterfaceProps) {
|
||||
const offset = el.scrollTop - position;
|
||||
setPosition(el.scrollTop);
|
||||
if (offset < 0) setScrollable(false);
|
||||
else setScrollable(el.scrollTop + el.clientHeight + 20 >= el.scrollHeight);
|
||||
else
|
||||
setScrollable(el.scrollTop + el.clientHeight + 20 >= el.scrollHeight);
|
||||
};
|
||||
return addEventListeners(
|
||||
el,
|
||||
|
@ -1,10 +1,5 @@
|
||||
import SelectGroup, { SelectItemProps } from "@/components/SelectGroup.tsx";
|
||||
import {
|
||||
expensiveModels,
|
||||
login,
|
||||
studentModels,
|
||||
supportModels,
|
||||
} from "@/conf.ts";
|
||||
import { expensiveModels, login, supportModels } from "@/conf.ts";
|
||||
import {
|
||||
getPlanModels,
|
||||
openMarket,
|
||||
@ -32,19 +27,13 @@ type ModelSelectorProps = {
|
||||
side?: "left" | "right" | "top" | "bottom";
|
||||
};
|
||||
|
||||
function filterModel(model: Model, level: number, student: boolean) {
|
||||
function filterModel(model: Model, level: number) {
|
||||
if (getPlanModels(level).includes(model.id)) {
|
||||
return {
|
||||
name: model.id,
|
||||
value: model.name,
|
||||
badge: { variant: "gold", name: "plus" },
|
||||
} as SelectItemProps;
|
||||
} else if (student && studentModels.includes(model.id)) {
|
||||
return {
|
||||
name: model.id,
|
||||
value: model.name,
|
||||
badge: { variant: "gold", name: "student" },
|
||||
} as SelectItemProps;
|
||||
} else if (expensiveModels.includes(model.id)) {
|
||||
return {
|
||||
name: model.id,
|
||||
@ -82,9 +71,7 @@ function ModelFinder(props: ModelSelectorProps) {
|
||||
const models = useMemo(() => {
|
||||
const raw = supportModels.filter((model) => list.includes(model.id));
|
||||
return [
|
||||
...raw.map(
|
||||
(model: Model): SelectItemProps => filterModel(model, level, student),
|
||||
),
|
||||
...raw.map((model: Model): SelectItemProps => filterModel(model, level)),
|
||||
{
|
||||
icon: <Sparkles size={16} />,
|
||||
name: "market",
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
X,
|
||||
} from "lucide-react";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import { login, modelAvatars, studentModels, supportModels } from "@/conf.ts";
|
||||
import { login, modelAvatars, supportModels } from "@/conf.ts";
|
||||
import { splitList } from "@/utils/base.ts";
|
||||
import { Model } from "@/api/types.ts";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
@ -81,10 +81,7 @@ function ModelItem({ model, className, style }: ModelProps) {
|
||||
}, [model, current, list]);
|
||||
|
||||
const pro = useMemo(() => {
|
||||
return (
|
||||
getPlanModels(level).includes(model.id) ||
|
||||
(student && studentModels.includes(model.id))
|
||||
);
|
||||
return getPlanModels(level).includes(model.id);
|
||||
}, [model, level, student]);
|
||||
|
||||
const avatar = useMemo(() => {
|
||||
|
@ -4,9 +4,9 @@ import { chatEvent } from "@/events/chat.ts";
|
||||
import { addEventListeners, scrollDown } from "@/utils/dom.ts";
|
||||
import { ChatAction } from "@/components/home/assemblies/ChatAction.tsx";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {Message} from "@/api/types.ts";
|
||||
import {useSelector} from "react-redux";
|
||||
import {selectMessages} from "@/store/chat.ts";
|
||||
import { Message } from "@/api/types.ts";
|
||||
import { useSelector } from "react-redux";
|
||||
import { selectMessages } from "@/store/chat.ts";
|
||||
|
||||
type ScrollActionProps = {
|
||||
visible: boolean;
|
||||
|
@ -338,8 +338,6 @@ export const largeContextModels = [
|
||||
"zhipu-chatglm-turbo",
|
||||
];
|
||||
|
||||
export const studentModels = ["claude-2-100k", "claude-2"];
|
||||
|
||||
export const planModels: PlanModel[] = [
|
||||
{ id: "gpt-4-0613", level: 1 },
|
||||
{ id: "gpt-4-1106-preview", level: 1 },
|
||||
|
Loading…
Reference in New Issue
Block a user