fix: init cluster id when deploy model
This commit is contained in:
@@ -12,10 +12,11 @@
|
||||
|
||||
.note-info {
|
||||
margin-left: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.star {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ const NoteInfo: React.FC<NoteInfoProps> = (props) => {
|
||||
if (!label) return null;
|
||||
const renderRequiredStar = required ? (
|
||||
<span className="star" style={{ color: 'red' }}>
|
||||
*
|
||||
﹡
|
||||
</span>
|
||||
) : null;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -23,7 +23,7 @@ declare namespace Global {
|
||||
require_password_change: boolean;
|
||||
id: number;
|
||||
source: string;
|
||||
avatar: string;
|
||||
avatar_url: string;
|
||||
}
|
||||
type EmptyObject = Record<never, never>;
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ export const ExtraContent = (props: { isDarkTheme?: boolean }) => {
|
||||
<Avatar
|
||||
size={24}
|
||||
style={{ ...avatarStyle }}
|
||||
src={initialState?.currentUser?.avatar}
|
||||
src={initialState?.currentUser?.avatar_url}
|
||||
icon={
|
||||
<IconFont type="icon-user-filled" className="font-size-24" />
|
||||
}
|
||||
@@ -322,7 +322,7 @@ export const ExtraContent = (props: { isDarkTheme?: boolean }) => {
|
||||
<Avatar
|
||||
size={24}
|
||||
style={{ ...avatarStyle }}
|
||||
src={initialState?.currentUser?.avatar}
|
||||
src={initialState?.currentUser?.avatar_url}
|
||||
icon={<IconFont type="icon-user-filled" className="font-size-24" />}
|
||||
/>
|
||||
</IconWrapper>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import ScrollerModal from '@/components/scroller-modal';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { VersionListItem } from '../config/types';
|
||||
import VersionInfo from '../forms/version-info';
|
||||
@@ -7,12 +9,14 @@ import VersionInfo from '../forms/version-info';
|
||||
interface VersionInfoModalProps {
|
||||
open?: boolean;
|
||||
currentData?: any;
|
||||
addVersion?: () => void;
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
const VersionInfoModal: React.FC<VersionInfoModalProps> = ({
|
||||
open,
|
||||
currentData,
|
||||
addVersion,
|
||||
onClose
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
@@ -55,7 +59,14 @@ const VersionInfoModal: React.FC<VersionInfoModalProps> = ({
|
||||
return (
|
||||
<ScrollerModal
|
||||
open={open}
|
||||
title={intl.formatMessage({ id: 'backend.versions' })}
|
||||
title={
|
||||
<div className="flex-center gap-16">
|
||||
{intl.formatMessage({ id: 'backend.versions' })}
|
||||
<Button onClick={addVersion} type="link" size="small">
|
||||
<PlusOutlined /> {intl.formatMessage({ id: 'backend.addVersion' })}
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
width={600}
|
||||
centered
|
||||
destroyOnHidden
|
||||
@@ -63,22 +74,6 @@ const VersionInfoModal: React.FC<VersionInfoModalProps> = ({
|
||||
maskClosable={false}
|
||||
onOk={onClose}
|
||||
onCancel={onClose}
|
||||
styles={{
|
||||
content: {
|
||||
padding: '0 0 16px 0'
|
||||
},
|
||||
header: {
|
||||
padding: 'var(--ant-modal-content-padding)',
|
||||
paddingBottom: '0'
|
||||
},
|
||||
body: {
|
||||
padding: '16px 24px 32px'
|
||||
},
|
||||
footer: {
|
||||
padding: '16px 24px',
|
||||
margin: '0'
|
||||
}
|
||||
}}
|
||||
footer={null}
|
||||
>
|
||||
<VersionInfo versionConfigs={versionConfigs} />
|
||||
|
||||
@@ -154,6 +154,18 @@ const BackendList = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleAddVersion = () => {
|
||||
setOpenVersionInfoModal({
|
||||
open: false,
|
||||
currentData: undefined
|
||||
});
|
||||
setOpenModalStatus({
|
||||
open: true,
|
||||
action: 'edit',
|
||||
currentData: openVersionInfoModal.currentData
|
||||
});
|
||||
};
|
||||
|
||||
const loadMore = useMemoizedFn((nextPage: number) => {
|
||||
fetchData({
|
||||
query: {
|
||||
@@ -226,6 +238,7 @@ const BackendList = () => {
|
||||
}
|
||||
></AddModal>
|
||||
<VersionInfoModal
|
||||
addVersion={handleAddVersion}
|
||||
open={openVersionInfoModal.open}
|
||||
currentData={openVersionInfoModal.currentData as ListItem}
|
||||
onClose={() =>
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
box-shadow: none !important;
|
||||
|
||||
:global(.ant-card-body) {
|
||||
height: 110px;
|
||||
height: 96px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
border-radius: var(--ant-border-radius-lg);
|
||||
border: 1px solid var(--ant-color-border);
|
||||
padding: 16px 24px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,9 +177,9 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
};
|
||||
|
||||
const initClusterId = (): number => {
|
||||
const cluster_id = clusterList?.find(
|
||||
(item) => item.state === ClusterStatusValueMap.Ready
|
||||
)?.value;
|
||||
const cluster_id =
|
||||
clusterList?.find((item) => item.state === ClusterStatusValueMap.Ready)
|
||||
?.value || clusterList?.[0]?.value;
|
||||
|
||||
return cluster_id as number;
|
||||
};
|
||||
|
||||
@@ -443,7 +443,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
}
|
||||
const cluster_id =
|
||||
clusterList?.find((item) => item.state === ClusterStatusValueMap.Ready)
|
||||
?.value || '';
|
||||
?.value || clusterList?.[0]?.value;
|
||||
|
||||
return cluster_id;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user