Skip to content

Commit

Permalink
refactor alert-template list render (DataLinkDC#2614)
Browse files Browse the repository at this point in the history
* render-alert-template

* Spotless Apply

* modify some layout

* Spotless Apply

---------

Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 authored Dec 7, 2023
1 parent 71f5d01 commit 0f0832c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
7 changes: 6 additions & 1 deletion dinky-web/src/pages/RegCenter/Alert/AlertTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-layout';
import { Button, Card, List, Modal, Typography } from 'antd';
import { useState } from 'react';
import Markdown from 'react-markdown';
const { Paragraph } = Typography;

export default () => {
Expand Down Expand Up @@ -120,7 +121,11 @@ export default () => {
<Card.Meta
style={{ width: '100%', height: '15vh' }}
title={<a>{item.name}</a>}
description={<Paragraph ellipsis={{ rows: 3 }}>{item.templateContent}</Paragraph>}
description={
<Markdown skipHtml={true} unwrapDisallowed>
{item.templateContent}
</Markdown>
}
/>
</Card>
</List.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const FileTree: React.FC<FileTreeProps> = (props) => {
<>
{treeData.length > 0 ? (
<DirectoryTree
className={'treeList'}
selectedKeys={selectedKeys}
onSelect={(_, info) => onNodeClick(info)}
onRightClick={(info) => onRightClick(info)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ const ResourceOverView: React.FC = () => {
*/
return (
<>
<ProCard size={'small'} bodyStyle={{ height: parent.innerHeight - 80 }}>
<ProCard ghost size={'small'} bodyStyle={{ height: parent.innerHeight - 80 }}>
<SplitPane
split={'vertical'}
defaultSizes={[100, 500]}
defaultSizes={[150, 500]}
minSize={150}
className={'split-pane'}
>
Expand All @@ -250,7 +250,12 @@ const ResourceOverView: React.FC = () => {
size={100}
split={'horizontal'}
>
<ProCard ghost hoverable bodyStyle={{ height: parent.innerHeight }} colSpan={'18%'}>
<ProCard
hoverable
boxShadow
bodyStyle={{ height: parent.innerHeight - 80 }}
colSpan={'18%'}
>
<FileTree
selectedKeys={resourceState.selectedKeys}
treeData={resourceState.treeData}
Expand All @@ -276,7 +281,7 @@ const ResourceOverView: React.FC = () => {
size={100}
split={'horizontal'}
>
<ProCard ghost hoverable bodyStyle={{ height: parent.innerHeight }}>
<ProCard hoverable bodyStyle={{ height: parent.innerHeight }}>
<FileShow
onChange={handleContentChange}
code={resourceState.content}
Expand Down

0 comments on commit 0f0832c

Please sign in to comment.