Skip to content

Commit 9efe5ba

Browse files
committed
Refine window summary display and memory options
1 parent 5337142 commit 9efe5ba

3 files changed

Lines changed: 59 additions & 37 deletions

File tree

plugins/pages/create-window/src/components/device-settings-form.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,18 @@ export function DeviceSettingsForm({ value, onChange }: DeviceSettingsFormProps)
186186
/>
187187
</div>
188188
<div className="flex items-center justify-between gap-4">
189-
<Label className="text-xs shrink-0">{t('deviceSettings.deviceMemory')}</Label>
190-
<NumberSelector
191-
value={value.deviceMemory}
192-
options={[4, 8, 16, 32]}
193-
onChange={(v) => onChange({ ...value, deviceMemory: v })}
194-
unit="G"
195-
/>
189+
<Label className="text-xs shrink-0">{t('deviceSettings.deviceMemory')}</Label>
190+
<NumberSelector
191+
value={value.deviceMemory}
192+
options={[
193+
4,
194+
8,
195+
// 16,
196+
// 32,
197+
]}
198+
onChange={(v) => onChange({ ...value, deviceMemory: v })}
199+
unit="G"
200+
/>
196201
</div>
197202
</div>
198203

plugins/pages/create-window/src/components/screen-hardware-form.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,18 @@ export function ScreenHardwareForm({
228228
/>
229229
</div>
230230
<div className="flex items-center justify-between gap-4">
231-
<Label className="text-xs shrink-0">{t('deviceSettings.deviceMemory')}</Label>
232-
<NumberSelector
233-
value={deviceSettings.deviceMemory}
234-
options={[4, 8, 16, 32]}
235-
onChange={(v) => onDeviceSettingsChange({ ...deviceSettings, deviceMemory: v })}
236-
unit="G"
237-
/>
231+
<Label className="text-xs shrink-0">{t('deviceSettings.deviceMemory')}</Label>
232+
<NumberSelector
233+
value={deviceSettings.deviceMemory}
234+
options={[
235+
4,
236+
8,
237+
// 16,
238+
// 32,
239+
]}
240+
onChange={(v) => onDeviceSettingsChange({ ...deviceSettings, deviceMemory: v })}
241+
unit="G"
242+
/>
238243
</div>
239244
</div>
240245

plugins/pages/create-window/src/components/window-summary.tsx

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,30 @@ interface WindowSummaryProps {
88
onRandomize?: () => void;
99
}
1010

11-
// 概要项组件
12-
function SummaryItem({ label, value, mono }: { label: string; value: string; mono?: boolean }) {
13-
return (
14-
<div className="flex justify-between items-center gap-2">
15-
<span className="text-muted-foreground shrink-0">{label}</span>
16-
<span className={`truncate text-right ${mono ? 'font-mono' : ''}`} title={value}>
17-
{value}
18-
</span>
19-
</div>
20-
);
21-
}
11+
// 概要项组件
12+
function SummaryItem({
13+
label,
14+
value,
15+
mono,
16+
wrap,
17+
}: {
18+
label: string;
19+
value: string;
20+
mono?: boolean;
21+
wrap?: boolean;
22+
}) {
23+
return (
24+
<div className={`flex justify-between gap-2 ${wrap ? 'items-start' : 'items-center'}`}>
25+
<span className="text-muted-foreground shrink-0">{label}</span>
26+
<span
27+
className={`flex-1 min-w-0 ${wrap ? 'text-right break-all whitespace-normal' : 'truncate text-right'} ${mono ? 'font-mono' : ''}`}
28+
title={value}
29+
>
30+
{value}
31+
</span>
32+
</div>
33+
);
34+
}
2235

2336
// 概要分组组件
2437
function SummaryGroup({ title, children }: { title: string; children: React.ReactNode }) {
@@ -57,11 +70,12 @@ export function WindowSummary({ config, onRandomize }: WindowSummaryProps) {
5770
<SummaryGroup title={t('sections.basicInfo')}>
5871
<SummaryItem label={t('windowInfo.name')} value={config.windowInfo.name || '-'} />
5972
<SummaryItem label={t('windowInfo.system')} value={config.windowInfo.system} />
60-
<SummaryItem
61-
label={t('windowInfo.userAgent')}
62-
value={config.windowInfo.userAgent || '-'}
63-
mono
64-
/>
73+
<SummaryItem
74+
label={t('windowInfo.userAgent')}
75+
value={config.windowInfo.userAgent || '-'}
76+
mono
77+
wrap
78+
/>
6579
<SummaryItem
6680
label={t('windowInfo.platformAccount')}
6781
value={
@@ -147,13 +161,11 @@ export function WindowSummary({ config, onRandomize }: WindowSummaryProps) {
147161
</SummaryGroup>
148162

149163
{/* 屏幕与硬件 */}
150-
<SummaryGroup title={t('sections.screenHardware')}>
151-
<SummaryItem
152-
label={t('summary.resolution')}
153-
value={t(
154-
`advancedFingerprint.fingerprintMode.${config.advancedFingerprintSettings.resolution}`
155-
)}
156-
/>
164+
<SummaryGroup title={t('sections.screenHardware')}>
165+
<SummaryItem
166+
label={t('summary.resolution')}
167+
value={`${config.advancedFingerprintSettings.resolution.width} × ${config.advancedFingerprintSettings.resolution.height}`}
168+
/>
157169
<SummaryItem
158170
label={t('advancedFingerprint.colorDepth')}
159171
value={`${config.advancedFingerprintSettings.colorDepth}bit`}

0 commit comments

Comments
 (0)