@kernel-sig/console 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +50 -0
- package/LICENSE +127 -0
- package/Makefile +66 -0
- package/README.md +279 -0
- package/backend/.dockerignore +12 -0
- package/backend/Dockerfile +43 -0
- package/backend/alembic/env.py +75 -0
- package/backend/alembic/script.py.mako +25 -0
- package/backend/alembic/versions/0001_initial.py +88 -0
- package/backend/alembic/versions/350e2d9b6553_add_pr_comment_table.py +48 -0
- package/backend/alembic/versions/4f8342e727fe_sig_info_roster_fields_and_branch_.py +39 -0
- package/backend/alembic/versions/5a31ade90136_add_repository_credential_pull_request_.py +293 -0
- package/backend/alembic/versions/87a008142f17_add_classification_attention_and_ai_.py +436 -0
- package/backend/alembic/versions/a1c7d90e4b52_branch_belongs_to_a_repository.py +72 -0
- package/backend/alembic/versions/b41c9d7e5f28_extend_pr_kind_categories.py +43 -0
- package/backend/alembic/versions/c8e4f2a71b93_add_release_kind.py +40 -0
- package/backend/alembic/versions/d1275091dfdc_add_needs_detail_flag_to_pull_request.py +44 -0
- package/backend/alembic/versions/e5b27c9d3a41_downgrade_cve_without_ids.py +54 -0
- package/backend/alembic/versions/ee3159a4eff0_add_sig_meeting_member_and_release_.py +164 -0
- package/backend/alembic/versions/fcf3c186d63b_attention_rule_subscriptions.py +42 -0
- package/backend/alembic.ini +40 -0
- package/backend/app/__init__.py +0 -0
- package/backend/app/api/__init__.py +0 -0
- package/backend/app/api/deps.py +74 -0
- package/backend/app/api/v1/__init__.py +0 -0
- package/backend/app/api/v1/ai.py +386 -0
- package/backend/app/api/v1/analytics.py +48 -0
- package/backend/app/api/v1/attention.py +142 -0
- package/backend/app/api/v1/auth.py +106 -0
- package/backend/app/api/v1/classification.py +192 -0
- package/backend/app/api/v1/health.py +29 -0
- package/backend/app/api/v1/issues.py +143 -0
- package/backend/app/api/v1/pulls.py +388 -0
- package/backend/app/api/v1/repositories.py +273 -0
- package/backend/app/api/v1/router.py +32 -0
- package/backend/app/api/v1/sig.py +565 -0
- package/backend/app/api/v1/users.py +87 -0
- package/backend/app/api/v1/webhooks.py +135 -0
- package/backend/app/core/__init__.py +0 -0
- package/backend/app/core/config.py +72 -0
- package/backend/app/core/crypto.py +74 -0
- package/backend/app/core/db.py +79 -0
- package/backend/app/core/exceptions.py +60 -0
- package/backend/app/core/logging.py +69 -0
- package/backend/app/core/permissions.py +87 -0
- package/backend/app/core/queue.py +57 -0
- package/backend/app/core/security.py +69 -0
- package/backend/app/domain/__init__.py +0 -0
- package/backend/app/domain/attention.py +618 -0
- package/backend/app/domain/classification.py +689 -0
- package/backend/app/domain/meeting.py +408 -0
- package/backend/app/domain/release.py +163 -0
- package/backend/app/domain/review.py +416 -0
- package/backend/app/domain/sig.py +178 -0
- package/backend/app/domain/sig_info.py +201 -0
- package/backend/app/integrations/__init__.py +0 -0
- package/backend/app/integrations/atomgit/__init__.py +0 -0
- package/backend/app/integrations/atomgit/client.py +505 -0
- package/backend/app/integrations/atomgit/models.py +311 -0
- package/backend/app/integrations/llm/__init__.py +0 -0
- package/backend/app/integrations/llm/prompts.py +222 -0
- package/backend/app/integrations/llm/provider.py +326 -0
- package/backend/app/main.py +242 -0
- package/backend/app/middleware/__init__.py +0 -0
- package/backend/app/middleware/audit.py +129 -0
- package/backend/app/middleware/request_context.py +42 -0
- package/backend/app/models/__init__.py +112 -0
- package/backend/app/models/ai.py +214 -0
- package/backend/app/models/attention.py +131 -0
- package/backend/app/models/attention_settings.py +61 -0
- package/backend/app/models/audit.py +53 -0
- package/backend/app/models/base.py +35 -0
- package/backend/app/models/classification.py +144 -0
- package/backend/app/models/credential.py +56 -0
- package/backend/app/models/issue.py +132 -0
- package/backend/app/models/meeting.py +189 -0
- package/backend/app/models/pull_request.py +288 -0
- package/backend/app/models/repository.py +196 -0
- package/backend/app/models/sig.py +194 -0
- package/backend/app/models/user.py +44 -0
- package/backend/app/schemas/__init__.py +0 -0
- package/backend/app/schemas/ai.py +120 -0
- package/backend/app/schemas/attention.py +43 -0
- package/backend/app/schemas/auth.py +26 -0
- package/backend/app/schemas/classification.py +58 -0
- package/backend/app/schemas/common.py +43 -0
- package/backend/app/schemas/pull_request.py +214 -0
- package/backend/app/schemas/repository.py +94 -0
- package/backend/app/schemas/sig.py +246 -0
- package/backend/app/schemas/user.py +79 -0
- package/backend/app/services/__init__.py +0 -0
- package/backend/app/services/ai_service.py +569 -0
- package/backend/app/services/analytics_service.py +390 -0
- package/backend/app/services/attention_queue.py +451 -0
- package/backend/app/services/attention_service.py +432 -0
- package/backend/app/services/auth_service.py +74 -0
- package/backend/app/services/classification_service.py +658 -0
- package/backend/app/services/credential_service.py +105 -0
- package/backend/app/services/pull_query.py +273 -0
- package/backend/app/services/release_service.py +446 -0
- package/backend/app/services/repository_service.py +132 -0
- package/backend/app/services/sig_service.py +385 -0
- package/backend/app/services/sync_service.py +752 -0
- package/backend/app/services/user_service.py +68 -0
- package/backend/app/worker.py +389 -0
- package/backend/entrypoint.sh +10 -0
- package/backend/pyproject.toml +68 -0
- package/backend/tests/test_analysis_api.py +154 -0
- package/backend/tests/test_atomgit_client.py +360 -0
- package/backend/tests/test_atomgit_models.py +257 -0
- package/backend/tests/test_attention.py +291 -0
- package/backend/tests/test_audit_middleware.py +135 -0
- package/backend/tests/test_classification.py +498 -0
- package/backend/tests/test_config.py +41 -0
- package/backend/tests/test_crypto.py +68 -0
- package/backend/tests/test_exceptions.py +62 -0
- package/backend/tests/test_health.py +63 -0
- package/backend/tests/test_llm_provider.py +320 -0
- package/backend/tests/test_meeting_domain.py +169 -0
- package/backend/tests/test_permissions.py +69 -0
- package/backend/tests/test_pull_query_wiring.py +66 -0
- package/backend/tests/test_pull_schemas.py +82 -0
- package/backend/tests/test_release_domain.py +82 -0
- package/backend/tests/test_review_parser.py +301 -0
- package/backend/tests/test_schemas_user.py +97 -0
- package/backend/tests/test_security.py +92 -0
- package/cli/index.js +338 -0
- package/compose.yaml +105 -0
- package/frontend/.dockerignore +4 -0
- package/frontend/Dockerfile +27 -0
- package/frontend/index.html +14 -0
- package/frontend/nginx.conf +47 -0
- package/frontend/package-lock.json +5020 -0
- package/frontend/package.json +35 -0
- package/frontend/src/api/ai.ts +124 -0
- package/frontend/src/api/analytics.ts +66 -0
- package/frontend/src/api/attention.ts +181 -0
- package/frontend/src/api/auth.ts +74 -0
- package/frontend/src/api/classification.ts +170 -0
- package/frontend/src/api/issues.ts +90 -0
- package/frontend/src/api/pulls.ts +233 -0
- package/frontend/src/api/repositories.ts +95 -0
- package/frontend/src/api/sig.ts +232 -0
- package/frontend/src/app/antd-theme.ts +94 -0
- package/frontend/src/app/providers.tsx +59 -0
- package/frontend/src/app/router.tsx +411 -0
- package/frontend/src/app/search.ts +30 -0
- package/frontend/src/components/ClassificationBadge.tsx +58 -0
- package/frontend/src/components/GateBadge.tsx +13 -0
- package/frontend/src/components/SeverityBadge.tsx +20 -0
- package/frontend/src/components/layout/AppShell.tsx +16 -0
- package/frontend/src/components/layout/AuthLayout.tsx +32 -0
- package/frontend/src/components/layout/Sidebar.tsx +223 -0
- package/frontend/src/components/layout/TopBar.tsx +47 -0
- package/frontend/src/components/pulls/DiscussionTimeline.tsx +145 -0
- package/frontend/src/components/pulls/FacetRail.tsx +199 -0
- package/frontend/src/components/pulls/LabelChips.tsx +87 -0
- package/frontend/src/components/ui/alert.tsx +30 -0
- package/frontend/src/components/ui/badge.tsx +53 -0
- package/frontend/src/components/ui/button.tsx +51 -0
- package/frontend/src/components/ui/card.tsx +64 -0
- package/frontend/src/components/ui/chart-theme.ts +65 -0
- package/frontend/src/components/ui/data-table.tsx +39 -0
- package/frontend/src/components/ui/echart.tsx +70 -0
- package/frontend/src/components/ui/empty-state.tsx +22 -0
- package/frontend/src/components/ui/input.tsx +39 -0
- package/frontend/src/components/ui/lazy-chart.tsx +21 -0
- package/frontend/src/components/ui/skeleton.tsx +19 -0
- package/frontend/src/hooks/use-current-repository.ts +44 -0
- package/frontend/src/hooks/use-current-user.ts +38 -0
- package/frontend/src/lib/api-client.ts +93 -0
- package/frontend/src/lib/css-color.ts +60 -0
- package/frontend/src/lib/utils.ts +45 -0
- package/frontend/src/main.tsx +22 -0
- package/frontend/src/pages/attention/AttentionQueuePage.tsx +316 -0
- package/frontend/src/pages/attention/RuleSettingsPanel.tsx +177 -0
- package/frontend/src/pages/branches/BranchDetailPage.tsx +632 -0
- package/frontend/src/pages/branches/BranchListPage.tsx +308 -0
- package/frontend/src/pages/dashboard/DashboardPage.tsx +657 -0
- package/frontend/src/pages/issues/IssueListPage.tsx +284 -0
- package/frontend/src/pages/login/LoginPage.tsx +95 -0
- package/frontend/src/pages/meetings/MeetingDetailPage.tsx +403 -0
- package/frontend/src/pages/meetings/MeetingListPage.tsx +264 -0
- package/frontend/src/pages/members/MembersPage.tsx +534 -0
- package/frontend/src/pages/pulls/PullDetailPage.tsx +833 -0
- package/frontend/src/pages/pulls/PullListPage.tsx +399 -0
- package/frontend/src/pages/settings/AiSettingsPage.tsx +449 -0
- package/frontend/src/pages/settings/SettingsPage.tsx +321 -0
- package/frontend/src/pages/setup/SetupPage.tsx +144 -0
- package/frontend/src/styles/globals.css +147 -0
- package/frontend/tsconfig.json +22 -0
- package/frontend/vite.config.ts +57 -0
- package/package.json +48 -0
- package/scripts/e2e-auth-flow.py +131 -0
- package/scripts/e2e-pr-detail.py +128 -0
- package/scripts/e2e-verify.py +773 -0
- package/scripts/verify-ai-pipeline.py +616 -0
- package/scripts/verify-analysis-pipeline.py +303 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query'
|
|
2
|
+
import { Link } from '@tanstack/react-router'
|
|
3
|
+
import { Tooltip } from 'antd'
|
|
4
|
+
import type { ColumnsType } from 'antd/es/table'
|
|
5
|
+
import { ExternalLink } from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
import { useCurrentRepository } from '@/hooks/use-current-repository'
|
|
8
|
+
import {
|
|
9
|
+
BRANCH_KIND_META,
|
|
10
|
+
sigApi,
|
|
11
|
+
type BranchKind,
|
|
12
|
+
type BranchSummary,
|
|
13
|
+
type ReleaseReport,
|
|
14
|
+
} from '@/api/sig'
|
|
15
|
+
import { Badge } from '@/components/ui/badge'
|
|
16
|
+
import { DataTable } from '@/components/ui/data-table'
|
|
17
|
+
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
18
|
+
import { EmptyState } from '@/components/ui/empty-state'
|
|
19
|
+
import { Skeleton } from '@/components/ui/skeleton'
|
|
20
|
+
import { formatNumber, formatRelativeTime } from '@/lib/utils'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 版本与分支总览。
|
|
24
|
+
*
|
|
25
|
+
* 每个版本一行而不是一张卡片:维护者看这张表是为了对比
|
|
26
|
+
* "哪个版本积压多、哪个刚合入过",行式排布才好横向扫。
|
|
27
|
+
*/
|
|
28
|
+
const COLUMNS: ColumnsType<BranchSummary> = [
|
|
29
|
+
{
|
|
30
|
+
title: '版本 / 分支',
|
|
31
|
+
render: (_, branch) => (
|
|
32
|
+
<>
|
|
33
|
+
<Link
|
|
34
|
+
to="/branches/$branch"
|
|
35
|
+
params={{ branch: branch.name }}
|
|
36
|
+
className="font-medium hover:text-[var(--color-accent)]"
|
|
37
|
+
>
|
|
38
|
+
{branch.name}
|
|
39
|
+
</Link>
|
|
40
|
+
{branch.raw_names.length > 1 && (
|
|
41
|
+
<Tooltip title={`上游并存写法:${branch.raw_names.join('、')}`}>
|
|
42
|
+
<span className="ml-2 text-2xs text-[var(--color-text-muted)]">
|
|
43
|
+
已归并 {branch.raw_names.length} 种写法
|
|
44
|
+
</span>
|
|
45
|
+
</Tooltip>
|
|
46
|
+
)}
|
|
47
|
+
</>
|
|
48
|
+
),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: '产品线',
|
|
52
|
+
width: 110,
|
|
53
|
+
render: (_, branch) => (
|
|
54
|
+
<Badge tone="neutral" className="font-normal">
|
|
55
|
+
{BRANCH_KIND_META[branch.kind]?.label ?? branch.kind}
|
|
56
|
+
</Badge>
|
|
57
|
+
),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: '当前 tag',
|
|
61
|
+
width: 150,
|
|
62
|
+
render: (_, branch) => (
|
|
63
|
+
<span className="font-mono text-xs text-[var(--color-text-secondary)]">
|
|
64
|
+
{branch.latest_tag ?? '—'}
|
|
65
|
+
</span>
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: '负责人',
|
|
70
|
+
width: 170,
|
|
71
|
+
// 来自 sig-info.yaml:看到积压之后必然要问"该找谁"
|
|
72
|
+
render: (_, branch) => (
|
|
73
|
+
<span className="flex flex-wrap gap-1">
|
|
74
|
+
{branch.keepers.length === 0 ? (
|
|
75
|
+
<span className="text-xs text-[var(--color-text-muted)]">—</span>
|
|
76
|
+
) : (
|
|
77
|
+
branch.keepers.map((login) => (
|
|
78
|
+
<Link
|
|
79
|
+
key={login}
|
|
80
|
+
to="/members"
|
|
81
|
+
search={{ member: login }}
|
|
82
|
+
className="font-mono text-2xs text-[var(--color-text-secondary)] hover:text-[var(--color-accent)]"
|
|
83
|
+
>
|
|
84
|
+
@{login}
|
|
85
|
+
</Link>
|
|
86
|
+
))
|
|
87
|
+
)}
|
|
88
|
+
</span>
|
|
89
|
+
),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
title: '待处理',
|
|
93
|
+
width: 90,
|
|
94
|
+
align: 'right',
|
|
95
|
+
render: (_, branch) =>
|
|
96
|
+
branch.open_count > 0 ? (
|
|
97
|
+
<Tooltip title={`查看 ${branch.name} 上待处理的 PR`}>
|
|
98
|
+
<Link
|
|
99
|
+
to="/pulls"
|
|
100
|
+
search={{ state: 'open', branch: [branch.name] }}
|
|
101
|
+
className="font-mono text-xs tabular-nums hover:text-[var(--color-accent)]"
|
|
102
|
+
>
|
|
103
|
+
{branch.open_count}
|
|
104
|
+
</Link>
|
|
105
|
+
</Tooltip>
|
|
106
|
+
) : (
|
|
107
|
+
<span className="font-mono text-xs tabular-nums text-[var(--color-text-muted)]">0</span>
|
|
108
|
+
),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: '已合入',
|
|
112
|
+
width: 90,
|
|
113
|
+
align: 'right',
|
|
114
|
+
render: (_, branch) => (
|
|
115
|
+
<span className="font-mono text-xs tabular-nums">{branch.merged_count}</span>
|
|
116
|
+
),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: '近 30 天',
|
|
120
|
+
width: 90,
|
|
121
|
+
align: 'right',
|
|
122
|
+
render: (_, branch) => (
|
|
123
|
+
<span className="font-mono text-xs tabular-nums text-[var(--color-success)]">
|
|
124
|
+
{branch.merged_recent}
|
|
125
|
+
</span>
|
|
126
|
+
),
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
title: '最近合入',
|
|
130
|
+
width: 110,
|
|
131
|
+
render: (_, branch) => (
|
|
132
|
+
<span className="text-xs text-[var(--color-text-muted)]">
|
|
133
|
+
{formatRelativeTime(branch.last_merged_at)}
|
|
134
|
+
</span>
|
|
135
|
+
),
|
|
136
|
+
},
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
export function BranchListPage() {
|
|
140
|
+
const { repository, isLoading: reposLoading } = useCurrentRepository()
|
|
141
|
+
|
|
142
|
+
const { data: branches, isLoading } = useQuery({
|
|
143
|
+
queryKey: ['branches', repository?.id],
|
|
144
|
+
queryFn: () => sigApi.branches(repository!.id),
|
|
145
|
+
enabled: Boolean(repository),
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
const { data: notes } = useQuery({
|
|
149
|
+
queryKey: ['release-notes', repository?.id],
|
|
150
|
+
queryFn: () => sigApi.releaseNotes(repository!.id, undefined, 30),
|
|
151
|
+
enabled: Boolean(repository),
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
if (reposLoading) return <Skeleton className="h-64 w-full" />
|
|
155
|
+
if (!repository) {
|
|
156
|
+
return (
|
|
157
|
+
<EmptyState
|
|
158
|
+
title="尚未纳管任何仓库"
|
|
159
|
+
description="请先在「设置 → 仓库与同步」中配置 AtomGit 凭据并纳管 openeuler/kernel。"
|
|
160
|
+
/>
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const latestByBranch = new Map<string, ReleaseReport[]>()
|
|
165
|
+
for (const note of notes ?? []) {
|
|
166
|
+
if (!latestByBranch.has(note.branch)) latestByBranch.set(note.branch, [])
|
|
167
|
+
latestByBranch.get(note.branch)!.push(note)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<div className="space-y-5">
|
|
172
|
+
<header>
|
|
173
|
+
<h1 className="text-base font-semibold tracking-tight">版本与分支</h1>
|
|
174
|
+
<p className="mt-0.5 text-sm text-[var(--color-text-secondary)]">
|
|
175
|
+
openEuler 内核分产品线维护:OLK 长期维护、发行版 LTS、创新版本。
|
|
176
|
+
合入数与 tag 来自本平台的 PR 数据与 SIG 例会纪要。
|
|
177
|
+
</p>
|
|
178
|
+
</header>
|
|
179
|
+
|
|
180
|
+
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
|
181
|
+
<KindCard branches={branches} kind="olk" />
|
|
182
|
+
<KindCard branches={branches} kind="lts" />
|
|
183
|
+
<KindCard branches={branches} kind="innovation" />
|
|
184
|
+
<Card>
|
|
185
|
+
<CardHeader className="pb-1">
|
|
186
|
+
<CardTitle className="text-xs font-normal text-[var(--color-text-muted)]">
|
|
187
|
+
合计
|
|
188
|
+
</CardTitle>
|
|
189
|
+
</CardHeader>
|
|
190
|
+
<CardContent>
|
|
191
|
+
<div className="font-mono text-xl tabular-nums">
|
|
192
|
+
{formatNumber(
|
|
193
|
+
(branches ?? []).reduce((sum, item) => sum + item.merged_count, 0),
|
|
194
|
+
)}
|
|
195
|
+
</div>
|
|
196
|
+
<p className="mt-1 text-xs text-[var(--color-text-muted)]">
|
|
197
|
+
历史合入 · {(branches ?? []).length} 个分支
|
|
198
|
+
</p>
|
|
199
|
+
</CardContent>
|
|
200
|
+
</Card>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<DataTable<BranchSummary>
|
|
204
|
+
rowKey="name"
|
|
205
|
+
columns={COLUMNS}
|
|
206
|
+
dataSource={branches ?? []}
|
|
207
|
+
loading={isLoading}
|
|
208
|
+
locale={{
|
|
209
|
+
emptyText: (
|
|
210
|
+
<EmptyState
|
|
211
|
+
title="尚无分支数据"
|
|
212
|
+
description="分支来自已同步的 PR,请先在「仓库与同步」中触发一次同步。"
|
|
213
|
+
/>
|
|
214
|
+
),
|
|
215
|
+
}}
|
|
216
|
+
// 分支只有十几个,一屏就能看完,不需要分页
|
|
217
|
+
pagination={false}
|
|
218
|
+
/>
|
|
219
|
+
|
|
220
|
+
<section className="space-y-3">
|
|
221
|
+
<h2 className="text-sm font-semibold">各版本最新发版说明</h2>
|
|
222
|
+
<div className="grid gap-3 lg:grid-cols-2">
|
|
223
|
+
{[...latestByBranch.entries()].map(([branch, list]) => {
|
|
224
|
+
const note = list[0]
|
|
225
|
+
return (
|
|
226
|
+
<Card key={branch}>
|
|
227
|
+
<CardHeader className="pb-2">
|
|
228
|
+
<div className="flex flex-wrap items-baseline gap-2">
|
|
229
|
+
<CardTitle className="text-sm">{branch}</CardTitle>
|
|
230
|
+
<span className="font-mono text-2xs text-[var(--color-text-muted)]">
|
|
231
|
+
{note.from_tag} → {note.to_tag}
|
|
232
|
+
</span>
|
|
233
|
+
{note.meeting_held_on && (
|
|
234
|
+
<span className="text-2xs text-[var(--color-text-muted)]">
|
|
235
|
+
{note.meeting_held_on} 例会
|
|
236
|
+
</span>
|
|
237
|
+
)}
|
|
238
|
+
</div>
|
|
239
|
+
</CardHeader>
|
|
240
|
+
<CardContent className="space-y-2">
|
|
241
|
+
<p className="text-sm text-[var(--color-text-secondary)]">
|
|
242
|
+
本期合入{' '}
|
|
243
|
+
<span className="font-mono tabular-nums text-[var(--color-text-primary)]">
|
|
244
|
+
{note.patch_count ?? note.listed_count}
|
|
245
|
+
</span>{' '}
|
|
246
|
+
个补丁
|
|
247
|
+
{note.cve_ids && note.cve_ids.length > 0 && (
|
|
248
|
+
<>
|
|
249
|
+
,其中 CVE{' '}
|
|
250
|
+
<span className="font-mono tabular-nums text-[var(--color-kind-cve)]">
|
|
251
|
+
{note.cve_ids.length}
|
|
252
|
+
</span>{' '}
|
|
253
|
+
个
|
|
254
|
+
</>
|
|
255
|
+
)}
|
|
256
|
+
</p>
|
|
257
|
+
{note.iso_urls && note.iso_urls.length > 0 && (
|
|
258
|
+
<div className="flex flex-wrap gap-x-3 gap-y-1">
|
|
259
|
+
{note.iso_urls.map((url) => (
|
|
260
|
+
<a
|
|
261
|
+
key={url}
|
|
262
|
+
href={url}
|
|
263
|
+
target="_blank"
|
|
264
|
+
rel="noreferrer noopener"
|
|
265
|
+
className="inline-flex items-center gap-1 text-xs text-[var(--color-accent)] hover:underline"
|
|
266
|
+
>
|
|
267
|
+
{url.replace('https://repo.openeuler.org/', '')}
|
|
268
|
+
<ExternalLink className="size-3" aria-hidden />
|
|
269
|
+
</a>
|
|
270
|
+
))}
|
|
271
|
+
</div>
|
|
272
|
+
)}
|
|
273
|
+
<Link
|
|
274
|
+
to="/branches/$branch"
|
|
275
|
+
params={{ branch }}
|
|
276
|
+
className="inline-block text-xs text-[var(--color-accent)] hover:underline"
|
|
277
|
+
>
|
|
278
|
+
查看该版本全部发版说明 →
|
|
279
|
+
</Link>
|
|
280
|
+
</CardContent>
|
|
281
|
+
</Card>
|
|
282
|
+
)
|
|
283
|
+
})}
|
|
284
|
+
</div>
|
|
285
|
+
</section>
|
|
286
|
+
</div>
|
|
287
|
+
)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function KindCard({ branches, kind }: { branches?: BranchSummary[]; kind: BranchKind }) {
|
|
291
|
+
const list = (branches ?? []).filter((item) => item.kind === kind)
|
|
292
|
+
const meta = BRANCH_KIND_META[kind]
|
|
293
|
+
return (
|
|
294
|
+
<Card title={meta.hint}>
|
|
295
|
+
<CardHeader className="pb-1">
|
|
296
|
+
<CardTitle className="text-xs font-normal text-[var(--color-text-muted)]">
|
|
297
|
+
{meta.label}
|
|
298
|
+
</CardTitle>
|
|
299
|
+
</CardHeader>
|
|
300
|
+
<CardContent>
|
|
301
|
+
<div className="font-mono text-xl tabular-nums">{list.length}</div>
|
|
302
|
+
<p className="mt-1 text-xs text-[var(--color-text-muted)]">
|
|
303
|
+
共合入 {formatNumber(list.reduce((sum, item) => sum + item.merged_count, 0))} 个 PR
|
|
304
|
+
</p>
|
|
305
|
+
</CardContent>
|
|
306
|
+
</Card>
|
|
307
|
+
)
|
|
308
|
+
}
|