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