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
bd15cec7
Commit
bd15cec7
authored
Jul 03, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ui
parent
cfaf6ee6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
38 deletions
+53
-38
index.tsx
web/app/components/app/chat/index.tsx
+19
-7
index.module.css
web/app/components/base/voice-input/index.module.css
+1
-0
index.tsx
web/app/components/base/voice-input/index.tsx
+33
-31
No files found.
web/app/components/app/chat/index.tsx
View file @
bd15cec7
...
@@ -22,6 +22,7 @@ import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
...
@@ -22,6 +22,7 @@ import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
import
VoiceInput
from
'@/app/components/base/voice-input'
import
VoiceInput
from
'@/app/components/base/voice-input'
import
{
Microphone01
}
from
'@/app/components/base/icons/src/vender/line/mediaAndDevices'
import
{
Microphone01
}
from
'@/app/components/base/icons/src/vender/line/mediaAndDevices'
import
{
Microphone01
as
Microphone01Solid
}
from
'@/app/components/base/icons/src/vender/solid/mediaAndDevices'
import
{
Microphone01
as
Microphone01Solid
}
from
'@/app/components/base/icons/src/vender/solid/mediaAndDevices'
import
{
XCircle
}
from
'@/app/components/base/icons/src/vender/solid/general'
const
stopIcon
=
(
const
stopIcon
=
(
<
svg
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
svg
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
...
@@ -570,13 +571,24 @@ const Chat: FC<IChatProps> = ({
...
@@ -570,13 +571,24 @@ const Chat: FC<IChatProps> = ({
/>
/>
<
div
className=
"absolute top-0 right-2 flex items-center h-[48px]"
>
<
div
className=
"absolute top-0 right-2 flex items-center h-[48px]"
>
<
div
className=
{
`${s.count} mr-4 h-5 leading-5 text-sm bg-gray-50 text-gray-500`
}
>
{
query
.
trim
().
length
}
</
div
>
<
div
className=
{
`${s.count} mr-4 h-5 leading-5 text-sm bg-gray-50 text-gray-500`
}
>
{
query
.
trim
().
length
}
</
div
>
<
div
{
className=
'group flex justify-center items-center w-8 h-8 hover:bg-primary-50 rounded-lg cursor-pointer'
query
onClick=
{
()
=>
setVoiceInputShow
(
true
)
}
?
(
>
<
div
className=
'flex justify-center items-center w-8 h-8 cursor-pointer'
onClick=
{
()
=>
setQuery
(
''
)
}
>
<
Microphone01
className=
'block w-4 h-4 text-gray-500 group-hover:hidden'
/>
<
XCircle
className=
'w-4 h-4 text-[#98A2B3]'
/>
<
Microphone01Solid
className=
'hidden w-4 h-4 text-primary-600 group-hover:block'
/>
</
div
>
</
div
>
)
:
(
<
div
className=
'group flex justify-center items-center w-8 h-8 hover:bg-primary-50 rounded-lg cursor-pointer'
onClick=
{
()
=>
setVoiceInputShow
(
true
)
}
>
<
Microphone01
className=
'block w-4 h-4 text-gray-500 group-hover:hidden'
/>
<
Microphone01Solid
className=
'hidden w-4 h-4 text-primary-600 group-hover:block'
/>
</
div
>
)
}
<
div
className=
'mx-2 w-[1px] h-4 bg-black opacity-5'
/>
{
isMobile
{
isMobile
?
sendBtn
?
sendBtn
:
(
:
(
...
...
web/app/components/base/voice-input/index.module.css
View file @
bd15cec7
.wrapper
{
.wrapper
{
background
:
linear-gradient
(
131deg
,
#2250F2
0%
,
#0EBCF3
100%
);
box-shadow
:
0px
4px
6px
-2px
rgba
(
16
,
24
,
40
,
0.03
),
0px
12px
16px
-4px
rgba
(
16
,
24
,
40
,
0.08
);
box-shadow
:
0px
4px
6px
-2px
rgba
(
16
,
24
,
40
,
0.03
),
0px
12px
16px
-4px
rgba
(
16
,
24
,
40
,
0.08
);
}
}
...
...
web/app/components/base/voice-input/index.tsx
View file @
bd15cec7
...
@@ -102,48 +102,50 @@ const VoiceInput = ({
...
@@ -102,48 +102,50 @@ const VoiceInput = ({
},
[])
},
[])
return
(
return
(
<
div
className=
{
cn
(
s
.
wrapper
,
'flex items-center absolute inset-0 pl-4 pr-2 py-[14px] bg-primary-25 rounded-xl overflow-hidden'
)
}
>
<
div
className=
{
cn
(
s
.
wrapper
,
'absolute inset-0 rounded-xl'
)
}
>
<
canvas
id=
'voice-input-record'
className=
'absolute left-0 bottom-0 w-full h-4'
/>
<
div
className=
'absolute inset-[1.5px] flex items-center pl-[14.5px] pr-[6.5px] py-[14px] bg-primary-25 rounded-[10.5px] overflow-hidden'
>
{
<
canvas
id=
'voice-input-record'
className=
'absolute left-0 bottom-0 w-full h-4'
/>
startConvert
&&
<
Loading02
className=
'mr-2 w-4 h-4 text-primary-700'
/>
{
}
startConvert
&&
<
Loading02
className=
'mr-2 w-4 h-4 text-primary-700'
/>
<
div
className=
'grow'
>
}
<
div
className=
'grow'
>
{
startRecord
&&
(
<
div
className=
'text-sm text-gray-500'
>
{
t
(
'common.voiceInput.speaking'
)
}
</
div
>
)
}
{
startConvert
&&
(
<
div
className=
{
cn
(
s
.
convert
,
'text-sm'
)
}
>
{
t
(
'common.voiceInput.converting'
)
}
</
div
>
)
}
</
div
>
{
{
startRecord
&&
(
startRecord
&&
(
<
div
className=
'text-sm text-gray-500'
>
<
div
{
t
(
'common.voiceInput.speaking'
)
}
className=
'flex justify-center items-center mr-1 w-8 h-8 hover:bg-primary-100 rounded-lg cursor-pointer'
onClick=
{
handleStopRecorder
}
>
<
StopCircle
className=
'w-5 h-5 text-primary-600'
/>
</
div
>
</
div
>
)
)
}
}
{
{
startConvert
&&
(
startConvert
&&
(
<
div
className=
{
cn
(
s
.
convert
,
'text-sm'
)
}
>
<
div
{
t
(
'common.voiceInput.converting'
)
}
className=
'flex justify-center items-center mr-1 w-8 h-8 hover:bg-primary-100 rounded-lg cursor-pointer'
onClick=
{
onCancel
}
>
<
XClose
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
</
div
>
)
)
}
}
<
div
className=
'w-[45px] pl-1 text-xs font-medium text-gray-700'
>
{
duration
}
</
div
>
</
div
>
</
div
>
{
startRecord
&&
(
<
div
className=
'flex justify-center items-center mr-1 w-8 h-8 hover:bg-primary-100 rounded-lg cursor-pointer'
onClick=
{
handleStopRecorder
}
>
<
StopCircle
className=
'w-5 h-5 text-primary-600'
/>
</
div
>
)
}
{
startConvert
&&
(
<
div
className=
'flex justify-center items-center mr-1 w-8 h-8 hover:bg-primary-100 rounded-lg cursor-pointer'
onClick=
{
onCancel
}
>
<
XClose
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
)
}
<
div
className=
'w-[45px] pl-1 text-xs font-medium text-gray-700'
>
{
duration
}
</
div
>
</
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