fix: init envs

This commit is contained in:
jialin
2026-01-30 20:48:55 +08:00
committed by Lawrence Li
parent 56985be26b
commit 507b0e44d5
9 changed files with 59 additions and 140 deletions
@@ -91,13 +91,6 @@ const BackendDetail: React.FC<{
return (
<li key={key}>
<div className="label">{_.upperCase(key)}</div>
{/* <Flex gap={8} wrap="wrap" style={{ marginBlock: 8 }}>
{value?.map?.((v: string, index: number) => (
<Tag key={index} style={{ margin: 0 }}>
{v}
</Tag>
))}
</Flex> */}
</li>
);
}
@@ -141,21 +134,6 @@ const BackendDetail: React.FC<{
<Content>{renderSupportedFrameworks()}</Content>
</Section>
)}
{/* <Section>
<Subtitle>
<BulbOutlined className="icon" />
<span>
{intl.formatMessage({
id: 'backend.form.defaultExecuteCommand'
})}
</span>
</Subtitle>
<Content style={{ padding: 0, border: 'none' }}>
<HighlightCode
code={currentData?.default_run_command}
></HighlightCode>
</Content>
</Section> */}
{currentData?.description && (
<Section>
<Subtitle>
+1 -89
View File
@@ -5,7 +5,7 @@ import TagWrapper from '@/components/tags-wrapper';
import ThemeTag from '@/components/tags-wrapper/theme-tag';
import Card from '@/components/templates/card';
import { useIntl } from '@umijs/max';
import { Button, Flex, Tag, Tooltip } from 'antd';
import { Button, Tag } from 'antd';
import _ from 'lodash';
import { useMemo } from 'react';
import semverCoerce from 'semver/functions/coerce';
@@ -32,23 +32,6 @@ const StyledCard = styled(Card)`
}
`;
const SourceWrapper = styled.div`
display: grid;
width: 100%;
grid-template-columns: max-content 1fr;
align-items: center;
gap: 0px;
.dot {
display: flex;
height: 4px;
width: 4px;
background-color: var(--ant-color-text-quaternary);
border-radius: 50%;
margin-inline: 8px;
}
`;
// add height props
const TagInner = styled(Tag)<{ height?: number }>`
display: flex;
@@ -237,16 +220,6 @@ const BackendCard: React.FC<BackendCardProps> = ({
);
};
const renderModel = (item: any) => {
return (
<AutoTooltip ghost minWidth={20} showTitle title={item}>
<ThemeTag key={item} style={{ marginRight: 0 }}>
{item}
</ThemeTag>
</AutoTooltip>
);
};
const renderFrameworks = () => {
const frameworks = _.keys(data.framework_index_map || {});
@@ -267,35 +240,6 @@ const BackendCard: React.FC<BackendCardProps> = ({
);
};
const renderRecommendModels = () => {
const recommendedModels = data.recommend_models || [];
if (recommendedModels.length === 0) {
return null;
}
return (
<div className="flex-center">
<span className="dot"></span>
<Tooltip
title={
<Flex gap={4} wrap="wrap">
{recommendedModels.map((item) => (
<Tag style={{ margin: 0 }} key={item}>
{item}
</Tag>
))}
</Flex>
}
>
<span>
<ThemeTag color="default">
{intl.formatMessage({ id: 'backend.recommendModels' })}
</ThemeTag>
</span>
</Tooltip>
</div>
);
};
const renderSource = () => {
if (layout === 'community') {
return null;
@@ -330,28 +274,6 @@ const BackendCard: React.FC<BackendCardProps> = ({
);
};
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>
);
};
const renderActions = () => {
return actionsRenderer ? (
actionsRenderer(data)
@@ -398,16 +320,6 @@ const BackendCard: React.FC<BackendCardProps> = ({
</span>
{renderSource()}
</CardName>
{/* <SourceWrapper>
<InfoItem>
<span className="label">
<IconFont type="icon-source" className="icon" />
<span>{intl.formatMessage({ id: 'models.form.source' })}:</span>
</span>
{renderEnabledTag()}
</InfoItem>
{renderRecommendModels()}
</SourceWrapper> */}
{renderFrameworks()}
</Content>
</StyledCard>
+1 -1
View File
@@ -31,7 +31,7 @@ export const builtInBackendLogos: Record<string, string> = {
export const BackendSourceValueMap = {
CUSTOM: 'custom',
BUILTIN: 'built-in',
BUILTIN: 'built_in',
COMMUNITY: 'community',
USER_DEFINED: 'user_defined'
};