chore: update env vars from backend version

This commit is contained in:
jialin
2026-01-30 20:48:55 +08:00
committed by Lawrence Li
parent 4000aacb2c
commit 4a4a02eb0d
18 changed files with 240 additions and 116 deletions
+24 -19
View File
@@ -308,6 +308,28 @@ const BackendCard: React.FC<BackendCardProps> = ({ data, onSelect }) => {
);
};
const renderEnabledTag = () => {
if (data.backend_source !== BackendSourceValueMap.COMMUNITY) {
return null;
}
return (
<ThemeTag
className="font-400"
variant="outlined"
color={data.enabled ? 'green' : 'default'}
style={{
borderRadius: 'var(--ant-border-radius)',
margin: 0,
width: 'max-content'
}}
>
{data.enabled
? `${intl.formatMessage({ id: 'common.status.enabled' })}`
: `${intl.formatMessage({ id: 'common.status.disabled' })}`}
</ThemeTag>
);
};
return (
<StyledCard
onClick={handleClick}
@@ -344,27 +366,10 @@ const BackendCard: React.FC<BackendCardProps> = ({ data, onSelect }) => {
<InfoItem>
<span className="label">
<IconFont type="icon-source" className="icon" />
<span>Source:</span>
<span>{intl.formatMessage({ id: 'models.form.source' })}:</span>
</span>
{renderSource()}
{data.backend_source === BackendSourceValueMap.COMMUNITY && (
<>
<ThemeTag
className="font-400"
variant="outlined"
color={data.enabled ? 'green' : 'default'}
style={{
borderRadius: 'var(--ant-border-radius)',
margin: 0,
width: 'max-content'
}}
>
{data.enabled
? `${intl.formatMessage({ id: 'common.status.enabled' })}`
: `${intl.formatMessage({ id: 'common.status.disabled' })}`}
</ThemeTag>
</>
)}
{renderEnabledTag()}
</InfoItem>
{renderRecommendModels()}
</SourceWrapper>
@@ -69,7 +69,9 @@ const VersionInfoModal: React.FC<VersionInfoModalProps> = ({
open={open}
title={
<div className="flex-center gap-16">
<span>{intl.formatMessage({ id: 'backend.versions' })}</span>
<span style={{ fontSize: 14 }}>
{intl.formatMessage({ id: 'backend.versions' })}
</span>
<Button onClick={addVersion} type="link" size="small">
<PlusOutlined /> {intl.formatMessage({ id: 'backend.addVersion' })}
</Button>