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