fix: dashboard re-render
This commit is contained in:
@@ -146,6 +146,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
onChange={handleInputRepoChange}
|
||||
onSearch={debounceSearch}
|
||||
options={repoOptions}
|
||||
disabled={action === PageAction.EDIT}
|
||||
addAfter={
|
||||
<span style={{ position: 'relative', top: '2px' }}>
|
||||
<SearchOutlined></SearchOutlined>
|
||||
@@ -176,6 +177,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
required
|
||||
options={fileOptions}
|
||||
onFocus={handleRepoOnBlur}
|
||||
disabled={action === PageAction.EDIT}
|
||||
></SealAutoComplete>
|
||||
</Form.Item>
|
||||
</>
|
||||
@@ -229,6 +231,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
>
|
||||
<SealAutoComplete
|
||||
filterOption
|
||||
disabled={action === PageAction.EDIT}
|
||||
label={intl.formatMessage({ id: 'model.form.ollama.model' })}
|
||||
required
|
||||
options={ollamaModelOptions}
|
||||
@@ -314,6 +317,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
]}
|
||||
>
|
||||
<SealSelect
|
||||
disabled={action === PageAction.EDIT}
|
||||
label={intl.formatMessage({
|
||||
id: 'models.form.source'
|
||||
})}
|
||||
@@ -343,7 +347,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
id: 'models.form.replicas'
|
||||
})}
|
||||
required
|
||||
min={1}
|
||||
min={0}
|
||||
></SealInput.Number>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name="description">
|
||||
|
||||
@@ -19,7 +19,8 @@ export const modelSourceMap = {
|
||||
};
|
||||
|
||||
export const status: any = {
|
||||
Running: StatusMaps.success
|
||||
Running: StatusMaps.success,
|
||||
Pending: StatusMaps.transitioning
|
||||
};
|
||||
|
||||
export const ActionList = [
|
||||
|
||||
@@ -334,9 +334,14 @@ const Models: React.FC = () => {
|
||||
handleViewLogs(row);
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
fetchData();
|
||||
return () => {
|
||||
axiosToken?.cancel?.();
|
||||
};
|
||||
}, [queryParams]);
|
||||
|
||||
useEffect(() => {
|
||||
// fetchData();
|
||||
createModelsChunkRequest();
|
||||
return () => {
|
||||
chunkRequedtRef.current?.current?.cancel?.();
|
||||
@@ -430,7 +435,7 @@ const Models: React.FC = () => {
|
||||
></Input>
|
||||
<Button
|
||||
type="text"
|
||||
style={{ color: 'var(--ant-color-primary)' }}
|
||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||
onClick={handleSearch}
|
||||
icon={<SyncOutlined></SyncOutlined>}
|
||||
></Button>
|
||||
|
||||
Reference in New Issue
Block a user