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
cfaf6ee6
Commit
cfaf6ee6
authored
Jun 30, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ui
parent
826c1a59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
index.tsx
web/app/components/app/chat/index.tsx
+1
-1
index.tsx
web/app/components/base/voice-input/index.tsx
+7
-8
No files found.
web/app/components/app/chat/index.tsx
View file @
cfaf6ee6
...
...
@@ -594,7 +594,7 @@ const Chat: FC<IChatProps> = ({
)
}
</
div
>
{
voiceInputShow
&&
<
VoiceInput
onConverted=
{
()
=>
setVoiceInputShow
(
false
)
}
/>
voiceInputShow
&&
<
VoiceInput
onC
ancel=
{
()
=>
setVoiceInputShow
(
false
)
}
onC
onverted=
{
()
=>
setVoiceInputShow
(
false
)
}
/>
}
</
div
>
</
div
>
...
...
web/app/components/base/voice-input/index.tsx
View file @
cfaf6ee6
...
...
@@ -8,9 +8,11 @@ import { Loading02, XClose } from '@/app/components/base/icons/src/vender/line/g
type
VoiceInputTypes
=
{
onConverted
:
(
text
:
string
)
=>
void
onCancel
:
()
=>
void
}
const
VoiceInput
=
({
onCancel
,
onConverted
,
}:
VoiceInputTypes
)
=>
{
const
{
t
}
=
useTranslation
()
...
...
@@ -36,14 +38,14 @@ const VoiceInput = ({
let
v
=
dataArray
[
i
*
gap
]
if
(
v
<
128
)
v
=
128
if
(
v
>
1
8
8
)
v
=
1
8
8
const
y
=
(
v
-
1
18
)
/
7
0
*
canvas
.
height
if
(
v
>
1
7
8
)
v
=
1
7
8
const
y
=
(
v
-
1
28
)
/
5
0
*
canvas
.
height
ctx
.
moveTo
(
x
,
16
)
ctx
.
roundRect
(
x
,
16
-
y
,
2
,
y
,
[
1
,
1
,
0
,
0
])
ctx
.
fill
()
x
+=
4
x
+=
3
}
ctx
.
closePath
()
},
[])
...
...
@@ -74,9 +76,6 @@ const VoiceInput = ({
if
(
canvasRef
.
current
&&
ctxRef
.
current
)
drawRecord
()
}
const
handleStopConvert
=
()
=>
{
handleStartRecord
()
}
const
initCanvas
=
()
=>
{
const
dpr
=
window
.
devicePixelRatio
||
1
...
...
@@ -138,7 +137,7 @@ const VoiceInput = ({
startConvert
&&
(
<
div
className=
'flex justify-center items-center mr-1 w-8 h-8 hover:bg-primary-100 rounded-lg cursor-pointer'
onClick=
{
handleStopConvert
}
onClick=
{
onCancel
}
>
<
XClose
className=
'w-4 h-4 text-gray-500'
/>
</
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