chore: format

This commit is contained in:
ryan
2026-08-16 21:39:25 +08:00
parent e5d2e4b6d5
commit 55c1fcd5f9
93 changed files with 544 additions and 439 deletions
@@ -165,9 +165,7 @@ export function DeploymentUploadDialog({
}}
>
<UploadCloud className='size-8 text-muted-foreground' />
<span className='text-sm font-medium'>
{t('dropHint')}
</span>
<span className='text-sm font-medium'>{t('dropHint')}</span>
<span className='text-xs text-muted-foreground'>
zip、tar.gz、tar.xz、tar.bz2、tar、7z
</span>
@@ -199,9 +197,7 @@ export function DeploymentUploadDialog({
<div className='rounded-md border bg-muted/20 px-3 py-2 font-mono text-sm'>
{pagesEntryPath(rootDir, entryFile)}
</div>
<FieldDescription>
{t('entryHint')}
</FieldDescription>
<FieldDescription>{t('entryHint')}</FieldDescription>
</Field>
{uploadProgress !== null ? (
@@ -211,7 +207,9 @@ export function DeploymentUploadDialog({
{uploadProgress >= 100 ? t('processing') : t('progress')}
</span>
<span>
{uploadProgress >= 100 ? t('pleaseWait') : `${uploadProgress}%`}
{uploadProgress >= 100
? t('pleaseWait')
: `${uploadProgress}%`}
</span>
</div>
<Progress value={Math.min(uploadProgress, 100)} />
@@ -26,7 +26,10 @@ function createPagesProjectSchema(t: (key: string) => string) {
entry_file: z.string().trim().min(1, t('form.entryRequired')).max(512),
})
.superRefine((data, ctx) => {
if (data.spa_fallback_enabled && !data.spa_fallback_path.startsWith('/')) {
if (
data.spa_fallback_enabled &&
!data.spa_fallback_path.startsWith('/')
) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ['spa_fallback_path'],
@@ -282,7 +282,9 @@ export function DeploymentHistory({
setPendingAction(null);
},
onError: (error) => {
toast.error(error instanceof Error ? error.message : t('history.activateFailed'));
toast.error(
error instanceof Error ? error.message : t('history.activateFailed'),
);
},
});
@@ -298,7 +300,9 @@ export function DeploymentHistory({
setPendingAction(null);
},
onError: (error) => {
toast.error(error instanceof Error ? error.message : t('history.deleteFailed'));
toast.error(
error instanceof Error ? error.message : t('history.deleteFailed'),
);
},
});
@@ -398,9 +402,7 @@ export function DeploymentHistory({
<Card className='border-dashed shadow-none'>
<CardHeader className='pb-3'>
<CardTitle className='text-base'>Production</CardTitle>
<CardDescription>
{t('history.productionHint')}
</CardDescription>
<CardDescription>{t('history.productionHint')}</CardDescription>
<CardAction>
<Button
type='button'
@@ -439,9 +441,7 @@ export function DeploymentHistory({
<Card className='border-dashed shadow-none'>
<CardHeader className='pb-3'>
<CardTitle className='text-base'>All deployments</CardTitle>
<CardDescription>
{t('history.historyHint')}
</CardDescription>
<CardDescription>{t('history.historyHint')}</CardDescription>
</CardHeader>
<CardContent className='space-y-3'>
{allDeployments.length === 0 ? (
@@ -267,7 +267,8 @@ export function PagesSourceCard({ projectId }: { projectId: number }) {
toast.success(t('source.actionDone', { action: actionLabel }));
} else {
toast.error(
execution.error_message || t('source.actionFailed', { action: actionLabel }),
execution.error_message ||
t('source.actionFailed', { action: actionLabel }),
);
}
setActiveAction(null);
@@ -284,7 +285,9 @@ export function PagesSourceCard({ projectId }: { projectId: number }) {
toast.success(t('source.checkQueued'));
},
onError: (error) => {
toast.error(error instanceof Error ? error.message : t('source.checkQueueFailed'));
toast.error(
error instanceof Error ? error.message : t('source.checkQueueFailed'),
);
},
});
@@ -300,7 +303,9 @@ export function PagesSourceCard({ projectId }: { projectId: number }) {
toast.success(t('source.syncQueued'));
},
onError: (error) => {
toast.error(error instanceof Error ? error.message : t('source.syncQueueFailed'));
toast.error(
error instanceof Error ? error.message : t('source.syncQueueFailed'),
);
},
});
@@ -405,9 +410,7 @@ export function PagesSourceCard({ projectId }: { projectId: number }) {
<div className='flex items-start justify-between gap-3'>
<div>
<CardTitle className='text-base'>{t('source.title')}</CardTitle>
<CardDescription>
{t('source.configDesc')}
</CardDescription>
<CardDescription>{t('source.configDesc')}</CardDescription>
</div>
{status ? (
<Badge variant={status.variant}>{t(status.labelKey)}</Badge>
@@ -136,9 +136,7 @@ export function PagesSourceGitHubFields({
<FieldLabel htmlFor='pages-github-auto-update'>
{t('autoUpdate')}
</FieldLabel>
<FieldDescription>
{t('autoUpdateHint')}
</FieldDescription>
<FieldDescription>{t('autoUpdateHint')}</FieldDescription>
</FieldContent>
<Switch
id='pages-github-auto-update'
@@ -182,9 +180,7 @@ export function PagesSourceGitHubFields({
) : null}
<Field data-invalid={Boolean(errors.assetName)}>
<FieldLabel htmlFor='pages-github-asset'>
{t('assetName')}
</FieldLabel>
<FieldLabel htmlFor='pages-github-asset'>{t('assetName')}</FieldLabel>
<Input
id='pages-github-asset'
placeholder={defaultAssetName}