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';
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 () => {
......@@ -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>
......
......@@ -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)}
......
......@@ -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'}
>
......@@ -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}
......@@ -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}
......
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