perf(charts): import chart components from @gpustack/core-ui/charts

Switch all echarts-based chart imports to the dedicated core-ui charts
entry so echarts stays out of the synchronous entry bundle and loads
only on chart routes. Requires @gpustack/core-ui with the ./charts export.
This commit is contained in:
jialin
2026-07-01 20:54:26 +08:00
committed by jialin
parent 0a1f875590
commit 5321973ebe
11 changed files with 15 additions and 16 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import useCoolColors from '@/hooks/use-cool-colors';
import { Chart } from '@gpustack/core-ui';
import { Chart } from '@gpustack/core-ui/charts';
import { formatLargeNumber } from '@gpustack/core-ui/utils';
import { Empty, Spin, theme } from 'antd';
import _ from 'lodash';
+1 -1
View File
@@ -1,5 +1,5 @@
import useCoolColors from '@/hooks/use-cool-colors';
import { Chart } from '@gpustack/core-ui';
import { Chart } from '@gpustack/core-ui/charts';
import { formatLargeNumber } from '@gpustack/core-ui/utils';
import { Empty, Spin, theme } from 'antd';
import React, {
@@ -1,4 +1,5 @@
import { GaugeChart, TemplateCard } from '@gpustack/core-ui';
import { TemplateCard } from '@gpustack/core-ui';
import { GaugeChart } from '@gpustack/core-ui/charts';
import { useSearchParams } from '@umijs/max';
import { Col, Row } from 'antd';
import _ from 'lodash';
@@ -1,4 +1,4 @@
import { LineChart } from '@gpustack/core-ui';
import { LineChart } from '@gpustack/core-ui/charts';
import { useIntl } from '@umijs/max';
import dayjs from 'dayjs';
import _ from 'lodash';
@@ -1,4 +1,4 @@
import { LineChart } from '@gpustack/core-ui';
import { LineChart } from '@gpustack/core-ui/charts';
import { useIntl } from '@umijs/max';
import dayjs from 'dayjs';
import _ from 'lodash';
@@ -1,10 +1,6 @@
import { queryClusterList } from '@/pages/cluster-management/apis';
import {
BaseSelect,
CardWrapper,
GaugeChart,
PageTools
} from '@gpustack/core-ui';
import { BaseSelect, CardWrapper, PageTools } from '@gpustack/core-ui';
import { GaugeChart } from '@gpustack/core-ui/charts';
import { useIntl } from '@umijs/max';
import { Col, Row } from 'antd';
import _ from 'lodash';
@@ -1,4 +1,4 @@
import { HBarChart } from '@gpustack/core-ui';
import { HBarChart } from '@gpustack/core-ui/charts';
import { useIntl } from '@umijs/max';
import { usageChartHeight, usageRankMaxItems } from '../../config';
import type useTopTokenUsageByUser from '../../hooks/use-top-token-usage-by-user';
@@ -1,6 +1,6 @@
import useCoolColors from '@/hooks/use-cool-colors';
import useQueryTimeSeriesData from '@/pages/usage/services/use-query-timeseries-data';
import { Chart } from '@gpustack/core-ui';
import { Chart } from '@gpustack/core-ui/charts';
import { formatLargeNumber } from '@gpustack/core-ui/utils';
import { useIntl } from '@umijs/max';
import type { GlobalToken } from 'antd';
@@ -1,5 +1,6 @@
import { formatLargeNumber } from '@/utils';
import { CardWrapper, MixLineBarChart, SimpleCard } from '@gpustack/core-ui';
import { CardWrapper, SimpleCard } from '@gpustack/core-ui';
import { MixLineBarChart } from '@gpustack/core-ui/charts';
import { Button } from 'antd';
import dayjs from 'dayjs';
import React, { useMemo } from 'react';
@@ -1,4 +1,5 @@
import { CardWrapper, HBarChart } from '@gpustack/core-ui';
import { CardWrapper } from '@gpustack/core-ui';
import { HBarChart } from '@gpustack/core-ui/charts';
import React from 'react';
interface TopUserProps {
+1 -1
View File
@@ -11,9 +11,9 @@ import {
HighlightCode,
IconFont,
ResizePanel,
ScatterChart,
useOverlayScroller
} from '@gpustack/core-ui';
import { ScatterChart } from '@gpustack/core-ui/charts';
import { useIntl } from '@umijs/max';
import { useMemoizedFn } from 'ahooks';
import { Button, Checkbox, Form, Segmented, Spin, Tabs, Tooltip } from 'antd';