add warning description

This commit is contained in:
Henry 2023-07-08 01:55:44 +01:00
parent 5b55ca0389
commit 7e076028df
5 changed files with 24 additions and 4 deletions

View File

@ -58,7 +58,8 @@ class Cheerio_DocumentLoaders implements INode {
default: 10,
optional: true,
additionalParams: true,
description: 'Set 0 to crawl/scrape all relative links'
description: 'Set 0 to crawl/scrape all relative links',
warning: `Scraping all links might take long time, and all links will be upserted again if the flow's state changed (eg: different URL, chunk size, etc) `
},
{
label: 'Metadata',

View File

@ -58,7 +58,8 @@ class Playwright_DocumentLoaders implements INode {
default: 10,
optional: true,
additionalParams: true,
description: 'Set 0 to crawl/scrape all relative links'
description: 'Set 0 to crawl/scrape all relative links',
warning: `Scraping all links might take long time, and all links will be upserted again if the flow's state changed (eg: different URL, chunk size, etc) `
},
{
label: 'Metadata',

View File

@ -58,7 +58,8 @@ class Puppeteer_DocumentLoaders implements INode {
default: 10,
optional: true,
additionalParams: true,
description: 'Set 0 to crawl/scrape all relative links'
description: 'Set 0 to crawl/scrape all relative links',
warning: `Scraping all links might take long time, and all links will be upserted again if the flow's state changed (eg: different URL, chunk size, etc) `
},
{
label: 'Metadata',

View File

@ -57,6 +57,7 @@ export interface INodeParams {
type: NodeParamsType | string
default?: CommonType | ICommonObject | ICommonObject[]
description?: string
warning?: string
options?: Array<INodeOptionsValue>
optional?: boolean | INodeDisplay
rows?: number

View File

@ -7,7 +7,7 @@ import { useSelector } from 'react-redux'
import { useTheme, styled } from '@mui/material/styles'
import { Box, Typography, Tooltip, IconButton, Button } from '@mui/material'
import { tooltipClasses } from '@mui/material/Tooltip'
import { IconArrowsMaximize, IconEdit } from '@tabler/icons'
import { IconArrowsMaximize, IconEdit, IconAlertTriangle } from '@tabler/icons'
// project import
import { Dropdown } from 'ui-component/dropdown/Dropdown'
@ -210,6 +210,22 @@ const NodeInputHandler = ({ inputAnchor, inputParam, data, disabled = false, isA
</IconButton>
)}
</div>
{inputParam.warning && (
<div
style={{
display: 'flex',
flexDirection: 'row',
borderRadius: 10,
background: 'rgb(254,252,191)',
padding: 10,
marginTop: 10,
marginBottom: 10
}}
>
<IconAlertTriangle size={36} color='orange' />
<span style={{ color: 'rgb(116,66,16)', marginLeft: 10 }}>{inputParam.warning}</span>
</div>
)}
{inputParam.type === 'file' && (
<File
disabled={disabled}