fix: automatically update the page when scrolling
This commit is contained in:
@@ -221,7 +221,8 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
<Tag
|
||||
color="cyan"
|
||||
style={{
|
||||
opacity: 0.75
|
||||
opacity: 0.75,
|
||||
borderRadius: 12
|
||||
}}
|
||||
>
|
||||
<InfoCircleOutlined className="m-r-5" />
|
||||
@@ -241,7 +242,8 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
<Tag
|
||||
color="processing"
|
||||
style={{
|
||||
opacity: 0.75
|
||||
opacity: 0.75,
|
||||
borderRadius: 12
|
||||
}}
|
||||
>
|
||||
<InfoCircleOutlined className="m-r-5" />
|
||||
|
||||
@@ -30,7 +30,7 @@ import { Access, useAccess, useIntl, useNavigate } from '@umijs/max';
|
||||
import { Button, Dropdown, Input, Space, Tag, message } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
import { memo, useCallback, useRef, useState } from 'react';
|
||||
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import {
|
||||
MODELS_API,
|
||||
@@ -66,6 +66,7 @@ interface ModelsProps {
|
||||
perPage: number;
|
||||
query?: string;
|
||||
};
|
||||
deleteIds?: number[];
|
||||
gpuDeviceList: GPUDeviceItem[];
|
||||
workerList: WorkerListItem[];
|
||||
dataSource: ListItem[];
|
||||
@@ -111,6 +112,7 @@ const Models: React.FC<ModelsProps> = ({
|
||||
handleDeleteSuccess,
|
||||
onViewLogs,
|
||||
onCancelViewLogs,
|
||||
deleteIds,
|
||||
dataSource,
|
||||
gpuDeviceList,
|
||||
workerList,
|
||||
@@ -211,6 +213,12 @@ const Models: React.FC<ModelsProps> = ({
|
||||
}
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (deleteIds?.length) {
|
||||
rowSelection.removeSelectedKey(deleteIds);
|
||||
}
|
||||
}, [deleteIds]);
|
||||
|
||||
const sourceOptions = [
|
||||
{
|
||||
label: 'Hugging Face',
|
||||
|
||||
@@ -35,6 +35,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
|
||||
const updateHandler = (list: any) => {
|
||||
const data = list?.find((item: any) => item.data?.id === props.id);
|
||||
// state in InstanceRealLogStatus will not enable scorll load, because it is in the trasisition state
|
||||
if (data) {
|
||||
setEnableScorllLoad(
|
||||
() => !InstanceRealLogStatus.includes(data?.data?.state)
|
||||
|
||||
Reference in New Issue
Block a user