fix: dashboard re-render

This commit is contained in:
jialin
2024-07-04 17:43:39 +08:00
parent ed3f9f7e96
commit e9d8828dcd
42 changed files with 240 additions and 1442 deletions
+5 -1
View File
@@ -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">
+2 -1
View File
@@ -19,7 +19,8 @@ export const modelSourceMap = {
};
export const status: any = {
Running: StatusMaps.success
Running: StatusMaps.success,
Pending: StatusMaps.transitioning
};
export const ActionList = [
+7 -2
View File
@@ -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>