diff --git a/web/src/components/layout/components/app-header.tsx b/web/src/components/layout/components/app-header.tsx index 40bb805b07..40ffae8962 100644 --- a/web/src/components/layout/components/app-header.tsx +++ b/web/src/components/layout/components/app-header.tsx @@ -28,10 +28,6 @@ import { TopNav } from './top-nav' * * * @example - * // Fixed at top - * - * - * @example * // Fully customize left and right content * } @@ -57,11 +53,6 @@ type AppHeaderProps = { * @default true */ showSearch?: boolean - /** - * Whether to fix at top - * @default false - */ - fixed?: boolean /** * Custom right content, overrides default right content if provided */ @@ -88,7 +79,6 @@ export function AppHeader({ showTopNav = true, leftContent, showSearch = true, - fixed = false, rightContent, showNotifications = true, showConfigDrawer = true, @@ -107,7 +97,7 @@ export function AppHeader({ return ( <> -
+
{leftSection} {rightContent ?? (
diff --git a/web/src/components/layout/components/authenticated-layout.tsx b/web/src/components/layout/components/authenticated-layout.tsx index e607d8c915..3ede5f25be 100644 --- a/web/src/components/layout/components/authenticated-layout.tsx +++ b/web/src/components/layout/components/authenticated-layout.tsx @@ -25,8 +25,8 @@ export function AuthenticatedLayout(props: AuthenticatedLayoutProps) { {props.children ?? } diff --git a/web/src/components/layout/components/header.tsx b/web/src/components/layout/components/header.tsx index 46556a2903..7c779a258b 100644 --- a/web/src/components/layout/components/header.tsx +++ b/web/src/components/layout/components/header.tsx @@ -1,53 +1,16 @@ -import { useEffect, useState } from 'react' import { cn } from '@/lib/utils' import { Separator } from '@/components/ui/separator' import { SidebarTrigger } from '@/components/ui/sidebar' -type HeaderProps = React.HTMLAttributes & { - /** - * 是否固定在顶部 - */ - fixed?: boolean -} - -/** - * 基础 Header 组件 - * 包含侧边栏触发器和分隔线 - * - fixed=true 时会固定在顶部,并在滚动时添加阴影效果 - */ -export function Header({ className, fixed, children, ...props }: HeaderProps) { - const [scrollOffset, setScrollOffset] = useState(0) - - useEffect(() => { - const handleScroll = () => { - setScrollOffset( - document.body.scrollTop || document.documentElement.scrollTop - ) - } - - document.addEventListener('scroll', handleScroll, { passive: true }) - return () => document.removeEventListener('scroll', handleScroll) - }, []) - - const shouldShowShadow = scrollOffset > 10 && fixed +type HeaderProps = React.HTMLAttributes +export function Header({ className, children, ...props }: HeaderProps) { return (
-
+
{children} diff --git a/web/src/components/layout/components/main.tsx b/web/src/components/layout/components/main.tsx index 505f2445a9..4287b76329 100644 --- a/web/src/components/layout/components/main.tsx +++ b/web/src/components/layout/components/main.tsx @@ -1,31 +1,14 @@ import { cn } from '@/lib/utils' type MainProps = React.HTMLAttributes & { - /** - * 是否使用固定布局(防止内容溢出) - */ - fixed?: boolean - /** - * 是否使用流式布局(不限制最大宽度) - * - 默认开启(true) - */ fluid?: boolean } -/** - * Main 内容区域组件 - * - fixed=true 时会使用 flexbox 布局并防止内容溢出 - * - fluid=true 时不会限制最大宽度(默认) - */ -export function Main({ fixed, className, fluid = true, ...props }: MainProps) { +export function Main({ className, fluid = true, ...props }: MainProps) { return (
(null) + +type PageFooterProviderProps = { + container: HTMLDivElement | null + children: ReactNode +} + +export function PageFooterProvider(props: PageFooterProviderProps) { + return ( + + {props.children} + + ) +} + +export function PageFooterPortal(props: { children: ReactNode }) { + const container = useContext(PageFooterContext) + if (!container) return null + return createPortal(props.children, container) +} diff --git a/web/src/components/layout/components/section-page-layout.tsx b/web/src/components/layout/components/section-page-layout.tsx index 5adf25f7d5..1bfcbbdb36 100644 --- a/web/src/components/layout/components/section-page-layout.tsx +++ b/web/src/components/layout/components/section-page-layout.tsx @@ -1,11 +1,13 @@ import { Children, isValidElement, + useState, type ReactElement, type ReactNode, } from 'react' import { AppHeader } from './app-header' import { Main } from './main' +import { PageFooterProvider } from './page-footer' type SlotProps = { children?: ReactNode } @@ -39,6 +41,10 @@ export type SectionPageLayoutProps = { } export function SectionPageLayout(props: SectionPageLayoutProps) { + const [footerContainer, setFooterContainer] = useState( + null + ) + let title: ReactNode = null let description: ReactNode = null let actions: ReactNode = null @@ -60,29 +66,35 @@ export function SectionPageLayout(props: SectionPageLayoutProps) { }) return ( - <> - + +
- {breadcrumb != null &&
{breadcrumb}
} -
-
-

{title}

- {description != null && ( -

{description}

+
+ {breadcrumb != null &&
{breadcrumb}
} +
+
+

{title}

+ {description != null && ( +

{description}

+ )} +
+ {actions != null && ( +
+ {actions} +
)}
- {actions != null && ( -
- {actions} -
- )} -
-
- {content}
+ +
{content}
+ +
- +
) } diff --git a/web/src/components/layout/index.ts b/web/src/components/layout/index.ts index c7163898ad..131580f4a9 100644 --- a/web/src/components/layout/index.ts +++ b/web/src/components/layout/index.ts @@ -13,6 +13,7 @@ export { HeaderLogo } from './components/header-logo' export { NavLinkItem, NavLinkList } from './components/nav-link-item' export { Header } from './components/header' export { Main } from './components/main' +export { PageFooterPortal } from './components/page-footer' export { NavGroup } from './components/nav-group' export { SectionPageLayout } from './components/section-page-layout' export { WorkspaceSwitcher } from './components/workspace-switcher' diff --git a/web/src/components/page-transition.tsx b/web/src/components/page-transition.tsx index 89fb63e3c8..f4dc1e341d 100644 --- a/web/src/components/page-transition.tsx +++ b/web/src/components/page-transition.tsx @@ -43,7 +43,11 @@ export function AnimatedOutlet() { }) if (shouldReduce) { - return + return ( +
+ +
+ ) } return ( @@ -52,7 +56,7 @@ export function AnimatedOutlet() { initial={MOTION_VARIANTS.pageEnter.initial} animate={MOTION_VARIANTS.pageEnter.animate} transition={MOTION_TRANSITION.fast} - className='flex flex-1 flex-col' + className='flex min-h-0 flex-1 flex-col' > diff --git a/web/src/features/channels/components/channels-table.tsx b/web/src/features/channels/components/channels-table.tsx index c775b003b4..684d3fcd17 100644 --- a/web/src/features/channels/components/channels-table.tsx +++ b/web/src/features/channels/components/channels-table.tsx @@ -2,6 +2,7 @@ import { useState, useMemo, useEffect } from 'react' import { useQuery } from '@tanstack/react-query' import { getRouteApi } from '@tanstack/react-router' import { + flexRender, getCoreRowModel, useReactTable, getExpandedRowModel, @@ -29,6 +30,7 @@ import { MobileCardList, } from '@/components/data-table' import { DataTablePagination } from '@/components/data-table/pagination' +import { PageFooterPortal } from '@/components/layout' import { getChannels, searchChannels, getGroups } from '../api' import { DEFAULT_PAGE_SIZE, @@ -274,120 +276,110 @@ export function ChannelsTable() { ] return ( -
- {/* Toolbar with Filters */} - setModelFilterInput(e.target.value)} - className='h-8 w-full sm:w-[150px] lg:w-[200px]' - /> - } - filters={[ - { - columnId: 'status', - title: t('Status'), - options: [...CHANNEL_STATUS_OPTIONS], - singleSelect: true, - }, - { - columnId: 'type', - title: t('Type'), - options: typeFilterOptions, - singleSelect: true, - }, - { - columnId: 'group', - title: t('Group'), - options: groupFilterOptions, - singleSelect: true, - }, - ]} - /> - - {isMobile ? ( - +
+ setModelFilterInput(e.target.value)} + className='h-8 w-full sm:w-[150px] lg:w-[200px]' + /> + } + filters={[ + { + columnId: 'status', + title: t('Status'), + options: [...CHANNEL_STATUS_OPTIONS], + singleSelect: true, + }, + { + columnId: 'type', + title: t('Type'), + options: typeFilterOptions, + singleSelect: true, + }, + { + columnId: 'group', + title: t('Group'), + options: groupFilterOptions, + singleSelect: true, + }, + ]} /> - ) : ( - <> - {/* Table */} -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - - - {isLoading ? ( - - ) : table.getRowModel().rows.length === 0 ? ( - - ) : ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - + + {isMobile ? ( + + ) : ( + <> +
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + ))} - )) - )} - -
-
+ ))} + + + {isLoading ? ( + + ) : table.getRowModel().rows.length === 0 ? ( + + ) : ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + )) + )} + + +
- {/* Bulk Actions Floating Toolbar */} - - - )} - - {/* Pagination */} - -
+ + + )} +
+ + + + ) } - -// Helper to render cell content -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function flexRender(content: unknown, context: any) { - if (typeof content === 'function') { - return content(context) - } - return content -} diff --git a/web/src/features/keys/components/api-keys-cells.tsx b/web/src/features/keys/components/api-keys-cells.tsx index 464be768dc..662030a9ab 100644 --- a/web/src/features/keys/components/api-keys-cells.tsx +++ b/web/src/features/keys/components/api-keys-cells.tsx @@ -1,8 +1,13 @@ -import { useCallback } from 'react' -import { Check, Eye, EyeOff, Copy, Loader2 } from 'lucide-react' +import { useState, useCallback } from 'react' +import { Check, Copy, Loader2 } from 'lucide-react' import { useTranslation } from 'react-i18next' import { copyToClipboard } from '@/lib/copy-to-clipboard' import { Button } from '@/components/ui/button' +import { + Popover, + PopoverContent, + PopoverTrigger, +} from '@/components/ui/popover' import { Tooltip, TooltipContent, @@ -16,70 +21,74 @@ export function ApiKeyCell({ apiKey }: { apiKey: ApiKey }) { const { t } = useTranslation() const { resolveRealKey, - toggleKeyVisibility, - keyVisibility, resolvedKeys, loadingKeys, copiedKeyId, markKeyCopied, } = useApiKeys() + const [popoverOpen, setPopoverOpen] = useState(false) - const isVisible = !!keyVisibility[apiKey.id] const isLoading = !!loadingKeys[apiKey.id] const resolvedFullKey = resolvedKeys[apiKey.id] const isCopied = copiedKeyId === apiKey.id + const maskedKey = `sk-${apiKey.key}` - const displayedKey = - isVisible && resolvedFullKey - ? resolvedFullKey - : `sk-${apiKey.key.slice(0, 4)}${'*'.repeat(16)}${apiKey.key.slice(-4)}` - - const handleCopy = useCallback( - async (e: React.MouseEvent) => { - e.stopPropagation() - const realKey = resolvedFullKey || (await resolveRealKey(apiKey.id)) - if (realKey) { - const success = await copyToClipboard(realKey) - if (success) { - markKeyCopied(apiKey.id) - } + const handlePopoverOpen = useCallback( + (open: boolean) => { + setPopoverOpen(open) + if (open && !resolvedFullKey) { + resolveRealKey(apiKey.id) } }, - [resolvedFullKey, resolveRealKey, apiKey.id, markKeyCopied] + [resolvedFullKey, resolveRealKey, apiKey.id] ) + const handleCopy = useCallback(async () => { + const realKey = resolvedFullKey || (await resolveRealKey(apiKey.id)) + if (realKey) { + const ok = await copyToClipboard(realKey) + if (ok) markKeyCopied(apiKey.id) + } + }, [resolvedFullKey, resolveRealKey, apiKey.id, markKeyCopied]) + return ( -
- - {displayedKey} - - - +
+ + - - - {isVisible ? t('Hide API key') : t('Reveal API key')} - - + + +
+

{t('Full API Key')}

+ {isLoading ? ( +
+ + + {t('Loading...')} + +
+ ) : ( + e.target.select()} + className='bg-muted/50 w-full min-w-[280px] rounded-md border px-3 py-2 font-mono text-xs outline-none' + /> + )} +
+
+
- {t('Remaining:')} {formatQuota(remaining)} + {t('Remaining:')} {formatQuota(remaining)} ( + {percentage.toFixed(1)}%)
{t('Total:')} {formatQuota(total)}
-
- {t('Percentage:')} {percentage.toFixed(1)}% -
@@ -204,17 +214,25 @@ export function useApiKeysColumns(): ColumnDef[] { const apiKey = row.original const group = row.getValue('group') as string const ratio = group && group !== 'auto' ? groupRatios[group] : undefined - const ratioLabel = ratio != null ? `${ratio}x` : undefined if (group === 'auto') { return ( - + + + {apiKey.cross_group_retry && ( + + )} + @@ -230,13 +248,15 @@ export function useApiKeysColumns(): ColumnDef[] {
- {ratioLabel && ( - - {ratioLabel} - + {ratio != null && ( + )}
) @@ -269,9 +289,9 @@ export function useApiKeysColumns(): ColumnDef[] { ), cell: ({ row }) => ( -
+ {formatTimestampToDate(row.getValue('created_time'))} -
+
), meta: { label: t('Created') }, }, @@ -293,11 +313,14 @@ export function useApiKeysColumns(): ColumnDef[] { } const isExpired = expiredTime * 1000 < Date.now() return ( -
{formatTimestampToDate(expiredTime)} -
+ ) }, meta: { label: t('Expires') }, diff --git a/web/src/features/keys/components/api-keys-provider.tsx b/web/src/features/keys/components/api-keys-provider.tsx index e7dc954538..0595752606 100644 --- a/web/src/features/keys/components/api-keys-provider.tsx +++ b/web/src/features/keys/components/api-keys-provider.tsx @@ -17,8 +17,6 @@ type ApiKeysContextType = { setResolvedKey: React.Dispatch> resolveRealKey: (id: number) => Promise resolveRealKeysBatch: (ids: number[]) => Promise> - toggleKeyVisibility: (id: number) => Promise - keyVisibility: Record resolvedKeys: Record loadingKeys: Record copiedKeyId: number | null @@ -35,9 +33,6 @@ export function ApiKeysProvider({ children }: { children: React.ReactNode }) { const [resolvedKey, setResolvedKey] = useState('') const [resolvedKeys, setResolvedKeys] = useState>({}) - const [keyVisibility, setKeyVisibility] = useState>( - {} - ) const [loadingKeys, setLoadingKeys] = useState>({}) const pendingRequests = useRef>>({}) @@ -56,7 +51,6 @@ export function ApiKeysProvider({ children }: { children: React.ReactNode }) { const triggerRefresh = useCallback(() => { setRefreshTrigger((prev) => prev + 1) - setKeyVisibility({}) }, []) const resolveRealKey = useCallback( @@ -140,20 +134,6 @@ export function ApiKeysProvider({ children }: { children: React.ReactNode }) { [resolvedKeys, t] ) - const toggleKeyVisibility = useCallback( - async (id: number) => { - if (keyVisibility[id]) { - setKeyVisibility((prev) => ({ ...prev, [id]: false })) - return - } - const key = await resolveRealKey(id) - if (key) { - setKeyVisibility((prev) => ({ ...prev, [id]: true })) - } - }, - [keyVisibility, resolveRealKey] - ) - return ( - - {isMobile ? ( - +
+ - ) : ( -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( + {isMobile ? ( + + ) : ( +
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( {header.isPlaceholder ? null @@ -191,50 +194,52 @@ export function ApiKeysTable() { header.getContext() )} - ) - })} - - ))} - - - {isLoading ? ( - - ) : table.getRowModel().rows.length === 0 ? ( - - ) : ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - ))} - )) - )} - -
-
- )} - - {!isMobile && } -
+ ))} + + + {isLoading ? ( + + ) : table.getRowModel().rows.length === 0 ? ( + + ) : ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + )) + )} + + +
+ )} + {!isMobile && } +
+ + + + ) } diff --git a/web/src/features/models/components/deployments-table.tsx b/web/src/features/models/components/deployments-table.tsx index 268b84b28d..a2e0172e55 100644 --- a/web/src/features/models/components/deployments-table.tsx +++ b/web/src/features/models/components/deployments-table.tsx @@ -36,6 +36,7 @@ import { TableSkeleton, } from '@/components/data-table' import { DataTablePagination } from '@/components/data-table/pagination' +import { PageFooterPortal } from '@/components/layout' import { deleteDeployment, listDeployments, searchDeployments } from '../api' import { getDeploymentStatusOptions } from '../constants' import { deploymentsQueryKeys } from '../lib' @@ -226,83 +227,91 @@ export function DeploymentsTable() { }, [t]) return ( -
- {/* Toolbar with Filters */} - - - {isMobile ? ( - +
+ - ) : ( -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - - - {isLoading ? ( - - ) : table.getRowModel().rows.length === 0 ? ( - - ) : ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - + + {isMobile ? ( + + ) : ( +
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + ))} - )) - )} - -
-
- )} + ))} + + + {isLoading ? ( + + ) : table.getRowModel().rows.length === 0 ? ( + + ) : ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + )) + )} + + +
+ )} +
- } /> + + } + /> + - + ) } diff --git a/web/src/features/models/components/models-table.tsx b/web/src/features/models/components/models-table.tsx index 858d1964c7..2c5a82bb72 100644 --- a/web/src/features/models/components/models-table.tsx +++ b/web/src/features/models/components/models-table.tsx @@ -2,6 +2,7 @@ import { useState, useMemo, useEffect } from 'react' import { useQuery } from '@tanstack/react-query' import { getRouteApi } from '@tanstack/react-router' import { + flexRender, getCoreRowModel, useReactTable, type SortingState, @@ -25,6 +26,7 @@ import { MobileCardList, } from '@/components/data-table' import { DataTablePagination } from '@/components/data-table/pagination' +import { PageFooterPortal } from '@/components/layout' import { getModels, searchModels, getVendors } from '../api' import { DEFAULT_PAGE_SIZE, @@ -213,113 +215,106 @@ export function ModelsTable() { ] return ( -
- {/* Toolbar with Filters */} - - - {isMobile ? ( - +
+ - ) : ( - <> - {/* Table */} -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - - - {isLoading ? ( - - ) : table.getRowModel().rows.length === 0 ? ( - - ) : ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - + + {isMobile ? ( + + ) : ( + <> +
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + ))} - )) - )} - -
-
+ ))} + + + {isLoading ? ( + + ) : table.getRowModel().rows.length === 0 ? ( + + ) : ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + )) + )} + + +
- {/* Bulk Actions Floating Toolbar */} - - - )} - - {/* Pagination */} - } /> -
+ + + )} + + + } + /> + + ) } - -// Helper to render cell content -function flexRender(content: unknown, context: unknown) { - if (typeof content === 'function') { - return content(context) - } - return content -} diff --git a/web/src/features/profile/index.tsx b/web/src/features/profile/index.tsx index f0eb63e3dc..669d39e3b4 100644 --- a/web/src/features/profile/index.tsx +++ b/web/src/features/profile/index.tsx @@ -25,50 +25,49 @@ export function Profile() { status?.turnstile_check && status?.turnstile_site_key ) const turnstileSiteKey = status?.turnstile_site_key || '' - // Hide the sidebar customization card when the backend explicitly forbids - // it (e.g. root users). Default to visible to handle legacy sessions where - // the permissions field has not been populated yet. const canConfigureSidebar = permissions?.sidebar_settings !== false return ( <> - +
- - - - +
+ + + + - - - + + + - -
-
- - - -
+ +
+
+ + + +
-
- {checkinEnabled && ( - + {checkinEnabled && ( + + )} + - )} - - {canConfigureSidebar && } + {canConfigureSidebar && } +
-
-
-
+ + +
) diff --git a/web/src/features/redemption-codes/components/redemptions-table.tsx b/web/src/features/redemption-codes/components/redemptions-table.tsx index e25dccb074..5081406ca3 100644 --- a/web/src/features/redemption-codes/components/redemptions-table.tsx +++ b/web/src/features/redemption-codes/components/redemptions-table.tsx @@ -29,6 +29,7 @@ import { TableSkeleton, TableEmpty, } from '@/components/data-table' +import { PageFooterPortal } from '@/components/layout' import { getRedemptions, searchRedemptions } from '../api' import { REDEMPTION_STATUS, getRedemptionStatusOptions } from '../constants' import { isRedemptionExpired } from '../lib' @@ -138,82 +139,86 @@ export function RedemptionsTable() { ) return ( -
- -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ) - })} - - ))} - - - {isLoading ? ( - - ) : table.getRowModel().rows.length === 0 ? ( - - ) : ( - table.getRowModel().rows.map((row) => { - const redemption = row.original - const isDisabled = - redemption.status !== REDEMPTION_STATUS.ENABLED || - isRedemptionExpired( - redemption.expired_time, - redemption.status - ) + <> +
+ +
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => { + return ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ) + })} + + ))} + + + {isLoading ? ( + + ) : table.getRowModel().rows.length === 0 ? ( + + ) : ( + table.getRowModel().rows.map((row) => { + const redemption = row.original + const isDisabled = + redemption.status !== REDEMPTION_STATUS.ENABLED || + isRedemptionExpired( + redemption.expired_time, + redemption.status + ) - return ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - - ))} - - ) - }) - )} - -
+ return ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + ) + }) + )} + + +
+
- - - + + + + ) } diff --git a/web/src/features/subscriptions/components/subscriptions-table.tsx b/web/src/features/subscriptions/components/subscriptions-table.tsx index 0771a5e173..d5c00d257c 100644 --- a/web/src/features/subscriptions/components/subscriptions-table.tsx +++ b/web/src/features/subscriptions/components/subscriptions-table.tsx @@ -23,6 +23,7 @@ import { TableSkeleton, TableEmpty, } from '@/components/data-table' +import { PageFooterPortal } from '@/components/layout' import { getAdminPlans } from '../api' import { useSubscriptionsColumns } from './subscriptions-columns' import { useSubscriptions } from './subscriptions-provider' @@ -57,7 +58,7 @@ export function SubscriptionsTable() { }) return ( -
+ <>
@@ -104,7 +105,9 @@ export function SubscriptionsTable() {
- -
+ + + + ) } diff --git a/web/src/features/system-settings/index.tsx b/web/src/features/system-settings/index.tsx index 54a5769c6b..39eddfcb35 100644 --- a/web/src/features/system-settings/index.tsx +++ b/web/src/features/system-settings/index.tsx @@ -5,10 +5,12 @@ import { AppHeader } from '@/components/layout/components/app-header' export function SystemSettings() { return ( <> - +
- +
+ +
) diff --git a/web/src/features/usage-logs/components/usage-logs-table.tsx b/web/src/features/usage-logs/components/usage-logs-table.tsx index b9bb1b1167..84f0c3281f 100644 --- a/web/src/features/usage-logs/components/usage-logs-table.tsx +++ b/web/src/features/usage-logs/components/usage-logs-table.tsx @@ -31,6 +31,7 @@ import { TableEmpty, MobileCardList, } from '@/components/data-table' +import { PageFooterPortal } from '@/components/layout' import { LOG_TYPE_FILTERS, DEFAULT_LOGS_DATA } from '../constants' import { useColumnsByCategory } from '../lib/columns' import { fetchLogsByCategory } from '../lib/utils' @@ -161,66 +162,70 @@ export function UsageLogsTable({ logCategory }: UsageLogsTableProps) { : [] return ( -
- - {isMobile ? ( - - ) : ( -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - - - {isLoadingData ? ( - - ) : table.getRowModel().rows.length === 0 ? ( - - ) : ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - + <> +
+ + {isMobile ? ( + + ) : ( +
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + ))} - )) - )} - -
-
- )} - -
+ ))} + + + {isLoadingData ? ( + + ) : table.getRowModel().rows.length === 0 ? ( + + ) : ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + )) + )} + + + + )} + + + + + ) } diff --git a/web/src/features/users/components/users-table.tsx b/web/src/features/users/components/users-table.tsx index e398bf7beb..ef5626882c 100644 --- a/web/src/features/users/components/users-table.tsx +++ b/web/src/features/users/components/users-table.tsx @@ -30,6 +30,7 @@ import { TableSkeleton, TableEmpty, } from '@/components/data-table' +import { PageFooterPortal } from '@/components/layout' import { getUsers, searchUsers } from '../api' import { USER_STATUS, @@ -155,30 +156,30 @@ export function UsersTable() { }, [pageCount, ensurePageInRange]) return ( -
- -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( + <> +
+ +
+
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( {header.isPlaceholder ? null @@ -187,53 +188,55 @@ export function UsersTable() { header.getContext() )} - ) - })} - - ))} - - - {isLoading ? ( - - ) : table.getRowModel().rows.length === 0 ? ( - - ) : ( - table.getRowModel().rows.map((row) => { - const user = row.original - const isDeleted = isUserDeleted(user) - const isDisabled = user.status === USER_STATUS.DISABLED + ))} + + ))} + + + {isLoading ? ( + + ) : table.getRowModel().rows.length === 0 ? ( + + ) : ( + table.getRowModel().rows.map((row) => { + const user = row.original + const isDeleted = isUserDeleted(user) + const isDisabled = user.status === USER_STATUS.DISABLED - return ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - - ))} - - ) - }) - )} - -
+ return ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + ) + }) + )} + + +
+
- - - + + + + ) } diff --git a/web/src/routes/_authenticated/errors/$error.tsx b/web/src/routes/_authenticated/errors/$error.tsx index 5b7cce6d76..82643a0fad 100644 --- a/web/src/routes/_authenticated/errors/$error.tsx +++ b/web/src/routes/_authenticated/errors/$error.tsx @@ -28,7 +28,7 @@ function RouteComponent() { return ( <> -
+
diff --git a/web/src/routes/_authenticated/playground/index.tsx b/web/src/routes/_authenticated/playground/index.tsx index d647adf2ae..00d07800d0 100644 --- a/web/src/routes/_authenticated/playground/index.tsx +++ b/web/src/routes/_authenticated/playground/index.tsx @@ -9,8 +9,8 @@ export const Route = createFileRoute('/_authenticated/playground/')({ function PlaygroundPage() { return ( <> - -
+ +
diff --git a/web/src/styles/index.css b/web/src/styles/index.css index 8de119063c..5a27a4a213 100644 --- a/web/src/styles/index.css +++ b/web/src/styles/index.css @@ -18,10 +18,6 @@ @apply bg-background text-foreground has-[div[data-variant='inset']]:bg-sidebar min-h-svh w-full font-sans; } - body:has([data-layout='fixed']) { - overflow: hidden; - } - /* Override Radix scroll locking for sticky headers */ body[data-scroll-locked] { overflow: unset !important;