mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-17 11:35:58 +08:00
add disable state
This commit is contained in:
parent
a448b140e9
commit
1f100ac038
@ -39,7 +39,7 @@ function MCPServiceCard({
|
|||||||
|
|
||||||
const { data: currentWorkflow } = useAppWorkflow(appInfo.id)
|
const { data: currentWorkflow } = useAppWorkflow(appInfo.id)
|
||||||
|
|
||||||
const toggleDisabled = !isCurrentWorkspaceEditor
|
const toggleDisabled = !isCurrentWorkspaceEditor || !currentWorkflow?.graph
|
||||||
const runningStatus = appInfo.enable_site // TODO
|
const runningStatus = appInfo.enable_site // TODO
|
||||||
const { app_base_url, access_token } = appInfo.site ?? {}
|
const { app_base_url, access_token } = appInfo.site ?? {}
|
||||||
const appMode = (appInfo.mode !== 'completion' && appInfo.mode !== 'workflow') ? 'chat' : appInfo.mode
|
const appMode = (appInfo.mode !== 'completion' && appInfo.mode !== 'workflow') ? 'chat' : appInfo.mode
|
||||||
@ -59,9 +59,11 @@ function MCPServiceCard({
|
|||||||
|
|
||||||
const [showMCPServerModal, setShowMCPServerModal] = useState(false)
|
const [showMCPServerModal, setShowMCPServerModal] = useState(false)
|
||||||
|
|
||||||
if (!currentWorkflow || !currentWorkflow.graph)
|
if (!currentWorkflow)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
// TODO: show disabled state if workflow not published
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={cn('w-full max-w-full rounded-xl border-l-[0.5px] border-t border-effects-highlight')}>
|
<div className={cn('w-full max-w-full rounded-xl border-l-[0.5px] border-t border-effects-highlight')}>
|
||||||
@ -133,7 +135,7 @@ function MCPServiceCard({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex items-center gap-1 self-stretch p-3'>
|
<div className='flex items-center gap-1 self-stretch p-3'>
|
||||||
<Button size='small' variant='ghost'>{t('tools.mcp.server.addDescription')}</Button>
|
<Button disabled={toggleDisabled} size='small' variant='ghost'>{t('tools.mcp.server.addDescription')}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user