fix(web): app features bugfix

This commit is contained in:
zhaoying
2026-03-18 19:39:12 +08:00
parent 4d83c074d9
commit 2c318f6e60
3 changed files with 13 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-03 16:29:33 * @Date: 2026-02-03 16:29:33
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-17 14:48:57 * @Last Modified time: 2026-03-18 19:37:15
*/ */
import { useEffect, useState, useRef, forwardRef, useImperativeHandle } from 'react' import { useEffect, useState, useRef, forwardRef, useImperativeHandle } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
@@ -30,7 +30,7 @@ import RadioGroupCard from '@/components/RadioGroupCard'
import { getModelListUrl } from '@/api/models' import { getModelListUrl } from '@/api/models'
import ModelConfigModal from './components/ModelConfigModal' import ModelConfigModal from './components/ModelConfigModal'
import type { Application } from '@/views/ApplicationManagement/types' import type { Application } from '@/views/ApplicationManagement/types'
import FeaturesConfig from './components/FeaturesConfig' // import FeaturesConfig from './components/FeaturesConfig'
const tagColors = ['processing', 'warning', 'default'] const tagColors = ['processing', 'warning', 'default']
const MAX_LENGTH = 5; const MAX_LENGTH = 5;
@@ -187,15 +187,15 @@ const Cluster = forwardRef<ClusterRef, { onFeaturesLoad?: (features: FeaturesCon
model_parameters: values model_parameters: values
}) })
} }
const handleSaveFeaturesConfig = (value: FeaturesConfigForm) => { // const handleSaveFeaturesConfig = (value: FeaturesConfigForm) => {
form.setFieldValue('features', value) // form.setFieldValue('features', value)
} // }
return ( return (
<Row className="rb:h-[calc(100vh-64px)]"> <Row className="rb:h-[calc(100vh-64px)]">
<Col span={12} className="rb:h-full rb:overflow-x-auto rb:border-r rb:border-[#DFE4ED] rb:p-[20px_16px_24px_16px]"> <Col span={12} className="rb:h-full rb:overflow-x-auto rb:border-r rb:border-[#DFE4ED] rb:p-[20px_16px_24px_16px]">
<Flex gap={10} justify="end" align="center" className="rb:mb-5!"> <Flex gap={10} justify="end" align="center" className="rb:mb-5!">
<FeaturesConfig value={values?.features as FeaturesConfigForm} refresh={handleSaveFeaturesConfig} /> {/* <FeaturesConfig value={values?.features as FeaturesConfigForm} refresh={handleSaveFeaturesConfig} /> */}
<Button type="primary" onClick={() => handleSave()}> <Button type="primary" onClick={() => handleSave()}>
{t('common.save')} {t('common.save')}
</Button> </Button>

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-03-05 * @Date: 2026-03-05
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-17 18:10:47 * @Last Modified time: 2026-03-18 19:35:57
*/ */
import { forwardRef, useImperativeHandle, useState } from 'react'; import { forwardRef, useImperativeHandle, useState } from 'react';
import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd'; import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd';
@@ -80,7 +80,7 @@ const FileUploadSettingModal = forwardRef<FileUploadSettingModalRef, FileUploadS
const handleOpen = (values?: FileUpload) => { const handleOpen = (values?: FileUpload) => {
setVisible(true); setVisible(true);
if (values) { if (values) {
const methods = values.allowed_transfer_methods const methods = values.allowed_transfer_methods || ['local_file', 'remote_url']
const transferMethod = Array.isArray(methods) const transferMethod = Array.isArray(methods)
? methods.length === 2 ? 'both' : methods[0] ? methods.length === 2 ? 'both' : methods[0]
: methods : methods

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-06 21:10:56 * @Date: 2026-02-06 21:10:56
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-18 14:34:20 * @Last Modified time: 2026-03-18 19:31:28
*/ */
/** /**
* Workflow Chat Component * Workflow Chat Component
@@ -63,9 +63,12 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
*/ */
const handleOpen = () => { const handleOpen = () => {
setOpen(true) setOpen(true)
if (data?.features) setFeatures(data.features)
} }
useEffect(() => {
if (data?.features && open) setFeatures(data.features)
}, [open, data?.features])
useEffect(() => { useEffect(() => {
if (open && graphRef.current && toolbarRef.current) { if (open && graphRef.current && toolbarRef.current) {
getVariables() getVariables()