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