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
f53242c0
Unverified
Commit
f53242c0
authored
Aug 21, 2023
by
zxhlyh
Committed by
GitHub
Aug 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat/add document status tooltip (#937)
parent
4b53bb1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
index.tsx
web/app/components/datasets/documents/detail/index.tsx
+1
-1
list.tsx
web/app/components/datasets/documents/list.tsx
+14
-2
No files found.
web/app/components/datasets/documents/detail/index.tsx
View file @
f53242c0
...
...
@@ -127,7 +127,7 @@ const DocumentDetail: FC<Props> = ({ datasetId, documentId }) => {
</
div
>
<
Divider
className=
'!h-4'
type=
'vertical'
/>
<
DocumentTitle
extension=
{
documentDetail
?.
data_source_info
?.
upload_file
?.
extension
}
name=
{
documentDetail
?.
name
}
/>
<
StatusItem
status=
{
documentDetail
?.
display_status
||
'available'
}
scene=
'detail'
/>
<
StatusItem
status=
{
documentDetail
?.
display_status
||
'available'
}
scene=
'detail'
errorMessage=
{
documentDetail
?.
error
||
''
}
/>
{
documentDetail
&&
!
documentDetail
.
archived
&&
(
<
SegmentAdd
importStatus=
{
importStatus
}
...
...
web/app/components/datasets/documents/list.tsx
View file @
f53242c0
...
...
@@ -27,7 +27,8 @@ import NotionIcon from '@/app/components/base/notion-icon'
import
ProgressBar
from
'@/app/components/base/progress-bar'
import
{
DataSourceType
,
type
DocumentDisplayStatus
,
type
SimpleDocumentDetail
}
from
'@/models/datasets'
import
type
{
CommonResponse
}
from
'@/models/common'
import
{
DotsHorizontal
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
FilePlus02
}
from
'@/app/components/base/icons/src/vender/line/files'
import
{
DotsHorizontal
,
HelpCircle
}
from
'@/app/components/base/icons/src/vender/line/general'
export
const
SettingsIcon
:
FC
<
{
className
?:
string
}
>
=
({
className
})
=>
{
return
<
svg
width=
"16"
height=
"16"
viewBox=
"0 0 16 16"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
className=
{
className
??
''
}
>
...
...
@@ -73,7 +74,8 @@ export const StatusItem: FC<{
reverse
?:
boolean
scene
?:
'list'
|
'detail'
textCls
?:
string
}
>
=
({
status
,
reverse
=
false
,
scene
=
'list'
,
textCls
=
''
})
=>
{
errorMessage
?:
string
}
>
=
({
status
,
reverse
=
false
,
scene
=
'list'
,
textCls
=
''
,
errorMessage
})
=>
{
const
DOC_INDEX_STATUS_MAP
=
useIndexStatus
()
const
localStatus
=
status
.
toLowerCase
()
as
keyof
typeof
DOC_INDEX_STATUS_MAP
return
<
div
className=
{
...
...
@@ -83,6 +85,16 @@ export const StatusItem: FC<{
}
>
<
Indicator
color=
{
DOC_INDEX_STATUS_MAP
[
localStatus
]?.
color
as
IndicatorProps
[
'color'
]
}
className=
{
reverse
?
'ml-2'
:
'mr-2'
}
/>
<
span
className=
{
cn
(
'text-gray-700 text-sm'
,
textCls
)
}
>
{
DOC_INDEX_STATUS_MAP
[
localStatus
]?.
text
}
</
span
>
{
errorMessage
&&
(
<
Tooltip
selector=
'dataset-document-detail-item-status'
content=
{
errorMessage
}
>
<
HelpCircle
className=
'ml-1 w-[14px] h-[14px] text-gray-700'
/>
</
Tooltip
>
)
}
</
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