fix MCP server card in app info

pull/22091/head
JzoNg 11 months ago
parent 53951a3a8d
commit f6eb37f488

@ -36,6 +36,8 @@ const CardView: FC<ICardViewProps> = ({ appId, isInPanel, className }) => {
const setAppDetail = useAppStore(state => state.setAppDetail)
const systemFeatures = useContextSelector(AppContext, state => state.systemFeatures)
const showMCPCard = isInPanel && (appDetail?.mode === 'advanced-chat' || appDetail?.mode === 'workflow')
const updateAppDetail = async () => {
try {
const res = await fetchAppDetail({ url: '/apps', id: appId })
@ -138,7 +140,7 @@ const CardView: FC<ICardViewProps> = ({ appId, isInPanel, className }) => {
isInPanel={isInPanel}
onChangeStatus={onChangeApiStatus}
/>
{isInPanel && (
{showMCPCard && (
<MCPServiceCard
appInfo={appDetail}
/>

@ -70,8 +70,10 @@ function MCPServiceCard({
const onChangeStatus = async (state: boolean) => {
setActivated(state)
if (state) {
if (!serverPublished)
if (!serverPublished) {
setShowMCPServerModal(true)
return
}
await updateMCPServer({
appID: appInfo.id,

Loading…
Cancel
Save