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
f2530912
Commit
f2530912
authored
Jul 07, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix textarea padding
parent
024d03e8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
24 deletions
+11
-24
index.tsx
web/app/components/app/chat/index.tsx
+7
-15
style.module.css
web/app/components/app/chat/style.module.css
+0
-1
index.tsx
web/app/components/app/configuration/debug/index.tsx
+0
-1
index.tsx
web/app/components/base/voice-input/index.tsx
+2
-2
index.tsx
web/app/components/explore/installed-app/index.tsx
+1
-1
index.tsx
web/app/components/share/chat/index.tsx
+1
-4
No files found.
web/app/components/app/chat/index.tsx
View file @
f2530912
...
...
@@ -4,7 +4,6 @@ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'
import
{
useContext
}
from
'use-context-selector'
import
cn
from
'classnames'
import
Recorder
from
'js-audio-recorder'
import
{
usePathname
}
from
'next/navigation'
import
{
HandThumbDownIcon
,
HandThumbUpIcon
}
from
'@heroicons/react/24/outline'
import
{
UserCircleIcon
}
from
'@heroicons/react/24/solid'
import
{
useTranslation
}
from
'react-i18next'
...
...
@@ -187,7 +186,6 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
const
[
localAdminFeedback
,
setLocalAdminFeedback
]
=
useState
<
Feedbacktype
|
undefined
|
null
>
(
adminFeedback
)
const
{
userProfile
}
=
useContext
(
AppContext
)
const
{
t
}
=
useTranslation
()
const
pathname
=
usePathname
()
/**
* Render feedback results (distinguish between users and administrators)
...
...
@@ -252,18 +250,13 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
}
const
adminOperation
=
()
=>
{
const
inAppLogPage
=
/
\/
app
\/
.+
\/
logs/g
.
test
(
pathname
)
return
<
div
className=
'flex gap-1'
>
{
inAppLogPage
&&
(
<
Tooltip
selector=
{
`user-feedback-${randomString(16)}`
}
content=
{
t
(
'appLog.detail.operation.addAnnotation'
)
as
string
}
>
{
OperationBtn
({
innerContent
:
<
IconWrapper
><
EditIcon
className=
'hover:text-gray-800'
/></
IconWrapper
>,
onClick
:
()
=>
setShowEdit
(
true
),
})
}
</
Tooltip
>
)
}
<
Tooltip
selector=
{
`user-feedback-${randomString(16)}`
}
content=
{
t
(
'appLog.detail.operation.addAnnotation'
)
as
string
}
>
{
OperationBtn
({
innerContent
:
<
IconWrapper
><
EditIcon
className=
'hover:text-gray-800'
/></
IconWrapper
>,
onClick
:
()
=>
setShowEdit
(
true
),
})
}
</
Tooltip
>
{
!
localAdminFeedback
?.
rating
&&
<>
<
Tooltip
selector=
{
`user-feedback-${randomString(16)}`
}
content=
{
t
(
'appLog.detail.operation.like'
)
as
string
}
>
{
OperationBtn
({
...
...
@@ -584,7 +577,7 @@ const Chat: FC<IChatProps> = ({
minHeight=
{
48
}
autoFocus
controlFocus=
{
controlFocus
}
className=
{
`${cn(s.textArea)} resize-none block w-full pl-3 bg-gray-50 border border-gray-200 rounded-md focus:outline-none sm:text-sm text-gray-700`
}
className=
{
`${cn(s.textArea)}
${isShowSpeechToText ? 'pr-[130px]' : 'pr-[90px]'}
resize-none block w-full pl-3 bg-gray-50 border border-gray-200 rounded-md focus:outline-none sm:text-sm text-gray-700`
}
/>
<
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
>
...
...
@@ -627,7 +620,6 @@ const Chat: FC<IChatProps> = ({
{
voiceInputShow
&&
(
<
VoiceInput
isPublic=
{
displayScene
===
'web'
}
onCancel=
{
()
=>
setVoiceInputShow
(
false
)
}
onConverted=
{
text
=>
setQuery
(
text
)
}
/>
...
...
web/app/components/app/chat/style.module.css
View file @
f2530912
...
...
@@ -79,7 +79,6 @@
.textArea
{
padding-top
:
13px
;
padding-bottom
:
13px
;
padding-right
:
90px
;
border-radius
:
12px
;
line-height
:
20px
;
background-color
:
#fff
;
...
...
web/app/components/app/configuration/debug/index.tsx
View file @
f2530912
...
...
@@ -389,7 +389,6 @@ const Debug: FC<IDebug> = ({
}
}
isShowSuggestion=
{
doShowSuggestion
}
suggestionList=
{
suggestQuestions
}
displayScene=
'console'
isShowSpeechToText=
{
speechToTextConfig
.
enabled
}
/>
</
div
>
...
...
web/app/components/base/voice-input/index.tsx
View file @
f2530912
...
...
@@ -10,13 +10,11 @@ import { Loading02, XClose } from '@/app/components/base/icons/src/vender/line/g
import
{
audioToText
}
from
'@/service/share'
type
VoiceInputTypes
=
{
isPublic
:
boolean
onConverted
:
(
text
:
string
)
=>
void
onCancel
:
()
=>
void
}
const
VoiceInput
=
({
isPublic
,
onCancel
,
onConverted
,
}:
VoiceInputTypes
)
=>
{
...
...
@@ -80,9 +78,11 @@ const VoiceInput = ({
formData
.
append
(
'file'
,
wavFile
)
let
url
=
''
let
isPublic
=
false
if
(
params
.
token
)
{
url
=
'/audio-to-text'
isPublic
=
true
}
else
if
(
params
.
appId
)
{
if
(
pathname
.
search
(
'explore/installed'
)
>
-
1
)
...
...
web/app/components/explore/installed-app/index.tsx
View file @
f2530912
...
...
@@ -29,7 +29,7 @@ const InstalledApp: FC<IInstalledAppProps> = ({
<
div
className=
'h-full p-2'
>
{
installedApp
?.
app
.
mode
===
'chat'
?
(
<
ChatApp
isInstalledApp
installedAppInfo=
{
installedApp
}
displayScene=
'console'
/>
<
ChatApp
isInstalledApp
installedAppInfo=
{
installedApp
}
/>
)
:
(
<
TextGenerationApp
isInstalledApp
installedAppInfo=
{
installedApp
}
/>
...
...
web/app/components/share/chat/index.tsx
View file @
f2530912
...
...
@@ -17,7 +17,7 @@ import Header from '@/app/components/share/header'
import
{
delConversation
,
fetchAppInfo
,
fetchAppParams
,
fetchChatList
,
fetchConversations
,
fetchSuggestedQuestions
,
pinConversation
,
sendChatMessage
,
stopChatMessageResponding
,
unpinConversation
,
updateFeedback
}
from
'@/service/share'
import
type
{
ConversationItem
,
SiteInfo
}
from
'@/models/share'
import
type
{
PromptConfig
,
SuggestedQuestionsAfterAnswerConfig
}
from
'@/models/debug'
import
type
{
DisplayScene
,
Feedbacktype
,
IChatItem
}
from
'@/app/components/app/chat'
import
type
{
Feedbacktype
,
IChatItem
}
from
'@/app/components/app/chat'
import
Chat
from
'@/app/components/app/chat'
import
{
changeLanguage
}
from
'@/i18n/i18next-config'
import
useBreakpoints
,
{
MediaType
}
from
'@/hooks/use-breakpoints'
...
...
@@ -28,13 +28,11 @@ import type { InstalledApp } from '@/models/explore'
import
Confirm
from
'@/app/components/base/confirm'
export
type
IMainProps
=
{
displayScene
?:
DisplayScene
isInstalledApp
?:
boolean
installedAppInfo
?:
InstalledApp
}
const
Main
:
FC
<
IMainProps
>
=
({
displayScene
=
'web'
,
isInstalledApp
=
false
,
installedAppInfo
,
})
=>
{
...
...
@@ -624,7 +622,6 @@ const Main: FC<IMainProps> = ({
controlFocus=
{
controlFocus
}
isShowSuggestion=
{
doShowSuggestion
}
suggestionList=
{
suggestQuestions
}
displayScene=
{
displayScene
}
isShowSpeechToText=
{
speechToTextConfig
?.
enabled
}
/>
</
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