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:
@@ -1,5 +1,5 @@
|
|||||||
import useCoolColors from '@/hooks/use-cool-colors';
|
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 { formatLargeNumber } from '@gpustack/core-ui/utils';
|
||||||
import { Empty, Spin, theme } from 'antd';
|
import { Empty, Spin, theme } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import useCoolColors from '@/hooks/use-cool-colors';
|
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 { formatLargeNumber } from '@gpustack/core-ui/utils';
|
||||||
import { Empty, Spin, theme } from 'antd';
|
import { Empty, Spin, theme } from 'antd';
|
||||||
import React, {
|
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 { useSearchParams } from '@umijs/max';
|
||||||
import { Col, Row } from 'antd';
|
import { Col, Row } from 'antd';
|
||||||
import _ from 'lodash';
|
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 { useIntl } from '@umijs/max';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import _ from 'lodash';
|
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 { useIntl } from '@umijs/max';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import { queryClusterList } from '@/pages/cluster-management/apis';
|
import { queryClusterList } from '@/pages/cluster-management/apis';
|
||||||
import {
|
import { BaseSelect, CardWrapper, PageTools } from '@gpustack/core-ui';
|
||||||
BaseSelect,
|
import { GaugeChart } from '@gpustack/core-ui/charts';
|
||||||
CardWrapper,
|
|
||||||
GaugeChart,
|
|
||||||
PageTools
|
|
||||||
} from '@gpustack/core-ui';
|
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Col, Row } from 'antd';
|
import { Col, Row } from 'antd';
|
||||||
import _ from 'lodash';
|
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 { useIntl } from '@umijs/max';
|
||||||
import { usageChartHeight, usageRankMaxItems } from '../../config';
|
import { usageChartHeight, usageRankMaxItems } from '../../config';
|
||||||
import type useTopTokenUsageByUser from '../../hooks/use-top-token-usage-by-user';
|
import type useTopTokenUsageByUser from '../../hooks/use-top-token-usage-by-user';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import useCoolColors from '@/hooks/use-cool-colors';
|
import useCoolColors from '@/hooks/use-cool-colors';
|
||||||
import useQueryTimeSeriesData from '@/pages/usage/services/use-query-timeseries-data';
|
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 { formatLargeNumber } from '@gpustack/core-ui/utils';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import type { GlobalToken } from 'antd';
|
import type { GlobalToken } from 'antd';
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { formatLargeNumber } from '@/utils';
|
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 { Button } from 'antd';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import React, { useMemo } from 'react';
|
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';
|
import React from 'react';
|
||||||
|
|
||||||
interface TopUserProps {
|
interface TopUserProps {
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import {
|
|||||||
HighlightCode,
|
HighlightCode,
|
||||||
IconFont,
|
IconFont,
|
||||||
ResizePanel,
|
ResizePanel,
|
||||||
ScatterChart,
|
|
||||||
useOverlayScroller
|
useOverlayScroller
|
||||||
} from '@gpustack/core-ui';
|
} from '@gpustack/core-ui';
|
||||||
|
import { ScatterChart } from '@gpustack/core-ui/charts';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { Button, Checkbox, Form, Segmented, Spin, Tabs, Tooltip } from 'antd';
|
import { Button, Checkbox, Form, Segmented, Spin, Tabs, Tooltip } from 'antd';
|
||||||
|
|||||||
Reference in New Issue
Block a user