From 3ad79299c3ac65b08220c2a7ac51451506009c98 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Wed, 29 Oct 2025 18:04:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=A2=E9=98=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/Deploy/GitManager/List/index.tsx | 50 ++--- .../ScheduleJob/List/components/Dashboard.tsx | 203 +++++++++++------- 2 files changed, 147 insertions(+), 106 deletions(-) diff --git a/frontend/src/pages/Deploy/GitManager/List/index.tsx b/frontend/src/pages/Deploy/GitManager/List/index.tsx index c2cce655..1c5b9b15 100644 --- a/frontend/src/pages/Deploy/GitManager/List/index.tsx +++ b/frontend/src/pages/Deploy/GitManager/List/index.tsx @@ -622,7 +622,7 @@ const GitManager: React.FC = () => { className={`h-4 w-4 ${syncing.groups ? 'animate-spin' : ''}`} /> - +
@@ -638,13 +638,13 @@ const GitManager: React.FC = () => { -
+
{loading.groups ? ( -
+
) : filteredGroupTree.length === 0 ? ( -
+

暂无仓库组

@@ -654,7 +654,7 @@ const GitManager: React.FC = () => {
- + {/* 中栏:项目列表 */} @@ -663,9 +663,9 @@ const GitManager: React.FC = () => {
项目 {selectedGroup && `(${filteredProjects.length})`} - - -
+ +
@@ -760,7 +760,7 @@ const GitManager: React.FC = () => { )}
-
+
{project.webUrl && ( @@ -772,11 +772,11 @@ const GitManager: React.FC = () => { onClick={(e) => e.stopPropagation()} className="flex-shrink-0" - > + > - + + +

在 GitLab 中查看

@@ -788,8 +788,8 @@ const GitManager: React.FC = () => { ))}
)} - - + + {/* 右栏:分支列表 */} @@ -798,8 +798,8 @@ const GitManager: React.FC = () => { 分支 {selectedProject && `(${filteredBranches.length})`} - - + +
{ 受保护 - +

受保护的分支,限制直接推送

@@ -900,10 +900,10 @@ const GitManager: React.FC = () => { + > diff --git a/frontend/src/pages/Deploy/ScheduleJob/List/components/Dashboard.tsx b/frontend/src/pages/Deploy/ScheduleJob/List/components/Dashboard.tsx index 6a852887..3ecbd1a1 100644 --- a/frontend/src/pages/Deploy/ScheduleJob/List/components/Dashboard.tsx +++ b/frontend/src/pages/Deploy/ScheduleJob/List/components/Dashboard.tsx @@ -3,6 +3,7 @@ import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Progress } from '@/components/ui/progress'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; +import { ScrollArea } from '@/components/ui/scroll-area'; import { Activity, CheckCircle2, @@ -119,7 +120,11 @@ const Dashboard: React.FC = () => { 正在执行 - + {data?.summary.running && data.summary.running > 0 ? ( + + ) : ( + + )}
{data?.summary.running || 0}
@@ -277,114 +282,150 @@ const Dashboard: React.FC = () => { {/* 状态分组视图 */} -
+
{/* 运行中 */} - - - + + +
- 运行中 ({groupedJobs.running.length}) + 运行中 +
{groupedJobs.running.length}
- - {groupedJobs.running.length === 0 ? ( -

无正在运行的任务

- ) : ( -
- {groupedJobs.running.map((job) => { - const runningJob = data?.runningJobs.find(r => r.jobId === job.id); - return ( -
-
-

{job.jobName}

+ + + {groupedJobs.running.length === 0 ? ( +
+ +

无正在运行的任务

+
+ ) : ( +
+ {groupedJobs.running.map((job) => { + const runningJob = data?.runningJobs.find(r => r.jobId === job.id); + return ( +
+

+ {job.jobName} +

{runningJob && ( - + <> + +
+ {runningJob.message || '执行中...'} + + {runningJob.progress}% + +
+ )}
- {runningJob && ( - {runningJob.progress}% - )} -
- ); - })} -
- )} + ); + })} +
+ )} + {/* 已暂停 */} - - - + + + - 已暂停 ({groupedJobs.paused.length}) + 已暂停 +
{groupedJobs.paused.length}
- - {groupedJobs.paused.length === 0 ? ( -

无暂停的任务

- ) : ( -
- {groupedJobs.paused.map((job) => ( -
-

{job.jobName}

-

- 上次: {job.lastExecuteTime ? dayjs(job.lastExecuteTime).fromNow() : '-'} -

-
- ))} -
- )} + + + {groupedJobs.paused.length === 0 ? ( +
+ +

无暂停的任务

+
+ ) : ( +
+ {groupedJobs.paused.map((job) => ( +
+

+ {job.jobName} +

+

+ 上次: {job.lastExecuteTime ? dayjs(job.lastExecuteTime).fromNow() : '-'} +

+
+ ))} +
+ )} +
{/* 空闲中 */} - - - + + + - 空闲中 ({groupedJobs.idle.length}) + 空闲中 +
{groupedJobs.idle.length}
- - {groupedJobs.idle.length === 0 ? ( -

无空闲任务

- ) : ( -
- {groupedJobs.idle.map((job) => ( -
-

{job.jobName}

-

- 下次: {job.nextExecuteTime ? dayjs(job.nextExecuteTime).format('MM-DD HH:mm') : '-'} -

-
- ))} -
- )} + + + {groupedJobs.idle.length === 0 ? ( +
+ +

无空闲任务

+
+ ) : ( +
+ {groupedJobs.idle.map((job) => ( +
+

+ {job.jobName} +

+

+ + 下次: {job.nextExecuteTime ? dayjs(job.nextExecuteTime).format('MM-DD HH:mm') : '-'} +

+
+ ))} +
+ )} +
{/* 已禁用 */} - - - + + + - 已禁用 ({groupedJobs.disabled.length}) + 已禁用 +
{groupedJobs.disabled.length}
- - {groupedJobs.disabled.length === 0 ? ( -

无禁用的任务

- ) : ( -
- {groupedJobs.disabled.map((job) => ( -
-

{job.jobName}

-

已停用

-
- ))} -
- )} + + + {groupedJobs.disabled.length === 0 ? ( +
+ +

无禁用的任务

+
+ ) : ( +
+ {groupedJobs.disabled.map((job) => ( +
+

+ {job.jobName} +

+

已停用

+
+ ))} +
+ )} +