Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions react/src/components/ServiceLauncherPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ const ServiceLauncherPageContent: React.FC<ServiceLauncherPageContentProps> = ({
deploymentRevisionPresets(limit: 100) {
edges {
node {
rowId
id
name
}
}
Expand Down Expand Up @@ -1716,7 +1716,7 @@ const ServiceLauncherPageContent: React.FC<ServiceLauncherPageContentProps> = ({
options={
deploymentRevisionPresets?.edges?.map(
(edge) => ({
value: edge.node.rowId,
value: edge.node.id,
label: edge.node.name,
}),
) ?? []
Expand Down
77 changes: 52 additions & 25 deletions react/src/components/VFolderDeployModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ import { useWebUINavigate } from '../hooks';
import { useSetBAINotification } from '../hooks/useBAINotification';
import { useCurrentProjectValue } from '../hooks/useCurrentProject';
import useDeploymentLauncher from '../hooks/useDeploymentLauncher';
import { EllipsisOutlined } from '@ant-design/icons';
import { App, Dropdown, Form, Space, Typography, theme } from 'antd';
import DeploymentPresetDetailModal from './DeploymentPresetDetailModal';
import { EllipsisOutlined, InfoCircleOutlined } from '@ant-design/icons';
import {
App,
Button,
Dropdown,
Form,
Space,
Tooltip,
Typography,
theme,
} from 'antd';
import type { DefaultOptionType } from 'antd/es/select';
import {
BAIButton,
Expand Down Expand Up @@ -268,6 +278,9 @@ const VFolderDeployModalContent: React.FC<VFolderDeployModalContentProps> = ({
const [userSelectedPresetId, setUserSelectedPresetId] = useState<
string | undefined
>(undefined);
const [presetDetailId, setPresetDetailId] = useState<string | undefined>(
undefined,
);
const effectivePresetId =
userSelectedPresetId ??
(availablePresets[0]?.id ? toLocalId(availablePresets[0].id) : undefined);
Expand Down Expand Up @@ -365,29 +378,43 @@ const VFolderDeployModalContent: React.FC<VFolderDeployModalContentProps> = ({
tooltip={t('modelStore.PresetTooltip')}
required
>
<BAISelect
value={effectivePresetId}
onChange={(value: string) => setUserSelectedPresetId(value)}
options={presetOptions}
disabled={hasNoPresets}
placeholder={
hasNoPresets ? t('modelStore.NoCompatiblePresets') : undefined
}
optionRender={(option) => (
<BAIFlex direction="column" align="start">
{option.label}
{option.data.description && (
<Typography.Text
type="secondary"
style={{ fontSize: token.fontSizeSM }}
ellipsis
>
{option.data.description}
</Typography.Text>
)}
</BAIFlex>
)}
style={{ width: '100%' }}
<Space.Compact style={{ width: '100%' }}>
<BAISelect
value={effectivePresetId}
onChange={(value: string) => setUserSelectedPresetId(value)}
options={presetOptions}
disabled={hasNoPresets}
placeholder={
hasNoPresets ? t('modelStore.NoCompatiblePresets') : undefined
}
optionRender={(option) => (
<BAIFlex direction="column" align="start">
{option.label}
{option.data.description && (
<Typography.Text
type="secondary"
style={{ fontSize: token.fontSizeSM }}
ellipsis
>
{option.data.description}
</Typography.Text>
)}
</BAIFlex>
)}
style={{ flex: 1 }}
/>
<Tooltip title={t('modelService.DeploymentPresetDetail')}>
<Button
icon={<InfoCircleOutlined />}
disabled={!effectivePresetId}
onClick={() => setPresetDetailId(effectivePresetId)}
/>
</Tooltip>
</Space.Compact>
<DeploymentPresetDetailModal
open={!!presetDetailId}
presetId={presetDetailId}
onRequestClose={() => setPresetDetailId(undefined)}
/>
</Form.Item>
<Form.Item
Expand Down
Loading