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
6f33163f
Commit
6f33163f
authored
Mar 13, 2024
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix app siderbar hook
parent
93101b4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
page.tsx
...ayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx
+2
-4
layout.tsx
...p/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx
+3
-3
index.tsx
web/app/components/develop/index.tsx
+14
-7
No files found.
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx
View file @
6f33163f
...
@@ -6,11 +6,9 @@ export type IProps = {
...
@@ -6,11 +6,9 @@ export type IProps = {
params
:
{
appId
:
string
}
params
:
{
appId
:
string
}
}
}
const
Logs
=
async
({
const
Logs
=
async
()
=>
{
params
:
{
appId
},
}:
IProps
)
=>
{
return
(
return
(
<
Main
pageType=
{
PageType
.
annotation
}
appId=
{
appId
}
/>
<
Main
pageType=
{
PageType
.
annotation
}
/>
)
)
}
}
...
...
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx
View file @
6f33163f
...
@@ -80,10 +80,10 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
...
@@ -80,10 +80,10 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
const
localeMode
=
localStorage
.
getItem
(
'app-detail-collapse-or-expand'
)
||
'expand'
const
localeMode
=
localStorage
.
getItem
(
'app-detail-collapse-or-expand'
)
||
'expand'
const
mode
=
isMobile
?
'collapse'
:
'expand'
const
mode
=
isMobile
?
'collapse'
:
'expand'
setAppSiderbarExpand
(
isMobile
?
mode
:
localeMode
)
setAppSiderbarExpand
(
isMobile
?
mode
:
localeMode
)
if
(
appDetail
.
mode
===
'advanced-chat'
||
appDetail
.
mode
===
'workflow'
)
if
(
(
appDetail
.
mode
===
'advanced-chat'
||
appDetail
.
mode
===
'workflow'
)
&&
(
pathname
).
endsWith
(
'workflow'
)
)
setAppSiderbarExpand
(
'collapse'
)
setAppSiderbarExpand
(
'collapse'
)
}
}
},
[
appDetail
,
isMobile
,
setAppSiderbarExpand
])
},
[
appDetail
,
isMobile
])
useEffect
(()
=>
{
useEffect
(()
=>
{
setAppDetail
()
setAppDetail
()
...
@@ -100,7 +100,7 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
...
@@ -100,7 +100,7 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
setNavigation
(
getNavigations
(
appId
,
isCurrentWorkspaceManager
,
res
.
mode
))
setNavigation
(
getNavigations
(
appId
,
isCurrentWorkspaceManager
,
res
.
mode
))
}
}
})
})
},
[
appId
,
getNavigations
,
isCurrentWorkspaceManager
,
pathname
,
router
,
setAppDetail
])
},
[
appId
,
isCurrentWorkspaceManager
])
if
(
!
appDetail
)
{
if
(
!
appDetail
)
{
return
(
return
(
...
...
web/app/components/develop/index.tsx
View file @
6f33163f
'use client'
'use client'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
import
useSWR
from
'swr'
import
s
from
'./secret-key/style.module.css'
import
s
from
'./secret-key/style.module.css'
import
Doc
from
'@/app/components/develop/doc'
import
Doc
from
'@/app/components/develop/doc'
import
Loading
from
'@/app/components/base/loading'
import
InputCopy
from
'@/app/components/develop/secret-key/input-copy'
import
InputCopy
from
'@/app/components/develop/secret-key/input-copy'
import
SecretKeyButton
from
'@/app/components/develop/secret-key/secret-key-button'
import
SecretKeyButton
from
'@/app/components/develop/secret-key/secret-key-button'
import
{
fetchAppDetail
}
from
'@/service/apps
'
import
{
useStore
as
useAppStore
}
from
'@/app/components/app/store
'
type
IDevelopMainProps
=
{
type
IDevelopMainProps
=
{
appId
:
string
appId
:
string
}
}
const
DevelopMain
=
({
appId
}:
IDevelopMainProps
)
=>
{
const
DevelopMain
=
({
appId
}:
IDevelopMainProps
)
=>
{
const
commonParams
=
{
url
:
'/apps'
,
id
:
appId
}
const
{
appDetail
}
=
useAppStore
()
const
{
data
:
appDetail
}
=
useSWR
(
commonParams
,
fetchAppDetail
)
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
if
(
!
appDetail
)
{
return
(
<
div
className=
'flex h-full items-center justify-center bg-white'
>
<
Loading
/>
</
div
>
)
}
return
(
return
(
<
div
className=
'relative flex flex-col h-full overflow-hidden'
>
<
div
className=
'relative flex flex-col h-full overflow-hidden'
>
<
div
className=
'flex items-center justify-between flex-shrink-0 px-6 border-b border-solid py-2 border-b-gray-100'
>
<
div
className=
'flex items-center justify-between flex-shrink-0 px-6 border-b border-solid py-2 border-b-gray-100'
>
<
div
className=
'text-lg font-medium text-gray-900'
></
div
>
<
div
className=
'text-lg font-medium text-gray-900'
></
div
>
<
div
className=
'flex items-center flex-wrap gap-y-1'
>
<
div
className=
'flex items-center flex-wrap gap-y-1'
>
<
InputCopy
className=
'flex-shrink-0 mr-1 w-52 sm:w-80'
value=
{
appDetail
?
.
api_base_url
}
>
<
InputCopy
className=
'flex-shrink-0 mr-1 w-52 sm:w-80'
value=
{
appDetail
.
api_base_url
}
>
<
div
className=
{
`ml-2 border border-gray-200 border-solid flex-shrink-0 px-2 py-0.5 rounded-[6px] text-gray-500 text-[0.625rem] ${s.customApi}`
}
>
<
div
className=
{
`ml-2 border border-gray-200 border-solid flex-shrink-0 px-2 py-0.5 rounded-[6px] text-gray-500 text-[0.625rem] ${s.customApi}`
}
>
{
t
(
'appApi.apiServer'
)
}
{
t
(
'appApi.apiServer'
)
}
</
div
>
</
div
>
</
InputCopy
>
</
InputCopy
>
<
div
className=
{
`flex items-center h-9 px-3 rounded-lg
<
div
className=
{
`flex items-center h-9 px-3 rounded-lg
text-[13px] font-normal mr-2 ${appDetail
?
.enable_api ? 'text-green-500 bg-green-50' : 'text-yellow-500 bg-yellow-50'}`
}
>
text-[13px] font-normal mr-2 ${appDetail.enable_api ? 'text-green-500 bg-green-50' : 'text-yellow-500 bg-yellow-50'}`
}
>
<
div
className=
'mr-1'
>
{
t
(
'appApi.status'
)
}
</
div
>
<
div
className=
'mr-1'
>
{
t
(
'appApi.status'
)
}
</
div
>
<
div
className=
'font-semibold'
>
{
appDetail
?
.
enable_api
?
`${t('appApi.ok')}`
:
`${t('appApi.disabled')}`
}
</
div
>
<
div
className=
'font-semibold'
>
{
appDetail
.
enable_api
?
`${t('appApi.ok')}`
:
`${t('appApi.disabled')}`
}
</
div
>
</
div
>
</
div
>
<
SecretKeyButton
className=
'flex-shrink-0'
appId=
{
appId
}
/>
<
SecretKeyButton
className=
'flex-shrink-0'
appId=
{
appId
}
/>
</
div
>
</
div
>
...
...
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