fix: 报错修复
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user