mirror of https://github.com/langgenius/dify.git
add route for workflow app
This commit is contained in:
parent
ac675c4443
commit
58922ba40b
|
|
@ -0,0 +1,13 @@
|
|||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
|
||||
import type { IMainProps } from '@/app/components/share/text-generation'
|
||||
import Main from '@/app/components/share/text-generation'
|
||||
|
||||
const TextGeneration: FC<IMainProps> = () => {
|
||||
return (
|
||||
<Main isWorkflow />
|
||||
)
|
||||
}
|
||||
|
||||
export default React.memo(TextGeneration)
|
||||
|
|
@ -68,9 +68,9 @@ const Logs: FC<ILogsProps> = ({ appDetail }) => {
|
|||
}
|
||||
|
||||
const getWebAppType = (appType: AppMode) => {
|
||||
if (appType === 'completion' || appType === 'workflow')
|
||||
return 'completion'
|
||||
return 'chat'
|
||||
if (appType !== 'completion' && appType !== 'workflow')
|
||||
return 'chat'
|
||||
return appType
|
||||
}
|
||||
|
||||
// Get the app type first
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ function AppCard({
|
|||
: t('appOverview.overview.apiInfo.title')
|
||||
const runningStatus = isApp ? appInfo.enable_site : appInfo.enable_api
|
||||
const { app_base_url, access_token } = appInfo.site ?? {}
|
||||
const appMode = (appInfo.mode === 'completion' || appInfo.mode === 'workflow') ? 'completion' : 'chat'
|
||||
const appMode = (appInfo.mode !== 'completion' && appInfo.mode !== 'workflow') ? 'chat' : appInfo.mode
|
||||
const appUrl = `${app_base_url}/${appMode}/${access_token}`
|
||||
const apiUrl = appInfo?.api_base_url
|
||||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ const Logs: FC<ILogsProps> = ({ appDetail }) => {
|
|||
}
|
||||
|
||||
const getWebAppType = (appType: AppMode) => {
|
||||
if (appType === 'completion' || appType === 'workflow')
|
||||
return 'completion'
|
||||
return 'chat'
|
||||
if (appType !== 'completion' && appType !== 'workflow')
|
||||
return 'chat'
|
||||
return appType
|
||||
}
|
||||
|
||||
const { data: workflowLogs, mutate } = useSWR({
|
||||
|
|
|
|||
|
|
@ -55,11 +55,13 @@ type Task = {
|
|||
export type IMainProps = {
|
||||
isInstalledApp?: boolean
|
||||
installedAppInfo?: InstalledApp
|
||||
isWorkflow?: boolean
|
||||
}
|
||||
|
||||
const TextGeneration: FC<IMainProps> = ({
|
||||
isInstalledApp = false,
|
||||
installedAppInfo,
|
||||
isWorkflow = false,
|
||||
}) => {
|
||||
const { notify } = Toast
|
||||
|
||||
|
|
@ -346,6 +348,7 @@ const TextGeneration: FC<IMainProps> = ({
|
|||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
console.log('isWorkflow', isWorkflow)
|
||||
const [appData, appParams]: any = await fetchInitData()
|
||||
const { app_id: appId, site: siteInfo, can_replace_logo } = appData
|
||||
setAppId(appId)
|
||||
|
|
|
|||
Loading…
Reference in New Issue