From 35578ce2cbe4acba968afa817fd8c7da7de2dbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=8C=AF=E6=B4=AA?= <2976151305@qq.com> Date: Thu, 4 Jan 2024 16:38:07 +0800 Subject: [PATCH] feat: unified UI style --- web/app/i18n.ts | 2 + web/components/chart/autoChart/index.tsx | 22 +++-- web/components/chart/bar-chart.tsx | 51 +++++------ web/components/chart/line-chart.tsx | 91 +++++++++---------- web/components/chart/table-chart.tsx | 55 +++++------ web/components/chat/chat-container.tsx | 6 +- .../chat/chat-content/code-preview.tsx | 7 +- web/components/chat/chat-content/config.tsx | 4 +- web/components/chat/chat-content/index.tsx | 6 +- web/components/chat/completion.tsx | 4 +- web/components/chat/header/index.tsx | 2 +- web/components/database/db-card.tsx | 4 +- web/components/icons/colorful-dashboard.tsx | 43 +++------ web/components/icons/colorful-data.tsx | 83 ++++------------- web/components/icons/colorful-db.tsx | 62 ++++++++++++- web/components/icons/colorful-doc.tsx | 39 ++------ web/components/icons/colorful-excel.tsx | 26 +++--- web/components/icons/colorful-plugin.tsx | 44 +-------- web/components/layout/side-bar.tsx | 44 ++++----- web/defaultTheme.ts | 28 ++---- web/pages/_app.tsx | 17 +++- web/pages/index.tsx | 14 +-- web/pages/knowledge/index.tsx | 2 +- web/styles/globals.css | 30 ++++-- web/tailwind.config.js | 8 ++ 25 files changed, 318 insertions(+), 376 deletions(-) diff --git a/web/app/i18n.ts b/web/app/i18n.ts index d15310b67..d1c26db07 100644 --- a/web/app/i18n.ts +++ b/web/app/i18n.ts @@ -181,6 +181,7 @@ const resources = { Advices: 'Advices', Retry: 'Retry', Load_more: 'load more', + new_chat: 'New Chat', }, }, zh: { @@ -362,6 +363,7 @@ const resources = { Advices: '自动推荐', Retry: '重试', Load_more: '加载更多', + new_chat: '创建会话', }, }, }; diff --git a/web/components/chart/autoChart/index.tsx b/web/components/chart/autoChart/index.tsx index cefaae761..c9fff8fa1 100644 --- a/web/components/chart/autoChart/index.tsx +++ b/web/components/chart/autoChart/index.tsx @@ -8,12 +8,15 @@ import { useEffect, useMemo, useState } from 'react'; import { defaultAdvicesFilter } from './advisor/utils'; import { AutoChartProps, ChartType, CustomAdvisorConfig, CustomChart, Specification } from './types'; import { customCharts } from './charts'; +import { useColorScheme } from '@mui/joy'; const { Option } = Select; export const AutoChart = (props: AutoChartProps) => { const { data, chartType, scopeOfCharts, ruleConfig } = props; + const { mode } = useColorScheme(); + const [advisor, setAdvisor] = useState(); const [advices, setAdvices] = useState([]); const [renderChartType, setRenderChartType] = useState(); @@ -54,7 +57,15 @@ export const AutoChart = (props: AutoChartProps) => { const chartTypeInput = renderChartType ?? advices[0].type; const spec: Specification = advices?.find((item: Advice) => item.type === chartTypeInput)?.spec ?? undefined; if (spec) { - return ; + return ( + + ); } } }, [advices, renderChartType]); @@ -62,13 +73,13 @@ export const AutoChart = (props: AutoChartProps) => { if (renderChartType) { return (
- + {i18n.t('Advices')}