feat: add marked for md

This commit is contained in:
xion 2024-11-03 23:25:45 +08:00
parent 1bc7494e4f
commit 005e0b401a
2 changed files with 12 additions and 1 deletions

View File

@ -6,6 +6,8 @@ import { CodeOutlined, DashboardOutlined, DeleteOutlined, EditOutlined, LinkOutl
import { isObjectNull } from '@/utils/is-null';
import { FileUpload } from '../modules/FileUpload';
import { useNewNavigate } from '@/modules';
import { marked } from 'marked';
import clsx from 'clsx';
const FormModal = () => {
const [form] = Form.useForm();
const containerStore = useUserAppStore(
@ -133,6 +135,8 @@ export const List = () => {
<div className='flex flex-wrap gap-2'>
{userAppStore.list.map((item) => {
const isRunning = item.status === 'running';
const hasDescription = !!item.description;
const content = marked.parse(item.description);
return (
<div className='card border-t w-[300px] ' key={item.id}>
<div className='card-title flex justify-between' onClick={() => {}}>
@ -141,6 +145,13 @@ export const List = () => {
<div className={`${isRunning ? 'bg-green-500' : 'bg-red-500'} w-4 h-4 rounded-full`}></div>
</div>
</div>
<div>
<div className='text-xs'>domain: {item.domain}</div>
<div className='text-xs'>version: {item.version}</div>
<div className={clsx('text-sm border p-2 max-h-[140px] scrollbar my-1', !hasDescription && 'hidden')}>
<div dangerouslySetInnerHTML={{ __html: content }}></div>
</div>
</div>
<div className='mt-2'>
<Button.Group>
<Tooltip title={'Edit'}>

2
theme

@ -1 +1 @@
Subproject commit 4784ac623bd05fc242d706727df31a66db44817b
Subproject commit 5e67c93b63984ff1996fb0060ff88d70123aebca