Skip to content

Commit 7afef7e

Browse files
committed
Simplify homepage telemetry cards
1 parent b148c0b commit 7afef7e

2 files changed

Lines changed: 57 additions & 52 deletions

File tree

src/pages/index.module.css

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -230,20 +230,34 @@
230230
font-size: 1.35rem;
231231
}
232232

233+
.telemetryIcon {
234+
display: inline-flex;
235+
flex: 0 0 3.25rem;
236+
align-items: center;
237+
justify-content: center;
238+
width: 3.25rem;
239+
height: 3.25rem;
240+
border-radius: 18px;
241+
background: linear-gradient(160deg, rgba(33, 121, 255, 0.1), rgba(33, 121, 255, 0.04));
242+
color: var(--site-kicker-color);
243+
}
244+
245+
.telemetryIcon svg {
246+
width: 1.6rem;
247+
height: 1.6rem;
248+
fill: none;
249+
stroke: currentColor;
250+
stroke-linecap: round;
251+
stroke-linejoin: round;
252+
stroke-width: 1.8;
253+
}
254+
233255
.telemetrySummary {
234256
margin: 0.7rem 0 0;
235257
color: var(--site-text-muted);
236258
line-height: 1.8;
237259
}
238260

239-
.telemetryMeta {
240-
display: flex;
241-
flex-wrap: wrap;
242-
gap: 0.6rem;
243-
margin-top: 1rem;
244-
}
245-
246-
.telemetryMeta span,
247261
.telemetryBadgeActive,
248262
.telemetryBadgePending {
249263
display: inline-flex;
@@ -253,13 +267,6 @@
253267
font-weight: 700;
254268
}
255269

256-
.telemetryMeta span {
257-
padding: 0.36rem 0.72rem;
258-
background: var(--site-badge-bg);
259-
color: var(--site-badge-text);
260-
font-size: 0.82rem;
261-
}
262-
263270
.telemetryBadgeActive,
264271
.telemetryBadgePending {
265272
padding: 0.32rem 0.72rem;
@@ -277,13 +284,6 @@
277284
color: #b45309;
278285
}
279286

280-
.telemetryList {
281-
margin: 1rem 0 0;
282-
padding-left: 1.15rem;
283-
color: var(--site-list-color);
284-
line-height: 1.9;
285-
}
286-
287287
.topicList {
288288
margin: 1rem 0 0;
289289
padding-left: 1.15rem;

src/pages/index.tsx

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -70,47 +70,59 @@ const workflowSteps = [
7070
},
7171
];
7272

73+
function TelemetryIcon({kind}: {kind: 'shop' | 'auth' | 'cook'}): ReactNode {
74+
if (kind === 'shop') {
75+
return (
76+
<svg viewBox="0 0 24 24" aria-hidden="true">
77+
<path d="M4 10.5h16" />
78+
<path d="M6 10.5v7.5h12v-7.5" />
79+
<path d="M3.5 10.5 5 6h14l1.5 4.5" />
80+
<path d="M10 18v-4h4v4" />
81+
</svg>
82+
);
83+
}
84+
if (kind === 'auth') {
85+
return (
86+
<svg viewBox="0 0 24 24" aria-hidden="true">
87+
<path d="M12 3.5 18.5 6v5c0 4.2-2.3 7.1-6.5 9.5-4.2-2.4-6.5-5.3-6.5-9.5V6L12 3.5Z" />
88+
<path d="M9.5 11.5 11 13l3.5-3.5" />
89+
</svg>
90+
);
91+
}
92+
return (
93+
<svg viewBox="0 0 24 24" aria-hidden="true">
94+
<path d="M7 9h10l1.2 7H5.8L7 9Z" />
95+
<path d="M9 9V7.8A3 3 0 0 1 12 5a3 3 0 0 1 3 2.8V9" />
96+
<path d="M18 6.5c1.6.8 2.5 2.2 2.5 4.1 0 2.7-1.8 4.4-4.5 4.4" />
97+
</svg>
98+
);
99+
}
100+
73101
const telemetryCards = [
74102
{
103+
icon: 'shop' as const,
75104
title: 'MatrixShop',
76105
status: '已接入',
77106
statusTone: 'active',
78-
summary: '首页展示当前已经接入的 bStats 统计维度,便于后续继续扩展到另外两个插件。',
79-
meta: ['插件 ID 30502', '8 项聚合图表', '仅配置与模块级统计'],
80-
points: [
81-
'database_backend / configured_database_backend',
82-
'enabled_module_count / enabled_modules',
83-
'systemshop_category_count / systemshop_goods_count',
84-
'economy_currency_count / economy_currency_modes',
85-
],
107+
summary: '已接入聚合级统计与遥测说明,首页只保留简要状态展示,详细范围进入文档页查看。',
86108
to: '/docs/matrixshop/bstats-and-telemetry',
87109
action: '查看 MatrixShop 统计',
88110
},
89111
{
112+
icon: 'auth' as const,
90113
title: 'MatrixAuth',
91114
status: '预留位置',
92115
statusTone: 'pending',
93116
summary: '等待插件代码和统计口径确定后接入。首页布局和卡位已经保留,后续只补内容。',
94-
meta: ['待提供代码', '待确定插件 ID', '待定义图表范围'],
95-
points: [
96-
'预留模块启用状态统计',
97-
'预留存储后端统计',
98-
'预留身份模式分布统计',
99-
],
100117
to: '/docs/matrixauth/overview',
101118
action: '查看 MatrixAuth 文档',
102119
},
103120
{
121+
icon: 'cook' as const,
104122
title: 'MatrixCook',
105123
status: '预留位置',
106124
statusTone: 'pending',
107125
summary: '等待插件代码和统计口径确定后接入。后续可以直接沿用当前首页的同一展示结构。',
108-
meta: ['待提供代码', '待确定插件 ID', '待定义图表范围'],
109-
points: [
110-
'预留配方与锅具配置统计',
111-
'预留存储后端统计',
112-
'预留可选集成启用统计',
113-
],
114126
to: '/docs/matrixcook/overview',
115127
action: '查看 MatrixCook 文档',
116128
},
@@ -214,6 +226,9 @@ export default function Home(): ReactNode {
214226
{telemetryCards.map((card) => (
215227
<article key={card.title} className={styles.telemetryCard}>
216228
<div className={styles.telemetryHeader}>
229+
<span className={styles.telemetryIcon} aria-hidden="true">
230+
<TelemetryIcon kind={card.icon} />
231+
</span>
217232
<div>
218233
<h3>{card.title}</h3>
219234
<p className={styles.telemetrySummary}>{card.summary}</p>
@@ -225,16 +240,6 @@ export default function Home(): ReactNode {
225240
{card.status}
226241
</span>
227242
</div>
228-
<div className={styles.telemetryMeta}>
229-
{card.meta.map((item) => (
230-
<span key={item}>{item}</span>
231-
))}
232-
</div>
233-
<ul className={styles.telemetryList}>
234-
{card.points.map((point) => (
235-
<li key={point}>{point}</li>
236-
))}
237-
</ul>
238243
<Link className={styles.cardAction} to={card.to}>
239244
{card.action}
240245
</Link>

0 commit comments

Comments
 (0)