fix: yaml editor do not update when upload same file

This commit is contained in:
jialin
2025-11-13 16:53:11 +08:00
parent b61c0d6dee
commit aee9566bbb
13 changed files with 42 additions and 98 deletions
+1 -2
View File
@@ -196,6 +196,7 @@ export async function queryModelScopeModels(
Criterion: [...(tagsCriterion || []), ...(tasksCriterion || [])]
}
: {};
const res = await fetch(setProxyUrl(`${MODEL_SCOPE_LIST_MODEL_API}`), {
method: 'PUT',
signal: config?.signal,
@@ -212,7 +213,6 @@ export async function queryModelScopeModels(
});
if (!res.ok) {
throw new Error('Network response was not ok');
return null;
}
return res.json();
}
@@ -246,7 +246,6 @@ export async function queryModelScopeModelFiles(
if (!res.ok) {
throw new Error('Network response was not ok');
return null;
}
return res.json();
@@ -122,6 +122,7 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
const handleClose = () => {
onClose();
};
return (
<ScrollerModal
open={open}
+6 -34
View File
@@ -12,7 +12,6 @@ import { CatalogItem as CatalogItemType } from '../config/types';
import '../style/catalog-item.less';
import { categoryConfig } from './model-tag';
const COLORS = ['blue', 'purple', 'orange'];
interface CatalogItemProps {
activeId: number;
data: CatalogItemType;
@@ -26,32 +25,6 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
onClick(data);
}, [data, onClick]);
const handleOnError = (e: any) => {
e.target.src = fallbackImg;
};
const renderTag = useCallback((sItem: any) => {
return (
<ThemeTag
key={sItem}
className="tag-item"
opacity={0.7}
style={{
marginRight: 0,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
padding: '2px 6px',
borderRadius: 4,
fontSize: 12,
height: 22
}}
>
{sItem.label}
</ThemeTag>
);
}, []);
const description = useMemo(() => {
return (
<Typography.Paragraph
@@ -86,13 +59,12 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
>
<div className="content">
<div className="title">
<div className="img">
<img
src={data.icon || fallbackImg}
alt=""
onError={handleOnError}
/>
</div>
<div
className="img"
style={{
backgroundImage: `url(${data.icon}),url(${fallbackImg})`
}}
></div>
<AutoTooltip ghost>{data.name}</AutoTooltip>
</div>
</div>
+1
View File
@@ -116,6 +116,7 @@ const Models: React.FC = () => {
cancelToken: axiosToken.token
});
// if the current page is beyond total page, fetch again
if (
!res.items.length &&
params.page > res.pagination.totalPage &&
@@ -19,6 +19,9 @@
height: 32px;
border-radius: var(--ant-border-radius);
overflow: hidden;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
img {
height: 32px;