fix: query catalog spec, default_version check

This commit is contained in:
jialin
2025-12-12 17:08:30 +08:00
parent cb43131ccb
commit 0500dd2e35
19 changed files with 86 additions and 23 deletions
+1 -1
View File
@@ -367,7 +367,7 @@ export async function queryCatalogList(
}
export async function queryCatalogItemSpec(
params: { id: number; cluster_id: number },
params: { id: number; cluster_id: number | null },
options?: any
) {
return request<Global.PageResponse<CatalogSpec>>(
+4 -1
View File
@@ -198,7 +198,10 @@ const Catalog: React.FC = () => {
const getCatalogSource = async () => {
try {
const id = dataSource.dataList?.[0]?.id;
const res: any = await queryCatalogItemSpec({ id, cluster_id: 0 });
const res: any = await queryCatalogItemSpec({
id,
cluster_id: null
});
sourceRef.current = res?.items?.[0]?.source;
} catch (error) {}
};
@@ -250,6 +250,16 @@ const AddModal: React.FC<AddModalProps> = (props) => {
cluster_id: clusterId,
name
});
// If no avaliable gpus for the model, show warning message
if (!res.items.length) {
setWarningStatus({
show: true,
type: 'warning',
message: intl.formatMessage({ id: 'models.catalog.nogpus.tips' })
});
return;
}
handleCheckCompatibility(allValues);
} catch (error) {
// ignore
-1
View File
@@ -103,7 +103,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
const [form] = Form.useForm();
const intl = useIntl();
const [activeKey, setActiveKey] = React.useState<string[]>([]);
const scheduleType = Form.useWatch('scheduleType', form);
const [target, setTarget] = React.useState<string>(TABKeysMap.BASIC);
console.log('scroller instance in form:', osInstance, scrollEventElement);
+6 -1
View File
@@ -296,7 +296,12 @@ export const useCheckCompatibility = () => {
title: intl.formatMessage({ id: 'models.form.check.passed' }),
message: intl.formatMessage({ id: messageId }, { ram, vram })
};
} else if (othersAvailable) {
} else if (
othersAvailable &&
!scheduling_messages?.length &&
!compatibility_messages?.length
) {
// no specific messages, but other clusters are available
msgData = {
title: intl.formatMessage({
id: 'models.form.check.clusterUnavailable'