chore: format

This commit is contained in:
ryan
2026-08-26 15:13:23 +08:00
parent 2b69f4d8d7
commit 81739f9cb4
13 changed files with 26 additions and 14 deletions
@@ -165,7 +165,10 @@ export function SQLConsole({ dbType, onClose }: SQLConsoleProps) {
{t('quickTemplates')} {t('quickTemplates')}
</span> </span>
<Select onValueChange={handlePresetSQLChange}> <Select onValueChange={handlePresetSQLChange}>
<SelectTrigger aria-label={t('selectPresetSQL')} className='h-7 w-[180px] text-[11px] bg-background'> <SelectTrigger
aria-label={t('selectPresetSQL')}
className='h-7 w-[180px] text-[11px] bg-background'
>
<SelectValue placeholder={t('selectPresetSQL')} /> <SelectValue placeholder={t('selectPresetSQL')} />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
@@ -140,7 +140,10 @@ export function TableBrowser({
<Skeleton className='h-8 w-48' /> <Skeleton className='h-8 w-48' />
) : ( ) : (
<Select value={selectedTable} onValueChange={handleTableChange}> <Select value={selectedTable} onValueChange={handleTableChange}>
<SelectTrigger aria-label={t('selectTable')} className='h-8 w-[200px] text-xs bg-background border-border/40'> <SelectTrigger
aria-label={t('selectTable')}
className='h-8 w-[200px] text-xs bg-background border-border/40'
>
<SelectValue placeholder={t('selectTable')} /> <SelectValue placeholder={t('selectTable')} />
</SelectTrigger> </SelectTrigger>
<SelectContent className='max-h-[300px]'> <SelectContent className='max-h-[300px]'>
+1 -1
View File
@@ -269,7 +269,7 @@ export function SystemConfigs() {
'h-full rounded-sm text-[11px] font-medium transition-colors', 'h-full rounded-sm text-[11px] font-medium transition-colors',
activeTab === tab activeTab === tab
? 'bg-background shadow-sm text-foreground' ? 'bg-background shadow-sm text-foreground'
: 'text-muted-foreground hover:text-foreground' : 'text-muted-foreground hover:text-foreground',
)} )}
> >
{tab === 'business' ? t('businessConfig') : t('systemConfig')} {tab === 'business' ? t('businessConfig') : t('systemConfig')}
@@ -222,7 +222,11 @@ export function SyncTasksPanel() {
setPage(1); setPage(1);
}} }}
> >
<SelectTrigger size='sm' className='w-[120px]' aria-label={t('statusPlaceholder')}> <SelectTrigger
size='sm'
className='w-[120px]'
aria-label={t('statusPlaceholder')}
>
<SelectValue placeholder={t('statusPlaceholder')} /> <SelectValue placeholder={t('statusPlaceholder')} />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
@@ -96,7 +96,11 @@ export function DashboardStatCards({
{t('onlineOf', { total: summary.total_nodes })} {t('onlineOf', { total: summary.total_nodes })}
</span> </span>
</div> </div>
<Progress value={onlineRate} aria-label={t('nodeOverview')} className='h-1.5' /> <Progress
value={onlineRate}
aria-label={t('nodeOverview')}
className='h-1.5'
/>
<p className='text-[10px] text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1'> <p className='text-[10px] text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1'>
<span className='inline-flex items-center gap-1'> <span className='inline-flex items-center gap-1'>
<Users className='size-3' /> <Users className='size-3' />
+3 -2
View File
@@ -258,8 +258,9 @@ func StatFilesystem(path string) (int64, int64) {
if err := syscall.Statfs(absPath, &stat); err != nil { if err := syscall.Statfs(absPath, &stat); err != nil {
return 0, 0 return 0, 0
} }
total := multiplyUint64Int64(stat.Blocks, stat.Bsize) bsize := int64(stat.Bsize) //nolint:unconvert // Statfs_t.Bsize is int64 on Linux and uint32 on Darwin
free := multiplyUint64Int64(stat.Bavail, stat.Bsize) total := multiplyUint64Int64(stat.Blocks, bsize)
free := multiplyUint64Int64(stat.Bavail, bsize)
used := max(total-free, 0) used := max(total-free, 0)
return total, used return total, used
} }
+1
View File
@@ -27,6 +27,7 @@ const (
oauthStateLimitKeyFormat = "oauth:state-limit:%s" oauthStateLimitKeyFormat = "oauth:state-limit:%s"
oauthStateLimitMax = 20 oauthStateLimitMax = 20
) )
// OAuth 授权用途常量 // OAuth 授权用途常量
const ( const (
OAuthPurposeLogin = "login" OAuthPurposeLogin = "login"
@@ -10,7 +10,6 @@ import (
"github.com/Rain-kl/Wavelet/internal/shared/response" "github.com/Rain-kl/Wavelet/internal/shared/response"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
const ctxFlaredNodeKey = "flared_node" const ctxFlaredNodeKey = "flared_node"
@@ -10,7 +10,6 @@ import (
"github.com/Rain-kl/Wavelet/internal/shared/response" "github.com/Rain-kl/Wavelet/internal/shared/response"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
const ctxRelayNodeKey = "relay_node" const ctxRelayNodeKey = "relay_node"
+1 -2
View File
@@ -12,9 +12,9 @@ import (
"github.com/Rain-kl/Wavelet/internal/infra/persistence/idgen" "github.com/Rain-kl/Wavelet/internal/infra/persistence/idgen"
"github.com/Rain-kl/Wavelet/internal/listener" "github.com/Rain-kl/Wavelet/internal/listener"
"github.com/Rain-kl/Wavelet/internal/model" "github.com/Rain-kl/Wavelet/internal/model"
pkgu "github.com/Rain-kl/Wavelet/pkg/util"
"github.com/Rain-kl/Wavelet/internal/shared/response" "github.com/Rain-kl/Wavelet/internal/shared/response"
"github.com/Rain-kl/Wavelet/pkg/logger" "github.com/Rain-kl/Wavelet/pkg/logger"
pkgu "github.com/Rain-kl/Wavelet/pkg/util"
"github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@@ -50,7 +50,6 @@ type updateProfileRequest struct {
Location string `json:"location"` Location string `json:"location"`
} }
// Login 用户密码登录 // Login 用户密码登录
// @Summary 用户密码登录 // @Summary 用户密码登录
// @Description 使用用户名和密码登录,登录成功后建立 Session。若管理员已关闭密码登录功能则返回错误。 // @Description 使用用户名和密码登录,登录成功后建立 Session。若管理员已关闭密码登录功能则返回错误。
-1
View File
@@ -31,4 +31,3 @@ func TOMLQuote(s string) string {
b.WriteByte('"') b.WriteByte('"')
return b.String() return b.String()
} }