Unverified Commit 0f0832c2 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

refactor alert-template list render (#2614)

* render-alert-template * Spotless Apply * modify some layout * Spotless Apply --------- Co-authored-by: 's avatarZzm0809 <Zzm0809@users.noreply.github.com>
parent 71f5d017
...@@ -32,6 +32,7 @@ import { PlusOutlined } from '@ant-design/icons'; ...@@ -32,6 +32,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { Button, Card, List, Modal, Typography } from 'antd'; import { Button, Card, List, Modal, Typography } from 'antd';
import { useState } from 'react'; import { useState } from 'react';
import Markdown from 'react-markdown';
const { Paragraph } = Typography; const { Paragraph } = Typography;
export default () => { export default () => {
...@@ -120,7 +121,11 @@ export default () => { ...@@ -120,7 +121,11 @@ export default () => {
<Card.Meta <Card.Meta
style={{ width: '100%', height: '15vh' }} style={{ width: '100%', height: '15vh' }}
title={<a>{item.name}</a>} title={<a>{item.name}</a>}
description={<Paragraph ellipsis={{ rows: 3 }}>{item.templateContent}</Paragraph>} description={
<Markdown skipHtml={true} unwrapDisallowed>
{item.templateContent}
</Markdown>
}
/> />
</Card> </Card>
</List.Item> </List.Item>
......
...@@ -38,6 +38,7 @@ const FileTree: React.FC<FileTreeProps> = (props) => { ...@@ -38,6 +38,7 @@ const FileTree: React.FC<FileTreeProps> = (props) => {
<> <>
{treeData.length > 0 ? ( {treeData.length > 0 ? (
<DirectoryTree <DirectoryTree
className={'treeList'}
selectedKeys={selectedKeys} selectedKeys={selectedKeys}
onSelect={(_, info) => onNodeClick(info)} onSelect={(_, info) => onNodeClick(info)}
onRightClick={(info) => onRightClick(info)} onRightClick={(info) => onRightClick(info)}
......
...@@ -236,10 +236,10 @@ const ResourceOverView: React.FC = () => { ...@@ -236,10 +236,10 @@ const ResourceOverView: React.FC = () => {
*/ */
return ( return (
<> <>
<ProCard size={'small'} bodyStyle={{ height: parent.innerHeight - 80 }}> <ProCard ghost size={'small'} bodyStyle={{ height: parent.innerHeight - 80 }}>
<SplitPane <SplitPane
split={'vertical'} split={'vertical'}
defaultSizes={[100, 500]} defaultSizes={[150, 500]}
minSize={150} minSize={150}
className={'split-pane'} className={'split-pane'}
> >
...@@ -250,7 +250,12 @@ const ResourceOverView: React.FC = () => { ...@@ -250,7 +250,12 @@ const ResourceOverView: React.FC = () => {
size={100} size={100}
split={'horizontal'} split={'horizontal'}
> >
<ProCard ghost hoverable bodyStyle={{ height: parent.innerHeight }} colSpan={'18%'}> <ProCard
hoverable
boxShadow
bodyStyle={{ height: parent.innerHeight - 80 }}
colSpan={'18%'}
>
<FileTree <FileTree
selectedKeys={resourceState.selectedKeys} selectedKeys={resourceState.selectedKeys}
treeData={resourceState.treeData} treeData={resourceState.treeData}
...@@ -276,7 +281,7 @@ const ResourceOverView: React.FC = () => { ...@@ -276,7 +281,7 @@ const ResourceOverView: React.FC = () => {
size={100} size={100}
split={'horizontal'} split={'horizontal'}
> >
<ProCard ghost hoverable bodyStyle={{ height: parent.innerHeight }}> <ProCard hoverable bodyStyle={{ height: parent.innerHeight }}>
<FileShow <FileShow
onChange={handleContentChange} onChange={handleContentChange}
code={resourceState.content} code={resourceState.content}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment