Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
067e6b5a
Commit
067e6b5a
authored
Mar 05, 2024
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app detail redirection
parent
6adb9861
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
37 deletions
+11
-37
AppCard.tsx
web/app/(commonLayout)/apps/AppCard.tsx
+1
-8
appForm.tsx
web/app/components/app/create-app-dialog/appForm.tsx
+4
-11
index.tsx
web/app/components/app/create-from-dsl-modal/index.tsx
+3
-9
index.tsx
web/app/components/explore/app-list/index.tsx
+3
-9
No files found.
web/app/(commonLayout)/apps/AppCard.tsx
View file @
067e6b5a
...
...
@@ -122,14 +122,7 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
message
:
t
(
'app.newApp.appCreated'
),
})
localStorage
.
setItem
(
NEED_REFRESH_APP_LIST_KEY
,
'1'
)
if
(
!
isCurrentWorkspaceManager
)
{
push
(
`/app/
${
newApp
.
id
}
/overview`
)
}
else
{
if
(
newApp
.
mode
===
'workflow'
||
newApp
.
mode
===
'advanced-chat'
)
push
(
`/app/
${
newApp
.
id
}
/workflow`
)
push
(
`/app/
${
newApp
.
id
}
/configuration`
)
}
getRedirection
(
isCurrentWorkspaceManager
,
newApp
,
push
)
}
catch
(
e
)
{
notify
({
type
:
'error'
,
message
:
t
(
'app.newApp.appCreateFailed'
)
})
...
...
web/app/components/app/create-app-dialog/appForm.tsx
View file @
067e6b5a
...
...
@@ -19,6 +19,7 @@ import { ChatBot, CuteRobot } from '@/app/components/base/icons/src/vender/line/
import
{
HelpCircle
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
Route
}
from
'@/app/components/base/icons/src/vender/line/mapsAndTravel'
import
TooltipPlus
from
'@/app/components/base/tooltip-plus'
import
{
getRedirection
}
from
'@/utils/app-redirection'
export
type
AppFormProps
=
{
onConfirm
:
()
=>
void
...
...
@@ -32,7 +33,7 @@ const AppForm = ({
onTipChange
,
}:
AppFormProps
)
=>
{
const
{
t
}
=
useTranslation
()
const
router
=
useRouter
()
const
{
push
}
=
useRouter
()
const
{
notify
}
=
useContext
(
ToastContext
)
const
mutateApps
=
useContextSelector
(
AppsContext
,
state
=>
state
.
mutateApps
)
...
...
@@ -73,21 +74,13 @@ const AppForm = ({
onConfirm
()
onHide
()
mutateApps
()
if
(
!
isCurrentWorkspaceManager
)
{
router
.
push
(
`/app/
${
app
.
id
}
/overview`
)
}
else
{
if
(
app
.
mode
===
'workflow'
||
app
.
mode
===
'advanced-chat'
)
router
.
push
(
`/app/
${
app
.
id
}
/workflow`
)
else
router
.
push
(
`/app/
${
app
.
id
}
/configuration`
)
}
getRedirection
(
isCurrentWorkspaceManager
,
app
,
push
)
}
catch
(
e
)
{
notify
({
type
:
'error'
,
message
:
t
(
'app.newApp.appCreateFailed'
)
})
}
isCreatingRef
.
current
=
false
},
[
name
,
notify
,
t
,
appMode
,
emoji
.
icon
,
emoji
.
icon_background
,
description
,
onConfirm
,
onHide
,
mutateApps
,
router
,
isCurrentWorkspaceManager
])
},
[
name
,
notify
,
t
,
appMode
,
emoji
.
icon
,
emoji
.
icon_background
,
description
,
onConfirm
,
onHide
,
mutateApps
,
push
,
isCurrentWorkspaceManager
])
return
(
<
div
className=
'overflow-y-auto'
>
...
...
web/app/components/app/create-from-dsl-modal/index.tsx
View file @
067e6b5a
...
...
@@ -15,6 +15,7 @@ import { useProviderContext } from '@/context/provider-context'
import
AppsFull
from
'@/app/components/billing/apps-full-in-dialog'
import
{
XClose
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
NEED_REFRESH_APP_LIST_KEY
}
from
'@/config'
import
{
getRedirection
}
from
'@/utils/app-redirection'
type
CreateFromDSLModalProps
=
{
show
:
boolean
...
...
@@ -23,7 +24,7 @@ type CreateFromDSLModalProps = {
}
const
CreateFromDSLModal
=
({
show
,
onSuccess
,
onClose
}:
CreateFromDSLModalProps
)
=>
{
const
router
=
useRouter
()
const
{
push
}
=
useRouter
()
const
{
t
}
=
useTranslation
()
const
{
notify
}
=
useContext
(
ToastContext
)
const
[
currentFile
,
setDSLFile
]
=
useState
<
File
>
()
...
...
@@ -67,14 +68,7 @@ const CreateFromDSLModal = ({ show, onSuccess, onClose }: CreateFromDSLModalProp
onClose
()
notify
({
type
:
'success'
,
message
:
t
(
'app.newApp.appCreated'
)
})
localStorage
.
setItem
(
NEED_REFRESH_APP_LIST_KEY
,
'1'
)
if
(
!
isCurrentWorkspaceManager
)
{
router
.
push
(
`/app/
${
app
.
id
}
/overview`
)
}
else
{
if
(
app
.
mode
===
'workflow'
||
app
.
mode
===
'advanced-chat'
)
router
.
push
(
`/app/
${
app
.
id
}
/workflow`
)
router
.
push
(
`/app/
${
app
.
id
}
/configuration`
)
}
getRedirection
(
isCurrentWorkspaceManager
,
app
,
push
)
}
catch
(
e
)
{
notify
({
type
:
'error'
,
message
:
t
(
'app.newApp.appCreateFailed'
)
})
...
...
web/app/components/explore/app-list/index.tsx
View file @
067e6b5a
...
...
@@ -20,6 +20,7 @@ import type { CreateAppModalProps } from '@/app/components/explore/create-app-mo
import
Loading
from
'@/app/components/base/loading'
import
{
NEED_REFRESH_APP_LIST_KEY
}
from
'@/config'
import
{
useAppContext
}
from
'@/context/app-context'
import
{
getRedirection
}
from
'@/utils/app-redirection'
type
AppsProps
=
{
pageType
?:
PageType
...
...
@@ -35,7 +36,7 @@ const Apps = ({
}:
AppsProps
)
=>
{
const
{
t
}
=
useTranslation
()
const
{
isCurrentWorkspaceManager
}
=
useAppContext
()
const
router
=
useRouter
()
const
{
push
}
=
useRouter
()
const
{
hasEditPermission
}
=
useContext
(
ExploreContext
)
const
allCategoriesEn
=
t
(
'explore.apps.allCategories'
,
{
lng
:
'en'
})
...
...
@@ -89,14 +90,7 @@ const Apps = ({
message
:
t
(
'app.newApp.appCreated'
),
})
localStorage
.
setItem
(
NEED_REFRESH_APP_LIST_KEY
,
'1'
)
if
(
!
isCurrentWorkspaceManager
)
{
router
.
push
(
`/app/
${
app
.
id
}
/overview`
)
}
else
{
if
(
app
.
mode
===
'workflow'
||
app
.
mode
===
'advanced-chat'
)
router
.
push
(
`/app/
${
app
.
id
}
/workflow`
)
router
.
push
(
`/app/
${
app
.
id
}
/configuration`
)
}
getRedirection
(
isCurrentWorkspaceManager
,
app
,
push
)
}
catch
(
e
)
{
Toast
.
notify
({
type
:
'error'
,
message
:
t
(
'app.newApp.appCreateFailed'
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment