mirror of
https://github.com/langgenius/dify.git
synced 2026-04-24 17:16:37 +08:00
fix: vertically center key-value table headers in HTTP and Webhook (#33260)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
1f4b6c84e0
commit
0a320c63a0
@ -58,10 +58,10 @@ const KeyValueList: FC<Props> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-hidden rounded-lg border border-divider-regular">
|
<div className="overflow-hidden rounded-lg border border-divider-regular">
|
||||||
<div className={cn('system-xs-medium-uppercase flex h-7 items-center leading-7 text-text-tertiary')}>
|
<div className={cn('flex h-7 items-center leading-7 text-text-tertiary system-xs-medium-uppercase')}>
|
||||||
<div className={cn('h-full border-r border-divider-regular pl-3', isSupportFile ? 'w-[140px]' : 'w-1/2')}>{t(`${i18nPrefix}.key`, { ns: 'workflow' })}</div>
|
<div className={cn('flex h-full items-center border-r border-divider-regular pl-3', isSupportFile ? 'w-[140px]' : 'w-1/2')}>{t(`${i18nPrefix}.key`, { ns: 'workflow' })}</div>
|
||||||
{isSupportFile && <div className="h-full w-[70px] shrink-0 border-r border-divider-regular pl-3">{t(`${i18nPrefix}.type`, { ns: 'workflow' })}</div>}
|
{isSupportFile && <div className="flex h-full w-[70px] shrink-0 items-center border-r border-divider-regular pl-3">{t(`${i18nPrefix}.type`, { ns: 'workflow' })}</div>}
|
||||||
<div className={cn('h-full items-center justify-between pl-3 pr-1', isSupportFile ? 'grow' : 'w-1/2')}>{t(`${i18nPrefix}.value`, { ns: 'workflow' })}</div>
|
<div className={cn('flex h-full items-center justify-between pl-3 pr-1', isSupportFile ? 'grow' : 'w-1/2')}>{t(`${i18nPrefix}.value`, { ns: 'workflow' })}</div>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
list.map((item, index) => (
|
list.map((item, index) => (
|
||||||
|
|||||||
@ -96,7 +96,10 @@ const GenericTable: FC<GenericTableProps> = ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
// If the last configured row has content, append a trailing empty row
|
// If the last configured row has content, append a trailing empty row
|
||||||
const lastHasContent = !isEmptyRow(data[data.length - 1])
|
const lastRow = data.at(-1)
|
||||||
|
if (!lastRow)
|
||||||
|
return rows
|
||||||
|
const lastHasContent = !isEmptyRow(lastRow)
|
||||||
if (lastHasContent)
|
if (lastHasContent)
|
||||||
rows.push({ row: { ...emptyRowData }, dataIndex: null, isVirtual: true })
|
rows.push({ row: { ...emptyRowData }, dataIndex: null, isVirtual: true })
|
||||||
|
|
||||||
@ -163,7 +166,7 @@ const GenericTable: FC<GenericTableProps> = ({
|
|||||||
// Ghost/inline style: looks like plain text until focus/hover
|
// Ghost/inline style: looks like plain text until focus/hover
|
||||||
'h-6 rounded-none border-0 bg-transparent px-0 py-0 shadow-none',
|
'h-6 rounded-none border-0 bg-transparent px-0 py-0 shadow-none',
|
||||||
'hover:border-transparent hover:bg-transparent focus:border-transparent focus:bg-transparent',
|
'hover:border-transparent hover:bg-transparent focus:border-transparent focus:bg-transparent',
|
||||||
'system-sm-regular text-text-secondary placeholder:text-text-quaternary',
|
'text-text-secondary system-sm-regular placeholder:text-text-quaternary',
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@ -212,12 +215,12 @@ const GenericTable: FC<GenericTableProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className="rounded-lg border border-divider-regular">
|
<div className="rounded-lg border border-divider-regular">
|
||||||
{showHeader && (
|
{showHeader && (
|
||||||
<div className="system-xs-medium-uppercase flex h-7 items-center leading-7 text-text-tertiary">
|
<div className="flex h-7 items-center leading-7 text-text-tertiary system-xs-medium-uppercase">
|
||||||
{columns.map((column, index) => (
|
{columns.map((column, index) => (
|
||||||
<div
|
<div
|
||||||
key={column.key}
|
key={column.key}
|
||||||
className={cn(
|
className={cn(
|
||||||
'h-full pl-3',
|
'flex h-full items-center pl-3',
|
||||||
column.width && column.width.startsWith('w-') ? 'shrink-0' : 'flex-1',
|
column.width && column.width.startsWith('w-') ? 'shrink-0' : 'flex-1',
|
||||||
column.width,
|
column.width,
|
||||||
// Add right border except for last column
|
// Add right border except for last column
|
||||||
@ -285,7 +288,7 @@ const GenericTable: FC<GenericTableProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<div className="mb-3 flex items-center justify-between">
|
<div className="mb-3 flex items-center justify-between">
|
||||||
<h4 className="system-sm-semibold-uppercase text-text-secondary">{title}</h4>
|
<h4 className="text-text-secondary system-sm-semibold-uppercase">{title}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{showPlaceholder
|
{showPlaceholder
|
||||||
|
|||||||
@ -7490,9 +7490,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"app/components/workflow/nodes/http/components/key-value/key-value-edit/index.tsx": {
|
"app/components/workflow/nodes/http/components/key-value/key-value-edit/index.tsx": {
|
||||||
"tailwindcss/enforce-consistent-class-order": {
|
|
||||||
"count": 1
|
|
||||||
},
|
|
||||||
"ts/no-explicit-any": {
|
"ts/no-explicit-any": {
|
||||||
"count": 2
|
"count": 2
|
||||||
}
|
}
|
||||||
@ -8522,9 +8519,6 @@
|
|||||||
"app/components/workflow/nodes/trigger-webhook/components/generic-table.tsx": {
|
"app/components/workflow/nodes/trigger-webhook/components/generic-table.tsx": {
|
||||||
"no-restricted-imports": {
|
"no-restricted-imports": {
|
||||||
"count": 1
|
"count": 1
|
||||||
},
|
|
||||||
"tailwindcss/enforce-consistent-class-order": {
|
|
||||||
"count": 3
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"app/components/workflow/nodes/trigger-webhook/default.ts": {
|
"app/components/workflow/nodes/trigger-webhook/default.ts": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user