add disable state

This commit is contained in:
JzoNg 2025-05-26 17:26:28 +08:00
parent a448b140e9
commit 1f100ac038

View File

@ -39,7 +39,7 @@ function MCPServiceCard({
const { data: currentWorkflow } = useAppWorkflow(appInfo.id)
const toggleDisabled = !isCurrentWorkspaceEditor
const toggleDisabled = !isCurrentWorkspaceEditor || !currentWorkflow?.graph
const runningStatus = appInfo.enable_site // TODO
const { app_base_url, access_token } = appInfo.site ?? {}
const appMode = (appInfo.mode !== 'completion' && appInfo.mode !== 'workflow') ? 'chat' : appInfo.mode
@ -59,9 +59,11 @@ function MCPServiceCard({
const [showMCPServerModal, setShowMCPServerModal] = useState(false)
if (!currentWorkflow || !currentWorkflow.graph)
if (!currentWorkflow)
return null
// TODO: show disabled state if workflow not published
return (
<>
<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 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>