mirror of https://github.com/langgenius/dify.git
fix: the action button of structure output modal should align right (#32700)
This commit is contained in:
parent
6c66e11cac
commit
9f0ee5c145
|
|
@ -1,12 +1,12 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { SchemaRoot } from '../../types'
|
import type { SchemaRoot } from '../../types'
|
||||||
import { RiBracesLine, RiCloseLine, RiTimelineView } from '@remixicon/react'
|
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import Divider from '@/app/components/base/divider'
|
import Divider from '@/app/components/base/divider'
|
||||||
import Toast from '@/app/components/base/toast'
|
import Toast from '@/app/components/base/toast'
|
||||||
import { JSON_SCHEMA_MAX_DEPTH } from '@/config'
|
import { JSON_SCHEMA_MAX_DEPTH } from '@/config'
|
||||||
|
import { cn } from '@/utils/classnames'
|
||||||
import { SegmentedControl } from '../../../../../base/segmented-control'
|
import { SegmentedControl } from '../../../../../base/segmented-control'
|
||||||
import { Type } from '../../types'
|
import { Type } from '../../types'
|
||||||
import {
|
import {
|
||||||
|
|
@ -35,9 +35,17 @@ enum SchemaView {
|
||||||
JsonSchema = 'jsonSchema',
|
JsonSchema = 'jsonSchema',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TimelineViewIcon: FC<{ className?: string }> = ({ className }) => {
|
||||||
|
return <span className={cn('i-ri-timeline-view', className)} />
|
||||||
|
}
|
||||||
|
|
||||||
|
const BracesIcon: FC<{ className?: string }> = ({ className }) => {
|
||||||
|
return <span className={cn('i-ri-braces-line', className)} />
|
||||||
|
}
|
||||||
|
|
||||||
const VIEW_TABS = [
|
const VIEW_TABS = [
|
||||||
{ Icon: RiTimelineView, text: 'Visual Editor', value: SchemaView.VisualEditor },
|
{ Icon: TimelineViewIcon, text: 'Visual Editor', value: SchemaView.VisualEditor },
|
||||||
{ Icon: RiBracesLine, text: 'JSON Schema', value: SchemaView.JsonSchema },
|
{ Icon: BracesIcon, text: 'JSON Schema', value: SchemaView.JsonSchema },
|
||||||
]
|
]
|
||||||
|
|
||||||
const DEFAULT_SCHEMA: SchemaRoot = {
|
const DEFAULT_SCHEMA: SchemaRoot = {
|
||||||
|
|
@ -203,11 +211,11 @@ const JsonSchemaConfig: FC<JsonSchemaConfigProps> = ({
|
||||||
<div className="flex h-full flex-col">
|
<div className="flex h-full flex-col">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="relative flex p-6 pb-3 pr-14">
|
<div className="relative flex p-6 pb-3 pr-14">
|
||||||
<div className="title-2xl-semi-bold grow truncate text-text-primary">
|
<div className="grow truncate text-text-primary title-2xl-semi-bold">
|
||||||
{t('nodes.llm.jsonSchema.title', { ns: 'workflow' })}
|
{t('nodes.llm.jsonSchema.title', { ns: 'workflow' })}
|
||||||
</div>
|
</div>
|
||||||
<div className="absolute right-5 top-5 flex h-8 w-8 items-center justify-center p-1.5" onClick={onClose}>
|
<div className="absolute right-5 top-5 flex h-8 w-8 items-center justify-center p-1.5" onClick={onClose}>
|
||||||
<RiCloseLine className="h-[18px] w-[18px] text-text-tertiary" />
|
<span className="i-ri-close-line h-[18px] w-[18px] text-text-tertiary" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
|
|
@ -249,7 +257,7 @@ const JsonSchemaConfig: FC<JsonSchemaConfigProps> = ({
|
||||||
{validationError && <ErrorMessage message={validationError} />}
|
{validationError && <ErrorMessage message={validationError} />}
|
||||||
</div>
|
</div>
|
||||||
{/* Footer */}
|
{/* Footer */}
|
||||||
<div className="flex items-center gap-x-2 p-6 pt-5">
|
<div className="flex items-center justify-end gap-x-2 p-6 pt-5">
|
||||||
<div className="flex items-center gap-x-3">
|
<div className="flex items-center gap-x-3">
|
||||||
<div className="flex items-center gap-x-2">
|
<div className="flex items-center gap-x-2">
|
||||||
<Button variant="secondary" onClick={handleResetDefaults}>
|
<Button variant="secondary" onClick={handleResetDefaults}>
|
||||||
|
|
|
||||||
|
|
@ -6817,11 +6817,6 @@
|
||||||
"count": 3
|
"count": 3
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx": {
|
|
||||||
"tailwindcss/enforce-consistent-class-order": {
|
|
||||||
"count": 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/generated-result.tsx": {
|
"app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/generated-result.tsx": {
|
||||||
"style/multiline-ternary": {
|
"style/multiline-ternary": {
|
||||||
"count": 2
|
"count": 2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue