fix: delay querying backends
This commit is contained in:
@@ -152,6 +152,7 @@ const SingleImage: React.FC<SingleImageProps> = (props) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Spin
|
<Spin
|
||||||
|
size="middle"
|
||||||
indicator={<LoadingOutlined style={{ fontSize: 32 }} spin />}
|
indicator={<LoadingOutlined style={{ fontSize: 32 }} spin />}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -144,7 +144,9 @@ const DeleteModal = forwardRef((props, ref) => {
|
|||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
destroyOnHidden={false}
|
destroyOnHidden={false}
|
||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
mask={{
|
||||||
|
closable: false
|
||||||
|
}}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
width={460}
|
width={460}
|
||||||
styles={{
|
styles={{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const Loading = (props: { width: number; height: number }) => {
|
|||||||
const { width, height } = props;
|
const { width, height } = props;
|
||||||
return (
|
return (
|
||||||
<LoadWrapper width={width} height={height}>
|
<LoadWrapper width={width} height={height}>
|
||||||
<Spin spinning></Spin>
|
<Spin spinning size="middle"></Spin>
|
||||||
</LoadWrapper>
|
</LoadWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -319,6 +319,7 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
|
|||||||
></LogsList>
|
></LogsList>
|
||||||
</div>
|
</div>
|
||||||
<Spin
|
<Spin
|
||||||
|
size="middle"
|
||||||
spinning={loading}
|
spinning={loading}
|
||||||
className={classNames({
|
className={classNames({
|
||||||
loading: loading
|
loading: loading
|
||||||
|
|||||||
@@ -10,13 +10,7 @@ import React from 'react';
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const ScrollerModal = (props: DrawerProps) => {
|
const ScrollerModal = (props: DrawerProps) => {
|
||||||
const {
|
const { title, closable = true, mask, styles, ...restProps } = props;
|
||||||
title,
|
|
||||||
closable = true,
|
|
||||||
maskClosable = false,
|
|
||||||
styles,
|
|
||||||
...restProps
|
|
||||||
} = props;
|
|
||||||
const { EscHint } = useEscHint({
|
const { EscHint } = useEscHint({
|
||||||
enabled: !props.keyboard && props.open
|
enabled: !props.keyboard && props.open
|
||||||
});
|
});
|
||||||
@@ -48,7 +42,7 @@ const ScrollerModal = (props: DrawerProps) => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
closable={false}
|
closable={false}
|
||||||
maskClosable={maskClosable}
|
mask={mask}
|
||||||
title={
|
title={
|
||||||
<div className="flex-between flex-center">
|
<div className="flex-between flex-center">
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -217,7 +217,9 @@ const TableRow: React.FC<
|
|||||||
</div>
|
</div>
|
||||||
{expanded && !disableExpand && (
|
{expanded && !disableExpand && (
|
||||||
<div className="expanded-row">
|
<div className="expanded-row">
|
||||||
<Spin spinning={loading}>{renderChildrenData()}</Spin>
|
<Spin spinning={loading} size="middle">
|
||||||
|
{renderChildrenData()}
|
||||||
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ const SealTable: React.FC<SealTableProps & { pagination?: PaginationProps }> = (
|
|||||||
showSorterTooltip={showSorterTooltip}
|
showSorterTooltip={showSorterTooltip}
|
||||||
></Header>
|
></Header>
|
||||||
</div>
|
</div>
|
||||||
<Spin spinning={loading}>
|
<Spin spinning={loading} size="middle">
|
||||||
<TableBody
|
<TableBody
|
||||||
empty={empty}
|
empty={empty}
|
||||||
dataSource={props.dataSource}
|
dataSource={props.dataSource}
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ const ShortCuts: React.FC<{ intl: any }> = ({ intl }) => {
|
|||||||
export const modalConfig = {
|
export const modalConfig = {
|
||||||
icon: null,
|
icon: null,
|
||||||
centered: false,
|
centered: false,
|
||||||
maskClosable: true,
|
mask: {
|
||||||
|
closeable: true
|
||||||
|
},
|
||||||
footer: null,
|
footer: null,
|
||||||
style: {
|
style: {
|
||||||
top: '10%'
|
top: '10%'
|
||||||
@@ -89,4 +91,4 @@ export const modalConfig = {
|
|||||||
width: 700
|
width: 700
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(ShortCuts);
|
export default ShortCuts;
|
||||||
|
|||||||
@@ -40,11 +40,14 @@ const ListSkeleton: React.FC<{
|
|||||||
{loading && (
|
{loading && (
|
||||||
<SpinWrapper>
|
<SpinWrapper>
|
||||||
<Spin
|
<Spin
|
||||||
|
size="middle"
|
||||||
spinning={loading}
|
spinning={loading}
|
||||||
style={{
|
style={{
|
||||||
width: '100%'
|
width: '100%'
|
||||||
}}
|
}}
|
||||||
wrapperClassName="skelton-wrapper"
|
classNames={{
|
||||||
|
root: 'skelton-wrapper'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{isFirst && <CardSkeleton></CardSkeleton>}
|
{isFirst && <CardSkeleton></CardSkeleton>}
|
||||||
</Spin>
|
</Spin>
|
||||||
|
|||||||
@@ -87,7 +87,9 @@ const VersionInfo: React.FC<{ intl: any }> = ({ intl }) => {
|
|||||||
export const modalConfig = {
|
export const modalConfig = {
|
||||||
icon: null,
|
icon: null,
|
||||||
centered: false,
|
centered: false,
|
||||||
maskClosable: true,
|
mask: {
|
||||||
|
closeable: true
|
||||||
|
},
|
||||||
footer: null,
|
footer: null,
|
||||||
style: {
|
style: {
|
||||||
top: '30%'
|
top: '30%'
|
||||||
|
|||||||
@@ -57,10 +57,13 @@ const ListSkeleton: React.FC<{
|
|||||||
<SpinWrapper>
|
<SpinWrapper>
|
||||||
<Spin
|
<Spin
|
||||||
spinning={loading}
|
spinning={loading}
|
||||||
|
size="middle"
|
||||||
style={{
|
style={{
|
||||||
width: '100%'
|
width: '100%'
|
||||||
}}
|
}}
|
||||||
wrapperClassName="skelton-wrapper"
|
classNames={{
|
||||||
|
root: 'skelton-wrapper'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{isFirst && (
|
{isFirst && (
|
||||||
<SkeletonWrapper>
|
<SkeletonWrapper>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const SelectCluster: React.FC<AddWorkerStepProps> = ({ disabled }) => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Spin spinning={clusterLoading}>
|
<Spin spinning={clusterLoading} size="middle">
|
||||||
<BaseSelect
|
<BaseSelect
|
||||||
defaultValue={registrationInfo.cluster_id}
|
defaultValue={registrationInfo.cluster_id}
|
||||||
options={clusterList}
|
options={clusterList}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const Dashboard: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<DashboardContext.Provider value={{ ...data, fetchData: fetchData }}>
|
<DashboardContext.Provider value={{ ...data, fetchData: fetchData }}>
|
||||||
<PageBox>
|
<PageBox>
|
||||||
<Spin spinning={loading} style={{ minHeight: 300 }}>
|
<Spin spinning={loading} style={{ minHeight: 300 }} size="middle">
|
||||||
<DashboardInner />
|
<DashboardInner />
|
||||||
</Spin>
|
</Spin>
|
||||||
</PageBox>
|
</PageBox>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const ListSkeleton: React.FC<{
|
|||||||
<SpinWrapper>
|
<SpinWrapper>
|
||||||
<Spin
|
<Spin
|
||||||
spinning={loading}
|
spinning={loading}
|
||||||
|
size="middle"
|
||||||
style={{
|
style={{
|
||||||
width: '100%'
|
width: '100%'
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -472,6 +472,9 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleOnOpen = async () => {
|
const handleOnOpen = async () => {
|
||||||
|
await new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, 100);
|
||||||
|
});
|
||||||
const [backendOptions, gpuOptions] = await Promise.all([
|
const [backendOptions, gpuOptions] = await Promise.all([
|
||||||
form.current?.getBackendOptions?.({
|
form.current?.getBackendOptions?.({
|
||||||
cluster_id: initClusterId()
|
cluster_id: initClusterId()
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
|
|||||||
<div className="spin-wrapper">
|
<div className="spin-wrapper">
|
||||||
<Spin
|
<Spin
|
||||||
spinning={dataSource.loading}
|
spinning={dataSource.loading}
|
||||||
|
size="middle"
|
||||||
style={{ height: '100%', width: '100%' }}
|
style={{ height: '100%', width: '100%' }}
|
||||||
></Spin>
|
></Spin>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -241,7 +241,10 @@ const LoginForm = () => {
|
|||||||
<SpinContainer>
|
<SpinContainer>
|
||||||
{renderWelCome()}
|
{renderWelCome()}
|
||||||
<div className="spin">
|
<div className="spin">
|
||||||
<Spin tip={intl.formatMessage({ id: 'common.login.auth' })}>
|
<Spin
|
||||||
|
tip={intl.formatMessage({ id: 'common.login.auth' })}
|
||||||
|
size="middle"
|
||||||
|
>
|
||||||
<div style={{ width: 300 }}></div>
|
<div style={{ width: 300 }}></div>
|
||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -671,7 +671,7 @@ const GroundEmbedding: React.FC<MessageProps> = forwardRef((props, ref) => {
|
|||||||
alignItems: 'center'
|
alignItems: 'center'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Spin spinning={true}></Spin>
|
<Spin spinning={true} size="middle"></Spin>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<ResizeContainer
|
<ResizeContainer
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ const GroundVideo: React.FC<MessageProps> = forwardRef((props, ref) => {
|
|||||||
>
|
>
|
||||||
<Spin
|
<Spin
|
||||||
spinning={loading}
|
spinning={loading}
|
||||||
|
size="middle"
|
||||||
styles={{
|
styles={{
|
||||||
root: {
|
root: {
|
||||||
height: '100%'
|
height: '100%'
|
||||||
|
|||||||
Reference in New Issue
Block a user