Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(web): keep API key modal within viewport with sticky table header (#20635)

chanx67eef5ae7e74
diff --git a/web/src/components/api-service/chat-api-key-modal/index.tsx b/web/src/components/api-service/chat-api-key-modal/index.tsx
index d9c7964d20..0f670da192 100644
--- a/web/src/components/api-service/chat-api-key-modal/index.tsx
+++ b/web/src/components/api-service/chat-api-key-modal/index.tsx
@@ -48,15 +48,15 @@ const ChatApiKeyModal = ({
return (
<>
<Dialog open onOpenChange={hideModal}>
- <DialogContent className="max-w-[50vw]">
+ <DialogContent className="max-w-[50vw] max-h-[calc(100vh-8rem)] flex flex-col">
<DialogHeader>
<DialogTitle>{t('apiKey')}</DialogTitle>
</DialogHeader>
- <div className="space-y-4">
+ <div className="space-y-4 flex flex-col min-h-0">
{listLoading ? (
<div className="flex justify-center py-8">Loading...</div>
) : (
- <Table>
+ <Table rootClassName="min-h-0 shrink">
<TableHeader>
<TableRow>
<TableHead>Token</TableHead>
@@ -89,9 +89,10 @@ const ChatApiKeyModal = ({
</Table>
)}
<Button
+ className="w-fit shrink-0"
onClick={createToken}
loading={creatingLoading}
- disabled={tokenList?.length > 0}
+ disabled={tokenList?.length > 16}
>
{t('createNewKey')}
</Button>