fix: allowed models do not contain the org name
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import { PageActionType } from '@/config/types';
|
import { PageActionType } from '@/config/types';
|
||||||
import { queryMyModels } from '@/pages/llmodels/apis';
|
import { queryMyModels } from '@/pages/llmodels/apis';
|
||||||
|
import useOpenPlayground from '@/pages/model-routes/hooks/use-open-playground';
|
||||||
import { SelectPanel, useAppUtils } from '@gpustack/core-ui';
|
import { SelectPanel, useAppUtils } from '@gpustack/core-ui';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Checkbox, Divider, Form, Radio } from 'antd';
|
import { Checkbox, Divider, Form, Radio } from 'antd';
|
||||||
@@ -22,6 +23,7 @@ const AllowModelsForm: React.FC<{
|
|||||||
onValuesChange?: (changedValues: any, allValues: any) => void;
|
onValuesChange?: (changedValues: any, allValues: any) => void;
|
||||||
}> = ({ currentData, action, onValuesChange }) => {
|
}> = ({ currentData, action, onValuesChange }) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
const { generateModelName } = useOpenPlayground();
|
||||||
const { getRuleMessage } = useAppUtils();
|
const { getRuleMessage } = useAppUtils();
|
||||||
const form = Form.useFormInstance();
|
const form = Form.useFormInstance();
|
||||||
const allowedModelNames = Form.useWatch(
|
const allowedModelNames = Form.useWatch(
|
||||||
@@ -39,7 +41,7 @@ const AllowModelsForm: React.FC<{
|
|||||||
const res = await queryMyModels({
|
const res = await queryMyModels({
|
||||||
page: -1
|
page: -1
|
||||||
});
|
});
|
||||||
const options = res.items.map((item) => item.name);
|
const options = res.items.map((item) => generateModelName(item));
|
||||||
if (action === PageAction.EDIT && currentData) {
|
if (action === PageAction.EDIT && currentData) {
|
||||||
const list = new Set([
|
const list = new Set([
|
||||||
...options,
|
...options,
|
||||||
|
|||||||
Reference in New Issue
Block a user