mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-02 14:56:38 +08:00
chore(prettier): format 并清理无用 import
make prettier 统一格式化,goimports 与 eslint unused-imports 自动移除未使用导入。
This commit is contained in:
@@ -17,12 +17,7 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from '@/components/ui/card';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import { type PagesProject, PagesService } from '@/lib/services/openflare';
|
||||
|
||||
|
||||
@@ -73,9 +73,7 @@ function isActiveDeployment(
|
||||
deployment: PagesDeployment,
|
||||
activeDeploymentId?: number | null,
|
||||
) {
|
||||
return (
|
||||
deployment.id === activeDeploymentId || deployment.status === 'active'
|
||||
);
|
||||
return deployment.id === activeDeploymentId || deployment.status === 'active';
|
||||
}
|
||||
|
||||
function deploymentSnapshot(deployment: PagesDeployment) {
|
||||
@@ -151,7 +149,9 @@ function DeploymentRow({
|
||||
<span className='text-sm font-medium'>
|
||||
部署 #{deployment.deployment_number}
|
||||
</span>
|
||||
<Badge variant='secondary'>{deploymentSnapshot(deployment)}</Badge>
|
||||
<Badge variant='secondary'>
|
||||
{deploymentSnapshot(deployment)}
|
||||
</Badge>
|
||||
</div>
|
||||
<DeploymentMeta deployment={deployment} />
|
||||
</div>
|
||||
|
||||
@@ -108,7 +108,9 @@ export function GitHubSourceDetails({
|
||||
|
||||
<div className='rounded-lg border border-dashed bg-muted/15 px-5 py-5'>
|
||||
<div className='mb-4 flex flex-wrap items-center gap-2 border-b border-dashed pb-4'>
|
||||
<code className='text-sm font-medium'>{source.github_repository}</code>
|
||||
<code className='text-sm font-medium'>
|
||||
{source.github_repository}
|
||||
</code>
|
||||
<Badge variant='secondary' className='font-normal'>
|
||||
{source.asset_name}
|
||||
</Badge>
|
||||
|
||||
@@ -327,9 +327,7 @@ export function PagesSourceDialog({
|
||||
<DialogContent className='sm:max-w-xl'>
|
||||
<DialogHeader>
|
||||
<DialogTitle>部署源设置</DialogTitle>
|
||||
<DialogDescription>
|
||||
选择部署来源。
|
||||
</DialogDescription>
|
||||
<DialogDescription>选择部署来源。</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<FieldGroup>
|
||||
|
||||
@@ -138,11 +138,7 @@ function PagesDetailRoute() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Tabs
|
||||
value={tab}
|
||||
onValueChange={handleTabChange}
|
||||
className='w-full'
|
||||
>
|
||||
<Tabs value={tab} onValueChange={handleTabChange} className='w-full'>
|
||||
<TabsList variant='line' className='mb-6 inline-flex w-fit gap-8'>
|
||||
<TabsTrigger
|
||||
value='deployments'
|
||||
@@ -158,10 +154,7 @@ function PagesDetailRoute() {
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent
|
||||
value='deployments'
|
||||
className='focus-visible:outline-none'
|
||||
>
|
||||
<TabsContent value='deployments' className='focus-visible:outline-none'>
|
||||
<DeploymentsTab project={project} />
|
||||
</TabsContent>
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ export function AppleSpinner({
|
||||
* 用于统一显示加载状态
|
||||
*/
|
||||
export function LoadingPage(props: { text?: string; badgeText?: string }) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const _ = props;
|
||||
return (
|
||||
<div className='absolute inset-0 z-50 overflow-hidden font-sans bg-background/80 backdrop-blur-md text-foreground flex items-center justify-center'>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"build:embed": "NEXT_STANDALONE_EXPORT=true next build",
|
||||
"start": "next start -p 3010",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --write ."
|
||||
"format": "prettier --write . && eslint . --fix --max-warnings 0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/lang-sql": "^6.10.0",
|
||||
|
||||
@@ -50,7 +50,7 @@ describe('PagesService', () => {
|
||||
await PagesService.getSource(12);
|
||||
await PagesService.updateSource(12, {
|
||||
source_type: 'remote_url',
|
||||
remote_url: 'https://example.com/site.zip?token=secret',
|
||||
remote_url: 'https://example.com/site.zip?token=secret',
|
||||
allow_insecure: false,
|
||||
});
|
||||
await PagesService.deleteSource(12);
|
||||
@@ -66,7 +66,7 @@ describe('PagesService', () => {
|
||||
'/api/v1/d/pages/12/source/update',
|
||||
expect.objectContaining({
|
||||
source_type: 'remote_url',
|
||||
}),
|
||||
}),
|
||||
undefined,
|
||||
);
|
||||
expect(apiClient.post).toHaveBeenNthCalledWith(
|
||||
|
||||
@@ -539,9 +539,7 @@ describe('Pages source UI', () => {
|
||||
expect(
|
||||
screen.getByRole('switch', { name: '允许不安全的连接' }),
|
||||
).not.toBeChecked();
|
||||
await user.click(
|
||||
screen.getByRole('switch', { name: '允许不安全的连接' }),
|
||||
);
|
||||
await user.click(screen.getByRole('switch', { name: '允许不安全的连接' }));
|
||||
await user.click(screen.getByRole('button', { name: '保存 Remote 来源' }));
|
||||
|
||||
await waitFor(() => {
|
||||
|
||||
Reference in New Issue
Block a user