fix: 报错修复

This commit is contained in:
2026-01-03 23:18:33 +08:00
parent d22fdc9618
commit a067d167e9
4 changed files with 4 additions and 18 deletions

View File

@@ -25,17 +25,6 @@ function DeployRecordItem({
return <Tag color={config.color}>{config.text}</Tag>;
};
// 环境标签渲染函数
const getEnvTag = (env: string) => {
const envMap: Record<string, { color: string; text: string }> = {
production: { color: 'red', text: '生产环境' },
staging: { color: 'orange', text: '预发布环境' },
development: { color: 'blue', text: '开发环境' },
};
const config = envMap[env] || { color: 'gray', text: env };
return <Tag color={config.color}>{config.text}</Tag>;
};
return (
<List.Item
key={item.id}
@@ -68,9 +57,6 @@ function DeployRecordItem({
:{' '}
<span className="font-medium text-gray-700">{item.branch}</span>
</span>
<span className="text-sm text-gray-500">
: {getEnvTag(item.env || 'unknown')}
</span>
<span className="text-sm text-gray-500">
: {getStatusTag(item.status)}
</span>

View File

@@ -813,7 +813,7 @@ function ProjectDetailPage() {
/>
{workspaceStatus.error && (
<div className="mt-4 p-3 bg-red-50 border border-red-200 rounded">
<Typography.Text type="danger">
<Typography.Text type="error">
{workspaceStatus.error}
</Typography.Text>
</div>
@@ -888,7 +888,7 @@ function ProjectDetailPage() {
</Typography.Title>
{selectedRecord && (
<Typography.Text type="secondary" className="text-sm">
{selectedRecord.branch} · {selectedRecord.env} ·{' '}
{selectedRecord.branch}
{formatDateTime(selectedRecord.createdAt)}
</Typography.Text>
)}

View File

@@ -214,7 +214,7 @@ class DetailService {
// 更新项目
async updateProject(
id: number,
project: Partial<{ name: string; description: string; repository: string }>,
project: Partial<Project>,
) {
const { data } = await net.request<APIResponse<Project>>({
url: `/api/projects/${id}`,