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
d0ca8af0
Commit
d0ca8af0
authored
Jul 18, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: account-dropdown style
parent
0df135ea
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
512 additions
and
124 deletions
+512
-124
index.tsx
web/app/components/base/avatar/index.tsx
+15
-13
dify.svg
web/app/components/base/icons/assets/public/common/dify.svg
+8
-0
arrow-up-right.svg
...s/base/icons/assets/vender/line/arrows/arrow-up-right.svg
+5
-0
chevron-down.svg
...nts/base/icons/assets/vender/line/arrows/chevron-down.svg
+5
-0
chevron-right.svg
...ts/base/icons/assets/vender/line/arrows/chevron-right.svg
+5
-0
check.svg
...omponents/base/icons/assets/vender/line/general/check.svg
+5
-0
log-out-01.svg
...ents/base/icons/assets/vender/line/general/log-out-01.svg
+5
-0
Dify.json
web/app/components/base/icons/src/public/common/Dify.json
+62
-0
Dify.tsx
web/app/components/base/icons/src/public/common/Dify.tsx
+14
-0
index.ts
web/app/components/base/icons/src/public/common/index.ts
+1
-0
ArrowUpRight.json
...nents/base/icons/src/vender/line/arrows/ArrowUpRight.json
+39
-0
ArrowUpRight.tsx
...onents/base/icons/src/vender/line/arrows/ArrowUpRight.tsx
+14
-0
ChevronDown.json
...onents/base/icons/src/vender/line/arrows/ChevronDown.json
+39
-0
ChevronDown.tsx
...ponents/base/icons/src/vender/line/arrows/ChevronDown.tsx
+14
-0
ChevronRight.json
...nents/base/icons/src/vender/line/arrows/ChevronRight.json
+39
-0
ChevronRight.tsx
...onents/base/icons/src/vender/line/arrows/ChevronRight.tsx
+14
-0
index.ts
...app/components/base/icons/src/vender/line/arrows/index.ts
+3
-0
Check.json
.../components/base/icons/src/vender/line/general/Check.json
+39
-0
Check.tsx
...p/components/base/icons/src/vender/line/general/Check.tsx
+14
-0
LogOut01.json
...mponents/base/icons/src/vender/line/general/LogOut01.json
+39
-0
LogOut01.tsx
...omponents/base/icons/src/vender/line/general/LogOut01.tsx
+14
-0
index.ts
...pp/components/base/icons/src/vender/line/general/index.ts
+2
-0
index.module.css
web/app/components/header/account-about/index.module.css
+1
-1
index.tsx
web/app/components/header/account-about/index.tsx
+8
-8
index.tsx
web/app/components/header/account-dropdown/index.tsx
+89
-84
index.tsx
...ents/header/account-dropdown/workplace-selector/index.tsx
+19
-18
No files found.
web/app/components/base/avatar/index.tsx
View file @
d0ca8af0
'use client'
import
cn
from
'classnames'
interface
IAvatarProps
{
type
AvatarProps
=
{
name
:
string
avatar
?:
string
size
?:
number
className
?:
string
textClassName
?:
string
}
const
Avatar
=
({
name
,
avatar
,
size
=
30
,
className
}:
IAvatarProps
)
=>
{
const
avatarClassName
=
`shrink-0 flex items-center rounded-full bg-primary-600`
const
style
=
{
width
:
`
${
size
}
px`
,
height
:
`
${
size
}
px`
,
fontSize
:
`
${
size
}
px`
,
lineHeight
:
`
${
size
}
px`
}
className
,
textClassName
,
}:
AvatarProps
)
=>
{
const
avatarClassName
=
'shrink-0 flex items-center rounded-full bg-primary-600'
const
style
=
{
width
:
`
${
size
}
px`
,
height
:
`
${
size
}
px`
,
fontSize
:
`
${
size
}
px`
,
lineHeight
:
`
${
size
}
px`
}
if
(
avatar
)
{
return
(
...
...
@@ -33,7 +35,7 @@ const Avatar = ({
style=
{
style
}
>
<
div
className=
{
`text-center text-white scale-[0.4]`
}
className=
{
cn
(
textClassName
,
'text-center text-white scale-[0.4]'
)
}
style=
{
style
}
>
{
name
[
0
].
toLocaleUpperCase
()
}
...
...
web/app/components/base/icons/assets/public/common/dify.svg
0 → 100644
View file @
d0ca8af0
<svg
width=
"50"
height=
"26"
viewBox=
"0 0 50 26"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
id=
"Dify"
>
<path
d=
"M6.61784 2.064C8.37784 2.064 9.92184 2.408 11.2498 3.096C12.5938 3.784 13.6258 4.768 14.3458 6.048C15.0818 7.312 15.4498 8.784 15.4498 10.464C15.4498 12.144 15.0818 13.616 14.3458 14.88C13.6258 16.128 12.5938 17.096 11.2498 17.784C9.92184 18.472 8.37784 18.816 6.61784 18.816H0.761841V2.064H6.61784ZM6.49784 15.96C8.25784 15.96 9.61784 15.48 10.5778 14.52C11.5378 13.56 12.0178 12.208 12.0178 10.464C12.0178 8.72 11.5378 7.36 10.5778 6.384C9.61784 5.392 8.25784 4.896 6.49784 4.896H4.12184V15.96H6.49784Z"
fill=
"#1D2939"
/>
<path
d=
"M20.869 3.936C20.277 3.936 19.781 3.752 19.381 3.384C18.997 3 18.805 2.528 18.805 1.968C18.805 1.408 18.997 0.944 19.381 0.576C19.781 0.192 20.277 0 20.869 0C21.461 0 21.949 0.192 22.333 0.576C22.733 0.944 22.933 1.408 22.933 1.968C22.933 2.528 22.733 3 22.333 3.384C21.949 3.752 21.461 3.936 20.869 3.936ZM22.525 5.52V18.816H19.165V5.52H22.525Z"
fill=
"#1D2939"
/>
<path
d=
"M33.1407 8.28H30.8127V18.816H27.4047V8.28H25.8927V5.52H27.4047V4.848C27.4047 3.216 27.8687 2.016 28.7967 1.248C29.7247 0.48 31.1247 0.12 32.9967 0.168001V3C32.1807 2.984 31.6127 3.12 31.2927 3.408C30.9727 3.696 30.8127 4.216 30.8127 4.968V5.52H33.1407V8.28Z"
fill=
"#1D2939"
/>
<path
d=
"M49.2381 5.52L41.0061 25.104H37.4301L40.3101 18.48L34.9821 5.52H38.7501L42.1821 14.808L45.6621 5.52H49.2381Z"
fill=
"#1D2939"
/>
</g>
</svg>
web/app/components/base/icons/assets/vender/line/arrows/arrow-up-right.svg
0 → 100644
View file @
d0ca8af0
<svg
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
id=
"arrow-up-right"
>
<path
id=
"Icon"
d=
"M4.08325 9.91665L9.91659 4.08331M9.91659 4.08331H4.08325M9.91659 4.08331V9.91665"
stroke=
"#667085"
stroke-width=
"1.25"
stroke-linecap=
"round"
stroke-linejoin=
"round"
/>
</g>
</svg>
web/app/components/base/icons/assets/vender/line/arrows/chevron-down.svg
0 → 100644
View file @
d0ca8af0
<svg
width=
"12"
height=
"12"
viewBox=
"0 0 12 12"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
id=
"chevron-down"
>
<path
id=
"Icon"
d=
"M3 4.5L6 7.5L9 4.5"
stroke=
"#344054"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
/>
</g>
</svg>
web/app/components/base/icons/assets/vender/line/arrows/chevron-right.svg
0 → 100644
View file @
d0ca8af0
<svg
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
id=
"chevron-right"
>
<path
id=
"Icon"
d=
"M5.25 10.5L8.75 7L5.25 3.5"
stroke=
"#667085"
stroke-width=
"1.25"
stroke-linecap=
"round"
stroke-linejoin=
"round"
/>
</g>
</svg>
web/app/components/base/icons/assets/vender/line/general/check.svg
0 → 100644
View file @
d0ca8af0
<svg
width=
"16"
height=
"16"
viewBox=
"0 0 16 16"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
id=
"check"
>
<path
id=
"Icon"
d=
"M13.3334 4L6.00008 11.3333L2.66675 8"
stroke=
"#155EEF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
/>
</g>
</svg>
web/app/components/base/icons/assets/vender/line/general/log-out-01.svg
0 → 100644
View file @
d0ca8af0
<svg
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
id=
"log-out-01"
>
<path
id=
"Icon"
d=
"M9.33333 9.91667L12.25 7M12.25 7L9.33333 4.08333M12.25 7H5.25M5.25 1.75H4.55C3.56991 1.75 3.07986 1.75 2.70552 1.94074C2.37623 2.10852 2.10852 2.37623 1.94074 2.70552C1.75 3.07986 1.75 3.56991 1.75 4.55V9.45C1.75 10.4301 1.75 10.9201 1.94074 11.2945C2.10852 11.6238 2.37623 11.8915 2.70552 12.0593C3.07986 12.25 3.56991 12.25 4.55 12.25H5.25"
stroke=
"#667085"
stroke-width=
"1.25"
stroke-linecap=
"round"
stroke-linejoin=
"round"
/>
</g>
</svg>
web/app/components/base/icons/src/public/common/Dify.json
0 → 100644
View file @
d0ca8af0
{
"icon"
:
{
"type"
:
"element"
,
"isRootNode"
:
true
,
"name"
:
"svg"
,
"attributes"
:
{
"width"
:
"50"
,
"height"
:
"26"
,
"viewBox"
:
"0 0 50 26"
,
"fill"
:
"none"
,
"xmlns"
:
"http://www.w3.org/2000/svg"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"g"
,
"attributes"
:
{
"id"
:
"Dify"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"d"
:
"M6.61784 2.064C8.37784 2.064 9.92184 2.408 11.2498 3.096C12.5938 3.784 13.6258 4.768 14.3458 6.048C15.0818 7.312 15.4498 8.784 15.4498 10.464C15.4498 12.144 15.0818 13.616 14.3458 14.88C13.6258 16.128 12.5938 17.096 11.2498 17.784C9.92184 18.472 8.37784 18.816 6.61784 18.816H0.761841V2.064H6.61784ZM6.49784 15.96C8.25784 15.96 9.61784 15.48 10.5778 14.52C11.5378 13.56 12.0178 12.208 12.0178 10.464C12.0178 8.72 11.5378 7.36 10.5778 6.384C9.61784 5.392 8.25784 4.896 6.49784 4.896H4.12184V15.96H6.49784Z"
,
"fill"
:
"#1D2939"
},
"children"
:
[]
},
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"d"
:
"M20.869 3.936C20.277 3.936 19.781 3.752 19.381 3.384C18.997 3 18.805 2.528 18.805 1.968C18.805 1.408 18.997 0.944 19.381 0.576C19.781 0.192 20.277 0 20.869 0C21.461 0 21.949 0.192 22.333 0.576C22.733 0.944 22.933 1.408 22.933 1.968C22.933 2.528 22.733 3 22.333 3.384C21.949 3.752 21.461 3.936 20.869 3.936ZM22.525 5.52V18.816H19.165V5.52H22.525Z"
,
"fill"
:
"#1D2939"
},
"children"
:
[]
},
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"d"
:
"M33.1407 8.28H30.8127V18.816H27.4047V8.28H25.8927V5.52H27.4047V4.848C27.4047 3.216 27.8687 2.016 28.7967 1.248C29.7247 0.48 31.1247 0.12 32.9967 0.168001V3C32.1807 2.984 31.6127 3.12 31.2927 3.408C30.9727 3.696 30.8127 4.216 30.8127 4.968V5.52H33.1407V8.28Z"
,
"fill"
:
"#1D2939"
},
"children"
:
[]
},
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"d"
:
"M49.2381 5.52L41.0061 25.104H37.4301L40.3101 18.48L34.9821 5.52H38.7501L42.1821 14.808L45.6621 5.52H49.2381Z"
,
"fill"
:
"#1D2939"
},
"children"
:
[]
}
]
}
]
},
"name"
:
"Dify"
}
\ No newline at end of file
web/app/components/base/icons/src/public/common/Dify.tsx
0 → 100644
View file @
d0ca8af0
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import
*
as
React
from
'react'
import
data
from
'./Dify.json'
import
IconBase
from
'@/app/components/base/icons/IconBase'
import
type
{
IconBaseProps
,
IconData
}
from
'@/app/components/base/icons/IconBase'
const
Icon
=
React
.
forwardRef
<
React
.
MutableRefObject
<
SVGElement
>
,
Omit
<
IconBaseProps
,
'data'
>>
((
props
,
ref
,
)
=>
<
IconBase
{
...
props
}
ref=
{
ref
}
data=
{
data
as
IconData
}
/>)
export
default
Icon
web/app/components/base/icons/src/public/common/index.ts
View file @
d0ca8af0
export
{
default
as
Dify
}
from
'./Dify'
export
{
default
as
Github
}
from
'./Github'
web/app/components/base/icons/src/vender/line/arrows/ArrowUpRight.json
0 → 100644
View file @
d0ca8af0
{
"icon"
:
{
"type"
:
"element"
,
"isRootNode"
:
true
,
"name"
:
"svg"
,
"attributes"
:
{
"width"
:
"14"
,
"height"
:
"14"
,
"viewBox"
:
"0 0 14 14"
,
"fill"
:
"none"
,
"xmlns"
:
"http://www.w3.org/2000/svg"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"g"
,
"attributes"
:
{
"id"
:
"arrow-up-right"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"id"
:
"Icon"
,
"d"
:
"M4.08325 9.91665L9.91659 4.08331M9.91659 4.08331H4.08325M9.91659 4.08331V9.91665"
,
"stroke"
:
"currentColor"
,
"stroke-width"
:
"1.25"
,
"stroke-linecap"
:
"round"
,
"stroke-linejoin"
:
"round"
},
"children"
:
[]
}
]
}
]
},
"name"
:
"ArrowUpRight"
}
\ No newline at end of file
web/app/components/base/icons/src/vender/line/arrows/ArrowUpRight.tsx
0 → 100644
View file @
d0ca8af0
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import
*
as
React
from
'react'
import
data
from
'./ArrowUpRight.json'
import
IconBase
from
'@/app/components/base/icons/IconBase'
import
type
{
IconBaseProps
,
IconData
}
from
'@/app/components/base/icons/IconBase'
const
Icon
=
React
.
forwardRef
<
React
.
MutableRefObject
<
SVGElement
>
,
Omit
<
IconBaseProps
,
'data'
>>
((
props
,
ref
,
)
=>
<
IconBase
{
...
props
}
ref=
{
ref
}
data=
{
data
as
IconData
}
/>)
export
default
Icon
web/app/components/base/icons/src/vender/line/arrows/ChevronDown.json
0 → 100644
View file @
d0ca8af0
{
"icon"
:
{
"type"
:
"element"
,
"isRootNode"
:
true
,
"name"
:
"svg"
,
"attributes"
:
{
"width"
:
"12"
,
"height"
:
"12"
,
"viewBox"
:
"0 0 12 12"
,
"fill"
:
"none"
,
"xmlns"
:
"http://www.w3.org/2000/svg"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"g"
,
"attributes"
:
{
"id"
:
"chevron-down"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"id"
:
"Icon"
,
"d"
:
"M3 4.5L6 7.5L9 4.5"
,
"stroke"
:
"currentColor"
,
"stroke-width"
:
"1.5"
,
"stroke-linecap"
:
"round"
,
"stroke-linejoin"
:
"round"
},
"children"
:
[]
}
]
}
]
},
"name"
:
"ChevronDown"
}
\ No newline at end of file
web/app/components/base/icons/src/vender/line/arrows/ChevronDown.tsx
0 → 100644
View file @
d0ca8af0
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import
*
as
React
from
'react'
import
data
from
'./ChevronDown.json'
import
IconBase
from
'@/app/components/base/icons/IconBase'
import
type
{
IconBaseProps
,
IconData
}
from
'@/app/components/base/icons/IconBase'
const
Icon
=
React
.
forwardRef
<
React
.
MutableRefObject
<
SVGElement
>
,
Omit
<
IconBaseProps
,
'data'
>>
((
props
,
ref
,
)
=>
<
IconBase
{
...
props
}
ref=
{
ref
}
data=
{
data
as
IconData
}
/>)
export
default
Icon
web/app/components/base/icons/src/vender/line/arrows/ChevronRight.json
0 → 100644
View file @
d0ca8af0
{
"icon"
:
{
"type"
:
"element"
,
"isRootNode"
:
true
,
"name"
:
"svg"
,
"attributes"
:
{
"width"
:
"14"
,
"height"
:
"14"
,
"viewBox"
:
"0 0 14 14"
,
"fill"
:
"none"
,
"xmlns"
:
"http://www.w3.org/2000/svg"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"g"
,
"attributes"
:
{
"id"
:
"chevron-right"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"id"
:
"Icon"
,
"d"
:
"M5.25 10.5L8.75 7L5.25 3.5"
,
"stroke"
:
"currentColor"
,
"stroke-width"
:
"1.25"
,
"stroke-linecap"
:
"round"
,
"stroke-linejoin"
:
"round"
},
"children"
:
[]
}
]
}
]
},
"name"
:
"ChevronRight"
}
\ No newline at end of file
web/app/components/base/icons/src/vender/line/arrows/ChevronRight.tsx
0 → 100644
View file @
d0ca8af0
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import
*
as
React
from
'react'
import
data
from
'./ChevronRight.json'
import
IconBase
from
'@/app/components/base/icons/IconBase'
import
type
{
IconBaseProps
,
IconData
}
from
'@/app/components/base/icons/IconBase'
const
Icon
=
React
.
forwardRef
<
React
.
MutableRefObject
<
SVGElement
>
,
Omit
<
IconBaseProps
,
'data'
>>
((
props
,
ref
,
)
=>
<
IconBase
{
...
props
}
ref=
{
ref
}
data=
{
data
as
IconData
}
/>)
export
default
Icon
web/app/components/base/icons/src/vender/line/arrows/index.ts
View file @
d0ca8af0
export
{
default
as
ArrowNarrowLeft
}
from
'./ArrowNarrowLeft'
export
{
default
as
ArrowUpRight
}
from
'./ArrowUpRight'
export
{
default
as
ChevronDown
}
from
'./ChevronDown'
export
{
default
as
ChevronRight
}
from
'./ChevronRight'
export
{
default
as
RefreshCw05
}
from
'./RefreshCw05'
web/app/components/base/icons/src/vender/line/general/Check.json
0 → 100644
View file @
d0ca8af0
{
"icon"
:
{
"type"
:
"element"
,
"isRootNode"
:
true
,
"name"
:
"svg"
,
"attributes"
:
{
"width"
:
"16"
,
"height"
:
"16"
,
"viewBox"
:
"0 0 16 16"
,
"fill"
:
"none"
,
"xmlns"
:
"http://www.w3.org/2000/svg"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"g"
,
"attributes"
:
{
"id"
:
"check"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"id"
:
"Icon"
,
"d"
:
"M13.3334 4L6.00008 11.3333L2.66675 8"
,
"stroke"
:
"currentColor"
,
"stroke-width"
:
"1.5"
,
"stroke-linecap"
:
"round"
,
"stroke-linejoin"
:
"round"
},
"children"
:
[]
}
]
}
]
},
"name"
:
"Check"
}
\ No newline at end of file
web/app/components/base/icons/src/vender/line/general/Check.tsx
0 → 100644
View file @
d0ca8af0
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import
*
as
React
from
'react'
import
data
from
'./Check.json'
import
IconBase
from
'@/app/components/base/icons/IconBase'
import
type
{
IconBaseProps
,
IconData
}
from
'@/app/components/base/icons/IconBase'
const
Icon
=
React
.
forwardRef
<
React
.
MutableRefObject
<
SVGElement
>
,
Omit
<
IconBaseProps
,
'data'
>>
((
props
,
ref
,
)
=>
<
IconBase
{
...
props
}
ref=
{
ref
}
data=
{
data
as
IconData
}
/>)
export
default
Icon
web/app/components/base/icons/src/vender/line/general/LogOut01.json
0 → 100644
View file @
d0ca8af0
{
"icon"
:
{
"type"
:
"element"
,
"isRootNode"
:
true
,
"name"
:
"svg"
,
"attributes"
:
{
"width"
:
"14"
,
"height"
:
"14"
,
"viewBox"
:
"0 0 14 14"
,
"fill"
:
"none"
,
"xmlns"
:
"http://www.w3.org/2000/svg"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"g"
,
"attributes"
:
{
"id"
:
"log-out-01"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"id"
:
"Icon"
,
"d"
:
"M9.33333 9.91667L12.25 7M12.25 7L9.33333 4.08333M12.25 7H5.25M5.25 1.75H4.55C3.56991 1.75 3.07986 1.75 2.70552 1.94074C2.37623 2.10852 2.10852 2.37623 1.94074 2.70552C1.75 3.07986 1.75 3.56991 1.75 4.55V9.45C1.75 10.4301 1.75 10.9201 1.94074 11.2945C2.10852 11.6238 2.37623 11.8915 2.70552 12.0593C3.07986 12.25 3.56991 12.25 4.55 12.25H5.25"
,
"stroke"
:
"currentColor"
,
"stroke-width"
:
"1.25"
,
"stroke-linecap"
:
"round"
,
"stroke-linejoin"
:
"round"
},
"children"
:
[]
}
]
}
]
},
"name"
:
"LogOut01"
}
\ No newline at end of file
web/app/components/base/icons/src/vender/line/general/LogOut01.tsx
0 → 100644
View file @
d0ca8af0
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import
*
as
React
from
'react'
import
data
from
'./LogOut01.json'
import
IconBase
from
'@/app/components/base/icons/IconBase'
import
type
{
IconBaseProps
,
IconData
}
from
'@/app/components/base/icons/IconBase'
const
Icon
=
React
.
forwardRef
<
React
.
MutableRefObject
<
SVGElement
>
,
Omit
<
IconBaseProps
,
'data'
>>
((
props
,
ref
,
)
=>
<
IconBase
{
...
props
}
ref=
{
ref
}
data=
{
data
as
IconData
}
/>)
export
default
Icon
web/app/components/base/icons/src/vender/line/general/index.ts
View file @
d0ca8af0
export
{
default
as
Check
}
from
'./Check'
export
{
default
as
Loading02
}
from
'./Loading02'
export
{
default
as
LogOut01
}
from
'./LogOut01'
export
{
default
as
Trash03
}
from
'./Trash03'
export
{
default
as
XClose
}
from
'./XClose'
export
{
default
as
X
}
from
'./X'
web/app/components/header/account-about/index.module.css
View file @
d0ca8af0
.logo-icon
{
background
:
url(../assets/logo-icon.png)
center
center
no-repeat
;
background-size
:
32px
;
box-shadow
:
0px
4px
6px
-1px
rgba
(
0
,
0
,
0
,
0.05
),
0px
2px
4px
-2
px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
0px
2px
4px
-2px
rgba
(
0
,
0
,
0
,
0.05
),
0px
4px
6px
-1
px
rgba
(
0
,
0
,
0
,
0.05
);
}
.logo-text
{
...
...
web/app/components/header/account-about/index.tsx
View file @
d0ca8af0
'use client'
import
{
useTranslation
}
from
'react-i18next'
import
{
XMarkIcon
}
from
'@heroicons/react/24/outline'
import
classNames
from
'classnames'
import
Link
from
'next/link'
import
s
from
'./index.module.css'
import
Modal
from
'@/app/components/base/modal'
import
{
XClose
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
Dify
}
from
'@/app/components/base/icons/src/public/common'
import
type
{
LangGeniusVersionResponse
}
from
'@/models/common'
import
{
IS_CE_EDITION
}
from
'@/config'
...
...
@@ -30,16 +31,15 @@ export default function AccountAbout({
className=
{
s
.
modal
}
>
<
div
className=
'relative'
>
<
XMarkIcon
className=
'absolute top-0 -right-2 w-4 h-4 cursor-pointer'
onClick=
{
onCancel
}
/>
<
div
className=
'absolute -top-2 -right-4 flex justify-center items-center w-8 h-8 cursor-pointer'
onClick=
{
onCancel
}
>
<
XClose
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
<
div
>
<
div
className=
{
classNames
(
s
[
'logo-icon'
],
'mx-auto mb-3 w-12 h-12 bg-white rounded-xl border border-gray-200'
,
)
}
/>
<
div
className=
{
classNames
(
s
[
'logo-text'
],
'mx-auto mb-2'
,
'mx-auto mb-3 w-12 h-12 bg-white rounded-xl border-[0.5px] border-gray-200'
,
)
}
/>
<
Dify
className=
'mx-auto mb-2'
/>
<
div
className=
'mb-3 text-center text-xs font-normal text-gray-500'
>
Version
{
langeniusVersionInfo
?.
current_version
}
</
div
>
<
div
className=
'mb-4 text-center text-xs font-normal text-gray-700'
>
<
div
>
© 2023 LangGenius, Inc., Contributors.
</
div
>
...
...
@@ -55,7 +55,7 @@ export default function AccountAbout({
</
div
>
</
div
>
</
div
>
<
div
className=
'mb-4
h-0 border-[0.5px] border
-gray-200'
/>
<
div
className=
'mb-4
-mx-8 h-[0.5px] bg
-gray-200'
/>
<
div
className=
'flex justify-between items-center'
>
<
div
className=
'text-xs font-medium text-gray-800'
>
{
...
...
web/app/components/header/account-dropdown/index.tsx
View file @
d0ca8af0
...
...
@@ -5,7 +5,6 @@ import { useRouter } from 'next/navigation'
import
{
useContext
}
from
'use-context-selector'
import
classNames
from
'classnames'
import
Link
from
'next/link'
import
{
ArrowRightOnRectangleIcon
,
ArrowTopRightOnSquareIcon
,
ChevronDownIcon
}
from
'@heroicons/react/24/solid'
import
{
Menu
,
Transition
}
from
'@headlessui/react'
import
Indicator
from
'../indicator'
import
AccountSetting
from
'../account-setting'
...
...
@@ -15,10 +14,12 @@ import I18n from '@/context/i18n'
import
Avatar
from
'@/app/components/base/avatar'
import
{
logout
}
from
'@/service/common'
import
{
useAppContext
}
from
'@/context/app-context'
import
{
ArrowUpRight
,
ChevronDown
}
from
'@/app/components/base/icons/src/vender/line/arrows'
import
{
LogOut01
}
from
'@/app/components/base/icons/src/vender/line/general'
export
default
function
AppSelector
()
{
const
itemClassName
=
`
flex items-center w-full h-
10
px-3 text-gray-700 text-[14px]
flex items-center w-full h-
9
px-3 text-gray-700 text-[14px]
rounded-lg font-normal hover:bg-gray-100 cursor-pointer
`
const
router
=
useRouter
()
...
...
@@ -40,20 +41,21 @@ export default function AppSelector() {
return
(
<
div
className=
""
>
<
Menu
as=
"div"
className=
"relative inline-block text-left"
>
{
({
open
})
=>
(
<>
<
div
>
<
Menu
.
Button
className=
"
inline-flex items-center h-[38px]
rounded-xl pl-2 pr-2.5 text-[14px] font-normal
text-gray-800 hover:bg-gray-200
"
className=
{
`
inline-flex items-center
rounded-[20px] py-1 pr-2.5 pl-1 text-sm
text-gray-700 hover:bg-gray-200
${open && 'bg-gray-200'}
`
}
>
<
Avatar
name=
{
userProfile
.
name
}
className=
'mr-2'
/>
<
Avatar
name=
{
userProfile
.
name
}
className=
'mr-2'
size=
{
32
}
/>
{
userProfile
.
name
}
<
ChevronDownIcon
className=
"w-3 h-3 ml-1"
aria
-
hidden=
"true"
/>
<
ChevronDown
className=
"w-3 h-3 ml-1 text-gray-700"
/>
</
Menu
.
Button
>
</
div
>
<
Transition
...
...
@@ -99,7 +101,7 @@ export default function AppSelector() {
}
target=
'_blank'
>
<
div
>
{
t
(
'common.userProfile.helpCenter'
)
}
</
div
>
<
ArrowTopRightOnSquareIcon
className=
'hidden w-4 h-4
group-hover:flex'
/>
<
ArrowUpRight
className=
'hidden w-4 h-4 text-gray-500
group-hover:flex'
/>
</
Link
>
</
Menu
.
Item
>
<
Menu
.
Item
>
...
...
@@ -115,15 +117,18 @@ export default function AppSelector() {
<
Menu
.
Item
>
<
div
className=
'p-1'
onClick=
{
()
=>
handleLogout
()
}
>
<
div
className=
'flex items-center justify-between h-12
px-3 rounded-lg cursor-pointer group hover:bg-gray-100'
className=
'flex items-center justify-between h-9
px-3 rounded-lg cursor-pointer group hover:bg-gray-100'
>
<
div
className=
'font-normal text-[14px] text-gray-700'
>
{
t
(
'common.userProfile.logout'
)
}
</
div
>
<
ArrowRightOnRectangleIcon
className=
'hidden w-4 h-4
group-hover:flex'
/>
<
LogOut01
className=
'hidden w-4 h-4 text-gray-500
group-hover:flex'
/>
</
div
>
</
div
>
</
Menu
.
Item
>
</
Menu
.
Items
>
</
Transition
>
</>
)
}
</
Menu
>
{
settingVisible
&&
<
AccountSetting
onCancel=
{
()
=>
setSettingVisible
(
false
)
}
/>
...
...
web/app/components/header/account-dropdown/workplace-selector/index.tsx
View file @
d0ca8af0
import
{
Fragment
}
from
'react'
import
{
switchWorkspace
}
from
'@/service/common'
import
{
Menu
,
Transition
}
from
'@headlessui/react'
import
{
ChevronRightIcon
,
CheckIcon
}
from
'@heroicons/react/24/outline'
import
cn
from
'classnames'
import
s
from
'./index.module.css'
import
{
useContext
}
from
'use-context-selector'
import
{
ToastContext
}
from
'@/app/components/base/toast'
import
{
useTranslation
}
from
'react-i18next'
import
{
useRouter
}
from
'next/navigation'
import
{
Menu
,
Transition
}
from
'@headlessui/react'
import
cn
from
'classnames'
import
s
from
'./index.module.css'
import
{
switchWorkspace
}
from
'@/service/common'
import
{
useWorkspacesContext
}
from
'@/context/workspace-context'
import
{
ChevronRight
}
from
'@/app/components/base/icons/src/vender/line/arrows'
import
{
Check
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
ToastContext
}
from
'@/app/components/base/toast'
const
itemClassName
=
`
flex items-center px-3 py-2 h-10 cursor-pointer
`
const
itemIconClassName
=
`
shrink-0 mr-2
w-6 h-6 bg-[#EFF4FF] rounded-md
shrink-0 mr-2
flex items-center justify-center w-6 h-6 bg-[#EFF4FF] rounded-md text-xs font-medium text-primary-600
`
const
itemNameClassName
=
`
grow mr-2 text-sm text-gray-700 text-left
...
...
@@ -32,12 +33,12 @@ const WorkplaceSelector = () => {
const
handleSwitchWorkspace
=
async
(
tenant_id
:
string
)
=>
{
try
{
await
switchWorkspace
({
url
:
`/workspaces/switch`
,
body
:
{
tenant_id
}
})
await
switchWorkspace
({
url
:
'/workspaces/switch'
,
body
:
{
tenant_id
}
})
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
router
.
replace
(
'/apps'
)
}
catch
(
e
)
{
}
catch
(
e
)
{
notify
({
type
:
'error'
,
message
:
t
(
'common.provider.saveFailed'
)
})
}
finally
{
}
}
...
...
@@ -49,12 +50,12 @@ const WorkplaceSelector = () => {
<
Menu
.
Button
className=
{
cn
(
`
${itemClassName} w-full
group hover:bg-gray-50 cursor-pointer ${open && 'bg-gray-50'}
`
group hover:bg-gray-50 cursor-pointer ${open && 'bg-gray-50'}
rounded-lg
`
,
)
}
>
<
div
className=
{
itemIconClassName
}
/
>
<
div
className=
{
itemIconClassName
}
>
{
currentWrokspace
?.
name
[
0
].
toLocaleUpperCase
()
}
</
div
>
<
div
className=
{
`${itemNameClassName} truncate`
}
>
{
currentWrokspace
?.
name
}
</
div
>
<
ChevronRight
Icon
className=
'shrink-0 w-[14px] h-[14px]
'
/>
<
ChevronRight
className=
'shrink-0 w-[14px] h-[14px] text-gray-500
'
/>
</
Menu
.
Button
>
<
Transition
as=
{
Fragment
}
...
...
@@ -71,16 +72,16 @@ const WorkplaceSelector = () => {
absolute top-[1px] min-w-[200px] z-10 bg-white border-[0.5px] border-gray-200
divide-y divide-gray-100 origin-top-right rounded-xl
`
,
s
.
popup
s
.
popup
,
)
}
>
<
div
className=
"px-1 py-1"
>
{
workspaces
.
map
(
workspace
=>
(
<
div
className=
{
itemClassName
}
key=
{
workspace
.
id
}
onClick=
{
()
=>
handleSwitchWorkspace
(
workspace
.
id
)
}
>
<
div
className=
{
itemIconClassName
}
/
>
<
div
className=
{
itemIconClassName
}
>
{
workspace
.
name
[
0
].
toLocaleUpperCase
()
}
</
div
>
<
div
className=
{
itemNameClassName
}
>
{
workspace
.
name
}
</
div
>
{
workspace
.
current
&&
<
Check
Icon
className=
{
itemCheckClassName
}
/>
}
{
workspace
.
current
&&
<
Check
className=
{
itemCheckClassName
}
/>
}
</
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