增加图标展示,区分清楚项目类型
This commit is contained in:
parent
a1ab19b7f3
commit
456a4bede2
@ -4,7 +4,6 @@ import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
Package,
|
||||
GitBranch,
|
||||
Rocket,
|
||||
CheckCircle2,
|
||||
@ -18,6 +17,7 @@ import {
|
||||
Hash,
|
||||
} from "lucide-react";
|
||||
import { formatDuration, formatTime, getStatusIcon, getStatusText } from '../utils/dashboardUtils';
|
||||
import { getLanguageIcon } from '../utils/languageIcons';
|
||||
import type { ApplicationConfig, DeployEnvironment, DeployRecord } from '../types';
|
||||
import { DeployFlowGraphModal } from './DeployFlowGraphModal';
|
||||
import DeploymentFormModal from './DeploymentFormModal';
|
||||
@ -41,6 +41,9 @@ export const ApplicationCard: React.FC<ApplicationCardProps> = ({
|
||||
const [flowModalOpen, setFlowModalOpen] = useState(false);
|
||||
const [deployDialogOpen, setDeployDialogOpen] = useState(false);
|
||||
|
||||
// 获取语言图标配置
|
||||
const languageConfig = getLanguageIcon(app.language);
|
||||
|
||||
const handleDeployRecordClick = (record: DeployRecord) => {
|
||||
setSelectedDeployRecordId(record.id);
|
||||
setFlowModalOpen(true);
|
||||
@ -50,7 +53,26 @@ export const ApplicationCard: React.FC<ApplicationCardProps> = ({
|
||||
<div className="flex flex-col p-3 rounded-lg border hover:bg-accent/50 transition-colors">
|
||||
{/* 应用基本信息 - 固定高度确保一致性 */}
|
||||
<div className="flex items-start gap-2 mb-3 min-h-[54px]">
|
||||
<Package className="h-4 w-4 text-muted-foreground shrink-0 mt-0.5" />
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<span
|
||||
className="shrink-0 mt-0.5 flex items-center justify-center"
|
||||
style={{
|
||||
fontSize: '16px',
|
||||
color: languageConfig.color,
|
||||
width: '16px',
|
||||
height: '16px'
|
||||
}}
|
||||
>
|
||||
{languageConfig.icon}
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>{languageConfig.label}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
<div className="flex-1 min-w-0">
|
||||
{app.applicationName ? (
|
||||
<h4 className="font-semibold text-sm mb-1 truncate">{app.applicationName}</h4>
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import type { DevelopmentLanguageTypeEnum } from '@/pages/Deploy/Application/List/types';
|
||||
|
||||
export interface Approver {
|
||||
userId: number;
|
||||
username: string;
|
||||
@ -46,6 +48,7 @@ export interface ApplicationConfig {
|
||||
applicationCode: string;
|
||||
applicationName: string;
|
||||
applicationDesc?: string;
|
||||
language?: DevelopmentLanguageTypeEnum; // 开发语言
|
||||
buildType?: BuildType; // 构建类型
|
||||
branch: string;
|
||||
deployBranch?: string; // 🆕 部署分支
|
||||
|
||||
Loading…
Reference in New Issue
Block a user