mirror of
https://github.com/langgenius/dify.git
synced 2026-04-20 05:56:30 +08:00
add route for workflow app
This commit is contained in:
parent
ac675c4443
commit
58922ba40b
13
web/app/(shareLayout)/workflow/[token]/page.tsx
Normal file
13
web/app/(shareLayout)/workflow/[token]/page.tsx
Normal file
@ -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) => {
|
const getWebAppType = (appType: AppMode) => {
|
||||||
if (appType === 'completion' || appType === 'workflow')
|
if (appType !== 'completion' && appType !== 'workflow')
|
||||||
return 'completion'
|
return 'chat'
|
||||||
return 'chat'
|
return appType
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the app type first
|
// Get the app type first
|
||||||
|
|||||||
@ -83,7 +83,7 @@ function AppCard({
|
|||||||
: t('appOverview.overview.apiInfo.title')
|
: t('appOverview.overview.apiInfo.title')
|
||||||
const runningStatus = isApp ? appInfo.enable_site : appInfo.enable_api
|
const runningStatus = isApp ? appInfo.enable_site : appInfo.enable_api
|
||||||
const { app_base_url, access_token } = appInfo.site ?? {}
|
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 appUrl = `${app_base_url}/${appMode}/${access_token}`
|
||||||
const apiUrl = appInfo?.api_base_url
|
const apiUrl = appInfo?.api_base_url
|
||||||
|
|
||||||
|
|||||||
@ -60,9 +60,9 @@ const Logs: FC<ILogsProps> = ({ appDetail }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getWebAppType = (appType: AppMode) => {
|
const getWebAppType = (appType: AppMode) => {
|
||||||
if (appType === 'completion' || appType === 'workflow')
|
if (appType !== 'completion' && appType !== 'workflow')
|
||||||
return 'completion'
|
return 'chat'
|
||||||
return 'chat'
|
return appType
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data: workflowLogs, mutate } = useSWR({
|
const { data: workflowLogs, mutate } = useSWR({
|
||||||
|
|||||||
@ -55,11 +55,13 @@ type Task = {
|
|||||||
export type IMainProps = {
|
export type IMainProps = {
|
||||||
isInstalledApp?: boolean
|
isInstalledApp?: boolean
|
||||||
installedAppInfo?: InstalledApp
|
installedAppInfo?: InstalledApp
|
||||||
|
isWorkflow?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const TextGeneration: FC<IMainProps> = ({
|
const TextGeneration: FC<IMainProps> = ({
|
||||||
isInstalledApp = false,
|
isInstalledApp = false,
|
||||||
installedAppInfo,
|
installedAppInfo,
|
||||||
|
isWorkflow = false,
|
||||||
}) => {
|
}) => {
|
||||||
const { notify } = Toast
|
const { notify } = Toast
|
||||||
|
|
||||||
@ -346,6 +348,7 @@ const TextGeneration: FC<IMainProps> = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
console.log('isWorkflow', isWorkflow)
|
||||||
const [appData, appParams]: any = await fetchInitData()
|
const [appData, appParams]: any = await fetchInitData()
|
||||||
const { app_id: appId, site: siteInfo, can_replace_logo } = appData
|
const { app_id: appId, site: siteInfo, can_replace_logo } = appData
|
||||||
setAppId(appId)
|
setAppId(appId)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user