mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 13:15:58 +08:00
latest params
This commit is contained in:
parent
ccea3212a2
commit
a448b140e9
@ -19,7 +19,7 @@ const MCPServerParamItem = ({
|
||||
<div className='flex h-6 items-center gap-2'>
|
||||
<div className='system-xs-medium text-text-secondary'>{data.label}</div>
|
||||
<div className='system-xs-medium text-text-quaternary'>·</div>
|
||||
<div className='system-xs-medium text-text-secondary'>{data.name}</div>
|
||||
<div className='system-xs-medium text-text-secondary'>{data.variable}</div>
|
||||
<div className='system-xs-medium text-text-tertiary'>{data.type}</div>
|
||||
</div>
|
||||
<Textarea
|
||||
|
@ -20,6 +20,7 @@ import { useAppContext } from '@/context/app-context'
|
||||
import type { AppSSO } from '@/types/app'
|
||||
import Indicator from '@/app/components/header/indicator'
|
||||
import MCPServerModal from '@/app/components/tools/mcp/mcp-server-modal'
|
||||
import { useAppWorkflow } from '@/service/use-workflow'
|
||||
import cn from '@/utils/classnames'
|
||||
|
||||
export type IAppCardProps = {
|
||||
@ -36,6 +37,8 @@ function MCPServiceCard({
|
||||
const [genLoading, setGenLoading] = useState(false)
|
||||
const [showConfirmDelete, setShowConfirmDelete] = useState(false)
|
||||
|
||||
const { data: currentWorkflow } = useAppWorkflow(appInfo.id)
|
||||
|
||||
const toggleDisabled = !isCurrentWorkspaceEditor
|
||||
const runningStatus = appInfo.enable_site // TODO
|
||||
const { app_base_url, access_token } = appInfo.site ?? {}
|
||||
@ -56,6 +59,9 @@ function MCPServiceCard({
|
||||
|
||||
const [showMCPServerModal, setShowMCPServerModal] = useState(false)
|
||||
|
||||
if (!currentWorkflow || !currentWorkflow.graph)
|
||||
return null
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={cn('w-full max-w-full rounded-xl border-l-[0.5px] border-t border-effects-highlight')}>
|
||||
|
@ -24,7 +24,7 @@ import {
|
||||
} from '@/app/components/workflow/types'
|
||||
import type { StartNodeType } from '@/app/components/workflow/nodes/start/types'
|
||||
import { useToastContext } from '@/app/components/base/toast'
|
||||
import { usePublishWorkflow, useResetWorkflowVersionHistory } from '@/service/use-workflow'
|
||||
import { useInvalidateAppWorkflow, usePublishWorkflow, useResetWorkflowVersionHistory } from '@/service/use-workflow'
|
||||
import type { PublishWorkflowParams } from '@/types/workflow'
|
||||
import { fetchAppDetail, fetchAppSSO } from '@/service/apps'
|
||||
import { useStore as useAppStore } from '@/app/components/app/store'
|
||||
@ -98,6 +98,7 @@ const FeaturesTrigger = () => {
|
||||
}
|
||||
}, [appID, setAppDetail, systemFeatures.enable_web_sso_switch_component])
|
||||
const { mutateAsync: publishWorkflow } = usePublishWorkflow(appID!)
|
||||
const updatePublishedWorkflow = useInvalidateAppWorkflow()
|
||||
const onPublish = useCallback(async (params?: PublishWorkflowParams) => {
|
||||
if (await handleCheckBeforePublish()) {
|
||||
const res = await publishWorkflow({
|
||||
@ -107,6 +108,7 @@ const FeaturesTrigger = () => {
|
||||
|
||||
if (res) {
|
||||
notify({ type: 'success', message: t('common.api.actionSuccess') })
|
||||
updatePublishedWorkflow(appID!)
|
||||
updateAppDetail()
|
||||
workflowStore.getState().setPublishedAt(res.created_at)
|
||||
resetWorkflowVersionHistory()
|
||||
@ -115,7 +117,7 @@ const FeaturesTrigger = () => {
|
||||
else {
|
||||
throw new Error('Checklist failed')
|
||||
}
|
||||
}, [handleCheckBeforePublish, notify, t, workflowStore, publishWorkflow, resetWorkflowVersionHistory, updateAppDetail])
|
||||
}, [handleCheckBeforePublish, publishWorkflow, notify, t, updatePublishedWorkflow, appID, updateAppDetail, workflowStore, resetWorkflowVersionHistory])
|
||||
|
||||
const onPublisherToggle = useCallback((state: boolean) => {
|
||||
if (state)
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { del, get, patch, post } from './base'
|
||||
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query'
|
||||
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import type {
|
||||
FetchWorkflowDraftPageParams,
|
||||
FetchWorkflowDraftPageResponse,
|
||||
@ -21,6 +21,16 @@ export const useAppWorkflow = (appID: string) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const useInvalidateAppWorkflow = () => {
|
||||
const queryClient = useQueryClient()
|
||||
return (appID: string) => {
|
||||
queryClient.invalidateQueries(
|
||||
{
|
||||
queryKey: [NAME_SPACE, 'publish', appID],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const useWorkflowConfig = (appId: string, onSuccess: (v: WorkflowConfigResponse) => void) => {
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'config', appId],
|
||||
|
Loading…
x
Reference in New Issue
Block a user