mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-28 15:36:07 +08:00
更改标签展示
This commit is contained in:
parent
133481053e
commit
1eb8e263f7
|
@ -11,6 +11,7 @@ import {
|
|||
Menu,
|
||||
Typography,
|
||||
Input,
|
||||
Popover,
|
||||
} from 'antd';
|
||||
import {
|
||||
ClockCircleOutlined,
|
||||
|
@ -30,7 +31,7 @@ import {
|
|||
import config from '@/utils/config';
|
||||
import { PageContainer } from '@ant-design/pro-layout';
|
||||
import { request } from '@/utils/http';
|
||||
import CronModal,{CronLabelModal} from './modal';
|
||||
import CronModal,{ CronLabelModal } from './modal';
|
||||
import CronLogModal from './logModal';
|
||||
import cron_parser from 'cron-parser';
|
||||
import { diffTime } from '@/utils/date';
|
||||
|
@ -77,20 +78,39 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
|
|||
width: 150,
|
||||
align: 'center' as const,
|
||||
render: (text: string, record: any) => (
|
||||
<a
|
||||
onClick={() => {
|
||||
goToScriptManager(record);
|
||||
}}
|
||||
>
|
||||
{record.name || record._id}{' '}
|
||||
{record.isPinned ? (
|
||||
<span>
|
||||
<PushpinOutlined />
|
||||
</span>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</a>
|
||||
<>
|
||||
<a
|
||||
onClick={() => {
|
||||
goToScriptManager(record);
|
||||
}}
|
||||
>
|
||||
{record.name || record._id}{' '}
|
||||
{record.isPinned ? (
|
||||
<span>
|
||||
<PushpinOutlined />
|
||||
</span>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</a>
|
||||
<span>
|
||||
{record.labels?.length > 0 && record.labels[0] !== '' ?
|
||||
<Popover placement='right' trigger={isPhone ? 'click' : 'hover'}
|
||||
content={
|
||||
<div>
|
||||
{record.labels?.map((label: string, i: number) => (
|
||||
<Tag color="blue"
|
||||
onClick={() => { onSearch(`label:${label}`) }}>
|
||||
{label}
|
||||
</Tag>
|
||||
))}
|
||||
</div>
|
||||
}>
|
||||
<Tag color="blue">{record.labels[0]}</Tag>
|
||||
</Popover>
|
||||
: ''}
|
||||
</span>
|
||||
</>
|
||||
),
|
||||
sorter: {
|
||||
compare: (a: any, b: any) => a.name.localeCompare(b.name),
|
||||
|
@ -275,26 +295,6 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
|
|||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '标签',
|
||||
key: 'labels',
|
||||
dataIndex: 'labels',
|
||||
align: 'center' as const,
|
||||
width: 100,
|
||||
render: (text: string, record: any) => (
|
||||
<>
|
||||
{record.labels?.map((label: string) => (
|
||||
<Tag style={{
|
||||
width: label.replace(/[^\x00-\xff]/g,"01").length < 5 ? 40:90,
|
||||
overflow:'hidden',
|
||||
textOverflow:'ellipsis',
|
||||
}}
|
||||
color="blue"
|
||||
onClick={() => { onSearch(`label:${label}`) }}>{label}</Tag>
|
||||
))}
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
|
|
Loading…
Reference in New Issue
Block a user