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
b5e0b6a3
Commit
b5e0b6a3
authored
Jul 05, 2023
by
Joel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' into feat/embedding
parents
5a48f566
2b945451
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
dataset_service.py
api/services/dataset_service.py
+1
-0
app-context.tsx
web/context/app-context.tsx
+13
-11
No files found.
api/services/dataset_service.py
View file @
b5e0b6a3
...
...
@@ -35,6 +35,7 @@ class DatasetService:
permission_filter
=
Dataset
.
permission
==
'all_team_members'
datasets
=
Dataset
.
query
.
filter
(
db
.
and_
(
Dataset
.
provider
==
provider
,
Dataset
.
tenant_id
==
tenant_id
,
permission_filter
))
\
.
order_by
(
Dataset
.
created_at
.
desc
())
\
.
paginate
(
page
=
page
,
per_page
=
per_page
,
...
...
web/context/app-context.tsx
View file @
b5e0b6a3
...
...
@@ -20,6 +20,16 @@ export type AppContextValue = {
useSelector
:
typeof
useSelector
}
const
initialLangeniusVersionInfo
=
{
current_env
:
''
,
current_version
:
''
,
latest_version
:
''
,
release_date
:
''
,
release_notes
:
''
,
version
:
''
,
can_auto_update
:
false
,
}
const
AppContext
=
createContext
<
AppContextValue
>
({
apps
:
[],
mutateApps
:
()
=>
{
},
...
...
@@ -30,15 +40,7 @@ const AppContext = createContext<AppContextValue>({
},
mutateUserProfile
:
()
=>
{
},
pageContainerRef
:
createRef
(),
langeniusVersionInfo
:
{
current_env
:
''
,
current_version
:
''
,
latest_version
:
''
,
release_date
:
''
,
release_notes
:
''
,
version
:
''
,
can_auto_update
:
false
,
},
langeniusVersionInfo
:
initialLangeniusVersionInfo
,
useSelector
,
})
...
...
@@ -57,7 +59,7 @@ export const AppContextProvider: FC<AppContextProviderProps> = ({ children }) =>
const
{
data
:
userProfileResponse
,
mutate
:
mutateUserProfile
}
=
useSWR
({
url
:
'/account/profile'
,
params
:
{}
},
fetchUserProfile
)
const
[
userProfile
,
setUserProfile
]
=
useState
<
UserProfileResponse
>
()
const
[
langeniusVersionInfo
,
setLangeniusVersionInfo
]
=
useState
<
LangGeniusVersionResponse
>
()
const
[
langeniusVersionInfo
,
setLangeniusVersionInfo
]
=
useState
<
LangGeniusVersionResponse
>
(
initialLangeniusVersionInfo
)
const
updateUserProfileAndVersion
=
async
()
=>
{
if
(
userProfileResponse
&&
!
userProfileResponse
.
bodyUsed
)
{
const
result
=
await
userProfileResponse
.
json
()
...
...
@@ -72,7 +74,7 @@ export const AppContextProvider: FC<AppContextProviderProps> = ({ children }) =>
updateUserProfileAndVersion
()
},
[
userProfileResponse
])
if
(
!
appList
||
!
userProfile
||
!
langeniusVersionInfo
)
if
(
!
appList
||
!
userProfile
)
return
<
Loading
type=
'app'
/>
return
(
...
...
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