mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
feat: update workflow run button to Test Run with keyboard shortcut (#24071)
This commit is contained in:
@ -22,6 +22,7 @@ import {
|
||||
import { useEventEmitterContextContext } from '@/context/event-emitter'
|
||||
import { EVENT_WORKFLOW_STOP } from '@/app/components/workflow/variable-inspect/types'
|
||||
import useTheme from '@/hooks/use-theme'
|
||||
import ShortcutsName from '../shortcuts-name'
|
||||
|
||||
const RunMode = memo(() => {
|
||||
const { t } = useTranslation()
|
||||
@ -64,6 +65,7 @@ const RunMode = memo(() => {
|
||||
<>
|
||||
<RiPlayLargeLine className='mr-1 h-4 w-4' />
|
||||
{t('workflow.common.run')}
|
||||
<ShortcutsName keys={['alt', 'r']} className="ml-1" textColor="secondary" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@ -5,10 +5,12 @@ import cn from '@/utils/classnames'
|
||||
type ShortcutsNameProps = {
|
||||
keys: string[]
|
||||
className?: string
|
||||
textColor?: 'default' | 'secondary'
|
||||
}
|
||||
const ShortcutsName = ({
|
||||
keys,
|
||||
className,
|
||||
textColor = 'default',
|
||||
}: ShortcutsNameProps) => {
|
||||
return (
|
||||
<div className={cn(
|
||||
@ -19,7 +21,10 @@ const ShortcutsName = ({
|
||||
keys.map(key => (
|
||||
<div
|
||||
key={key}
|
||||
className='system-kbd flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray capitalize'
|
||||
className={cn(
|
||||
'system-kbd flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray capitalize',
|
||||
textColor === 'secondary' && 'text-text-secondary',
|
||||
)}
|
||||
>
|
||||
{getKeyboardKeyNameBySystem(key)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user