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
52291c64
Unverified
Commit
52291c64
authored
Sep 28, 2023
by
crazywoola
Committed by
GitHub
Sep 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dataset footer styles (#1254)
parent
a31466d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
24 deletions
+20
-24
Container.tsx
web/app/(commonLayout)/datasets/Container.tsx
+20
-24
No files found.
web/app/(commonLayout)/datasets/Container.tsx
View file @
52291c64
'use client'
'use client'
// Libraries
import
{
useRef
,
useState
}
from
'react'
import
{
useRef
,
useState
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
import
useSWR
from
'swr'
import
useSWR
from
'swr'
// Components
import
Datasets
from
'./Datasets'
import
Datasets
from
'./Datasets'
import
DatasetFooter
from
'./DatasetFooter'
import
DatasetFooter
from
'./DatasetFooter'
import
ApiServer
from
'./ApiServer'
import
ApiServer
from
'./ApiServer'
import
Doc
from
'./Doc'
import
Doc
from
'./Doc'
import
TabSlider
from
'@/app/components/base/tab-slider'
import
TabSlider
from
'@/app/components/base/tab-slider'
// Services
import
{
fetchDatasetApiBaseUrl
}
from
'@/service/datasets'
import
{
fetchDatasetApiBaseUrl
}
from
'@/service/datasets'
const
Container
=
()
=>
{
const
Container
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
options
=
[
const
options
=
[
{
{
value
:
'dataset'
,
text
:
t
(
'dataset.datasets'
)
},
value
:
'dataset'
,
{
value
:
'api'
,
text
:
t
(
'dataset.datasetsApi'
)
},
text
:
t
(
'dataset.datasets'
),
},
{
value
:
'api'
,
text
:
t
(
'dataset.datasetsApi'
),
},
]
]
const
[
activeTab
,
setActiveTab
]
=
useState
(
'dataset'
)
const
[
activeTab
,
setActiveTab
]
=
useState
(
'dataset'
)
const
containerRef
=
useRef
<
HTMLDivElement
>
(
null
)
const
containerRef
=
useRef
<
HTMLDivElement
>
(
null
)
const
{
data
}
=
useSWR
(
activeTab
===
'dataset'
?
null
:
'/datasets/api-base-info'
,
fetchDatasetApiBaseUrl
)
const
{
data
}
=
useSWR
(
activeTab
===
'dataset'
?
null
:
'/datasets/api-base-info'
,
fetchDatasetApiBaseUrl
)
...
@@ -34,26 +35,21 @@ const Container = () => {
...
@@ -34,26 +35,21 @@ const Container = () => {
onChange=
{
newActiveTab
=>
setActiveTab
(
newActiveTab
)
}
onChange=
{
newActiveTab
=>
setActiveTab
(
newActiveTab
)
}
options=
{
options
}
options=
{
options
}
/>
/>
{
{
activeTab
===
'api'
&&
data
&&
<
ApiServer
apiBaseUrl=
{
data
.
api_base_url
||
''
}
/>
}
activeTab
===
'api'
&&
(
<
ApiServer
apiBaseUrl=
{
data
?.
api_base_url
||
''
}
/>
)
}
</
div
>
</
div
>
{
activeTab
===
'dataset'
&&
(
{
activeTab
===
'dataset'
<
div
className=
''
>
?
(
<
Datasets
containerRef=
{
containerRef
}
/>
<>
<
Datasets
containerRef=
{
containerRef
}
/>
<
DatasetFooter
/>
<
DatasetFooter
/>
</
div
>
</>
)
}
{
activeTab
===
'api'
&&
(
<
Doc
apiBaseUrl=
{
data
?.
api_base_url
||
''
}
/>
)
)
}
:
(
activeTab
===
'api'
&&
data
&&
<
Doc
apiBaseUrl=
{
data
.
api_base_url
||
''
}
/>
)
}
</
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