feat(license): show Instance ID with copy on settings + ProGate

Always return machine fingerprint instanceId from license status for
offline LICOFF- binding. Shared InstanceIdRow (zh/en) above activate.
This commit is contained in:
opsx committed 2026-11-01 03:12:53 +08:00
1 parent db92426973
commit f3d27ceb04
6 files changed
+86 -22

No files matched your search

+15 -10
View File
@@ -6,6 +6,7 @@ import { toast } from 'sonner'
import { Button } from '@/components/ui/button'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Input } from '@/components/ui/input'
import { InstanceIdRow } from '@/components/InstanceIdRow'
import { LicenseStatusBanners } from '@/components/LicenseStatusBanners'
import { licenseApi } from '@/api/license'
import { useLicense } from '@/hooks/useLicense'
@@ -41,6 +42,7 @@ export const ProGate = memo(function ProGate({ featureKey }: { featureKey: strin
return (
<div className="mx-auto max-w-2xl space-y-4 pt-8">
<LicenseStatusBanners info={info} pro={pro} onAction={focusKey} />
<InstanceIdRow instanceId={info?.instanceId} />
<Card>
<CardHeader className="pb-3">
<CardTitle className="flex items-center gap-2 text-base">
@@ -71,16 +73,19 @@ export const ProGate = memo(function ProGate({ featureKey }: { featureKey: strin
<p className="mt-1 text-xs text-muted-foreground">{t('pricing.teamDesc')}</p>
</div>
</div>
<div className="flex gap-2">
<Input
ref={inputRef}
value={key}
onChange={e => setKey(e.target.value)}
placeholder={t('gate.keyPlaceholder')}
className="font-mono text-sm"
/>
<Button onClick={() => void activate()} disabled={activating || !key.trim()}>{t('gate.activate')}</Button>
<Button variant="outline" onClick={() => navigate('/settings')}>{t('gate.toSettings')}</Button>
<div className="space-y-2">
<p className="text-xs text-muted-foreground">{t('activateHint')}</p>
<div className="flex gap-2">
<Input
ref={inputRef}
value={key}
onChange={e => setKey(e.target.value)}
placeholder={t('gate.keyPlaceholder')}
className="font-mono text-sm"
/>
<Button onClick={() => void activate()} disabled={activating || !key.trim()}>{t('gate.activate')}</Button>
<Button variant="outline" onClick={() => navigate('/settings')}>{t('gate.toSettings')}</Button>
</div>
</div>
<p className="text-xs text-muted-foreground">{t('gate.freeHint')}</p>
</CardContent>