-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: system settings page and add event source max timeout
- Loading branch information
1 parent
d496635
commit 8990c7c
Showing
24 changed files
with
784 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.system { | ||
width: 100%; | ||
height: max-content; | ||
padding: 2rem; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
.system-card { | ||
width: 100%; | ||
height: 100%; | ||
min-height: 20vh; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import React from "react"; | ||
import { ChevronDown, Info } from "lucide-react"; | ||
import { cn } from "@/components/ui/lib/utils.ts"; | ||
import { Button } from "@/components/ui/button.tsx"; | ||
import Markdown from "@/components/Markdown.tsx"; | ||
|
||
export type ParagraphProps = { | ||
title?: string; | ||
children: React.ReactNode; | ||
configParagraph?: boolean; | ||
isCollapsed?: boolean; | ||
onCollapse?: () => void; | ||
defaultCollapsed?: boolean; | ||
}; | ||
|
||
function Paragraph({ | ||
title, | ||
children, | ||
configParagraph, | ||
isCollapsed, | ||
onCollapse, | ||
defaultCollapsed, | ||
}: ParagraphProps) { | ||
const [collapsed, setCollapsed] = React.useState(defaultCollapsed ?? false); | ||
|
||
React.useEffect(() => onCollapse && onCollapse(), [collapsed]); | ||
|
||
return ( | ||
<div | ||
className={cn( | ||
`paragraph`, | ||
configParagraph && `config-paragraph`, | ||
isCollapsed && `collapsable`, | ||
collapsed && `collapsed`, | ||
)} | ||
> | ||
<div | ||
className={`paragraph-header`} | ||
onClick={() => setCollapsed(!collapsed)} | ||
> | ||
{title && <div className={`paragraph-title`}>{title}</div>} | ||
<div className={`grow`} /> | ||
{isCollapsed && ( | ||
<Button size={`icon`} variant={`ghost`} className={`w-8 h-8`}> | ||
<ChevronDown | ||
className={cn( | ||
`w-4 h-4 transition-transform duration-300`, | ||
collapsed && `transform rotate-180`, | ||
)} | ||
/> | ||
</Button> | ||
)} | ||
</div> | ||
<div | ||
className={`paragraph-content`} | ||
style={ | ||
{ | ||
"--max-height": collapsed ? "0px" : "1000px", | ||
} as React.CSSProperties | ||
} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function ParagraphItem({ children }: { children: React.ReactNode }) { | ||
return <div className={`paragraph-item`}>{children}</div>; | ||
} | ||
|
||
export function ParagraphDescription({ children }: { children: string }) { | ||
return ( | ||
<div className={`paragraph-description`}> | ||
<Info size={16} /> | ||
<Markdown children={children} /> | ||
</div> | ||
); | ||
} | ||
|
||
function ParagraphFooter({ children }: { children: React.ReactNode }) { | ||
return <div className={`paragraph-footer`}>{children}</div>; | ||
} | ||
|
||
export default Paragraph; | ||
export { ParagraphItem, ParagraphFooter }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.