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
b1a0f150
Commit
b1a0f150
authored
Jun 14, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dataset notion icon
parent
0c51b423
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
layout.tsx
...ut)/datasets/(datasetDetailLayout)/[datasetId]/layout.tsx
+2
-1
basic.tsx
web/app/components/app-sidebar/basic.tsx
+15
-1
index.tsx
web/app/components/app-sidebar/index.tsx
+1
-2
No files found.
web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout.tsx
View file @
b1a0f150
...
@@ -28,6 +28,7 @@ import Indicator from '@/app/components/header/indicator'
...
@@ -28,6 +28,7 @@ import Indicator from '@/app/components/header/indicator'
import
AppIcon
from
'@/app/components/base/app-icon'
import
AppIcon
from
'@/app/components/base/app-icon'
import
Loading
from
'@/app/components/base/loading'
import
Loading
from
'@/app/components/base/loading'
import
DatasetDetailContext
from
'@/context/dataset-detail'
import
DatasetDetailContext
from
'@/context/dataset-detail'
import
{
DataSourceType
}
from
'@/models/datasets'
// import { fetchDatasetDetail } from '@/service/datasets'
// import { fetchDatasetDetail } from '@/service/datasets'
...
@@ -162,7 +163,7 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
...
@@ -162,7 +163,7 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
desc=
{
datasetRes
?.
description
||
'--'
}
desc=
{
datasetRes
?.
description
||
'--'
}
navigation=
{
navigation
}
navigation=
{
navigation
}
extraInfo=
{
<
ExtraInfo
/>
}
extraInfo=
{
<
ExtraInfo
/>
}
iconType=
'dataset'
iconType=
{
datasetRes
?.
data_source_type
===
DataSourceType
.
NOTION
?
'notion'
:
'dataset'
}
/>
}
/>
}
<
DatasetDetailContext
.
Provider
value=
{
{
<
DatasetDetailContext
.
Provider
value=
{
{
indexingTechnique
:
datasetRes
?.
indexing_technique
,
indexingTechnique
:
datasetRes
?.
indexing_technique
,
...
...
web/app/components/app-sidebar/basic.tsx
View file @
b1a0f150
...
@@ -14,7 +14,7 @@ export function randomString(length: number) {
...
@@ -14,7 +14,7 @@ export function randomString(length: number) {
}
}
export
type
IAppBasicProps
=
{
export
type
IAppBasicProps
=
{
iconType
?:
'app'
|
'api'
|
'dataset'
|
'webapp'
iconType
?:
'app'
|
'api'
|
'dataset'
|
'webapp'
|
'notion'
icon
?:
string
icon
?:
string
icon_background
?:
string
icon_background
?:
string
name
:
string
name
:
string
...
@@ -40,11 +40,25 @@ const WebappSvg = <svg width="16" height="18" viewBox="0 0 16 18" fill="none" xm
...
@@ -40,11 +40,25 @@ const WebappSvg = <svg width="16" height="18" viewBox="0 0 16 18" fill="none" xm
<
path
d=
"M14.375 5.45825L7.99998 8.99992M7.99998 8.99992L1.62498 5.45825M7.99998 8.99992L8 16.1249M14.75 12.0439V5.95603C14.75 5.69904 14.75 5.57055 14.7121 5.45595C14.6786 5.35457 14.6239 5.26151 14.5515 5.18299C14.4697 5.09424 14.3574 5.03184 14.1328 4.90704L8.58277 1.8237C8.37007 1.70553 8.26372 1.64645 8.15109 1.62329C8.05141 1.60278 7.9486 1.60278 7.84891 1.62329C7.73628 1.64645 7.62993 1.70553 7.41723 1.8237L1.86723 4.90704C1.64259 5.03184 1.53026 5.09424 1.44847 5.18299C1.37612 5.26151 1.32136 5.35457 1.28786 5.45595C1.25 5.57055 1.25 5.69904 1.25 5.95603V12.0439C1.25 12.3008 1.25 12.4293 1.28786 12.5439C1.32136 12.6453 1.37612 12.7384 1.44847 12.8169C1.53026 12.9056 1.64259 12.968 1.86723 13.0928L7.41723 16.1762C7.62993 16.2943 7.73628 16.3534 7.84891 16.3766C7.9486 16.3971 8.05141 16.3971 8.15109 16.3766C8.26372 16.3534 8.37007 16.2943 8.58277 16.1762L14.1328 13.0928C14.3574 12.968 14.4697 12.9056 14.5515 12.8169C14.6239 12.7384 14.6786 12.6453 14.7121 12.5439C14.75 12.4293 14.75 12.3008 14.75 12.0439Z"
stroke=
"#155EEF"
strokeWidth=
"1.5"
strokeLinecap=
"round"
strokeLinejoin=
"round"
/>
<
path
d=
"M14.375 5.45825L7.99998 8.99992M7.99998 8.99992L1.62498 5.45825M7.99998 8.99992L8 16.1249M14.75 12.0439V5.95603C14.75 5.69904 14.75 5.57055 14.7121 5.45595C14.6786 5.35457 14.6239 5.26151 14.5515 5.18299C14.4697 5.09424 14.3574 5.03184 14.1328 4.90704L8.58277 1.8237C8.37007 1.70553 8.26372 1.64645 8.15109 1.62329C8.05141 1.60278 7.9486 1.60278 7.84891 1.62329C7.73628 1.64645 7.62993 1.70553 7.41723 1.8237L1.86723 4.90704C1.64259 5.03184 1.53026 5.09424 1.44847 5.18299C1.37612 5.26151 1.32136 5.35457 1.28786 5.45595C1.25 5.57055 1.25 5.69904 1.25 5.95603V12.0439C1.25 12.3008 1.25 12.4293 1.28786 12.5439C1.32136 12.6453 1.37612 12.7384 1.44847 12.8169C1.53026 12.9056 1.64259 12.968 1.86723 13.0928L7.41723 16.1762C7.62993 16.2943 7.73628 16.3534 7.84891 16.3766C7.9486 16.3971 8.05141 16.3971 8.15109 16.3766C8.26372 16.3534 8.37007 16.2943 8.58277 16.1762L14.1328 13.0928C14.3574 12.968 14.4697 12.9056 14.5515 12.8169C14.6239 12.7384 14.6786 12.6453 14.7121 12.5439C14.75 12.4293 14.75 12.3008 14.75 12.0439Z"
stroke=
"#155EEF"
strokeWidth=
"1.5"
strokeLinecap=
"round"
strokeLinejoin=
"round"
/>
</
svg
>
</
svg
>
const
NotionSvg
=
<
svg
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
g
clip
-
path=
"url(#clip0_6294_13848)"
>
<
path
fill
-
rule=
"evenodd"
clip
-
rule=
"evenodd"
d=
"M4.287 21.9133L1.70748 18.6999C1.08685 17.9267 0.75 16.976 0.75 15.9974V4.36124C0.75 2.89548 1.92269 1.67923 3.43553 1.57594L15.3991 0.759137C16.2682 0.699797 17.1321 0.930818 17.8461 1.41353L22.0494 4.25543C22.8018 4.76414 23.25 5.59574 23.25 6.48319V19.7124C23.25 21.1468 22.0969 22.3345 20.6157 22.4256L7.3375 23.243C6.1555 23.3158 5.01299 22.8178 4.287 21.9133Z"
fill=
"white"
/>
<
path
d=
"M8.43607 10.1842V10.0318C8.43607 9.64564 8.74535 9.32537 9.14397 9.29876L12.0475 9.10491L16.0628 15.0178V9.82823L15.0293 9.69046V9.6181C15.0293 9.22739 15.3456 8.90501 15.7493 8.88433L18.3912 8.74899V9.12918C18.3912 9.30765 18.2585 9.46031 18.0766 9.49108L17.4408 9.59861V18.0029L16.6429 18.2773C15.9764 18.5065 15.2343 18.2611 14.8527 17.6853L10.9545 11.803V17.4173L12.1544 17.647L12.1377 17.7583C12.0853 18.1069 11.7843 18.3705 11.4202 18.3867L8.43607 18.5195C8.39662 18.1447 8.67758 17.8093 9.06518 17.7686L9.45771 17.7273V10.2416L8.43607 10.1842Z"
fill=
"black"
/>
<
path
fill
-
rule=
"evenodd"
clip
-
rule=
"evenodd"
d=
"M15.5062 2.22521L3.5426 3.04201C2.82599 3.09094 2.27051 3.66706 2.27051 4.36136V15.9975C2.27051 16.6499 2.49507 17.2837 2.90883 17.7992L5.48835 21.0126C5.90541 21.5322 6.56174 21.8183 7.24076 21.7765L20.519 20.9591C21.1995 20.9172 21.7293 20.3716 21.7293 19.7125V6.48332C21.7293 6.07557 21.5234 5.69348 21.1777 5.45975L16.9743 2.61784C16.546 2.32822 16.0277 2.1896 15.5062 2.22521ZM4.13585 4.54287C3.96946 4.41968 4.04865 4.16303 4.25768 4.14804L15.5866 3.33545C15.9476 3.30956 16.3063 3.40896 16.5982 3.61578L18.8713 5.22622C18.9576 5.28736 18.9171 5.41935 18.8102 5.42516L6.8129 6.07764C6.44983 6.09739 6.09144 5.99073 5.80276 5.77699L4.13585 4.54287ZM6.25018 8.12315C6.25018 7.7334 6.56506 7.41145 6.9677 7.38952L19.6523 6.69871C20.0447 6.67734 20.375 6.97912 20.375 7.35898V18.8141C20.375 19.2031 20.0613 19.5247 19.6594 19.5476L7.05516 20.2648C6.61845 20.2896 6.25018 19.954 6.25018 19.5312V8.12315Z"
fill=
"black"
/>
</
g
>
<
defs
>
<
clipPath
id=
"clip0_6294_13848"
>
<
rect
width=
"24"
height=
"24"
fill=
"white"
/>
</
clipPath
>
</
defs
>
</
svg
>
const
ICON_MAP
=
{
const
ICON_MAP
=
{
app
:
<
AppIcon
className=
'border !border-[rgba(0,0,0,0.05)]'
/>,
app
:
<
AppIcon
className=
'border !border-[rgba(0,0,0,0.05)]'
/>,
api
:
<
AppIcon
innerIcon=
{
ApiSvg
}
className=
'border !bg-purple-50 !border-purple-200'
/>,
api
:
<
AppIcon
innerIcon=
{
ApiSvg
}
className=
'border !bg-purple-50 !border-purple-200'
/>,
dataset
:
<
AppIcon
innerIcon=
{
DatasetSvg
}
className=
'!border-[0.5px] !border-indigo-100 !bg-indigo-25'
/>,
dataset
:
<
AppIcon
innerIcon=
{
DatasetSvg
}
className=
'!border-[0.5px] !border-indigo-100 !bg-indigo-25'
/>,
webapp
:
<
AppIcon
innerIcon=
{
WebappSvg
}
className=
'border !bg-primary-100 !border-primary-200'
/>,
webapp
:
<
AppIcon
innerIcon=
{
WebappSvg
}
className=
'border !bg-primary-100 !border-primary-200'
/>,
notion
:
<
AppIcon
innerIcon=
{
NotionSvg
}
className=
'!border-[0.5px] !border-indigo-100 !bg-white'
/>,
}
}
export
default
function
AppBasic
({
icon
,
icon_background
,
name
,
type
,
hoverTip
,
textStyle
,
iconType
=
'app'
}:
IAppBasicProps
)
{
export
default
function
AppBasic
({
icon
,
icon_background
,
name
,
type
,
hoverTip
,
textStyle
,
iconType
=
'app'
}:
IAppBasicProps
)
{
...
...
web/app/components/app-sidebar/index.tsx
View file @
b1a0f150
...
@@ -4,7 +4,7 @@ import NavLink from './navLink'
...
@@ -4,7 +4,7 @@ import NavLink from './navLink'
import
AppBasic
from
'./basic'
import
AppBasic
from
'./basic'
export
type
IAppDetailNavProps
=
{
export
type
IAppDetailNavProps
=
{
iconType
?:
'app'
|
'dataset'
iconType
?:
'app'
|
'dataset'
|
'notion'
title
:
string
title
:
string
desc
:
string
desc
:
string
icon
:
string
icon
:
string
...
@@ -18,7 +18,6 @@ export type IAppDetailNavProps = {
...
@@ -18,7 +18,6 @@ export type IAppDetailNavProps = {
extraInfo
?:
React
.
ReactNode
extraInfo
?:
React
.
ReactNode
}
}
const
AppDetailNav
:
FC
<
IAppDetailNavProps
>
=
({
title
,
desc
,
icon
,
icon_background
,
navigation
,
extraInfo
,
iconType
=
'app'
})
=>
{
const
AppDetailNav
:
FC
<
IAppDetailNavProps
>
=
({
title
,
desc
,
icon
,
icon_background
,
navigation
,
extraInfo
,
iconType
=
'app'
})
=>
{
return
(
return
(
<
div
className=
"flex flex-col w-56 overflow-y-auto bg-white border-r border-gray-200 shrink-0"
>
<
div
className=
"flex flex-col w-56 overflow-y-auto bg-white border-r border-gray-200 shrink-0"
>
...
...
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